100 coin flips, expect to see 7 heads in a row
So a random piece of information in a video I watched ages ago popped in my head tonight and I started thinking about it. I believe I am remembering this video properly...
They flipped a coin 100 times you saw the ratio of head and tails to be 50/50. They created a diagram of all the flips. There was a lot of flip-flopping between heads and tail. There were even some strings of 4 or 5 heads/tails in a row. At one point in the chart there were 7 heads in a row. They said in a sample this size, that was expected.
That is where my question is, is there a mathematical formula or something that allows us to compute, in a sample size of 100, where the outcome can go 50% one way or the other, the probability of getting 7 of one outcome in a row?
$\endgroup$ 13 Answers
$\begingroup$Here's a similar question with pretty good answers:
What are the odds of getting heads 7 times in a row in 40 tries of flipping a coin?
$\endgroup$ 2 $\begingroup$What do you mean by 'expected' ?
Suppose you flip a fair coin 2 times. The probability of the event of getting heads on the nth (n = 1, 2) toss, denoted by $H_n$, is 1/2. Note that the $H_n$'s are independent and have the same probability as the $H_n^C$'s.
Let $X$ denote the number of heads of in 2 flips.
$P(X = 0) = P(H_1^C \cap H_2^C) = P(H_1^C) P(H_2^C) = 1/4$
$P(X = 1) = P(H_1^C \cap H_2) + P(H_1 \cap H_2^C)= 1/2$
$P(X = 2) = P(H_1 \cap H_2) = P(H_1) P(H_2) = 1/4$
The 'expected' value of $X$ is given by:
$E[X] = \sum_{i=0}^{2} iP(X=i) = 1(1/2) + 2(1/4) = 1$
Mathematically speaking, we 'expect' that if we flip a fair coin twice, we will get one head. 'Expected' value in this sense is 'the long-run average value of repetitions of the experiment it represents'
$\endgroup$ 2 $\begingroup$The problem is complicated to solve, so we answer a different but related question which has a relatively simple answer.
Call a number $k$ from $1$ to $94$ good if the $k$-th toss, and the following $6$ tosses, are all the same. Let $Y$ be the number of good numbers. We will find $E(Y)$, the expectation (mean) of $Y$. Note that if we have a run of exactly $8$ of the same kind, then $Y$ counts this run twice.
Let random variable $X_i$ be defined by $X_i=1$ if $i$ is good, and $X_i=0$ otherwise. Then $Y=X_1+X_2+\cdots+X_{94}$, so by the linearity of expectation we have $$E(Y)=E(X_1)+E(X_2)+\cdots+E(X_{94}).$$ We have $\Pr(X_i=1)=\frac{1}{2^6}$ and therefore $$E(Y)=\frac{94}{64}.$$ A little more complicated argument of the same kind could be used to find the expected number of runs of length exactly $7$.
$\endgroup$