Q.7.9

Question

A coin having probability p of landing on heads is flipped n times. Compute the expected number of runs of heads of size 1 , of size 2 , and of size k,1kn.

Step-by-Step Solution

Verified
Answer

The expected number of runs of heads of size 1 , of size 2 , and of size k,1kn is (n-k)pk(1-p)2+pk1-p2.

1Step 1: Given Information

Coin's probability =p

Number of flipping times =n,

2Step 2: Explanation

Define random variable Ij that marks whether the run of Heads of size k started from the trial number j or not, j=1,2,n-k+1.

Now define an indicator variable as follows:

Ij=1     (if a k sized run begins at jth  position 0     (otherwise) 

So, if we define X as the random variable that marks the total number of k-runs of Heads, So we have that:

X=j=1n-k+1Ij

Using the linearity of the expectation, so:

E(X)=j=1n-k+1EIj

=Ej=1n-k+1Ij

=PI1=1+j=2n-kPIj=1+PIn-k+1

3Step 3: Explanation

Now solving above expression:

=PI1=1+j=2n-kPIj=1+PIn-k+1

=pk(1-p)+(n-k-1)pk(1-p)2+pk(1-p)

=2pk(1-p)+(n-k-1)pk(1-p)2

=(n-k)pk(1-p)2+pk1-p2

4Step 4: Final Answer

Hence, the expected number of runs of heads of size as per question is:

(n-k)pk(1-p)2+pk1-p2