1

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?

skidjoe
  • 365
  • You can not come up with an event using a bounded finite number of flips with this unfair coin that has probability of occurrence exactly $\frac{1}{2}$.

    The reason for this is because given any finite maximum number of flips $n$, every event will be with probability of the form $\dfrac{k}{3^n}$ with $k$ some integer between $0$ and $3^n$. It is impossible for this to equal exactly $\dfrac{1}{2}$.

    To see why, suppose $\dfrac{1}{2} = \dfrac{k}{3^n}$. By cross multiplying, we have $3^n = 2k$. The number on the left is odd however while the number on the right is even.

    – JMoravitz Oct 26 '20 at 14:29
  • Closely related: https://math.stackexchange.com/questions/146605/improving-von-neumanns-unfair-coin-solution?rq=1 – JMoravitz Oct 26 '20 at 14:34

1 Answers1

2

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.

Parcly Taxel
  • 103,344