25 independent, fair coins are tossed in a row. What is the expected number of consecutive HH pairs?
Details and Assumptions:
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.
Everything correct, would not feature though, it is not helpful for someone who doesn't already understand.
Nice solution! Exactly how I solved.
Wonderful solution
1 coin flip results in no HH pairs. Successive flips have three cases:
Thus if p ( n ) is the expected number of pairs in a string of n flips, p ( n + 1 ) = 4 3 p ( n ) + 4 1 ( p ( n ) + 1 ) , where p ( 1 ) = 0 . Repeated application of this recursive definition gives p ( 2 5 ) = 6 . (Finding the closed form is left as an exercise for the reader.)
which means p ( n ) = 4 n − 1 .
Log in to reply
Right. The number of HH pairs, the number of HT pairs, the number of TH pairs, and the number of TT pairs, will all have the same expected value.
Could you explain why there is 4 1 ( p ( n ) + 1 ) instead of 4 1 ( p ( n ) ) please. I'm confused on that point.
as it seems straightforward , in 25 tosses there are 24 pairs . the probability of a pair being HH is 1/2 1/2=1/4.so the expected number is 24 1/4=6 answer
Need to mention linearity of expectation.
How are there 24 pairs?
Log in to reply
(toss 1,toss 2),(toss 2,toss 3),...,(toss 24,toss 25)
Let $S n$ count the sum of the number of pairs of heads obtained over all outcomes consisting of $n$ trials; that is, if $X = (x 1, \ldots, x n)$ is a single outcome of $n$ independent fair coin tosses, and $a(X)$ represents the number of pairs of heads for outcome $X$, then $S n = \sum {X} a(X)$. Clearly there are $2^n$ distinct outcomes for $n$ coin tosses, of which exactly half of these have $x n = H$ and half have $x n = T$. Of the $2^{n-1}$ outcomes that end in tails, the number of pairs of heads remains the same whether or not the $(n+1)$th trial is heads or tails; i.e., $a(X \cup x {n+1}) = a(X)$. Of the outcomes that end in heads, the number of pairs of heads is the same if $x {n+1} = T$, but it is incremented by one if $x {n+1} = H$; i.e., $a(X \cup x {n+1} = T) = a(X)$, whereas $a(X \cup x {n+1} = H) = a(X) + 1$. Since this last event occurs for $2^{n-1}$ outcomes, we then have $S {n+1} = 2S n + 2^{n-1}$. Hence $S {n+1} = 2^n S 1 + \sum {k=0}^{n-1} 2^k 2^{n-k-1}$, and since $S 1 = 0$, we have $S {n+1} = n 2^{n-1}$. The expected value of the number of pairs of heads is $\frac{S n}{2^n} = \frac{n-1}{4}$. For $n = 25$, this gives the answer $6$.
Good argument using the whole sample space. Would rather feature a simple answer using Linearity of Expectation.
Let S n count the sum of the number of pairs of heads obtained over all outcomes consisting of n trials; that is, if X = ( x 1 , … , x n ) is a single outcome of n independent fair coin tosses, and a ( X ) represents the number of pairs of heads for outcome X , then S n = ∑ X a ( X ) . Clearly there are 2 n distinct outcomes for n coin tosses, of which exactly half of these have x n = H and half have x n = T . Of the 2 n − 1 outcomes that end in tails, the number of pairs of heads remains the same whether or not the ( n + 1 ) th trial is heads or tails; i.e., a ( X ∪ x n + 1 ) = a ( X ) . Of the outcomes that end in heads, the number of pairs of heads is the same if x n + 1 = T , but it is incremented by one if x n + 1 = H ; i.e., a ( X ∪ x n + 1 = T ) = a ( X ) , whereas a ( X ∪ x n + 1 = H ) = a ( X ) + 1 . Since this last event occurs for 2 n − 1 outcomes, we then have S n + 1 = 2 S n + 2 n − 1 . Hence S n + 1 = 2 n S 1 + ∑ k = 0 n − 1 2 k 2 n − k − 1 , and since S 1 = 0 , we have S n + 1 = n 2 n − 1 . The expected value of the number of pairs of heads is 2 n S n = 4 n − 1 . For n = 2 5 , this gives the answer 6 .
In each pair of consecutive coins, there are 4 outcomes: T T , T H , H T , H H of which one is H H . Therefore in each pair of consecutive coins, the probability of H H is 4 1 . In a row of 2 5 coins, there are 2 4 pairs of consecutive coins. So the expected number of H H is 2 4 ∗ 4 1 , which is 6 .
Consider an arbitrary sequence { A i } of k tosses where A i = H or T for some k ∈ Z + and i ∈ [ 1 , k ] . Construct { B i } where B i = H if A i = T and B i = T otherwise. Construct { C i } such that C 1 = H and C i + 1 = C i if A i = A i + 1 otherwise C i + 1 = C i for i ∈ [ 1 , k − 1 ] which is uniquely definted for an arbitrary sequence { A i } . Construct { D i } where D i = H if C i = T and D i = T otherwise.
By trying all possibilities of A i A i + 1 ∈ { H H , H T , T H , T T } and following the constructions, we can see that ( A i A i + 1 , B i B i + 1 , C i C i + 1 , D i D i + 1 ) is a permutation of ( H H , H T , T H , T T ) for all i ∈ [ 1 , k − 1 ] and the sequences form a set such that picking any of the sequences in this set and following the above construction will produce the other 3 sequences in this set.
Therefore, the total number of consecutive HH pairs in each set of 4 sequences is k − 1 since for every pair of tosses i and i + 1 , exactly one sequence in the set has both as heads. As we can construct such a set for every sequence, we can divide all the possible 2 k sequence of tosses into 2 k − 2 sets of 4 sequences with k − 1 consecutive HH pairs each.
Therefore, the expected number of consecutive HH pairs is 2 k 2 k − 2 × ( k − 1 ) = 4 k − 1 so for k = 2 5 , the expected number is 4 2 5 − 1 = 6
For any n ≥ 2 , let h n be the expected number of HH pairs. Clearly, h 2 = 4 1 .
If n > 2 , then, h n = h n − 1 + 2 1 ⋅ 2 1 = h n − 1 + 4 1 This is true since the sequence of n − 1 tosses has an equal probability of ending on H or T, and since the next flip has equal probability of being H or T.
We find that h n = 4 n − 1 and so the answer is 6 .
You should define your variables clearly. Saying " For any n ≥ 2 , let h n be the expected number of HH pairs" doesn't tell us how n affects your variable.
Log in to reply
Oh yeah oops I omitted: let h n be the expected number of HH pairs " in n flips of a coin "
Calvin we were asked to solve this problem 2 months 1 week ago
as we are having 25 independent fair coins
so in 25 tosses
there will be 24 pairs so the probability of the pair being head head is is 1/4 i.e.(1/2 1/2) so ................ 24 1/4=6 so that way i arrived at this solution
Intituitively the probability of each flip scoring a HH is 1/4. To prove it more formally we use a recurrence relation/induction argument
Let x k be the expected number of HH flips after k flips. We can assume that x k = (k-1)*1/4 for all k from 1,2....m. Consider x (m+1). If the (m+1)th flip is a tails, the expected is just x m = (m-1)/4 Otherwise if the last flip is a heads, the expected is simply (m-1)/4 + 1/2 the 1/2 is the probability of the mth coin being a heads.
Thus summing, we get x_(m+1) = m/4, completing the proof.
Let S be a sequence of length 25. It consists of 24 overlapping 2-blocks. Each 2-block has a 1/4 probability of giving a HH pair. Thus the expected number of pairs is 24/4=6.
Let X i be the indicator variable which is 1 if i'th toss is head , 0 otherwise
X = ∑ 1 2 4 X i X i + 1 is the number of "HH" pairs .
E [ X ] = ∑ 1 2 4 E [ X i X i + 1 ]
E [ X i X i + 1 ] = 4 1 . 1 + 4 3 . 0 = 4 1
E [ X ] = 2 4 . 4 1 = 6
Let X . denote the number of consecutive pairs of heads. For i = 1 , . . . , 2 4 , let X i equal 1 if flip i and flip i + 1 are both heads and 0 otherwise. Thus, the probability that X i = 1 is 4 1 (since two flips must both land heads). Then X = X 1 + . . . + X 2 4 and we have E ( X ) = E ( X 1 ) + . . . + E ( X 2 4 ) = 4 2 4 = 6 .
Since our random variable is counting the no. of HH pairs, we can ask the question of how much is each coin contributing to the total number of HH pairs and then take the sum
Consider 25 random variables X 1 , X 2 , . . . , X 2 5 corresponding to 25 coins
X n = 1 if the nth coin was able to form a pair with the (n-1)th coin (i.e n and n-1 tosses are both H and H), and 0 otherwise
E [ X 1 + X 2 + . . . + X 2 5 ] = E [ X 1 ] + E [ X 2 ] + . . . + E [ X 2 5 ] ( by linearity of expectation)
E [ X n ] = 0 × P ( X n = 0 ) + 1 × P ( X n = 1 ) = P ( X n = 1 )
If we go through a few calculations we can find a pattern
E [ X 1 ] = P ( X 1 = 1 ) = 0 because being the first coin, there is no previous coin to pair with
E [ X 2 ] = P ( X 2 = 1 ) = ? for coin 2 to form a HH pair with the previous, we want both coin 1 and coin 2 to be H and the rest of the coins can be anything
the probability of which is total possible outcomes no. of ways in which first two coins are HH = 2 2 5 2 2 3 = 4 1
Similarly E [ X 3 ] = E [ X 4 ] = . . . = E [ X 2 5 ] = E [ X 2 ] = 4 1
∴ E [ X 1 + X 2 + . . . + X 2 5 ] = E [ X 1 ] + E [ X 2 ] + . . . + E [ X 2 5 ] = 0 + 2 4 × 4 1 = 6
Assign a variable a i a 1 if HH comes, and 0 otherwise. Then we wish to compute that expected value of a 1 + a 2 + … a 2 4 = 4 2 4 = 6 by linearity of expectation !
(BTW I can’t believe I solved this one )
Since all the 4 pairs {HH,HT,TH,TT} are equiprobable to appear in any position, they have the same expected number of occurrences. And also the same of these expected numbers results in the total number of pairs, which is 24. Hence, E[HH] = E[HT] = E[TH] = E[TT] = 24 / 4 = 6.
With 25 tossed coins, we get a sequence which looks for example like this:
For each two adjacent coins, we create an indicator variable , I k :
I k = { 1 0 if k ’th pair equals ( H H ) else
Because of 2 5 coins, we have 2 4 interspaces and thus 2 4 pairs of consecutive coins.
Possible basic outcomes for a pair of tossed coins are: Ω = { ( H H ) , ( H T ) , ( T H ) , ( T T ) }
Because every basic outcome is equally likely to happen, we know that P ( X k = 1 ) = P ( ( H H ) ) = ∣ Ω ∣ ∣ { ( H H ) } ∣ = 4 1
Finally, with the principle of the linearity of expectation and the property of indicator variables that E [ I k ] = P ( I k = 1 ) , we get:
E [ "Number of consecutive HH pairs" ] = E [ k = 1 ∑ 2 4 I k ] = k = 1 ∑ 2 4 E [ I k ] = k = 1 ∑ 2 4 4 1 = 6
In 25 tosses, a fair set of coins would expect to produce either 12H and 13T or 13H and 12T. The order is irrelevant. However, with 12H and 13T, it can produce a line of coins (ie HHHH....TTTTT.....) with 11 pairs or (HTHTHTH...) with 0 pairs. The average is 5.5. With 13H and 12T, it can produce 12 pairs or 0 pairs, average of 6. The average of 5.5 and 6 is 5.75 which rounds up to 6.
First let us group 25 coins cosecutively in groups having 2 elements .[I.e (1st coin, 2nd coin),(2nd coin, 3rd coin),......(24th coin, 25coin)].we would get 24 groups. Now in each group We can have {H, T},{T, H},{H,H},{T,T}. Therefore probability of having {H,H} is 1/4. Therefore in group of 24 we would probably would have 6 group having {H, H}.
Let X 1 , 2 be the random variable which takes value 1 if pair at index 1 and 2 is H H and 0 otherwise.
For example, in ' H H H T ', X 1 , 2 = 1 , X 2 , 3 = 1 , X 3 , 4 = 0
Let X be the random variable presenting the number of consecutive H H pairs in 2 5 independent tosses.
Notice, X = X 1 , 2 + X 2 , 3 + X 3 , 4 + . . . + X 2 4 , 2 5 .
(This is because, lets say X 1 , 2 takes the value x 1 , 2 , X 2 , 3 takes the value x 2 , 3 , and so on and so forth, then number of consecutive ' H H ' pair in all 2 5 tosses will be x 1 , 2 + x 2 , 3 + . . . + x 2 4 , 2 5 )
Now the beauty of Linearity of Expectation comes in. It say the following:
E [ X 1 + X 2 + X 3 ] = E [ X 1 ] + E [ X 2 ] + E [ X 3 ]
The above is true even if X 1 , X 2 , X 3 are dependent. That's surprising about this.
Making use of this theorem in our problem, we now have:
E [ X ] = E [ X 1 , 2 + X 2 , 3 + X 3 , 4 + . . . + X 2 4 , 2 5 ] = E [ X 1 , 2 ] + E [ X 2 , 3 ] + E [ X 3 , 4 ] + . . . + E [ X 2 4 , 2 5 ]
Now comes the easy part. Given the tosses are independent we have, E [ X i , i + 1 ] = 4 1 for any valid i .
Summing everything up, we get
E [ X ] = 2 4 ∗ 4 1 = 6
Mean=np, n refers to the number of consecutive pairs of coins, p refers to the probability of getting HH for each consecutive pair of coins. n=24 since there are 24 consecutive pairs of coins, p=1/4 since there are four possible outcomes (HH, HT, TH, TT). Thus np=24x1/4=6 is the solution.
After thinking about this for a while and examining simple cases (2, 3, 4 coins) the pattern became clear.
Each coin has a 1/2 probability of being an H, with 1/2 probability of being followed by an H (except the last coin which isn't followed by anything). That gives ( n − 1 ) / 4 .
The formula was confirmed for small cases, so we have ( 2 5 − 1 ) / 4 = 6
We have to find the average of the total number of HH pairs ::
Total number of cases is 2^25
In this the last set of 2 columns is HH,HT,TH,TT. This is repeated 2^25/4 times =2^23 times
Since each set has one HH pair thus there are 2^23 HH pairs in the last 2 columns..
By symmetry we can say this is true for the remaining pairs of consecutive columns.
Thus there are 24 sets of pairs we can make each set having 2^23 HH's
Thus the average is 24*(2^23)/(2^25) == 6.
Linearity of expectation gives 4 1 ⋅ 2 4 = 6 consecutive HH pairs expected.
there are 24 pairs of HH
the possible of each HH is (1/2)*(1/2)=1/4
E(X)=(1/4)*24=6
in 25 coin tosses there are 24 pairs possible HH
The probability of each HH=1/2*1/2=1/4
expectance is then =1/4*24=6
In 25 coin tosses, we can have 24 HH pairs, the probability of having a such pair is 2 1 ⋅ 2 1 = 4 1 .
The expected number is : 4 2 4 = 6 .
Instead of thinking of the coin tosses individually, we think of coin tosses by consecutive pairs. A consecutive pair is the first toss and second toss, or the second toss and the third toss etc.
In this problem, there are 24 consecutive coin tosses. The probability that a single coin toss comes up HH is 1/4, and the probability that it comes up HT, TH, or TT is 3/4.
Thus, for every 4 consecutive pairs, you expect exactly 1 of them to come up HH. So the expected value of consecutive HH pairs in 25 tosses is 24/4 or 6.
Why are we allowed to look at each pir of consecutive coins seperately? If the first one is H T , the second one can only be T H or T T , so what allows us to say that H H occurs in each pair with probability 4 1 ?
Let X i be the random variable which is equal to 1 if the i th and ( i + 1 ) st tosses are both heads. Then E [ X i ] = P [ X i = 1 ] = 1 / 4 , since the value of X i only depends on the outcome of two particular tosses.
The total number of HH occurrences is the random variable X = i = 1 ∑ 2 4 X i and hence, since taking expectations is a linear operation, E [ X ] = I = 1 ∑ 2 4 E [ X i ] = 6 Of course, X 1 and X 2 are not independent, for example, but that does not affect this result about expectations.
Imagine writing out a table, with 2 2 5 rows, of all possible results of the coin flips . We could cover up all but two columns of this, and then by symmetry, the exposed columns must have equal numbers of { H T , T H , T T , H H } . The same argument applies to any two chosen columns.
(The expected value can be thought of as the number of occurrences of H H in this entire table, divided by the number of rows in the table).
To fill in the bit about how consecutive pairs of flips are independent, consider that P ( H H 2 ) = 4 1 P ( H H 2 ∣ H H 1 ) ∗ 4 1 P ( H H 2 ∣ T H 1 ) ∗ 4 1 P ( H H 2 ∣ H T 1 ) ∗ 4 1 P ( H H 2 ∣ T T 1 ) = 4 1 ∗ 2 1 + 4 1 ∗ 2 1 + 0 + 0 = 4 1 = P ( H H ) giving that P ( H H ) is indeed independent of the previous flip pair.
probability that a single consecutive pair comes up HH*
Problem Loading...
Note Loading...
Set Loading...
There are 24 consecutive pairs viz [1,2], [2,3], . . . , [24,25]
Label pairs as P 1 , P 2 , . . . , P 2 4
Let x i (1 ≤ i ≤ 24) be an indicator variable defined as
x i = { 1 0 if $P_i$ HH pair if $P_i$ is not a HH pair
E[ x i ] = 1 ⋅ Pr( P i is HH pair) + 0 ⋅ Pr( P i is not HH pair)
= 1 ⋅ (1/2)(1/2) + 0
= 1/4
Expected no of consecutive HH pairs = E [ ∑ i = 1 i = 2 4 x i ]
= ∑ i = 1 i = 2 4 E [ x i ]
= 2 4 ⋅ ( 1 / 4 ) = 6
Second equality follows by linearity of expectation.