Coin flip combinatorics problem

Here is a problem I ran into years ago that I find interesting:

If you flip a fair coin ten times, what is the probability there will be at least one sequence of three consecutive heads or three consecutive tails?

Hint: We know that 210=10242^{10}=1024

To turn the problem into Brilliant format, I would ask: "Of the 210=10242^{10}=1024 possibilities, how many contain at least one sequence of three consecutive heads or three consecutive tails?"

#Combinatorics #MathProblem #Math

Note by Alex Porush
7 years, 8 months ago

No vote yet
6 votes

  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:

  • 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.

MarkdownAppears as
*italics* or _italics_ italics
**bold** or __bold__ bold

- bulleted
- list

  • bulleted
  • list

1. numbered
2. list

  1. numbered
  2. list
Note: you must add a full line of space before and after lists for them to show up correctly
paragraph 1

paragraph 2

paragraph 1

paragraph 2

[example link](https://brilliant.org)example link
> This is a quote
This is a quote
    # 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"
MathAppears as
Remember to wrap math in \( ... \) or \[ ... \] to ensure proper formatting.
2 \times 3 2×3 2 \times 3
2^{34} 234 2^{34}
a_{i-1} ai1 a_{i-1}
\frac{2}{3} 23 \frac{2}{3}
\sqrt{2} 2 \sqrt{2}
\sum_{i=1}^3 i=13 \sum_{i=1}^3
\sin \theta sinθ \sin \theta
\boxed{123} 123 \boxed{123}

Comments

Consider the two scenarios:

  1. Toss a coin nn times. Whatever the value of the first toss is, just record whether each of the subsequent n1n-1 tosses was the same as (SS) or different to (DD) its predecessor.

  2. Take a different coin whose sides are labelled SS and DD, and toss it n1n-1 times.

In both cases, each sequence of n1n-1 SSs and DDs is equally likely. There are however two ways of obtaining each such sequence in the first scenario (since we can obtain each sequence once by throwing a head first, and once by throwing a tail first). The point of this is that the event of getting three or more consecutive heads, or three or more consecutive tails, in the first scenario exactly corresponds to the event of getting two or more consecutive SSs in the second scenario.

Working in the second scenario, we want to know how many sequences of n1n-1 tosses result in two or more consecutive SSs. It is easier to count the sequences that do not. Let xmx_m be the number of sequences of mm tosses of the relabelled coin that do not contain consecutive SSs. Certainly x1=2x_1=2 and x2=3x_2=3. Suppose now that m3m \ge 3.

  • It is clear the the number of sequences of mm tosses that do not contain consecutive SSs and which start with a DD is just equal to xm1x_{m-1}, the number of sequence of m1m-1 tosses that do not contain consecutive SSs (just ignore the first toss);

  • If the first toss is SS, we need the second toss to be DD if we want to be SSSS-free. Thus the number of sequences of mm tosses that do not contain consecutive SSs and which start with a SS is just equal to xm2x_{m-2}.

Hence xm=xm1+xm2x_m \,=\, x_{m-1} + x_{m-2} for all m3m \ge 3. From this it is clear that xm=Fm+2x_m = F_{m+2} is the (m+2)(m+2)nd Fibonacci number (starting the sequence F0=0F_0=0, F1=1F_1=1, etc. ).

We now interpret these results in the first scenario. The probability of getting three consecutive heads or three consecutive tails in nn throws is 1xn12(n1)=1Fn+12(n1)1 - x_{n-1}2^{-(n-1)} = 1 - F_{n+1}2^{-(n-1)}. Alternatively, the number of sequences of nn coin tosses which contain three consecutive heads or three consecutive tails 2n2Fn+12^n - 2F_{n+1}.

Mark Hennings - 7 years, 8 months ago

Log in to reply

Great explanation! I like how you created the bijection which simplified it slightly, and then did it again.

If you look at your answer, it suggests that we can take a simpler approach by counting the complement.

Hint: How many sequences of 1's and 2's are there which add up to nn?

Calvin Lin Staff - 7 years, 8 months ago

Log in to reply

The question asked for the non-complemented answer, which I gave by counting the complemented answer, and then complementing!

Your hint refers to the standard problem: how many ways are there of tiling an n×1n\times1 chessboard with single squares and 2×12\times1 dominoes? Enter the Fibonacci numbers, in the guise of the numbers xnx_n above. The 2×12\times1 "dominoes" are SDSD tosses, and the "single squares" are either single DD tosses, or else a toss of SS at the end of the sequence.

Mark Hennings - 7 years, 8 months ago

Log in to reply

@Mark Hennings It is easier to count the complement to the original question, without going through your bijection.

Calvin Lin Staff - 7 years, 8 months ago

Log in to reply

@Calvin Lin If I understand you right, you are writing nn as an ordered sum of 11s and 22s, and then interpreting each such sum as a sequence of heads of tails, where you change from heads to tails with each new number. Thus the sum 7=1+1+2+1+27=1+1+2+1+2 is either HTHHTHH or THTTHTT. There are Fn+1F_{n+1} ways of writing nn as a sum of 11s and 22s, and two sequences of coin tosses for each sum. This gives 2Fn+12F_{n+1} as the number of coin tosses with no successive HHH or TTT.

The idea of taking alternate numbers and inferring the change in head/taillness is just applying an argument equivalent to my bijection at the same time as doing the counting, My argument just separates the two processes. We are both more interested in tracking when the coin outcome changes than what its value is at any one time.

Mark Hennings - 7 years, 8 months ago

Wow... you explained it thoroughly. Thank you very much.

Lokesh Sharma - 7 years, 8 months ago

9/257

Jeffer Dave Cagubcob - 7 years, 8 months ago

By "sequence of three consecutive heads" do you mean "sequence of exactly three consecutive heads" or "sequence of at least three consecutive heads?" For example, does HHHH count as a "sequence of three consecutive heads" or not?

Also, I'm having great difficulty understanding the purpose of your hint. Surely anyone capable of solving this problem already knows how to count the total number of possible outcomes of ten coin flips, and those who aren't so capable will not be helped at all by it! Are you trying to imply by a trivial hint that the problem has a trivial solution?

Christopher Johnson - 7 years, 8 months ago

Log in to reply

He means "sequence of at least three consecutive heads". Also, the hint is actually incredibly insightful if you're used to seeing such problems.

Henrik Boecken - 7 years, 8 months ago

Log in to reply

How is the hint incredibly insightful to such a person? What does it tell such a person that they don't already know from having seen such problems before? I'm not trying to be a jerk, here; I really want to know!

Christopher Johnson - 7 years, 8 months ago

Log in to reply

@Christopher Johnson Sorry I took so long to answer this. Basically, the hint is a well-known problem, and the answer is just the Fibonacci numbers. The way the question is worded though slightly obscures that. The hint provides a different way of looking at the problem which is much easier to understand. http://www.artofproblemsolving.com/Forum/viewtopic.php?p=2630571&sid=517efe238b9f8891af7a818c8e105965#p2630571 is a similar example of a problem that is made more difficult by its wording. Sorry if I didn't explain that very well.

Henrik Boecken - 7 years, 8 months ago
×

Problem Loading...

Note Loading...

Set Loading...