TITLE: Simulating a fair coin toss using a biased coin in fixed number of tosses
QUESTION [14 upvotes]: For which values of $p$ can we simulate a fair coin toss using a fixed number of tosses of a $p$-biased coin?

Here are some positive and negative examples:

When $p = 1/2$, this is trivially possible.
When $p = 1/2 \pm 1/\sqrt{12}$, this is possible since $p^3 + (1-p)^3 = 1/2$.
When $p = k/n$ for odd $n$ and integer $k$, this is impossible, since after tossing the coin $m$ times, the probability of any event is an integer multiple of $1/n^m$.

In particular,

Is there a rational $p \neq 1/2$ for which we can simulate a fair coin toss using a fixed number of tosses of a $p$-biased coin?

REPLY [3 votes]: I was just about to ask the same question! Here is what I found:

As proved by  A. Pongrácz, all rational numbers except $1/2$ cannot simulate $1/2$. Let $p=a/(a+b)$, where $a$ and $b$ are relatively prime. After $n$ tosses, there are $1/2^n$ possible outcomes. The probability of each outcome is a rational number with denominator $(a+b)^n$. The numerators are all multiples of $b$, except one numerator which is $a^n$. Therefore, in any partition of the outcomes into two subsets, one subset (the one containing the $a^n$) will have a sum that is not a multiple of $b$, while the other sum will have a sum that is a multiple of $b$. Hence the two sums cannot be equal.
On the other hand, $p$ can simulate $1/2$ whenever $p = (1/2)^{1/n}$, for some integer $n\geq 1$. Proof. Just toss the coin $n$ times. The probability that it lands $n$ times on Heads is exactly $1/2$.

it is indeed interesting what other irrational numbers $p$ can simulate $1/2$.
Another interesting question is: what rational numbers $p$ can simulate a biased coin with probabilities $1/3,2/3$?
A potentially related paper is: Abel and Galois cannot share a cake in a simple and equitable way‏.