3 min read

Can you flip the magic coin?

Table of Contents

Problem

I have a coin with a sun on the front and the mooon on the back. I claim that on most days it’s a fair coin, with a 5050 percent chance of landing on either the sun or the moon.

But once a year, on the summer solstice, the coin absorbs the sun’s rays and exhibits a strange power:it always comes up the opposite side as the previous flip.

Of course, you are skeptical of my claim. You figure that there’s a 11 percent chance that the coin is magical and a 9999 percent chance that it’s just an ordinary fair coin. You then ask me to β€œprove” that the coin is magical by flipping it some number of times.

How many successfully alternating coin flips it will take for you to think there’s a 9999 percent chance the coin is magical (or, more likely, that I’ve rigged it in some ways so it always alternates)?

Solution

This is a classic application of Bayes Theorem.

Let MM be the even that the coin is magical. The probability that the coin is magical is given by P[M]=0.01\mathbb{P}[M]= 0.01.

The probability that the coin is not magical is given by P[Mc]=0.99\mathbb{P}[M^{c}]= 0.99.

Let nn be the number of alternating flips required for you to think that the coin is magical with a probability of 9999 percent.

Let AnA_n be the event of getting nn alternating flips on tossing the coin nn times.

This means that the conditional probability of the coin being considered by you as magical given nn alternating flips is given P[M∣An]β‰₯0.99\mathbb{P}[M \vert A_n] \geq 0.99.

For a magical coin the probability of alternate flips is always 11, so we have P[An∣M]=1\mathbb{P}[A_n \vert M] = 1.

For a normal coin, the probability of alternate flips is given by P[An∣Mc]=22n\mathbb{P}[A_n \vert M^c] = \frac{2}{2^n} because the nn alternate flips can start with a head or a tail.

Therefore, from Bayes theorem, we have

0.99≀P[M∣An]=P[An∣M]β‹…P[M]P[An∣M]β‹…P[M]+P[An∣Mc]β‹…P[Mc]=1β‹…0.011β‹…0.01+22nβ‹…0.99\begin{align*} 0.99 \leq \mathbb{P}[M \vert A_n]=& \frac{\mathbb{P}[A_n \vert M]\cdot \mathbb{P}[M]}{\mathbb{P}[A_n \vert M] \cdot \mathbb{P}[M]+ \mathbb{P}[A_n \vert M^c] \cdot \mathbb{P}[M^c]} \\ =& \frac{1 \cdot 0.01}{1 \cdot 0.01 + \frac{2}{2^n} \cdot 0.99} \end{align*}

We see that we need nβ‰₯15n \geq 15 alternating flips so that we can be 9999 percent confident that the coin is magical.