This discussion board is a place to discuss our Daily Challenges and the math and science
related to those challenges. Explanations are more than just a solution — they should
explain the steps and thinking strategies that you used to obtain the solution. Comments
should further the discussion of math and science.
When posting on Brilliant:
Use the emojis to react to an explanation, whether you're congratulating a job well done , or just really confused .
Ask specific questions about the challenge or the steps in somebody's explanation. Well-posed questions can add a lot to the discussion, but posting "I don't understand!" doesn't help anyone.
Try to contribute something new to the discussion, whether it is an extension, generalization or other idea related to the challenge.
Stay on topic — we're all here to learn more about math and science, not to hear about your favorite get-rich-quick scheme or current world events.
Markdown
Appears as
*italics* or _italics_
italics
**bold** or __bold__
bold
- bulleted - list
bulleted
list
1. numbered 2. list
numbered
list
Note: you must add a full line of space before and after lists for them to show up correctly
# I indented these lines
# 4 spaces, and now they show
# up as a code block.
print "hello world"
# I indented these lines
# 4 spaces, and now they show
# up as a code block.
print "hello world"
Math
Appears as
Remember to wrap math in \( ... \) or \[ ... \] to ensure proper formatting.
2 \times 3
2×3
2^{34}
234
a_{i-1}
ai−1
\frac{2}{3}
32
\sqrt{2}
2
\sum_{i=1}^3
∑i=13
\sin \theta
sinθ
\boxed{123}
123
Comments
Let Hn be the number of successive heads obtained in n tosses, given that the first toss is a head, and let Tn be the number of successive heads obtained in n tosses, given that the first toss is a tail. The number of successive heads obtained in n tosses is the same as Tn+1. Thus we want to know P[T13=7] or, more generally, the distribution of Tn+1.
Conditioning on the outcome of the second toss, we see that
P[H_n=k] \; = \; \left\{\begin{array}{l@{\qquad\qquad\qquad}l} \tfrac12P[H_{n-1}=k-1] + \tfrac12P[T_{n-1}=k] & k \ge 1 \\ \tfrac12P[T_{n-1}=k] & k = 0 \end{array}\right.
P[Tn=k]=21P[Hn−1=k]+21P[Tn−1=k]
for all n≥2.
If Hn(t) and Tn(t) are the probability generating functions of Hn and Tn respectively, then H1(t)=T1(t)=1, while
Hn(t)=21tHn−1(t)+21Tn−1(t)Tn(t)=21Hn−1(t)+21Tn−1(t)
for n≥2. Plugging these recurrence relations into Mathematica gives
T13(t)=40961(377+744t+894t2+806t3+588t4+363t5[]+188x6+89x7+31x8+13x9+2x10+x11)
and hence P[T13=7]=409689.
More generally, we can solve the matrix recurrence relation
(Tn(t)Hn(t))=(212121t21)(Tn−1(t)Hn−1(t))n≥2
together with the ground step (T1(t)H1(t))=(11). Looking for eigenvalues and eigenvectors of the matrix, we deduce that
(Tn(t)Hn(t))=α(4t+1+t2−2t+5)n−1(2t−1+t2−2t+5)+β(4t+1−t2−2t+5)n−1(2t−1−t2−2t+5)
where α,β are such that
(t−1)(α+β)+(α−β)t2−2t+5=12(α+β)=1
The conditions on α and β make the formula work for n=1. When n is odd the formula for Tn(t) can be "simplified" into a shape which is visibly polynomial, and we obtain
T2n+1(t)=42n1j=0∑n(2j2n)(t+1)2n−2j(t2−2t+5)j−42nt−3j=0∑n−1(2j+12n)(t+1)2n−2j−1(t2−2t+5)j
I have yet to obtain a closed form for P[T2n+1=k].
I do not understand what your initial equations are measuring, or why they are true. Note that Hn should measure the maximum number of successive heads, and not just the initial length of successive heads.
When n>>r, then there could be multiple strings of successive heads which are at the maximum. In this case, it is not clear what your recurrence relation is supposed to be counting. This is also where your recurrence relations break down.
My value of 7 consecutive heads out of 13 coins is different from either of your values.
In the case that r≤2n, we can do a direct counting of the cases. For r>2n, we need to use PIE to avoid double counting.
If the second toss is a head (with probability 21), then the probability of getting k occurrences of consecutive heads out of the n tosses is the probability of getting k−1 occurrences of consecutive heads out of the final n−1 tosses (excluding the first one) where we now have that the first of these n−1 tosses is a head (the first two tosses have given us one such occurrence).
If the second toss is a tail (with probability 21), then the probability of getting k occurrences of consecutive heads out of the n tosses is the probability of getting k occurrences of consecutive heads out of the final n−1 tosses (excluding the first one) where we now have that the first of these n−1 tosses is a tail (we have not obtained a successive head occurrence in the first pair this time).
Thus
P[Hn=k]=21P[Hn−1=k−1]+21P[Tn−1=k]
with similar arguments holding for the other formulae.
Our difference of opinion on this may be about what the question is asking. The question can be read as:
"what is the probability that heads occur consecutively seven times?", in which case HHHHTTHHHHHTT would do as a "good" sequence,
or as "what is the probability that a string of seven consecutive heads occurs?", in which "good" sequences would be like TTHHHHHHHTTHT.
Easy Math Editor
This discussion board is a place to discuss our Daily Challenges and the math and science related to those challenges. Explanations are more than just a solution — they should explain the steps and thinking strategies that you used to obtain the solution. Comments should further the discussion of math and science.
When posting on Brilliant:
*italics*
or_italics_
**bold**
or__bold__
paragraph 1
paragraph 2
[example link](https://brilliant.org)
> This is a quote
\(
...\)
or\[
...\]
to ensure proper formatting.2 \times 3
2^{34}
a_{i-1}
\frac{2}{3}
\sqrt{2}
\sum_{i=1}^3
\sin \theta
\boxed{123}
Comments
Let Hn be the number of successive heads obtained in n tosses, given that the first toss is a head, and let Tn be the number of successive heads obtained in n tosses, given that the first toss is a tail. The number of successive heads obtained in n tosses is the same as Tn+1. Thus we want to know P[T13=7] or, more generally, the distribution of Tn+1.
Conditioning on the outcome of the second toss, we see that P[H_n=k] \; = \; \left\{\begin{array}{l@{\qquad\qquad\qquad}l} \tfrac12P[H_{n-1}=k-1] + \tfrac12P[T_{n-1}=k] & k \ge 1 \\ \tfrac12P[T_{n-1}=k] & k = 0 \end{array}\right. P[Tn=k]=21P[Hn−1=k]+21P[Tn−1=k] for all n≥2.
If Hn(t) and Tn(t) are the probability generating functions of Hn and Tn respectively, then H1(t)=T1(t)=1, while Hn(t)=21tHn−1(t)+21Tn−1(t)Tn(t)=21Hn−1(t)+21Tn−1(t) for n≥2. Plugging these recurrence relations into Mathematica gives T13(t)=40961(377+744t+894t2+806t3+588t4+363t5[]+188x6+89x7+31x8+13x9+2x10+x11) and hence P[T13=7]=409689.
More generally, we can solve the matrix recurrence relation (Tn(t)Hn(t))=(212121t21)(Tn−1(t)Hn−1(t))n≥2 together with the ground step (T1(t)H1(t))=(11). Looking for eigenvalues and eigenvectors of the matrix, we deduce that (Tn(t)Hn(t))=α(4t+1+t2−2t+5)n−1(2t−1+t2−2t+5)+β(4t+1−t2−2t+5)n−1(2t−1−t2−2t+5) where α,β are such that (t−1)(α+β)+(α−β)t2−2t+5=12(α+β)=1 The conditions on α and β make the formula work for n=1. When n is odd the formula for Tn(t) can be "simplified" into a shape which is visibly polynomial, and we obtain T2n+1(t)=42n1j=0∑n(2j2n)(t+1)2n−2j(t2−2t+5)j−42nt−3j=0∑n−1(2j+12n)(t+1)2n−2j−1(t2−2t+5)j I have yet to obtain a closed form for P[T2n+1=k].
Log in to reply
I do not understand what your initial equations are measuring, or why they are true. Note that Hn should measure the maximum number of successive heads, and not just the initial length of successive heads.
When n>>r, then there could be multiple strings of successive heads which are at the maximum. In this case, it is not clear what your recurrence relation is supposed to be counting. This is also where your recurrence relations break down.
My value of 7 consecutive heads out of 13 coins is different from either of your values.
In the case that r≤2n, we can do a direct counting of the cases. For r>2n, we need to use PIE to avoid double counting.
Log in to reply
Consider n tosses, where the first is a head.
If the second toss is a head (with probability 21), then the probability of getting k occurrences of consecutive heads out of the n tosses is the probability of getting k−1 occurrences of consecutive heads out of the final n−1 tosses (excluding the first one) where we now have that the first of these n−1 tosses is a head (the first two tosses have given us one such occurrence).
If the second toss is a tail (with probability 21), then the probability of getting k occurrences of consecutive heads out of the n tosses is the probability of getting k occurrences of consecutive heads out of the final n−1 tosses (excluding the first one) where we now have that the first of these n−1 tosses is a tail (we have not obtained a successive head occurrence in the first pair this time).
Thus
P[Hn=k]=21P[Hn−1=k−1]+21P[Tn−1=k]
with similar arguments holding for the other formulae.
Our difference of opinion on this may be about what the question is asking. The question can be read as:
"what is the probability that heads occur consecutively seven times?", in which case HHHHTTHHHHHTT would do as a "good" sequence,
or as "what is the probability that a string of seven consecutive heads occurs?", in which "good" sequences would be like TTHHHHHHHTTHT.
I am answering the first of these questions.
Log in to reply
Note that your recurrence relation should use the variable t instead of x.
Oops! The coin is tossed 13 times, not 12. Thus the distribution we want is T14, not T13. Now
T14(t)=81921(610+1308t+1686t2+1624t3+1269t4+834t5+476t6+230t7+104t8+34t9+14t10+2t11+t12) and hence P[T14=7]=8192230=4096115.