For the first roll, chances for unique are 6/6, so 1 roll is needed. Then 5/6, that is also 1. 4/6, is 1 roll. 3/6 is 1 roll. 2/6 is 2 rolls. 1/6 is 3 rolls. So 9 rolls are needed.
I'd like to see how 15 was calculated. I'd surprised if the number of rolls happened to be an integer, so I suspect Ragknot's 14.7 is closer to the truth.
I'm on a roll (pun intended), after all. I'd sort of guessed that it was 6^6/6!. But now realise (thanks to Ragknot for the experimental value) that I should have been adding ("doh") and not multiplying:
Although I'm being brave enough to post, I can't say that I've properly understood why that calculation is correct (or even if it is!). It may just be a coincidence that the number is close to Ragknot's value.
I've had to remind myself about the definition of probability. If on average you have to do something n times to get the desired result, then the probability of getting the result in 1 trial is 1/n. Now I'm sure that my calculation is correct :)
If n is large, then number of rolls is approx: n(γ + ln[n]), where γ is the Euler–Mascheroni constant = 0.5772156649... and ln[n] is the natural logarithm (i.e. log base e) of n.
I Googled to get the info on the harmonic series to obtain the above asymptotic equation.
Hi Zaux. No! - 14.7 is what you would get in reality - Ragknot has proven that experimentally. I keep on saying "on average" because that is crucial to realising that a non-integer is allowed.
No, I did some to 10 million, but the average didn't change much.
Using math theory you can say that the average would be exactly 14.7, but by actually getting a average over N trials, how many trials would you have to do to say your trials had given you at least a 99% accuracy?
Hi Ragknot. To answer that question, the standard deviation (or variance) needs to be known, then you can introduce confidence intervals.
14.7 is what you get after an infinite number of trials.
Roughly, the confidence interval (accuracy for practical purposes) is inversely proportional to the square root of the number of trials. I can estimate the standard deviation for the presented problem by using your statistics to plot a graph and estimating (guessing more like). It is approximately 4 throws. The curve is similar to the normal distribution. If I'm remembering it right, the confidence interval is something like +/- (confidence required, expressed in standard deviations)*(std deviation)/root(n). I think that 2 standard deviation is around 95% confidence. So I guess 1,000,000 trials is good to 2*4/1000 = 0.008 throws, with 95% confidence. So 2 decimal places with 1,000,000 trials. Need 100,000,000 trials to get it to 3 DP (at 95% confidence).
So your first published result has done rather better than I would expect. Or I've goofed somewhere. (I nknow that I really ought to have converted everything to the standard normal distribution first (for the SND mean = 0 and std dev = 1).
23 Comments:
15
How about 14.7?
Can you explain please?
How are you going to roll a dice 0.7 times......
I came up with 16, but soon realised that the first roll was guaranteed to give me a unique number...
15 then.
For the first roll, chances for unique are 6/6, so 1 roll is needed.
Then 5/6, that is also 1. 4/6, is 1 roll. 3/6 is 1 roll. 2/6 is 2 rolls. 1/6 is 3 rolls.
So 9 rolls are needed.
To Mister Fahrenheit
I made a model to produce random numbers 1 to 6, and test for all six numbers being rolled. It reports how many rolls were required to get all six.
After 1 million runs
the maximum rolls required was 78
The minimum was 6 (of course)
The average was 14.699567
Of course can have 0.7 rolls "on average".
I'd like someone to figure out what's wrong with their computation with some additional info.
After 1 million tests the results
were the following.
It took six rolls 1.52% of the time.
It took 15 rolls 6.91% of the time...
2.5% of the time it took more than 30 rolls to get all six!
6 1.52%
7 3.85%
8 5.97%
9 7.53%
10 8.26%
11 8.48%
12 8.19%
13 7.54%
14 6.91%
15 6.16%
16 5.37%
17 4.66%
18 3.98%
19 3.40%
20 2.92%
21 2.51%
22 2.09%
23 1.75%
24 1.48%
25 1.20%
26 1.03%
27 0.85%
28 0.74%
29 0.61%
30 0.51%
I'd like to see how 15 was calculated. I'd surprised if the number of rolls happened to be an integer, so I suspect Ragknot's 14.7 is closer to the truth.
I haven't worked out how to do it myself :(
I'm on a roll (pun intended), after all. I'd sort of guessed that it was 6^6/6!. But now realise (thanks to Ragknot for the experimental value) that I should have been adding ("doh") and not multiplying:
6/6 + 6/5 + 6/4 + 6/3 + 6/2 + 6/1 =
14.7 (exactly).
Although I'm being brave enough to post, I can't say that I've properly understood why that calculation is correct (or even if it is!). It may just be a coincidence that the number is close to Ragknot's value.
Chris,
Very good, to test your theory about how this should be computed, suppose you have a seven sided die?
what is the avg for this (or any other how about a twelve sided... anyway whatever you suggest.
We can test it.
I've had to remind myself about the definition of probability. If on average you have to do something n times to get the desired result, then the probability of getting the result in 1 trial is 1/n. Now I'm sure that my calculation is correct :)
Hi Ragknot. Your post didn't appear until my last post.
If have an n sided dice then the number of rolls on average to get all n sides is:
n(1/1 + 1/2 + 1/3 + ... + 1/n). So for a 7 sided dice, number of rolls (on average) = 18.15.
For 12 sides, get 37.23853...
If n is large, then number of rolls is approx:
n(γ + ln[n]), where γ is the Euler–Mascheroni constant = 0.5772156649... and ln[n] is the natural logarithm (i.e. log base e) of n.
I Googled to get the info on the harmonic series to obtain the above asymptotic equation.
My random numbers check out to be
pretty close.
Sides= 7
Runs= 100000
Maxj= 80
Minj= 7
Avg= 18.13878
Sides= 12
Runs= 100000
Maxj= 150
Minj= 12
Avg= 37.22452
Yea ... 14.7 mathematically ... in reality 15.
Hi Zaux. No! - 14.7 is what you would get in reality - Ragknot has proven that experimentally. I keep on saying "on average" because that is crucial to realising that a non-integer is allowed.
Hi Ragknot. Thanks for that. I notice that you only used 100000trials. Wassup, is your machine poorly?
Hi Zaux, just to clarify, if you roll a dice many times, the average throw will be 3.5, even though you can't throw a 3.5.
No, I did some to 10 million, but the average didn't change much.
Using math theory you can say that the average would be exactly 14.7, but by actually getting a average over N trials, how many trials would you have to do to say your trials had given you at least a 99% accuracy?
Hi Ragknot. To answer that question, the standard deviation (or variance) needs to be known, then you can introduce confidence intervals.
14.7 is what you get after an infinite number of trials.
Roughly, the confidence interval (accuracy for practical purposes) is inversely proportional to the square root of the number of trials. I can estimate the standard deviation for the presented problem by using your statistics to plot a graph and estimating (guessing more like). It is approximately 4 throws. The curve is similar to the normal distribution. If I'm remembering it right, the confidence interval is something like +/- (confidence required, expressed in standard deviations)*(std deviation)/root(n). I think that 2 standard deviation is around 95% confidence. So I guess 1,000,000 trials is good to 2*4/1000 = 0.008 throws, with 95% confidence. So 2 decimal places with 1,000,000 trials. Need 100,000,000 trials to get it to 3 DP (at 95% confidence).
So your first published result has done rather better than I would expect. Or I've goofed somewhere. (I nknow that I really ought to have converted everything to the standard normal distribution first (for the SND mean = 0 and std dev = 1).
That's more than enough.
Ah .... OK
The most probable number of rolls is approximately 11.
Post a Comment
Links to this post:
Create a Link
<< Home