I have this problem to solve and I don't know where to start from and how to solve it. Would you help me, please?
We want to generate a r.v. X that is equaly likely to be 0 or 1.
We have a coin when flipped lands at Heads with probability p.
Consider the procedure
1. Flip the coin, and let O1, either heads of trails, be the result.
2. Flip the coin again, and let O2 to be the result.
3. If O1 and O2 are the same, return to step 1.
If O2 is heads, set X=0, otherwise set X=1
Show that the random variable X is equaly likely to be 0 or 1.
Could we use a simpler procedure that continues to flip the coin until the last 2 flips are different, and then sets X=0 if the final flip is a head, and sets X=1 if it is a tail?