Open Side Menu Go to the Top
Register
flipping a coin flipping a coin

02-06-2012 , 11:38 AM
Hi

I have come up with something and should be most grateful if someone a lot cleverer than me could answer the following.

We know that the chance of head or tail is 50/50. My question is, what is the longest run of heads/tails in a row you can expect and how many times will it occur.

The something I have 'discovered' puts the longest run of say heads at 6.

This is with 2000+ goes and it has happened 3 times only.

My gut instinct tells me that the longest run and number of times is a lot higher than this.

I look forward to receiving a reply to this question and thank you in anticipation of your help with it.

Dave
flipping a coin Quote
02-06-2012 , 11:43 AM
Try this: http://stattrek.com/tables/binomial.aspx

Chance of success: .5
Number of Trials = 6
Number of Successes = 6
Probability = .016 (or 1.6% or 1 in 63)

Change the Trials and Successes to see the chance of a "run of heads or tails."

One thing to be careful of - a run of either heads or tails is different than a run of a specific result. In the former, the first result doesn't matter, just the rest of the run.
flipping a coin Quote
02-06-2012 , 12:11 PM
Quote:
Originally Posted by DMMx69
Try this: http://stattrek.com/tables/binomial.aspx

Chance of success: .5
Number of Trials = 6
Number of Successes = 6
Probability = .016 (or 1.6% or 1 in 63)

Change the Trials and Successes to see the chance of a "run of heads or tails."

One thing to be careful of - a run of either heads or tails is different than a run of a specific result. In the former, the first result doesn't matter, just the rest of the run.
You just computed 0.56. For the probability of streaks occuring out of some number of flips, you don't use a binomial calculator because the trials overlap and are not independent. You need a streak calculator, and a non-standard one at that if you want to know the probability of it occurring multiple times. The only one I know of is the one I wrote the code for here:

http://daytradinglife.com/wp-content...calculator.pdf

That will give you probabilities. If you want the average longest length, you can compute that from the numbers given. If you want a run of heads or tails instead of just heads, the trick is to decrease the length of the streak and the number of flips by 1.

Now there is a way to approximate these probabilities with a binomial calculator, but you need to divide the number of flips by the average length of a trial to get the approximate number of independent trials (not flips). A trial is a sequence of flips ending in a tail or a successful streak of heads. The average length of a trial is computed with the geometric series as I've shown here before. The probability is the probability of a streak, not 0.5. For just a single streak, you don't need the binomial calculator because it's just an exponential distribution. For more than one streak, this method will lose accuracy unless the number of flips is sufficiently long compared to the length of a streak.

Last edited by BruceZ; 02-06-2012 at 06:49 PM.
flipping a coin Quote
02-06-2012 , 12:15 PM
(Edit: must have been typing at the same time as BruceZ, he was faster.)

Here's a streak calculator, I think this is what you want.

http://www.pulcinientertainment.com/...tor-enter.html

Use this one specifically as most of the ones on the web are inaccurate.

So to answer your question, a streak of ANY length can happen, and the chance of it depends on how many times you flip. So put your number of flips in the top box (trials), and the streak length in the next box, and it will tell you the chance of it happening. For example, the chance to get a streak of 10 heads in a row within 10,000 flips is over 99%.
flipping a coin Quote
02-06-2012 , 12:37 PM
Quote:
Originally Posted by BruceZ
You just computed 0.56.
Right. Maybe I am misreading the OP. I thought his two questions were:

1) What is the longest possible streak.
2) What is the chance this happens.

Longest possible is approaching infinite. And chance a streak of x happening at any given time is clearly .5^x.

If he is looking for the longest streak given Y trials, then please disregard.

Thanks for the link for streak calculator. This is cool.
flipping a coin Quote
02-06-2012 , 12:39 PM
surprised noone's mentioned martingale yet
flipping a coin Quote
02-06-2012 , 12:53 PM
Many Many thanks guys for your very quick and excellent replies.

So, when I put in 2000 trials and 6 - the streak of 128 means that the probability will be 2000 div by 128 meaning 6 in a row should occur about 15 times during the 2000 flips.

The 256 for 7 times = about 8 times for 7 in a row up to 2048 for 10 in a row, so about one 10 in a row per 2000 flips.

Have I picked this up the correct way.

If this is so, it makes my 3 x 6 and 1 x 7 in a row per 2000 flips very good odds indeed.

I should be again very grateful if what I have said above is correct. Once again many thanks in anticipation.

Dave
flipping a coin Quote
02-06-2012 , 02:01 PM
Quote:
Originally Posted by strikera
So, when I put in 2000 trials and 6 - the streak of 128 means that the probability will be 2000 div by 128 meaning 6 in a row should occur about 15 times during the 2000 flips.
6 or more in a row, yes.

And the 128 avg. length is unrelated to the 2000 trials, that only affects the top number (probability in that many trials). It just means that on average you will see a 6-in-a-row or longer every 128 flips.
flipping a coin Quote
02-13-2012 , 06:32 PM
Hi Dave,
I can answer a few more of your questions also after Valentine Day.

I have a few formulas and a worksheet just for you. More coming.

Now,
=(p^run)*(1+((trials-run)*q)) [remember: q = 1-p]
15.593750 is:
The expected number of Head runs of length 6 or more in 2,000 trials when p = 0.5
So you are in the ball park with your thoughts.
(If you run the formula for length 7 and subtract that from the above average value, you will be looking at the average number of runs of exactly length 6! So, cool.)
Quote:
Originally Posted by BruceZ
That will give you probabilities. If you want the average longest length, you can compute that from the numbers given.
the average longest length of Head runs from Ghost007 worksheet needed to be adjusted to do just that.

(The run lengths needed to go vertical instead of the current horizontal. I need to clean my Excel up and send it to Ghost so maybe he can format in his style and include it in the complete package for download if he wants)

Here is a snap of my Excel adjusted for Dave's 2,000 trials and longest run Q.

Quote:
Originally Posted by BruceZ
If you want a run of heads or tails instead of just heads, the trick is to decrease the length of the streak and the number of flips by 1.
And, If you want the average longest length Head or Tail run just add 1 to the 10.3

Bruce and all
Happy Valentine's Day
Vacation time!
Sally

here are the sim results showing how well BruceZ coded the VBA.
Code:
       group         middle     freq  freq/100
----------------------------------------------
 5.50 <= x <  6.50     6.00      306     0.03%
 6.50 <= x <  7.50     7.00    18750     1.88%
 7.50 <= x <  8.50     8.00   120362    12.04%
 8.50 <= x <  9.50     9.00   235605    23.56%
 9.50 <= x < 10.50    10.00   237889    23.79%
10.50 <= x < 11.50    11.00   169929    16.99%
11.50 <= x < 12.50    12.00   102544    10.25%
12.50 <= x < 13.50    13.00    55582     5.56%
13.50 <= x < 14.50    14.00    28982     2.90%
14.50 <= x < 15.50    15.00    14885     1.49%
15.50 <= x < 16.50    16.00     7524     0.75%
16.50 <= x < 17.50    17.00     3769     0.38%
17.50 <= x < 18.50    18.00     1989     0.20%
18.50 <= x < 19.50    19.00      909     0.09%
19.50 <= x < 20.50    20.00      491     0.05%
20.50 <= x < 21.50    21.00      247     0.02%
21.50 <= x < 22.50    22.00      122     0.01%
22.50 <= x < 23.50    23.00       54     0.01%
23.50 <= x < 24.50    24.00       32     0.00%
24.50 <= x < 25.50    25.00       12     0.00%
25.50 <= x < 26.50    26.00        9     0.00%
26.50 <= x < 27.50    27.00        5     0.00%
27.50 <= x < 28.50    28.00        2     0.00%
28.50 <= x < 29.50    29.00        1     0.00%

----------------------------------------------
grouped data
items:                   1,000,000   

minimum value:                6.00
first quartile:               9.00
median:                      10.00
third quartile:              11.00
maximum value:               29.00

mean value:                  10.30
midrange:                    17.50

range:                       23.00
interquartile range:          2.00
mean abs deviation:           1.44

sample variance (n):          3.49
sample variance (n-1):        3.49
sample std dev (n):           1.87
sample std dev (n-1):         1.87

----------------------------------------------

Last edited by sallymustang; 02-13-2012 at 06:40 PM. Reason: added sim results
flipping a coin Quote

      
m