You need to select one among p persons in a fair manner - i.e, probability of choosing any one should be 1/p. You have a fair coin at your disposal.
Assume p is not of the form 2N for some positive N.
a. What will be your strategy for least number of coin tosses? What is this least number?
b. What will be the average number of coin tosses?
b. Can you solve for the generic case, where you have to choose one among p persons, assuming you have a rand() function that returns a random number between 1 to q with uniform probability?
Question
Guest
You need to select one among p persons in a fair manner - i.e, probability of choosing any one should be 1/p. You have a fair coin at your disposal.
Assume p is not of the form 2N for some positive N.
a. What will be your strategy for least number of coin tosses? What is this least number?
b. What will be the average number of coin tosses?
b. Can you solve for the generic case, where you have to choose one among p persons, assuming you have a rand() function that returns a random number between 1 to q with uniform probability?
Link to comment
Share on other sites
6 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.