Quote:michael99000I bet Kurt Von Haller made more money selling his book than he did playing roulette

If he made $1 selling books, then this statement is true. Come to think of it, even if he lost money on his book it is probably still true.

the OP questions 37. Where it came fromQuote:WizardIf the question is how long will it take for every number to appear in double-zero roulette, the answer is 160.6602765, on average. This is the sum of the inverse of every integer from 1 to 38.

that is just 1/p where p=1/37

handy tables

0 Roulette (155.4586903)

# of numbers | average # of spins | cumulative sum |
---|---|---|

1 | 1 | 1 |

2 | 1.027777778 | 2.027777778 |

3 | 1.057142857 | 3.084920635 |

4 | 1.088235294 | 4.173155929 |

5 | 1.121212121 | 5.29436805 |

6 | 1.15625 | 6.45061805 |

7 | 1.193548387 | 7.644166437 |

8 | 1.233333333 | 8.877499771 |

9 | 1.275862069 | 10.15336184 |

10 | 1.321428571 | 11.47479041 |

11 | 1.37037037 | 12.84516078 |

12 | 1.423076923 | 14.2682377 |

13 | 1.48 | 15.7482377 |

14 | 1.541666667 | 17.28990437 |

15 | 1.608695652 | 18.89860002 |

16 | 1.681818182 | 20.58041821 |

17 | 1.761904762 | 22.34232297 |

18 | 1.85 | 24.19232297 |

19 | 1.947368421 | 26.13969139 |

20 | 2.055555556 | 28.19524694 |

21 | 2.176470588 | 30.37171753 |

22 | 2.3125 | 32.68421753 |

23 | 2.466666667 | 35.1508842 |

24 | 2.642857143 | 37.79374134 |

25 | 2.846153846 | 40.63989519 |

26 | 3.083333333 | 43.72322852 |

27 | 3.363636364 | 47.08686488 |

28 | 3.7 | 50.78686488 |

29 | 4.111111111 | 54.897976 |

30 | 4.625 | 59.522976 |

31 | 5.285714286 | 64.80869028 |

32 | 6.166666667 | 70.97535695 |

33 | 7.4 | 78.37535695 |

34 | 9.25 | 87.62535695 |

35 | 12.33333333 | 99.95869028 |

36 | 18.5 | 118.4586903 |

37 | 37 | 155.4586903 |

The average is not the mode (The "mode" is the value that occurs most often)

or median (The "median" is the "middle" value or close to 50%)

median = spin 147 @ 0.501522154

mode = 133 @ 0.0106293156

00 Roulette (160.6602765)

# of numbers | average # of spins | cumulative sum |
---|---|---|

1 | 1 | 1 |

2 | 1.027027027 | 2.027027027 |

3 | 1.055555556 | 3.082582583 |

4 | 1.085714286 | 4.168296868 |

5 | 1.117647059 | 5.285943927 |

6 | 1.151515152 | 6.437459079 |

7 | 1.1875 | 7.624959079 |

8 | 1.225806452 | 8.85076553 |

9 | 1.266666667 | 10.1174322 |

10 | 1.310344828 | 11.42777702 |

11 | 1.357142857 | 12.78491988 |

12 | 1.407407407 | 14.19232729 |

13 | 1.461538462 | 15.65386575 |

14 | 1.52 | 17.17386575 |

15 | 1.583333333 | 18.75719908 |

16 | 1.652173913 | 20.409373 |

17 | 1.727272727 | 22.13664572 |

18 | 1.80952381 | 23.94616953 |

19 | 1.9 | 25.84616953 |

20 | 2 | 27.84616953 |

21 | 2.111111111 | 29.95728064 |

22 | 2.235294118 | 32.19257476 |

23 | 2.375 | 34.56757476 |

24 | 2.533333333 | 37.1009081 |

25 | 2.714285714 | 39.81519381 |

26 | 2.923076923 | 42.73827073 |

27 | 3.166666667 | 45.9049374 |

28 | 3.454545455 | 49.35948285 |

29 | 3.8 | 53.15948285 |

30 | 4.222222222 | 57.38170508 |

31 | 4.75 | 62.13170508 |

32 | 5.428571429 | 67.56027651 |

33 | 6.333333333 | 73.89360984 |

34 | 7.6 | 81.49360984 |

35 | 9.5 | 90.99360984 |

36 | 12.66666667 | 103.6602765 |

37 | 19 | 122.6602765 |

38 | 38 | 160.6602765 |

median = spin 152 @ 0.501599171

mode = 138 @ 0.010333952

still interesting one brings up this question

Sally

Quote:WizardIf the question is how long will it take for every number to appear in double-zero roulette, the answer is 160.6602765, on average. This is the sum of the inverse of every integer from 1 to 38.

The sum of the inverse of every integer from 1 to 38 is 4.2279020133. Using the inverse of every integer, it would take like 10^70 of them to get to 160. (160.66 is the harmonic series up to 38 times 38; using 37 for single zero roulette it is is 155)

(I learned this one when calculating the expected longest drought for a Super Bowl or World Series)

being specific using pari/gp calculator found hereQuote:TomG(160.66 is the harmonic series up to 38 times 38; using 37 for single zero roulette it is is 155)

https://pari.math.u-bordeaux.fr/gp.html

a=sum(k=1,37,37/(37-(k-1)))

0 Roulette

(19:17) gp > a=sum(k=1,37,37/(37-(k-1)));

(19:20) gp > a

%6 = 2040798836801833/13127595717600

(19:20) gp > a=sum(k=1,37,37./(37-(k-1)));

(19:20) gp > a

%8 = 155.45869028140164699369367483727361613

00 Roulette

(19:17) gp > a=sum(k=1,38,38/(38-(k-1)));

(19:17) gp > a

%2 = 2053580969474233/12782132672400

(19:17) gp > a=sum(k=1,38,38./(38-(k-1)));

(19:17) gp > a

%4 = 160.66027650522331312865836875179452467

this is the short way to an answer

Sally

Quote:TomGThe sum of the inverse of every integer from 1 to 38 is 4.2279020133. Using the inverse of every integer, it would take like 10^70 of them to get to 160. (160.66 is the harmonic series up to 38 times 38; using 37 for single zero roulette it is is 155)

You're right. I forgot to say to multiply by 38.

Quote:mustangsallythe OP questions 37. Where it came from

that is just 1/p where p=1/37

The average is not the mode (The "mode" is the value that occurs most often)

or median (The "median" is the "middle" value or close to 50%)

median = spin 147 @ 0.501522154

mode = 133 @ 0.0106293156

I agree on the median. Here is my transition matrix.

0.027 | 0.973 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |

0 | 0.0541 | 0.9459 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |

0 | 0 | 0.0811 | 0.9189 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 |

If the table is too big, cell (x,x) = x/37 and cell (x,x+1) = (37-x)/37), and every other cell is zero.

to point out little differences in building a transition matrix (both are correct, one needs some special attention after calculations)Quote:WizardI agree on the median. Here is my transition matrix.

The Wizard's transition matrix (where rows sum to 1) starts with the 1st spin already completed.

I was taught to always start at 0 to make sure one does not forget to add 1 to calculations of the matrix.

(both methods are perfectly fine to use)

My TM is A, the Wizards is B (in the photo below - Wizard's values have been rounded down)

the column 1,2,3,4 is the row number and not the 'state name' for Matrix A but is correct for Matrix B

(Matrix A row names is just the row value - 1)

after raising the Wizards TM to the 146th power

(in the photo below)

we find the median (0.50141 - values have been rounded)

we must add 1 to 146 = 147 for the median (for the example 37 number Roulette)

distribution to only 160 spins

using R code section 3r.

https://sites.google.com/view/krapstuff/coupon-collecting

> tMax.dist.cum(37, 160)

Row Draw X Draw X Prob cumulative: (X or less)

[1,] 36 0 0

[2,] 37 1.30398646e-15 1.30398646e-15

[3,] 38 2.34717563e-14 2.47757428e-14

[4,] 39 2.18963997e-13 2.4373974e-13

[5,] 40 1.41020849e-12 1.65394823e-12

[6,] 41 7.04758973e-12 8.70153796e-12

[7,] 42 2.91274839e-11 3.78290219e-11

[8,] 43 1.0362069e-10 1.41449712e-10

[9,] 44 3.26113904e-10 4.67563616e-10

[10,] 45 9.26201149e-10 1.39376477e-09

[11,] 46 2.40983412e-09 3.80359888e-09

[12,] 47 5.81187695e-09 9.61547584e-09

[13,] 48 1.31152608e-08 2.27307366e-08

[14,] 49 2.79063823e-08 5.0637119e-08

[15,] 50 5.63461642e-08 1.06983283e-07

[16,] 51 1.08539739e-07 2.15523022e-07

[17,] 52 2.00382556e-07 4.15905578e-07

[18,] 53 3.55945139e-07 7.71850717e-07

[19,] 54 6.10432194e-07 1.38228291e-06

[20,] 55 1.01371507e-06 2.39599799e-06

[21,] 56 1.63439194e-06 4.03038993e-06

[22,] 57 2.56428073e-06 6.59467066e-06

[23,] 58 3.92320027e-06 1.05178709e-05

[24,] 59 5.86384932e-06 1.63817202e-05

[25,] 60 8.57655591e-06 2.49582762e-05

[26,] 61 1.22936442e-05 3.72519204e-05

[27,] 62 1.72931556e-05 5.4545076e-05

[28,] 63 2.39016655e-05 7.84467415e-05

[29,] 64 3.24959609e-05 0.000110942702

[30,] 65 4.35033766e-05 0.000154446079

[31,] 66 5.74006425e-05 0.000211846721

[32,] 67 7.47111458e-05 0.000286557867

[33,] 68 9.60005844e-05 0.000382558452

[34,] 69 0.000121871045 0.000504429497

[35,] 70 0.000152953612 0.000657383109

[36,] 71 0.000189899666 0.000847282775

[37,] 72 0.000233371083 0.00108065386

[38,] 73 0.000284029587 0.00136468345

[39,] 74 0.000342525541 0.00170720899

[40,] 75 0.000409486459 0.00211669545

[41,] 76 0.000485505566 0.00260220101

[42,] 77 0.000571130666 0.00317333168

[43,] 78 0.000666853627 0.0038401853

[44,] 79 0.000773100711 0.00461328601

[45,] 80 0.000890223971 0.00550350999

[46,] 81 0.0010184939 0.00652200389

[47,] 82 0.00115809345 0.00768009734

[48,] 83 0.00130911356 0.0089892109

[49,] 84 0.00147155014 0.010460761

[50,] 85 0.0016453027 0.0121060637

[51,] 86 0.00183017435 0.0139362381

[52,] 87 0.00202587342 0.0159621115

[53,] 88 0.00223201628 0.0181941278

[54,] 89 0.00244813147 0.0206422593

[55,] 90 0.00267366499 0.0233159243

[56,] 91 0.00290798647 0.0262239107

[57,] 92 0.0031503962 0.0293743069

[58,] 93 0.00340013282 0.0327744397

[59,] 94 0.00365638142 0.0364308212

[60,] 95 0.00391828208 0.0403491032

[61,] 96 0.00418493855 0.0445340418

[62,] 97 0.00445542691 0.0489894687

[63,] 98 0.00472880426 0.053718273

[64,] 99 0.00500411709 0.0587223901

[65,] 100 0.00528040947 0.0640027995

[66,] 101 0.00555673069 0.0695595302

[67,] 102 0.00583214262 0.0753916728

[68,] 103 0.00610572634 0.0814973992

[69,] 104 0.0063765884 0.0878739876

[70,] 105 0.00664386631 0.0945178539

[71,] 106 0.00690673349 0.101424587

[72,] 107 0.00716440359 0.108588991

[73,] 108 0.00741613413 0.116005125

[74,] 109 0.00766122955 0.123666355

[75,] 110 0.00789904366 0.131565398

[76,] 111 0.00812898147 0.13969438

[77,] 112 0.00835050049 0.14804488

[78,] 113 0.00856311152 0.156607992

[79,] 114 0.00876637894 0.165374371

[80,] 115 0.00895992057 0.174334291

[81,] 116 0.00914340706 0.183477698

[82,] 117 0.00931656105 0.192794259

[83,] 118 0.00947915584 0.202273415

[84,] 119 0.00963101392 0.211904429

[85,] 120 0.00977200518 0.221676434

[86,] 121 0.0099020449 0.231578479

[87,] 122 0.0100210917 0.241599571

[88,] 123 0.010129145 0.251728716

[89,] 124 0.010226243 0.261954959

[90,] 125 0.01031246 0.272267419

[91,] 126 0.0103879038 0.282655323

[92,] 127 0.0104527134 0.293108036

[93,] 128 0.0105070562 0.303615092

[94,] 129 0.0105511257 0.314166218

[95,] 130 0.0105851391 0.324751357

[96,] 131 0.0106093345 0.335360692

[97,] 132 0.0106239689 0.345984661

[98,] 133 0.0106293156 0.356613976

[99,] 134 0.0106256625 0.367239639

[100,] 135 0.0106133093 0.377852948

[101,] 136 0.0105925662 0.388445514

[102,] 137 0.0105637515 0.399009266

[103,] 138 0.0105271901 0.409536456

[104,] 139 0.0104832116 0.420019667

[105,] 140 0.0104321489 0.430451816

[106,] 141 0.0103743366 0.440826153

[107,] 142 0.0103101097 0.451136263

[108,] 143 0.0102398025 0.461376065

[109,] 144 0.0101637472 0.471539812

[110,] 145 0.0100822729 0.481622085

[111,] 146 0.00999570494 0.49161779

[112,] 147 0.00990436365 0.501522154

[113,] 148 0.00980856384 0.511330718

[114,] 149 0.00970861406 0.521039332

[115,] 150 0.00960481601 0.530644148

[116,] 151 0.00949746401 0.540141612

[117,] 152 0.00938684459 0.549528456

[118,] 153 0.00927323608 0.558801692

[119,] 154 0.00915690833 0.567958601

[120,] 155 0.00903812243 0.576996723

[121,] 156 0.00891713057 0.585913854

[122,] 157 0.00879417581 0.594708029

[123,] 158 0.00866949209 0.603377522

[124,] 159 0.00854330407 0.611920826

[125,] 160 0.00841582721 0.620336653

remember, we can only raise a square matrix to a power (as in B^146)

Enjoy

Assume there are N numbers, and K of them have already come up at least once.

This is equivalent to, "If you have N balls, K of which are red and the other N-K are white, how many draws with replacement (i.e. when you draw a ball, you put it back) should it take before you draw a white ball?"

The probability of doing it in exactly D draws is (K / N)

^{D-1}x (N - K) / N

= (K

^{D-1}(N - K)) / N

^{D}

The expected number is

1 x (N - K) / N

+ 2 x K (N - K) / N

^{2}

+ 3 x K

^{2}(N - K) / N

^{3}

+ 4 x K

^{3}(N - K) / N

^{4}

+ ...

= (N - K) / N x (1 + 2 (K / N) + 3 (K / N)

^{2}+ 4 (K / N)

^{3}+ ...)

= (N - K) / N x (1 + (K / N) + (K / N)

^{2}+ (K / N)

^{3}+ ...)

^{2}

= (N - K) / N x (1 / (1 - (K / N))

^{2}, since K < N

= (N - K) / N x (1 / ((N - K) / N))

^{2}

= (N - K) / N x (N / (N - K))

^{2}

= (N - K) / N x N

^{2}/ (N - K)

^{2}

= N / (N - K)

At the start, K = 0; after each number is drawn for the first time, K increases by 1.

The total number is the number needed to get the first number + the number to get the

second different number once you have already drawn one + the number needed to get the

third different number once you have already drawn two different numbers + ... + the number

needed to get the Nth different number once you have already drawn N-1 different numbers

This is is N / N + N / (N-1) + N / (N-2) + ... + N / 2 + N

= N x (1 / N + 1 / (N-1) + ... + 1 / 3 + 1 / 2 + 1)