# Thread:

1. ## P(H heads in a row) given N coin flips

Hi,

I recently thought of the following problem and my basic grasp of probability and combinatorics is not enough to handle it:

You flip a coin N times. What is the probability P(N,H) that you get at least one sequence of at least H heads in a row?

Since this question deals with the number of times a result will happen, I tried to use a Poisson Distribution, but I'm having trouble separating the problem into mutually exclusive events.

I wrote a program to do a simulation and found that P(20,7) ≈ 0.058, so please make sure your answer fits with this result.

2. Originally Posted by lambda
Hi,

I recently thought of the following problem and my basic grasp of probability and combinatorics is not enough to handle it:

You flip a coin N times. What is the probability P(N,H) that you get at least one sequence of at least H heads in a row?

Since this question deals with the number of times a result will happen, I tried to use a Poisson Distribution, but I'm having trouble separating the problem into mutually exclusive events.

I wrote a program to do a simulation and found that P(20,7) ≈ 0.058, so please make sure your answer fits with this result.

I would do it this way: treat the "H heads in a row" as a single object and call it "R" for "row". With N flips and "H heads in a row", there are N- H other flips. How many different ways are there to order 1 object and N- H other objects?

3. ## Problem - counts certain cases twice

Originally Posted by HallsofIvy
I would do it this way: treat the "H heads in a row" as a single object and call it "R" for "row". With N flips and "H heads in a row", there are N- H other flips. How many different ways are there to order 1 object and N- H other objects?
I tried this approach and got $P(n,h) = \frac{acceptable\_series}{total\_possible\_series} = \frac{2^{n-h}(n-h + 1)}{2^n} = \frac{n-h + 1}{2^h}$ but kept getting answers that were roughly 2x too large.
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 1, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9640918374061584, "perplexity_flag": "middle"}