You throw a perfect die (digits 1 to 6), adding up the results until the total score is over N.
What’s your estimate of the most likely final sum?
Please write down your guess prior to analytical evaluation or simulation.
n mean occurrences of
1 2 3 4 5 6
1 4.0607 1971 1960 1969 1948 1895 257
2 4.7727 2296 2231 2203 2317 626 327
3 5.5545 2657 2660 2628 967 712 376
4 6.4792 3092 3128 1387 1136 803 454
5 7.5623 3599 1970 1632 1332 942 525
6 8.8375 2465 2307 1933 1551 1171 573
7 9.72 2652 2361 1993 1515 1087 392
8 10.6513 2797 2448 2001 1408 891 455
9 11.6577 2878 2375 1918 1407 965 457
10 12.6524 2903 2416 1872 1350 981 478
10 12.6365 2940 2443 1812 1389 949 467
20 22.6686 2877 2372 1854 1470 939 488
30 32.6696 2865 2347 1919 1434 966 469
40 42.6676 2837 2440 1829 1474 944 476
50 52.6658 2855 2398 1881 1439 954 473
60 62.6342 2962 2389 1855 1419 889 486
70 72.6742 2837 2435 1856 1389 987 496
80 82.6848 2846 2297 1925 1507 945 480
90 92.7011 2693 2478 1895 1497 933 504
100 102.6693 2808 2393 1979 1411 936 473
DefDbl A-Z
Dim crlf$, excess()
Private Sub Form_Load()
Form1.Visible = True
Text1.Text = ""
crlf = Chr$(13) + Chr$(10)
tr0 = 10000
Randomize Timer
For n = 1 To 10
ReDim excess(6)
tosses = 0: overtot = 0
For tr = 1 To tr0
tot = 0
Do
tot = tot + Int(6 * Rnd(1) + 1)
Loop Until tot > n
overtot = overtot + tot
ex = tot - n
excess(ex) = excess(ex) + 1
Next tr
avrg = overtot / tr0
Text1.Text = Text1.Text & n & Str(avrg)
For i = 1 To 6
Text1.Text = Text1.Text & Str(excess(i))
Next
Text1.Text = Text1.Text & crlf
Next n
Text1.Text = Text1.Text & crlf
For n = 10 To 100 Step 10
ReDim excess(6)
tosses = 0: overtot = 0
For tr = 1 To tr0
tot = 0
Do
tot = tot + Int(6 * Rnd(1) + 1)
Loop Until tot > n
overtot = overtot + tot
ex = tot - n
excess(ex) = excess(ex) + 1
Next tr
avrg = overtot / tr0
Text1.Text = Text1.Text & n & Str(avrg)
For i = 1 To 6
Text1.Text = Text1.Text & Str(excess(i))
Next
Text1.Text = Text1.Text & crlf
Next n
Text1.Text = Text1.Text & crlf & " done"
End Sub
|
Posted by Charlie
on 2016-04-18 14:44:30 |