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