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?
A)
Step 1: Assign each student a unique integer from 1 to 30.
Step 2: Generate a random integer n from 1 to 15.
Step 3: Select the student who is currently assigned integer n and display the student’s name.
Step 4: Generate a new random integer from 16 to 30.
Step 5: Select the student who is currently assigned integer n and display the student’s name.
B)
Step 1: Assign each student a unique integer from 1 to 30.
Step 2: Generate a random integer from 1 to 30.
Step 3: Select the student who is currently assigned integer n and display the student’s name.
Step 4: Generate a new random integer from 1 to 30.
Step 5: Select the student who is currently assigned integer n and display the student’s name.
C)
Step 1: Assign each student a unique integer from 1 to 30.
Step 2: Generate a random odd integer from 1 to 29.
Step 3: Select the student who is currently assigned integer n and display the student’s name.
Step 4: Generate a new random even integer from 2 to 30.
Step 5: Select the student who is currently assigned integer n and display the student’s name.