[Math] Expected length of runs in a binary string

probability

Question

This is a math of the Introduction to Probability Models (11th edition) written by Sheldon M Ross.

Runs of 0s or 1s follow a geometric distribution. The solution I found in the solution manual:

Answer

Here conditioning has been applied on the first bit. So E[L1|X = 0] should be (1/p) – 1 , as the expected value of a geometric random variable is 1/p (where p is the probability of success). Here the expected length of first run given that first bit is zero is 1/p "including the first 1 after the run of zeroes". So I have written (1/p) – 1 , excluding the first 1 after the run of zeroes. But in the solution manual, it is (1/p). Am I missing something?

If I think somewhat different (not conditioning on the first bit), the first run can contain either all os or all 1s. If it contains all 0s, the expected length should be (1/p) – 1 or (1-p)/p , and if it contains all 1s, the expected length should be 1/(1-p) – 1 or p/(1-p) . In the first case, the success of a geometric random variable is characterized by the presence of a 1 after the first run ends. Same type of logic applies for the run of 1s. Then my solution matches with the solution of the picture.

Can anyone please point out what I am missing?

Best Answer

The solution manual is correct in stating that-

E(L1|X=0) = 1 + ($\frac{1}{p}$ - 1)

In this expression, the first 1 accounts for the "0" symbol at the very start of the sequence. The second term accounts for the number of zeroes until the first one is encountered. You are right, $\frac{1}{p}$ includes the final symbol "1" that we see in the sequence and we thus need to subtract one from $\frac{1}{p}$. However, you forgot to account for the first "0" symbol encountered at the very beginning.

Related Question