2

Similar to my last question but still can't get it!

A biased coin is tossed $n$ times, and heads shows with probability $p$ on each toss. A run is a sequence of throws in the same outcome so that, for example, the sequence $\text{HHTHTTH}$ contains five runs. Need to find the mean and variance.

Solution:

Let $I_j$ be the indicator function for the event that the $(j+1)$th toss is different from the $j$th toss. The number of distinct runs is given by:

$\begin{align} R &=1+\sum_{j=1}^{n-1} I_j \\ E(R) &= 1 + (n-1)E(I_1) = 1 + (n-1)2pq\end{align}$

I understand this, the indicators are equally likely and the probability is equal to $2pq$ because you need a heads and a tail but can be any order.

The note that $I_j$ and $I_k$ are independent if $|j-k| > 1$ so that:

$\begin{align} E[(R-1)^2] &= E\left \{ (\sum_{j=1}^{n-1}I_j)^2\right \} = (n-1)E(I_1) + 2(n-2)E(I_1I_2)+ \left \{(n-1)^2 - (n-1) -2(n-2) \right \}E(I_1)^2\end{align}$

I can't see how they got this rhs?

$\begin{align}(I_1 + I_2 + I_3)(I_1 + I_2 + I_3) \\ (I_1^2 + I_1I_2 + I_1I_3 + I_2I_1 + I_2^2 + I_2I_3 + I_3I_1 + I_3I_2 + I_3^2) \\ (\{ i_1 + I_2 + i_3\}+\{ 2I_1I_2 + 2I_2I_3\}+\{ 2I_1I_3\}) \end{align}$

So this is what I get: first group contains the three squared terms which as the hint noted are equal to their original values, and 2 neighbouring terms which appear twice each, the last group features indicators one and three which are independent. Is this correct?

So the first and second groups above correspond to the first and second groups on the rhs of the expression.
Why is it that the independent term $I_1I_3$ disappears it could be that they are both 1?
Does the first term in the third bracket of the original expression correspond to subtracting the mean squared?(As in E(X^2)-E(X)^2)?
Still not sure where the remaining terms come from?

Bazman
  • 899
  • 2
    Try a smallish example, say $n=5$. Take the quantity $E(\sum_{j=1}^4 I_j)^2$, expand out the squared summation into all $16$ of its summands (maybe try $n=3$ first, so its only $9$ summands), and collect them into groups which have the same expectation. Use the fact that $I_j$ and $I_k$ are independent whenever $|j-k|>1$ to put all such summands $I_jI_k$ in the same group. See how many groups there are, how many summands are in each group, and find a pattern. Also, remember that $I_j^2=I_j$, because $I_j$ is always 0 or 1. – Mike Earnest Jul 03 '18 at 21:10
  • Please see edits above – Bazman Jul 04 '18 at 09:21
  • 1
    The term $I_1I_3$ doesn't disappear; note that $E[I_1I_3]=E[I_1]E[I_3]=E[I_1]^2$, which is the last term. The coefficient in from of it is just the number of such terms $E[I_jI_k]$. – Mike Earnest Jul 05 '18 at 16:08

0 Answers0