Q.7.18

Question

Let X be the length of the initial run in a random ordering of n ones and m zeros. That is, if the first k values are the same (either all ones or all zeros), then X Ú k. Find E[X]. 

Step-by-Step Solution

Verified
Answer

The E[X} of the problem if X be the length of the initial run in a random ordering of n ones and m zeros E[L]=nm+1+mn+1.

1Step 1: Given information

X= length of the initial run in a random ordering of n ones and m zeros 

k-value are same

2Step 2: Solution

The solution will be shown below,

E[L]=E[L First vlaue is one ]n(n+m)

+E[L First value is 0]m(n+m)

Now if first value =1,

Length of run will be position of first 0 when considering remaining n+m-1 values, of which n-1 are one's and m are zero's

E[L]=n+mm+1nn+m+n+mn+1mn+m

E[L]=nm+1+mn+1

3Step 3: Final answer

The E[X] of the given problem Will be E[L]=nm+1+mn+1.