Making events that match certain probabilities?? I came across this question while preparing for an interview and actually struggled, and I'm not sure how to solve it? Anyone have any advice?
Unfair coin with P(H) = 1/3 and P(T) = 2/3.
a) How to make  an event with 50% probability?
b) Expected number of flips until a realization occurs?
c) Can you create a strategy to reduce the number of flips necessary?
d) Can you create a strategy to reduce the number of flips necessary for an unfair coin with any bias?
The only thing I can think of a) is that it $p(event) = \frac{4.5}{9}$ but how to get that in terms of the given probabilities? for b) it will just be the inverse, right? What about c and d?
 A: To get a $50\%$ event we can flip our unfair coin twice. If we get two tails we return $0$. If we get one head and one tail we return $1$. If we get two heads we repeat all over.
With this scheme, two flips produce a result $\frac89$ of the time, so the expected number of flips is $2×\frac98=2.25$. This is the minimal expected number of flips we can achieve for the given coin if we only need one realisation – obviously we can't get a $50\%$ event from just one flip.
For a generally biased coin, irrational head probability or otherwise*, we can perform what is called von Neumann whitening: repeatedly flip the coin twice. If the results disagree, take the first result (the probabilities are guaranteed equal by the symmetry of the setup). If they agree, flip twice again. If the chance of getting heads is $p$ this results in an expected flip count of $\frac1{p(1-p)}$.

*If the coin is rational we can usually do better than von Neumann whitening. Suppose $p=\frac14$. We can simulate a $50\%$ event by tossing three times and:

*

*returning $0$ if $TTT$ or $THH$ comes up (probability $\frac{30}{64}$)

*restarting if either $HHH$ or $HHT$ comes up (probability $\frac4{64}$)

*returning $1$ otherwise (probability $\frac{30}{64}$)

With this scheme the expected number of tosses is $\frac{16}5$, whereas whitening takes $\frac{16}3$ flips on average.
