Flip coin until more heads

131 Views Asked by At

Suppose we flip a coin until we get more heads than tails. What is our expected number of flips?

I'm struggling with my approach here. Suppose our expected number of flips is $X$. We can say $$X = \frac12\cdot1 + \frac12(1 + Y)$$ where $Y$ is the number of flips needed to get $2$ more heads than tails. The problem is I think $Y = 2X$ which does not leave me with a solvable equation. Any guidance would be appreciated.

2

There are 2 best solutions below

1
On BEST ANSWER

Actually, the expected number of flips is $\infty$. Let $n$ denote (the number of tails $-$ the number of heads). Let $X_{n+1}$ denote the expected number of flips when you have $n$ more tails than heads. Suppose the process also ends when $n+1=w>0$, then \begin{align} X_{0}&=0&\\ X_{1}&=1+\frac12X_{0}+\frac12X_2&\\ X_{n}&=1+\frac12X_{n-1}+\frac12X_{n+1}&\\ \dots&=\dots\\ X_{w}&=0& \end{align} The solution of this inhomogeneous system of equations is $$X_n=n(w-n)$$ The expected number of flips is $$X_1=w-1\to\infty\:(w\to\infty)$$ if the flipping can continue indefinitely. The process ends with probability $1$ (eventually we will get more heads than tails), but the expected number of flips is infinite.

7
On

For 3 tosses ....
HHH, HHT, HTH, HTT, THH, THT, TTH, TTT

X = 2 or more heads

$P(X) = \frac{4}{8} = \frac{1}{2}$

That is to say you'll need at least 2 sets of 3 tosses each to get just one set (3 tosses) with more heads than tails.

Generalize ad lib

N tosses, H = the number of heads $H> \frac{1}{2}N$

The number of heads H = $^NC _H + ^NC_{H+1}+ ... + ^NC_N$

The probability of H number of heads = $\frac{^NC_H + ^NC_{H+1}+ ... + ^NC_N}{2^N}$


The random variable (X) here is the number of tosses needed to get more heads than tails.

We could do a simulation or use a random numbers table and calculate the arithmetic mean of the number of tosses. This would be an experimental probability but the question is about theoretical probability.

$E_2$ = 2 tosses are required: HH
$P(E_1) = \frac{1}{4}$
$E_3$ = 3 tosses are required: HTH, THH
$P(E_3) = \frac{2}{8} = \frac{1}{4}$
$E_4$ = 4 tosses are required: HTHH, HHTH
$P(E_4) = \frac{2}{16} = \frac{1}{8}$
$E_5$ = 5 tosses are required: HTTHH, THTHH, TTHHH, HHTTH
$P(E_5) = \frac{4}{32} = \frac{1}{8}$

Is there a pattern?
Over the interval 2 tosses to 5 tosses, the number of tosses you'll need so that you have more heads than tails is, on average, $\frac{1 \times 2 + 2 \times 3 + 2 \times 4 + 4 \times 5}{9} = \frac{36}{9} = 4 $