OU blog

Personal Blogs

Richard Walker

Answer to "Another Classic Problem"

Visible to anyone in the world
See here for the problem I posed.

The answer is the expected proportion of Heads and Tails is 50:50.

A plausible intuition is that the strategy described in the problem with result in more Heads being observed than Tails, but this intuition is misleading

Each coin flip is independent and over a large number of trials Heads and Tails will each turn up with about the same frequency, and no strategy we might decide to follow can change this ratio.

I wrote a Python program to simulate the problem and sure enough if we run it Heads and Tails each appear in with about the same frequency.

import random
H = 0
for i in range(1000000):
throw = random.choice(['H','T'])
    if throw != 'T':
        H = H + 1
    while throw != 'T':
        throw = random.choice(['H','T'])
        if throw  != 'T':
            H = H + 1
print('Heads per 1000000 Tails', H)

Permalink
Share post

Comments

Masami Watanabe

New comment

Hi, Richard

I run the python program and got the output,

'Heads per 1000000 Tails 999965'

This program looks doing Monte Carlo Simulation.

What provability distribution does the problem follow?


Steven McDonald

New comment

I find it interesting to approach this problem from the other direction. Instead of considering what happens for very many people, we can consider the expectation value for the number of heads for a single person flipping one coin.

There is a 50% probability of the first coin flip being tails, and so of there being 0 heads. There is then a 25% probability of obtaining heads once, since there is a 50% probability of the first flip being heads and 50% thereafter of the second flip being tails. Proceeding in this way, we have a one solidus two super n plus one probability of obtaining heads n times, so that the expectation value is the infinite series

n ary summation from n equals zero to normal infinity over n divided by two super n plus one .

This series can be evaluated similarly to Example 2 under the heading Taylor Series in this document. The result is that we expect to see 1 coin come up heads on average, which is equal to the number of tails we always have.

Hence it does not matter how many or how few people are flipping coins—the expected proportion of heads to tails for a single person is 1:1, and each person is flipping their own coin independently, so this is always the case.

Masami Watanabe

New comment

Hi, Richard and Steven.

So, that’s why the output of the program 999965 is close to 1000000, thank you. Maybe, this probability distribution is the sum of multiplication of  Bernoulli trial probability,

P=P(1)*P(0)+P(1)*P(1)*P(0)+P(1)*P(1)*P(1)*P(0)+…

Where,

1:the event of head

0:the event of tail

P(*): probability of the event *

P:The expected proportion of heads to tails for a single person


Masami Watanabe

New comment

p.s.

Sorry. Maybe, the number of heads for single person may be

N=1*P(1)*P(0)+2*P(1)* P(1)*P(0)+ 3*P(1)* P(1) * P(1)*P(0)+…