Two "Heads" Are Indeed Better Than One

I toss a fair coin 100 times in a row. If the variance of the number of times that two Heads are tossed consecutively is equal to a b \dfrac{a}{b} , where a a and b b are coprime positive integers, what is the value of a + b a+b ?

Clarification : A run of three or more Heads in a row will contribute more than one instance of consecutive Heads. If three Heads are tossed in a row, then two Heads have been tossed consecutively twice. If six Heads are tossed in a row, then two Heads have been tossed consecutively five times, and so on. For example, two Heads have been tossed consecutively 11 times in the following sequence of 30 tosses:

T H H T H H H H T H H H T H T H H H H H T T T T H H T H T T THHTHHHHTHHHTHTHHHHHTTTTHHTHTT


The answer is 509.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Calvin Lin Staff
May 18, 2016

Relevant wiki: Discrete Random Variables - Indicator Variables

We use the indicator variables as stated by Mark, where X i X_i is the RV that is equal to 1 if Heads is tossed by both the j j and j + 1 j+1 coins, and 0 otherwise. We have X = X i X = \sum X_i . We calculate the variance as follows:

V a r ( X ) = V a r ( X i ) + 2 i < j C o v ( X i , X j ) Var (X) = \sum Var (X_i) + 2 \sum_{i < j } Cov(X_i, X_j)

  1. V a r ( X i ) = ( n 1 ) V a r ( X 1 ) = ( n 1 ) × 3 16 \sum Var (X_i) = (n-1) Var (X_1) = (n-1) \times \frac{3}{16} .
  2. For i j 2 |i-j| \geq 2 , the coin tosses are independent and so the covariance is 0.
  3. For i j = 1 |i-j| = 1 , the covariance is C o v ( X i , X i + 1 ) = E [ X i X i + 1 ] E [ X i ] E [ X i + 1 ] = 1 8 1 4 × 1 4 = 1 8 Cov(X_i, X_{i+1} ) = E[X_i X_{i+1} ] - E[X_i] E[X_{i+1} ] = \frac{1}{8} - \frac{1}{4} \times \frac{1}{4} = \frac{1}{8}

Hence, V a r ( X ) = ( n 1 ) × 3 16 + 2 ( n 2 ) × 1 8 + 0 = 5 n 7 16 Var (X) = (n-1) \times \frac{3}{16} + 2 (n-2) \times \frac{1}{8} + 0 = \frac{5n-7}{16} .

Sorry to be picky, but the final fraction in numbered bullet point 3 should be 1 16 \frac{1}{16} , and the fraction 1 8 \frac18 in the final formula for V a r ( X ) \mathrm{Var}(X) should also be 1 16 \frac1{16} .

Mark Hennings - 5 years ago
Mark Hennings
May 16, 2016

Relevant wiki: Expected Value - Problem Solving

Suppose that I toss a coin n n times in a row. For any 1 j n 1 1 \le j \le n-1 , let X j X_j be the random variable which is equal to 1 1 if Heads is tossed by the j t h j^\mathrm{th} and ( j + 1 ) s t (j+1)^\mathrm{st} coins, and 0 0 otherwise, so that the total number of occurrences of consecutive Heads is X = X 1 + X 2 + + X n 1 . X \; = \; X_1 + X_2 + \cdots + X_{n-1} \;. It is clear that E [ X j ] = P [ X j = 1 ] = 1 4 E[X_j] \,=\, P[X_j = 1] \; = \; \tfrac14 for each 1 j n 1 1 \le j \le n-1 , and hence that N = E [ X ] = E [ X 1 ] + E [ X 2 ] + + E [ X n 1 ] = 1 4 ( n 1 ) . N \; = \; E[X] \; = \; E[X_1] + E[X_2] + \cdots + E[X_{n-1}] \; = \; \tfrac14(n-1) \;. Now suppose that 1 i , j n 1 1 \le i,j \le n-1 and consider E [ X i X j ] = P [ X i = X j = 1 ] E[X_iX_j] = P[X_i=X_j=1] . If i = j i=j , this is just the probability that X i = 1 X_i=1 , namely the probability of tossing two Heads in a row. If i i and j j are consecutive, this is the probability of tossing three Heads in a row; otherwise this is the probability that four coins come up Heads. In other words E [ X i X j ] = { 1 4 i = j 1 8 i j = 1 1 16 i j 2 E[X_iX_j] \; = \; \left\{ \begin{array}{lll} \tfrac14 & \qquad & i=j \\ \tfrac18 & & |i-j|=1 \\ \tfrac{1}{16} & & |i-j| \ge 2 \end{array} \right. and hence E [ X 2 ] = i , j E [ X i X j ] = 1 4 × ( n 1 ) + 1 8 × 2 ( n 2 ) + 1 16 × ( n 2 ) ( n 3 ) = 1 16 ( n 2 + 3 n 6 ) \begin{array}{rcl} \displaystyle E[X^2] \; = \; \sum_{i,j} E[X_iX_j] & = & \tfrac14\times (n-1) + \tfrac18 \times 2(n-2) + \tfrac{1}{16} \times (n-2)(n-3) \\ & = & \tfrac{1}{16}(n^2 + 3n - 6) \end{array} so that V a r [ X ] = E [ X 2 ] E [ X ] 2 = 1 16 ( 5 n 7 ) \mathrm{Var}[X] \; = \; E[X^2] - E[X]^2 \; =\; \tfrac{1}{16}(5n-7) With n = 100 n=100 , the variance is 493 16 \tfrac{493}{16} , and so the answer is 509 \boxed{509} .

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...