Question: Suppose you are given a coin for which the probability of heads, say p , is unknown . How can you use this coin to

Suppose you are given a coin for which the probability of heads, say p, is unknown. How can you use this coin to generate unbiased, i.e., Pr[H] = Pr[T] = 1/2, coin flips? Give an algorithm for which the expected number of flips of the biased coin for extracting one unbiased coin flip is no more than 1/[p(1 p)].

1. Describe your algorithm in pseudocode. Comment your code.

2. Prove that your algorithm is correct.

3. Analyze your algorithm: what is the expected number of trials that your algorithm performs? Justify your answer.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!