Simulate unfair coin with a fair random generator

probabilityrandomsimulation

Let's say that I have a random generator that gives me the number $1$ or the number $0$ each with probability $1/2$. Is it possible to use this random generator to simulate the toss of an unfair coin that is "head" with probability $2/3$ and "tails" with probability $1/3$?

My guess is no because no power of $2$ is divisible by $3$. But I don't know if my guess is correct and, even if it is, I don't see how I can use this intuition (that no power of $2$ is divisible by $3$) to prove that this simulation with probabilities exactly $2/3$ and $1/3$ is impossible.

Any help is welcome. (I have found this question which may be relevant). Thanks in advance!

Best Answer

Run your random number generator until it produces $1$. The probability that you see no $0$s or an even number of $0$s before the first $1$ is $\frac 2 3$. The probability that you see an odd number of $0$s before the first $1$ is $\frac 1 3$.

Related Question