0

In this post, I cannot understand the logic behind the approach nor can I devise an approach myself. Can anyone be so kind so as to give me a detailed explanation as to what is being done?

More specifically, why is the expected number of tosses e appearing on both side?

Doesn't the formula state something like: $e = p_1x_1 + p_2x_2+...$ where $p_1, p_2...$ are probabilities of events $x_1,x_2... $?

zhirzh
  • 171
  • The standard formula for the expectation of a discrete random variable does have the shape you quote. But that does not mean that using the formula is the only way to compute expectation. In my solution, conditioning (on the results of the first few tosses) was used. There are other ways of finding expectation that bypass finding the probabilities $p_i$. – André Nicolas Sep 18 '14 at 02:11
  • 1
    @AndréNicolas There is a valid point hidden here: the argument only works given that we know a priori that the expectation exists. To show that, one way is to use $\mathbb{E}[X] = \sum_{i \geq 1} \Pr[X \geq i]$ and then use some trivial bound such as $\Pr[X \geq i] \leq (1-2^{-5})^{\lfloor i/5 \rfloor}$. – Yuval Filmus Sep 18 '14 at 02:59
  • The issue is taken account of, though without detail, in the first sentence of that answer: we assert that the expectation exists. – André Nicolas Sep 18 '14 at 03:01

1 Answers1

0

Let $N$ count the number of tosses until 5 consecutive heads occur. Let $X$ count the number of heads before the first(/next) tail.

The conditional expectation of tosses until 5 consecutive heads occurs when given that $x$ heads and then $1$ tail are tossed must be $x+1$ plus the expectation of tosses until 5 heads are thrown after that. Unless $x\geqslant 5$ in which case the expectation is just $5$.

Then we use the rule of conditional expectation, followed by the definition of expectation. $\begin{align} \mathsf E[N\mid X = x] & = \begin{cases}\mathsf E[N] + x + 1 & 0\leqslant x\leqslant 4 \\ 5 & x\geqslant 5\end{cases} \\[2ex] \mathsf P(X=x) & = \frac 1 {2^{x+1}} \\[2ex] \mathsf E[N] & = \mathsf E[\mathsf E[N\mid X]] \\ & = \sum_{x=0}^{4} \mathsf P(X=x) \mathsf E[N\mid X=x] + \mathsf P(X\geqslant 5)\mathsf E[N\mid X\geqslant 5] \\[2ex] & = \substack{\mathsf P(X=0) \mathsf E[N\mid X=0] + \mathsf P(X=1) \mathsf E[N\mid X=1] + \mathsf P(X=2) \mathsf E[N\mid X=2] \\ + \mathsf P(X=3) \mathsf E[N\mid X=3] + \mathsf P(X=4) \mathsf E[N\mid X=4] + \mathsf P(X\geqslant 5) \mathsf E[N\mid X\geqslant 5] } \\[2ex] & = \frac 1 2 (\mathsf E[N]+1) + \frac 1 {2^2}(\mathsf E[N]+2) + \frac 1 {2^3}(\mathsf E[N]+3) + \frac 1 {2^4}(\mathsf E[N]+4) + \frac 1 {2^5}(\mathsf E[N]+5) + \frac 1 {2^5} 5 \\[3ex] \text{Substitute : } a & = \mathsf E[N] \\[2ex] a & = 2^{-1} (a+1) + 2^{-2}(a+2) + 2^{-3} (a+3) + 2^{-4} (a+4) + 2^{-5}(a+5) + 2^{-5}5 \\[2ex] \therefore a & = 62 \end{align}$

Graham Kemp
  • 129,094