Problemas
Mark for Review A teacher has a goal of displaying the names of 2 students selected at random from a group of 30 students in a classroom. Any possible pair of students should be equally likely to be selected. Which of the following algorithms can be used to accomplish the teacher's goal?
Solución
Tomásprofessionell · Tutor durante 6 años
Verificación de expertos
4.0 (290 votos)
Responder
To accomplish the teacher's goal of displaying the names of 2 students selected at random from a group of 30 students, where any possible pair of students is equally likely to be selected, we can use the following algorithm:<br /><br />1. Create a list of all 30 students' names.<br />2. Use a random number generator to select two unique indices from the list.<br />3. Display the names of the students corresponding to those indices.<br /><br />This algorithm ensures that each possible pair of students has an equal probability of being selected.
Haz clic para calificar: