Thread Rating:
Suppose you're playing American roulette ... 38 numbers. What is the expected number of spins until all the numbers 1..36, and 0 and 00 have each been hit at least one time?
In general, given numbers 1 .. N and a random number generator that generates values from 1 to N, what is the expected number of numbers the generator will have to turn out until it has hit each of 1, 2, 3, ... up to N?
For example, with N = 2, the answer is 2*(1/2) + 3*(1/4) + 4*(1/8) + 5*(1/16) + ... = 3. So, the expected number of flips of a coin to get both heads and tails to appear is 3.
It's kind of the opposite of the birthday problem. How many people do you need to have in a room so that you expect every birth date to be hit by one or more people?
Oh, well, this is probably well known ... and I think I know the answer for roulette ... just in case no one cares ...
--Ms. D.
I didn't know they even had pigs in Australia much less that pigs got milked!Quote: DorothyGaleWhile I was milking the pigs today,
>So, the expected number of flips of a coin to get both heads and tails to appear is 3.
I wish I understood that proof more clearly. Certainly 2 tosses are the minimum that is required and a certain probability exists for further tosses that both Heads and Tails will appear.
Are you thinking of establishing a FireBet for roulette?
No, I don't care about applications of this question. Though I do see the relationship ... maybe someone else who cares can make a side bet out of it and say it's the world's best new idea and make a ton of money, I don't care ...Quote: FleaStiffAre you thinking of establishing a FireBet for roulette?
Ms. D.
Therefore, after one spin, there are 37 numbers that are due, and one that isn't. This continues until 37 numbers have come up, and there is one number left, which is so, like, totally due that it is certain to hit.
Therefore, I say the answer is 39 spins (not 38, because one has to take into account atmospheric and gravitational disturbances).
Before I read all the surefire roulette systems posted on this board, and absorbed their mighty wisdom, I might have resorted to silly old math to obtain my answer. This way is so much easier!
Quote: DorothyGaleWhile I was milking the pigs today, I thought of a little problem. Nothing this simple is new, but it's got some twists to it.
Suppose you're playing American roulette ... 38 numbers. What is the expected number of spins until all the numbers 1..36, and 0 and 00 have each been hit at least one time?
In general, given numbers 1 .. N and a random number generator that generates values from 1 to N, what is the expected number of numbers the generator will have to turn out until it has hit each of 1, 2, 3, ... up to N?
For example, with N = 2, the answer is 2*(1/2) + 3*(1/4) + 4*(1/8) + 5*(1/16) + ... = 3. So, the expected number of flips of a coin to get both heads and tails to appear is 3.
It's kind of the opposite of the birthday problem. How many people do you need to have in a room so that you expect every birth date to be hit by one or more people?
Oh, well, this is probably well known ... and I think I know the answer for roulette ... just in case no one cares ...
--Ms. D.
Just a guess, but would it be around 514 or so? Approximation using ln2?
Quote: KelmoJust a guess, but would it be around 514 or so? Approximation using ln2?
A better guess, about 158-160?
I'll refrain from giving a solution to let others enjoy the problem.
Quote: miplet160.66 according to the Wizard.
I forgot I answered that. How did you dig that up?
Quote: Mr. WOnce you have hit n numbers the probability of getting a new number on the next spin is (38-n)/38. If the probability of an event is p then the expected number of trials before it happens is 1/p. Thus the expected number of spins to get a new number, given that you already have n, is 38/(38-n). For example once you have hit 20 numbers the expected number of spins to get the 21st is 38/18=2.11. So the answer is the product of the expected number of spins at each step: (38/38)*(38/37)*(38/36)*...*(38/1)=160.66. March 11, 2001
The answer 160.66 is right. That's what I got too. But, I think you want to "add" the numbers, not "multiply" them.
(38/38) + (38/37) + (38/36) + ... (38/2) + (38/1) = 160.66.
--Ms. D.
"So the answer is the product of the expected number of spins at each step: (38/38)*(38/37)*(38/36)*Ö*(38/1)=160.66."
I only get the 160.66 when I ADD all the steps instead of multiply.
1
1.027027027
1.055555556
1.085714286
1.117647059
1.151515152
1.1875
1.225806452
1.266666667
1.310344828
1.357142857
1.407407407
1.461538462
1.52
1.583333333
1.652173913
1.727272727
1.80952381
1.9
2
2.111111111
2.235294118
2.375
2.533333333
2.714285714
2.923076923
3.166666667
3.454545455
3.8
4.222222222
4.75
5.428571429
6.333333333
7.6
9.5
12.66666667
19
38
___________
160.6602765
Quote: DorothyGale
For example, with N = 2, the answer is 2*(1/2) + 3*(1/4) + 4*(1/8) + 5*(1/16) + ... = 3. So, the expected number of flips of a coin to get both heads and tails to appear is 3.
So then (2/2)+(2/1)=3 solves for the coin toss example.
Another Wizard Gem!
Quote: Wizard160.6602765.
I'll refrain from giving a solution to let others enjoy the problem.
A quick Excel simulation shows only a 59.4% chance that in 161 spins, all 38 numbers would hit.
65377 groups of 161 spins so the sample size is small and the error about 1.5%
Nope27 has a nice table showing the probability of NOT hitting "at least 1" number in x spins
https://wizardofvegas.com/member/nope27/blog/#post153
In case you didn't know the answer is closely approximated by 38 x (ln 38 + γ) = 160.16, where γ is the Euler constant .57721...
This is a version of the coupon collectors problem.
yes, the basic versionQuote: AceThis is a version of the coupon collectors problem.
as you know
there are many many versions to the ccp.
one can run R code for this here online
https://sites.google.com/view/krapstuff/coupon-collecting
BruceZ R code provided above
data
draw Prob on X cumulative
[1,] 37 0 0
[2,] 38 4.86120346e-16 4.86120346e-16
[3,] 39 8.993226401e-15 9.479346747e-15
[4,] 40 8.614564237e-14 9.562498912e-14
[5,] 41 5.691765657e-13 6.648015548e-13
[6,] 42 2.915675884e-12 3.580477438e-12
[7,] 43 1.234202623e-11 1.592250366e-11
[8,] 44 4.493466909e-11 6.085717275e-11
[9,] 45 1.446233166e-10 2.054804894e-10
[10,] 46 4.197640261e-10 6.252445154e-10
[11,] 47 1.115394694e-09 1.740639209e-09
[12,] 48 2.745508363e-09 4.486147572e-09
[13,] 49 6.319513238e-09 1.080566081e-08
[14,] 50 1.370746777e-08 2.451312858e-08
[15,] 51 2.819825894e-08 5.271138752e-08
[16,] 52 5.531184799e-08 1.080232355e-07
[17,] 53 1.039291494e-07 2.119523849e-07
[18,] 54 1.877993422e-07 3.997517271e-07
[19,] 55 3.274732435e-07 7.272249706e-07
[20,] 56 5.526923563e-07 1.279917327e-06
[21,] 57 9.052368025e-07 2.185154129e-06
[22,] 58 1.442202938e-06 3.627357068e-06
[23,] 59 2.239645227e-06 5.867002295e-06
[24,] 60 3.39647971e-06 9.263482005e-06
[25,] 61 5.038511251e-06 1.430199326e-05
[26,] 62 7.322416712e-06 2.162440997e-05
[27,] 63 1.043949409e-05 3.206390406e-05
[28,] 64 1.461897549e-05 4.668287956e-05
[29,] 65 2.013070094e-05 6.68135805e-05
[30,] 66 2.728696108e-05 9.410054158e-05
[31,] 67 3.644333883e-05 0.0001305438804
[32,] 68 4.799841269e-05 0.0001785422931
[33,] 69 6.239222416e-05 0.0002409345173
[34,] 70 8.010345867e-05 0.0003210379759
[35,] 71 0.0001016453376 0.0004226833135
[36,] 72 0.000127560269 0.0005502435825
[37,] 73 0.0001584133524 0.0007086569349
[38,] 74 0.0001947848733 0.0009034418082
[39,] 75 0.000237261963 0.001140703771
[40,] 76 0.0002864296247 0.001427133396
[41,] 77 0.0003428613473 0.001769994743
[42,] 78 0.000407109541 0.002177104284
[43,] 79 0.0004796960279 0.002656800312
[44,] 80 0.0005611028174 0.003217903129
[45,] 81 0.0006517633789 0.003869666508
[46,] 82 0.0007520546081 0.004621721117
[47,] 83 0.0008622896541 0.005484010771
[48,] 84 0.0009827117486 0.006466722519
[49,] 85 0.001113489145 0.007580211664
[50,] 86 0.001254711243 0.008834922907
[51,] 87 0.001406385947 0.01024130885
[52,] 88 0.001568438264 0.01180974712
[53,] 89 0.001740710129 0.01355045725
[54,] 90 0.001922961422 0.01547341867
[55,] 91 0.002114872092 0.01758829076
[56,] 92 0.002316045332 0.01990433609
[57,] 93 0.002526011677 0.02243034777
[58,] 94 0.002744233928 0.0251745817
[59,] 95 0.002970112782 0.02814469448
[60,] 96 0.003202993039 0.03134768752
[61,] 97 0.003442170257 0.03478985777
[62,] 98 0.00368689774 0.03847675551
[63,] 99 0.003936393734 0.04241314925
[64,] 100 0.004189848706 0.04660299796
[65,] 101 0.004446432623 0.05104943058
[66,] 102 0.004705302106 0.05575473268
[67,] 103 0.004965607402 0.06072034009
[68,] 104 0.005226499062 0.06594683915
[69,] 105 0.005487134293 0.07143397344
[70,] 106 0.00574668291 0.07718065635
[71,] 107 0.006004332849 0.0831849892
[72,] 108 0.006259295209 0.08944428441
[73,] 109 0.006510808794 0.0959550932
[74,] 110 0.006758144154 0.1027132374
[75,] 111 0.007000607105 0.1097138445
[76,] 112 0.00723754173 0.1169513862
[77,] 113 0.007468332886 0.1244197191
[78,] 114 0.007692408205 0.1321121273
[79,] 115 0.007909239634 0.1400213669
[80,] 116 0.008118344515 0.1481397114
[81,] 117 0.008319286249 0.1564589977
[82,] 118 0.008511674556 0.1649706722
[83,] 119 0.008695165377 0.1736658376
[84,] 120 0.008869460438 0.1825352981
[85,] 121 0.009034306517 0.1915696046
[86,] 122 0.009189494436 0.200759099
[87,] 123 0.00933485782 0.2100939568
[88,] 124 0.009470271652 0.2195642285
[89,] 125 0.009595650648 0.2291598791
[90,] 126 0.009710947485 0.2388708266
[91,] 127 0.009816150919 0.2486869775
[92,] 128 0.009911283796 0.2585982613
[93,] 129 0.009996401006 0.2685946623
[94,] 130 0.01007158738 0.2786662497
[95,] 131 0.01013695557 0.2888032053
[96,] 132 0.01019264393 0.2989958492
[97,] 133 0.01023881434 0.3092346635
[98,] 134 0.01027565017 0.3195103137
[99,] 135 0.0103033542 0.3298136679
[100,] 136 0.01032214655 0.3401358145
[101,] 137 0.0103322628 0.3504680773
[102,] 138 0.01033395204 0.3608020293
[103,] 139 0.01032747508 0.3711295044
[104,] 140 0.01031310269 0.3814426071
[105,] 141 0.01029111397 0.391733721
[106,] 142 0.01026179471 0.4019955157
[107,] 143 0.01022543601 0.4122209518
[108,] 144 0.01018233277 0.4224032845
[109,] 145 0.01013278246 0.432536067
[110,] 146 0.01007708389 0.4426131509
[111,] 147 0.01001553604 0.4526286869
[112,] 148 0.009948437068 0.462577124
[113,] 149 0.009876083334 0.4724532073
[114,] 150 0.009798768516 0.4822519758
[115,] 151 0.00971678283 0.4919687587
[116,] 152 0.009630412305 0.501599171
[117,] 153 0.009539938145 0.5111391091
[118,] 154 0.009445636154 0.5205847453
[119,] 155 0.009347776235 0.5299325215
[120,] 156 0.009246621943 0.5391791434
[121,] 157 0.00914243011 0.5483215735
[122,] 158 0.009035450517 0.5573570241
[123,] 159 0.008925925627 0.5662829497
[124,] 160 0.008814090359 0.5750970401
[125,] 161 0.008700171916 0.583797212
[126,] 162 0.008584389651 0.5923816016
[127,] 163 0.008466954977 0.6008485566
[128,] 164 0.008348071305 0.6091966279
[129,] 165 0.008227934027 0.6174245619
[130,] 166 0.008106730519 0.6255312924
[131,] 167 0.007984640178 0.6335159326
[132,] 168 0.007861834482 0.6413777671
[133,] 169 0.00773847707 0.6491162442
[134,] 170 0.007614723847 0.656730968
[135,] 171 0.007490723104 0.6642216911
[136,] 172 0.007366615652 0.6715883068
[137,] 173 0.007242534973 0.6788308418
[138,] 174 0.007118607382 0.6859494491
[139,] 175 0.006994952199 0.6929444013
[140,] 176 0.006871681928 0.6998160833
[141,] 177 0.006748902444 0.7065649857
[142,] 178 0.006626713189 0.7131916989
[143,] 179 0.006505207365 0.7196969063
[144,] 180 0.006384472142 0.7260813784
[145,] 181 0.006264588852 0.7323459673
[146,] 182 0.006145633203 0.7384916005
[147,] 183 0.006027675475 0.7445192759
[148,] 184 0.005910780734 0.7504300567
[149,] 185 0.005795009025 0.7562250657
[150,] 186 0.005680415583 0.7619054813
[151,] 187 0.00556705103 0.7674725323
[152,] 188 0.005454961567 0.7729274939
[153,] 189 0.005344189176 0.778271683
[154,] 190 0.005234771804 0.7835064549
[155,] 191 0.005126743552 0.7886331984
[156,] 192 0.005020134854 0.7936533333
[157,] 193 0.004914972662 0.7985683059
[158,] 194 0.004811280611 0.8033795865
[159,] 195 0.004709079192 0.8080886657
[160,] 196 0.004608385915 0.8126970516
[161,] 197 0.004509215465 0.8172062671
[162,] 198 0.004411579859 0.821617847
[163,] 199 0.004315488595 0.8259333356
[164,] 200 0.00422094879 0.8301542843
[165,] 201 0.004127965323 0.8342822497
[166,] 202 0.004036540969 0.8383187906
[167,] 203 0.003946676521 0.8422654672
[168,] 204 0.003858370922 0.8461238381
[169,] 205 0.003771621375 0.8498954595
[170,] 206 0.003686423462 0.8535818829
[171,] 207 0.00360277125 0.8571846542
[172,] 208 0.003520657396 0.8607053116
[173,] 209 0.003440073247 0.8641453848
[174,] 210 0.003361008934 0.8675063937
[175,] 211 0.003283453461 0.8707898472
[176,] 212 0.003207394797 0.873997242
[177,] 213 0.003132819954 0.877130062
[178,] 214 0.003059715063 0.880189777
[179,] 215 0.002988065457 0.8831778425
[180,] 216 0.002917855732 0.8860956982
[181,] 217 0.002849069822 0.888944768
[182,] 218 0.002781691059 0.8917264591
[183,] 219 0.002715702232 0.8944421613
[184,] 220 0.002651085649 0.897093247
[185,] 221 0.002587823185 0.8996810702
[186,] 222 0.002525896339 0.9022069665
[187,] 223 0.002465286276 0.9046722528
[188,] 224 0.002405973878 0.9070782267
[189,] 225 0.002347939785 0.9094261664
[190,] 226 0.00229116443 0.9117173309
[191,] 227 0.002235628087 0.913952959
[192,] 228 0.002181310896 0.9161342699
[193,] 229 0.002128192904 0.9182624628
[194,] 230 0.002076254091 0.9203387168
[195,] 231 0.002025474402 0.9223641912
[196,] 232 0.001975833774 0.924340025
[197,] 233 0.001927312158 0.9262673372
[198,] 234 0.001879889547 0.9281472267
[199,] 235 0.001833545996 0.9299807727
[200,] 236 0.001788261643 0.9317690344
[201,] 237 0.001744016725 0.9335130511
[202,] 238 0.0017007916 0.9352138427
[203,] 239 0.001658566758 0.9368724095
[204,] 240 0.001617322841 0.9384897323
[205,] 241 0.001577040652 0.9400667729
[206,] 242 0.00153770117 0.9416044741
[207,] 243 0.001499285562 0.9431037597
[208,] 244 0.00146177519 0.9445655349
[209,] 245 0.001425151623 0.9459906865
[210,] 246 0.001389396645 0.9473800831
[211,] 247 0.001354492261 0.9487345754
[212,] 248 0.001320420707 0.9500549961
[213,] 249 0.001287164452 0.9513421606
[214,] 250 0.001254706207 0.9525968668
[215,] 251 0.001223028926 0.9538198957
[216,] 252 0.001192115813 0.9550120115
[217,] 253 0.001161950322 0.9561739618
[218,] 254 0.001132516164 0.957306478
[219,] 255 0.001103797306 0.9584102753
[220,] 256 0.001075777975 0.9594860533
[221,] 257 0.001048442655 0.9605344959
[222,] 258 0.001021776095 0.961556272
[223,] 259 0.0009957633018 0.9625520353
[224,] 260 0.000970389547 0.9635224249
[225,] 261 0.0009456403615 0.9644680652
[226,] 262 0.0009215015376 0.9653895668
[227,] 263 0.0008979591278 0.9662875259
[228,] 264 0.0008749994431 0.9671625253
[229,] 265 0.0008526090524 0.9680151344
[230,] 266 0.0008307747802 0.9688459092
[231,] 267 0.0008094837052 0.9696553929
[232,] 268 0.0007887231584 0.970444116
[233,] 269 0.0007684807205 0.9712125968
[234,] 270 0.0007487442199 0.971961341
[235,] 271 0.0007295017299 0.9726908427
[236,] 272 0.0007107415665 0.9734015843
[237,] 273 0.0006924522853 0.9740940366
[238,] 274 0.0006746226787 0.9747686592
[239,] 275 0.0006572417731 0.975425901
[240,] 276 0.0006402988256 0.9760661998
[241,] 277 0.0006237833211 0.9766899832
[242,] 278 0.0006076849692 0.9772976681
[243,] 279 0.0005919937005 0.9778896618
[244,] 280 0.0005766996639 0.9784663615
[245,] 281 0.0005617932228 0.9790281547
[246,] 282 0.0005472649521 0.9795754197
[247,] 283 0.0005331056343 0.9801085253
[248,] 284 0.0005193062567 0.9806278316
[249,] 285 0.0005058580076 0.9811336896
[250,] 286 0.000492752273 0.9816264418
[251,] 287 0.000479980633 0.9821064225
[252,] 288 0.0004675348586 0.9825739573
[253,] 289 0.0004554069079 0.9830293642
[254,] 290 0.0004435889232 0.9834729532
[255,] 291 0.0004320732272 0.9839050264
[256,] 292 0.0004208523196 0.9843258787
[257,] 293 0.0004099188739 0.9847357976
[258,] 294 0.000399265734 0.9851350633
[259,] 295 0.000388885911 0.9855239492
[260,] 296 0.0003787725794 0.9859027218
[261,] 297 0.0003689190746 0.9862716409
[262,] 298 0.0003593188889 0.9866309598
[263,] 299 0.0003499656689 0.9869809254
[264,] 300 0.0003408532121 0.9873217786
[265,] 301 0.0003319754636 0.9876537541
[266,] 302 0.0003233265134 0.9879770806
[267,] 303 0.0003149005929 0.9882919812
[268,] 304 0.0003066920722 0.9885986733
[269,] 305 0.0002986954573 0.9888973687
[270,] 306 0.0002909053867 0.9891882741
[271,] 307 0.0002833166287 0.9894715908
[272,] 308 0.0002759240789 0.9897475148
[273,] 309 0.000268722757 0.9900162376
[274,] 310 0.0002617078041 0.9902779454
[275,] 311 0.0002548744803 0.9905328199
[276,] 312 0.0002482181617 0.990781038
[277,] 313 0.0002417343379 0.9910227724
[278,] 314 0.0002354186097 0.991258191
[279,] 315 0.0002292666861 0.9914874577
[280,] 316 0.0002232743822 0.9917107321
[281,] 317 0.0002174376167 0.9919281697
[282,] 318 0.0002117524093 0.9921399221
[283,] 319 0.0002062148787 0.992346137
[284,] 320 0.00020082124 0.9925469582
[285,] 321 0.0001955678028 0.992742526
[286,] 322 0.0001904509686 0.992932977
[287,] 323 0.0001854672289 0.9931184442
[288,] 324 0.000180613163 0.9932990574
[289,] 325 0.0001758854358 0.9934749428
[290,] 326 0.0001712807963 0.9936462236
[291,] 327 0.0001667960747 0.9938130197
[292,] 328 0.0001624281814 0.9939754479
[293,] 329 0.0001581741043 0.994133622
[294,] 330 0.0001540309076 0.9942876529
[295,] 331 0.0001499957294 0.9944376486
[296,] 332 0.0001460657803 0.9945837144
[297,] 333 0.0001422383416 0.9947259527
[298,] 334 0.0001385107633 0.9948644635
[299,] 335 0.0001348804628 0.9949993439
[300,] 336 0.0001313449229 0.9951306889
[301,] 337 0.0001279016907 0.9952585906
[302,] 338 0.0001245483754 0.9953831389
[303,] 339 0.0001212826472 0.9955044216
[304,] 340 0.0001181022359 0.9956225238
[305,] 341 0.000115004929 0.9957375287
[306,] 342 0.0001119885705 0.9958495173
[307,] 343 0.0001090510597 0.9959585684
[308,] 344 0.0001061903493 0.9960647587
[309,] 345 0.0001034044449 0.9961681632
[310,] 346 0.0001006914027 0.9962688546
[311,] 347 9.804932913e-05 0.9963669039
[312,] 348 9.547637895e-05 0.9964623803
[313,] 349 9.297075443e-05 0.996555351
[314,] 350 9.053070399e-05 0.9966458817
[315,] 351 8.815452109e-05 0.9967340363
[316,] 352 8.584054311e-05 0.9968198768
[317,] 353 8.358715022e-05 0.996903464
[318,] 354 8.139276432e-05 0.9969848567
[319,] 355 7.925584798e-05 0.9970641126
[320,] 356 7.717490343e-05 0.9971412875
[321,] 357 7.514847154e-05 0.9972164359
[322,] 358 7.317513086e-05 0.9972896111
[323,] 359 7.125349666e-05 0.9973608646
[324,] 360 6.938221999e-05 0.9974302468
[325,] 361 6.755998678e-05 0.9974978068
[326,] 362 6.578551697e-05 0.9975635923
[327,] 363 6.405756363e-05 0.9976276499
[328,] 364 6.237491209e-05 0.9976900248
[329,] 365 6.073637919e-05 0.9977507611
[330,] 366 5.91408124e-05 0.997809902
[331,] 367 5.75870891e-05 0.997867489
[332,] 368 5.607411576e-05 0.9979235632
[333,] 369 5.460082725e-05 0.997978164
[334,] 370 5.316618609e-05 0.9980313302
[335,] 371 5.176918172e-05 0.9980830994
[336,] 372 5.040882985e-05 0.9981335082
[337,] 373 4.908417178e-05 0.9981825924
[338,] 374 4.77942737e-05 0.9982303866
[339,] 375 4.653822611e-05 0.9982769249
[340,] 376 4.531514316e-05 0.99832224
[341,] 377 4.412416205e-05 0.9983663642
[342,] 378 4.296444245e-05 0.9984093286
[343,] 379 4.18351659e-05 0.9984511638
[344,] 380 4.073553525e-05 0.9984918993
[345,] 381 3.966477413e-05 0.9985315641
[346,] 382 3.862212641e-05 0.9985701862
[347,] 383 3.760685564e-05 0.9986077931
[348,] 384 3.66182446e-05 0.9986444113
[349,] 385 3.565559477e-05 0.9986800669
[350,] 386 3.471822583e-05 0.9987147851
[351,] 387 3.380547524e-05 0.9987485906
[352,] 388 3.291669774e-05 0.9987815073
[353,] 389 3.205126492e-05 0.9988135586
[354,] 390 3.120856475e-05 0.9988447671
[355,] 391 3.038800123e-05 0.9988751551
[356,] 392 2.958899389e-05 0.9989047441
[357,] 393 2.881097744e-05 0.9989335551
[358,] 394 2.805340137e-05 0.9989616085
[359,] 395 2.731572954e-05 0.9989889242
[360,] 396 2.659743985e-05 0.9990155217
[361,] 397 2.589802382e-05 0.9990414197
[362,] 398 2.52169863e-05 0.9990666367
[363,] 399 2.455384506e-05 0.9990911905
[364,] 400 2.390813051e-05 0.9991150987
from avg draws
0 160.66028
1 159.66028
2 158.63325
3 157.57769
4 156.49198
5 155.37433
6 154.22282
7 153.03532
8 151.80951
9 150.54284
10 149.23250
11 147.87536
12 146.46795
13 145.00641
14 143.48641
15 141.90308
16 140.25090
17 138.52363
18 136.71411
19 134.81411
20 132.81411
21 130.70300
22 128.46770
23 126.09270
24 123.55937
25 120.84508
26 117.92201
27 114.75534
28 111.30079
29 107.50079
30 103.27857
31 98.52857
32 93.10000
33 86.76667
34 79.16667
35 69.66667
36 57.00000
37 38.00000
"A quick Excel simulation shows only a 59.4% chance that in 161 spins, all 38 numbers would hit."
that I calculated using a Markov chain in R (in the spoiler results)
161 spins: all 38 numbers prob: 0.583797212
Sally
yes, I actually have but it recently got off of my A-list.Quote: Ace2Has anyone ever worked the coupon collector problem, but with 2 hits required?
I was reading this interesting pdf
(Handsome man, sweet family)
https://www.cmc3.org/conference/Tahoe15/Tahoe15_JLee.pdf
"Two Questions I Started To Ask Myself
1) How Many Happy Meals Do I Have To Buy
Before I Collect All 8 Toys?
2) How Much Money Will I Spend Until I Have
Collected All 8 Toys?"
What If We Want To Collect Two Complete Sets?
in the pdf he continues
"Another Method To Calculate The Waiting Time
Is To Use The Dirichlet Type-II C-Integral
This Is Used To Calculate The Lower Tail Of
The Multinomial Distribution"
ok
learn some more stuff
well,
I started with a Markov chain approach (states get large)
but found myself completing other projects first (as I usually do)
not much easy stuff out there that I found
I am more into the actual distribution (the mean is ok too)
as one can create fun games to play from them (imo, of course)
Sally
yes, there are other methods too. I like this method and start in Excel
*****
regular coupon collect problem of at least 1 of each:
will start with coupons=3
(coupons=38 asked for will be later as only in Excel right now and NOT online yet. the number of states is (N+1)*(N+2) / 2 = 780 so I have to get it right the 1st time)
mean wait time for at least 1 of each = 11/2 = 5.5
the distribution
(from here: https://sites.google.com/view/krapstuff/coupon-collecting
section 3r.)
Draw x | Draw x Prob | cumulative: x or less |
---|---|---|
2 | 0 | 0 |
3 | 0.222222222 | 0.222222222 |
4 | 0.222222222 | 0.444444444 |
5 | 0.172839506 | 0.617283951 |
6 | 0.12345679 | 0.740740741 |
7 | 0.085048011 | 0.825788752 |
8 | 0.057613169 | 0.88340192 |
9 | 0.038713611 | 0.922115531 |
10 | 0.025910684 | 0.948026216 |
11 | 0.01730766 | 0.965333875 |
12 | 0.01154973 | 0.976883605 |
13 | 0.007703583 | 0.984587188 |
14 | 0.005136977 | 0.989724165 |
15 | 0.003425069 | 0.993149234 |
16 | 0.002283519 | 0.995432753 |
17 | 0.001522392 | 0.996955146 |
18 | 0.001014944 | 0.997970089 |
19 | 0.000676634 | 0.998646724 |
20 | 0.000451091 | 0.999097815 |
*****
coupon collect problem of at least 2 of each:
with coupons=3
mean wait time for at least 1 of each = 347/36 (about 9.638888889)
the distribution
draw x | draw x prob | cumulative: (x or less) |
---|---|---|
1 | 0 | 0 |
2 | 0 | 0 |
3 | 0 | 0 |
4 | 0 | 0 |
5 | 0 | 0 |
6 | 0.12345679 | 0.12345679 |
7 | 0.164609053 | 0.288065844 |
8 | 0.16003658 | 0.448102423 |
9 | 0.136564548 | 0.584666971 |
10 | 0.108824874 | 0.693491846 |
11 | 0.083320632 | 0.776812478 |
12 | 0.062219513 | 0.83903199 |
13 | 0.045702157 | 0.884734147 |
14 | 0.0331865 | 0.917920647 |
15 | 0.023896454 | 0.941817101 |
16 | 0.017096076 | 0.958913177 |
17 | 0.012167617 | 0.971080794 |
18 | 0.008622678 | 0.979703471 |
19 | 0.006088083 | 0.985791554 |
20 | 0.004284762 | 0.990076316 |
what they both look like
1st = at least 1
2nd = at least 2
1st to see
Sally
Quote: Gabes22The only problem I see in the McDonald's problem is don't they "release" the different toys at different dates. i.e. releasing toy A on June 1st and toy B on June 8th and so on and so forth, They might do it in waves to like release A, B and C on one date then D, E and F on another and so on and so forth. Knowing that information may drastically change the odds.
I have seen them do that, yes.
the simple answer is, of course, just less than 2x that of collecting at least 1 each...Quote: Ace2Has anyone ever worked the coupon collector problem, but with 2 hits required? So, for instance, what is the expected number of roulette spins for every number to have appeared at least twice ?
I have some help with this question now,
as the pdf I was using had the transition matrix populated correctly
but how to do it was by far not correct. (the main diagonal is easy using a helper column, the others are elusive right now)
I found a formula for this
in this pdf on page 14 that looks good
"By termwise integration it is easy to obtain the following exact
formula, which is a finite sum, for T2,
the average number of trials needed to collect
at least two of each of the d kinds of coupons:"
http://www.brynmawr.edu/math/people/anmyers/PAPERS/SIGEST_Coupons.pdf
but do not understand where and what m and j is (I think m=2 and j=number of states) in the formula they arrive at
(the results from the formula are correct so far)
but I never took calculus and the calculus to inclusion exclusion conversion
lost me
at this point in time
Sally
Quote: mustangsallyI found a formula for this in this pdf on page 14 that looks good
"By termwise integration it is easy to obtain the following exact formula, which is a finite sum, for T2, the average number of trials needed to collect
at least two of each of the d kinds of coupons:"
http://www.brynmawr.edu/math/people/anmyers/PAPERS/SIGEST_Coupons.pdf
but do not understand where and what m and j is (I think m=2 and j=number of states) in the formula they arrive at
(the results from the formula are correct so far)
I think m and j under the sigma sign usually means "for all nonnegative integers m and j," but in this case, it appears to be 0 <= j <= m <= d - 1, as otherwise (d-1)C(m) and (m)C(j) are undefined.
However, while I get results of 2, 11/2, 347/36, and 11259/864, I get them for d = 1 through 4 instead of 2 through 5, which makes sense, as if d = 1, it will always take 2 draws to get "each" coupon twice, while for d = 2, getting all of the coupons in a total of 2 draws happens only half of the time.
ok, I have time now to look at this again.Quote: ThatDonGuyI think m and j under the sigma sign usually means "for all nonnegative integers m and j," but in this case, it appears to be 0 <= j <= m <= d - 1, as otherwise (d-1)C(m) and (m)C(j) are undefined.
nice observation
what values did you use for m and j?Quote: ThatDonGuyHowever, while I get results of 2, 11/2, 347/36, and 11259/864,
I saw that too. I think that is a typo as the rows of results below that shows the correct values 1:4Quote: ThatDonGuyI get them for d = 1 through 4 instead of 2 through 5, <snip>
For the 38 numbers on a 00 Roulette wheel,
Excel says (once I was shown how to populate the transition matrix fast)
mean spins = 234.8326629 for 'at least 2' of each number
that is just over a 40% increase for the 'at least 1' value.
(time for a fast simulation)
now, to see if I can too get the formula to work (from the pdf I linked to)
The Markov chain method may take some time to get into R or even Pari GP
I want the distribution (as always)
Sally
Here is a small table of data so farQuote: Ace2Based on what I’ve seen the limit could be the natural log of 2. So if the average is about 7,485 tries to get all of them once, it would be that divided by 0.693 = 10,800 to get all of them twice. Just a guess.
A | B | C | D | E | F |
---|---|---|---|---|---|
coupons | at least 1 | at least 2 | B/C | C-B | E/B |
1 | 1 | 2 | 0.500 | 1 | 1 |
2 | 3 | 5.5 | 0.545 | 2.5 | 0.833333333 |
3 | 5.5 | 9.6389 | 0.571 | 4.1389 | 0.752527273 |
4 | 8.3333 | 14.189 | 0.587 | 5.8557 | 0.702686811 |
5 | 11.417 | 19.041 | 0.600 | 7.624 | 0.667776123 |
6 | 14.7 | 24.134 | 0.609 | 9.434 | 0.641768707 |
7 | 18.15 | 29.425 | 0.617 | 11.275 | 0.621212121 |
8 | 21.743 | 34.885 | 0.623 | 13.142 | 0.604424412 |
9 | 25.46 | 40.492 | 0.629 | 15.032 | 0.590416339 |
10 | 29.29 | 46.23 | 0.634 | 16.94 | 0.578354387 |
38 | 160.66 | 234.833 | 0.684 | 74.173 | 0.461676833 |
Sally
extended the data as I finished the R code for the Markov chain solution (my computer is so small and old as 8GB ram is all)Quote: mustangsallyHere is a small table of data so far
coupons | at least 1 | at least 2 | B/C | C-B | E/B |
---|---|---|---|---|---|
70 | 338.299 | 481.7105 | 0.702 | 143.4115 | 0.423919373 |
80 | 397.238 | 562.7222 | 0.706 | 165.4842 | 0.416587033 |
90 | 457.431 | 645.1401 | 0.709 | 187.7091 | 0.410355004 |
100 | 518.7378 | 728.8052 | 0.712 | 210.0674 | 0.404958729 |
110 | 581.046 | 813.5907 | 0.714 | 232.5447 | 0.400217367 |
120 | 644.264 | 899.393 | 0.716 | 255.129 | 0.396000708 |
125 | 676.1905 | 942.648 | 0.717 | 266.4575 | 0.394056852 |
130 | 708.317 | 986.1261 | 0.718 | 277.8091 | 0.392210126 |
140 | 773.14 | 1073.717 | 0.720 | 300.577 | 0.388774349 |
200 | 1175.606 | 1614.313 | 0.728 | 438.394 | 0.372908951 |
300 | 1884.799 | 2557.884 | 0.737 | 673.085 | 0.35711235 |
400 | 2627.972 | 3538.97 | 0.743 | 911 | 0.346654378 |
to see what the 'at least 1' and 'at least 2' look like together
Oh, they look to be going apart
ok,
math is done 4 today
Happy 4th of July 2018 USA!
Sally
Quote: mustangsallywhat values did you use for m and j?
For d = 3, I used the (m,j) pairs (0,0), (0,1), (0,2), (1,1), (1,2), and (2,2).
For d = 4, I used the (m,j) pairs (0,0), (0,1), (0,2), (1,1), (1,2), (2,2), (0,3), (1,3), (2,3), and (3,3).
In other words, replace the Sigma with "m,j" at the bottom with a Sigma with "m=0" at the bottom and "d-1" at the top, followed by another Sigma with "j=0" at the bottom and "m" at the top.
thank you.Quote: ThatDonGuyIn other words, replace the Sigma with "m,j" at the bottom with a Sigma with "m=0" at the bottom and "d-1" at the top, followed by another Sigma with "j=0" at the bottom and "m" at the top.
I found another pdf that shows what m and j are
problem I see is this
(j + 2)!
in the formula
Excel does 170! and below but requires the gamma() for higher factorials
R takes too long over that (and precision suffers)
I used a recursion method in R to make this
coupons | at least 1 | at least 2 | at least 3 | at least 4 | at least 5 |
---|---|---|---|---|---|
1 | 1 | 2 | 3 | 4 | 5 |
2 | 3 | 5.5 | 7.875 | 10.1875 | 12.46094 |
3 | 5.5 | 9.6389 | 13.48688 | 17.19202 | 20.80842 |
4 | 8.3333 | 14.189 | 19.56591 | 24.71023 | 29.71024 |
5 | 11.417 | 19.041 | 25.98684 | 32.60279 | 39.01481 |
6 | 14.7 | 24.13387 | 32.67716 | 40.78943 | 48.63511 |
7 | 18.15 | 29.425 | 39.58954 | 49.21796 | 58.51471 |
8 | 21.743 | 34.885 | 46.69068 | 57.85175 | 68.61409 |
9 | 25.46 | 40.492 | 53.95589 | 66.6637 | 78.90403 |
10 | 29.29 | 46.23 | 61.36614 | 75.63296 | 89.36209 |
11 | 33.21865 | 52.08425 | 68.9063 | 84.74299 | 99.97046 |
12 | 37.23853 | 58.04503 | 76.5641 | 93.98035 | 110.7147 |
13 | 41.34174 | 64.10284 | 84.32933 | 103.3339 | 121.5829 |
14 | 45.52187 | 70.25003 | 92.19342 | 112.7944 | 132.5651 |
15 | 49.77343 | 76.48005 | 100.149 | 122.3537 | 143.6525 |
16 | 54.09166 | 82.78725 | 108.1899 | 132.005 | 154.838 |
17 | 58.47239 | 89.1667 | 116.3104 | 141.7422 | 166.115 |
18 | 62.91195 | 95.61405 | 124.5058 | 151.5602 | 177.4778 |
19 | 67.40705 | 102.1254 | 132.7717 | 161.4543 | 188.9216 |
20 | 71.955 | 108.6974 | 141.1043 | 171.4202 | 200.4418 |
21 | 76.55253 | 115.3269 | 149.5002 | 181.4542 | . |
22 | 81.19789 | 122.0111 | 157.9563 | 191.553 | . |
23 | 85.8887 | 128.7475 | 166.4696 | 201.7135 | . |
24 | 90.623 | 135.5337 | 175.0378 | 211.9329 | . |
25 | 95.39895 | 142.3677 | 183.6583 | 222.2086 | . |
26 | 100.2149 | 149.2474 | 192.329 | 232.5384 | . |
27 | 105.0693 | 156.1711 | 201.0481 | 242.92 | . |
28 | 109.9608 | 163.1372 | 209.8135 | 253.3515 | . |
29 | 114.888 | 170.144 | 218.6236 | 263.831 | . |
30 | 119.85 | 177.1902 | 227.4768 | 274.3569 | . |
31 | 124.8446 | 184.2745 | 236.3717 | 284.9274 | . |
32 | 129.8718 | 191.3955 | 245.3068 | 295.5411 | . |
33 | 134.9303 | 198.552 | 254.2809 | . | . |
34 | 140.0191 | 205.7431 | 263.2927 | . | . |
35 | 145.1373 | 212.9677 | 272.3412 | . | . |
36 | 150.2841 | 220.2247 | 281.4251 | . | . |
37 | 155.4587 | 227.5133 | 290.5436 | . | . |
38 | 160.6603 | 234.833 | 299.6956 | . | . |
39 | 165.8882 | 242.1819 | 308.8803 | . | . |
40 | 171.142 | 249.5602 | 318.0967 | . | . |
this looks good for now
Sally
Quote: Ace2Can someone run the number for 1000 coupons, getting at least 2 of each ? I’d be interested to know if there’s a limit. Based on what I’ve seen the limit could be the natural log of 2. So if the average is about 7,485 tries to get all of them once, it would be that divided by 0.693 = 10,800 to get all of them twice. Just a guess.
I can't use the formula for anything above about 50, as there's either an overflow or an underflow (i.e. the number is so small that it is treated as zero) that's throwing the results off.
For those of you interested in details, it's something like this: for 51 coupons, with M = 50 and J = 25, the value involved in the sum is on the order of 1018. However, 64-bit floating point numbers as implemented by Microsoft are only accurate to about 15 digits, so it's going to be off by up to 1000, which is not good when the final sum (over all J from 0 to 50) is supposed to be around 400.
However, when I run a simulation on various numbers of coupons up to 1000, and divide the simulated average number of draws needed to get two of each by the expected number needed to get one of each, it approaches something like 1.319.
EDIT: At 5000, it's more like 1.278.
As a matter of fact, I wouldn't be surprised if the limit of the ratio is 1. If you have, say, Googolplex (that's 1 followed by googol zeroes) different coupons, there's a very, very, very good chance you will be very close to having chosen all of the coupons at least twice by the time you choose every coupon once.
Coupons | 2 of Each | 1 of Each | Ratio |
---|---|---|---|
10 | 46.221 | 29.290 | 1.578 |
20 | 108.667 | 71.955 | 1.510 |
30 | 177.162 | 119.850 | 1.478 |
40 | 249.529 | 171.142 | 1.458 |
50 | 324.765 | 224.960 | 1.444 |
60 | 402.279 | 280.792 | 1.433 |
70 | 481.672 | 338.299 | 1.424 |
80 | 562.691 | 397.238 | 1.417 |
90 | 645.102 | 457.431 | 1.410 |
100 | 728.775 | 518.738 | 1.405 |
110 | 813.565 | 581.046 | 1.400 |
120 | 899.351 | 644.264 | 1.396 |
130 | 986.093 | 708.317 | 1.392 |
140 | 1073.683 | 773.140 | 1.389 |
150 | 1162.080 | 838.677 | 1.386 |
160 | 1251.196 | 904.882 | 1.383 |
170 | 1341.026 | 971.712 | 1.380 |
180 | 1431.502 | 1039.131 | 1.378 |
190 | 1522.605 | 1107.105 | 1.375 |
200 | 1614.283 | 1175.606 | 1.373 |
210 | 1706.520 | 1244.607 | 1.371 |
220 | 1799.274 | 1314.085 | 1.369 |
230 | 1892.539 | 1384.017 | 1.367 |
240 | 1986.291 | 1454.385 | 1.366 |
250 | 2080.513 | 1525.169 | 1.364 |
260 | 2175.148 | 1596.353 | 1.363 |
270 | 2270.224 | 1667.922 | 1.361 |
280 | 2365.713 | 1739.861 | 1.360 |
290 | 2461.593 | 1812.158 | 1.358 |
300 | 2557.856 | 1884.799 | 1.357 |
310 | 2654.481 | 1957.774 | 1.356 |
320 | 2751.455 | 2031.071 | 1.355 |
330 | 2848.797 | 2104.681 | 1.354 |
340 | 2946.463 | 2178.595 | 1.352 |
350 | 3044.451 | 2252.802 | 1.351 |
360 | 3142.744 | 2327.295 | 1.350 |
370 | 3241.365 | 2402.066 | 1.349 |
380 | 3340.256 | 2477.107 | 1.348 |
390 | 3439.461 | 2552.411 | 1.348 |
400 | 3538.939 | 2627.972 | 1.347 |
410 | 3638.695 | 2703.783 | 1.346 |
420 | 3738.696 | 2779.837 | 1.345 |
430 | 3838.995 | 2856.130 | 1.344 |
440 | 3939.552 | 2932.656 | 1.343 |
450 | 4040.324 | 3009.408 | 1.343 |
460 | 4141.358 | 3086.383 | 1.342 |
470 | 4242.629 | 3163.576 | 1.341 |
480 | 4344.126 | 3240.981 | 1.340 |
490 | 4445.882 | 3318.594 | 1.340 |
500 | 4547.828 | 3396.412 | 1.339 |
510 | 4650.020 | 3474.429 | 1.338 |
520 | 4752.404 | 3552.643 | 1.338 |
530 | 4855.003 | 3631.049 | 1.337 |
540 | 4957.836 | 3709.644 | 1.336 |
550 | 5060.840 | 3788.424 | 1.336 |
560 | 5164.062 | 3867.385 | 1.335 |
570 | 5267.466 | 3946.526 | 1.335 |
580 | 5371.056 | 4025.841 | 1.334 |
590 | 5474.868 | 4105.329 | 1.334 |
600 | 5578.835 | 4184.987 | 1.333 |
610 | 5683.001 | 4264.811 | 1.333 |
620 | 5787.352 | 4344.800 | 1.332 |
630 | 5891.864 | 4424.949 | 1.332 |
640 | 5996.548 | 4505.258 | 1.331 |
650 | 6101.402 | 4585.722 | 1.331 |
660 | 6206.452 | 4666.341 | 1.330 |
670 | 6311.634 | 4747.110 | 1.330 |
680 | 6417.005 | 4828.030 | 1.329 |
690 | 6522.513 | 4909.096 | 1.329 |
700 | 6628.224 | 4990.307 | 1.328 |
710 | 6734.043 | 5071.661 | 1.328 |
720 | 6840.017 | 5153.156 | 1.327 |
730 | 6946.171 | 5234.790 | 1.327 |
740 | 7052.477 | 5316.561 | 1.327 |
750 | 7158.909 | 5398.467 | 1.326 |
760 | 7265.495 | 5480.506 | 1.326 |
770 | 7372.223 | 5562.677 | 1.325 |
780 | 7479.080 | 5644.977 | 1.325 |
790 | 7586.110 | 5727.406 | 1.325 |
800 | 7693.266 | 5809.962 | 1.324 |
810 | 7800.548 | 5892.642 | 1.324 |
820 | 7907.960 | 5975.446 | 1.323 |
830 | 8015.537 | 6058.372 | 1.323 |
840 | 8123.209 | 6141.419 | 1.323 |
850 | 8231.026 | 6224.584 | 1.322 |
860 | 8338.961 | 6307.867 | 1.322 |
870 | 8447.048 | 6391.267 | 1.322 |
880 | 8555.236 | 6474.781 | 1.321 |
890 | 8663.586 | 6558.409 | 1.321 |
900 | 8772.002 | 6642.149 | 1.321 |
910 | 8880.605 | 6726.001 | 1.320 |
920 | 8989.279 | 6809.962 | 1.320 |
930 | 9098.080 | 6894.032 | 1.320 |
940 | 9207.002 | 6978.210 | 1.319 |
950 | 9316.046 | 7062.494 | 1.319 |
960 | 9425.187 | 7146.883 | 1.319 |
970 | 9534.464 | 7231.376 | 1.318 |
980 | 9643.864 | 7315.973 | 1.318 |
990 | 9753.340 | 7400.671 | 1.318 |
1000 | 9862.942 | 7485.471 | 1.318 |
Yes it does appear that way.Quote: ThatDonGuyAs a matter of fact, I wouldn't be surprised if the limit of the ratio is 1. If you have, say, Googolplex (that's 1 followed by googol zeroes) different coupons, there's a very, very, very good chance you will be very close to having chosen all of the coupons at least twice by the time you choose every coupon once.
These are some great answers from you and Mustang Sally. I found a fairly slick way to simulate this in excel but my computer freezes for anything over about 500 coupons.
It’s amazing how this problem is very simple for 1 of each coupon, but gets quite tedious for any other number, even with a formula.
From what I can tell, the formula is basically an enormous inclusion-exclusion exercise which explodes before the number of coupons gets very large.
yes it is.Quote: Ace2It’s amazing how this problem is very simple for 1 of each coupon, but gets quite tedious for any other number, even with a formula.
of course, if it was real simple, every one could do it.
agree.Quote: Ace2From what I can tell, the formula is basically an enormous inclusion-exclusion exercise which explodes before the number of coupons gets very large.
even the approximation formula given (online and in papers) is way off on most results.
I am not wasting my time figuring out how far off and what ranges
others have done that before
I can only think of fun dice games to play with the distribution data
other than that, hard to imagine what good knowing the mean for at least 2 is.
from my R code not published yet
Time difference of 2.952016 mins <<<< takes time even for my machine
> print(sprintf("for %g items at least 2 each, mean:%g ",N,meanTrials))
[1] "for 38 items at least 2 each, mean: 234.833 "
> print(formatC(data, digits=10),quote=FALSE)
Draw X Draw X Prob cumulative: (X or less)
[1,] 75 0 0
[2,] 76 5.925597361e-21 5.925597361e-21
[3,] 77 1.461647349e-19 1.520903323e-19
[4,] 78 1.851099439e-18 2.003189771e-18
[5,] 79 1.603948436e-17 1.804267413e-17
[6,] 80 1.069168303e-16 1.249595045e-16
[7,] 81 5.845270243e-16 7.094865288e-16
[8,] 82 2.728872441e-15 3.43835897e-15
[9,] 83 1.118442664e-14 1.462278561e-14
[10,] 84 4.106353755e-14 5.568632316e-14
[11,] 85 1.371398506e-13 1.928261737e-13
[12,] 86 4.216488998e-13 6.144750736e-13
[13,] 87 1.205063898e-12 1.819538971e-12
[14,] 88 3.22684756e-12 5.046386531e-12
[15,] 89 8.149328924e-12 1.319571546e-11
[16,] 90 1.951922687e-11 3.271494232e-11
[17,] 91 4.455253589e-11 7.726747822e-11
[18,] 92 9.730631824e-11 1.745737965e-10
[19,] 93 2.040930538e-10 3.786668503e-10
[20,] 94 4.123859188e-10 7.910527691e-10
[21,] 95 8.049689046e-10 1.596021674e-09
[22,] 96 1.521708889e-09 3.117730563e-09
[23,] 97 2.792061784e-09 5.909792347e-09
[24,] 98 4.982252249e-09 1.08920446e-08
[25,] 99 8.661951043e-09 1.955399564e-08
[26,] 100 1.469616449e-08 3.425016013e-08
[27,] 101 2.436887984e-08 5.861903997e-08
[28,] 102 3.95456994e-08 9.816473937e-08
[29,] 103 6.288315778e-08 1.610478971e-07
[30,] 104 9.809256193e-08 2.591404591e-07
[31,] 105 1.502659394e-07 4.094063985e-07
[32,] 106 2.262709568e-07 6.356773553e-07
[33,] 107 3.352204269e-07 9.708977822e-07
[34,] 108 4.89020241e-07 1.459918023e-06
[35,] 109 7.029972444e-07 2.162915268e-06
[36,] 110 9.966057708e-07 3.159521038e-06
[37,] 111 1.394208334e-06 4.553729373e-06
[38,] 112 1.925922459e-06 6.479651831e-06
[39,] 113 2.62852195e-06 9.108173782e-06
[40,] 114 3.546377208e-06 1.265455099e-05
[41,] 115 4.73241567e-06 1.738696666e-05
[42,] 116 6.249080252e-06 2.363604691e-05
[43,] 117 8.169260964e-06 3.180530787e-05
[44,] 118 1.057717281e-05 4.238248068e-05
[45,] 119 1.356915178e-05 5.595163246e-05
[46,] 120 1.725434028e-05 7.320597274e-05
[47,] 121 2.175523392e-05 9.496120666e-05
[48,] 122 2.720806277e-05 0.0001221692694
[49,] 123 3.376298279e-05 0.0001559322522
[50,] 124 4.158405603e-05 0.0001975163083
[51,] 125 5.08490024e-05 0.0002483653107
[52,] 126 6.174871013e-05 0.0003101140208
[53,] 127 7.448649723e-05 0.000384600518
[54,] 128 8.927712172e-05 0.0004738776397
[55,] 129 0.0001063455439 0.0005802231836
[56,] 130 0.0001259254492 0.0007061486328
[57,] 131 0.0001482575467 0.0008544061794
[58,] 132 0.0001735876611 0.001027993841
[59,] 133 0.000202164644 0.001230158484
[60,] 134 0.0002342381305 0.001464396615
[61,] 135 0.0002700561739 0.001734452789
[62,] 136 0.0003098627913 0.00204431558
[63,] 137 0.0003538954567 0.002398211037
[64,] 138 0.0004023825774 0.002800593614
[65,] 139 0.0004555409911 0.003256134605
[66,] 140 0.0005135735197 0.003769708125
[67,] 141 0.0005766666157 0.004346374741
[68,] 142 0.0006449881318 0.004991362873
[69,] 143 0.0007186852474 0.00571004812
[70,] 144 0.0007978825768 0.006507930697
[71,] 145 0.0008826804836 0.00739061118
[72,] 146 0.0009731536228 0.008363764803
[73,] 147 0.001069349725 0.009433114528
[74,] 148 0.001171288633 0.01060440316
[75,] 149 0.00127896161 0.01188336477
[76,] 150 0.001392330902 0.01327569567
[77,] 151 0.001511329574 0.01478702525
[78,] 152 0.001635861612 0.01642288686
[79,] 153 0.001765802276 0.01818868913
[80,] 154 0.0019009987 0.02008968783
[81,] 155 0.002041270724 0.02213095856
[82,] 156 0.002186411947 0.02431737051
[83,] 157 0.002336190974 0.02665356148
[84,] 158 0.002490352849 0.02914391433
[85,] 159 0.002648620644 0.03179253497
[86,] 160 0.002810697192 0.03460323217
[87,] 161 0.002976266928 0.03757949909
[88,] 162 0.003144997836 0.04072449693
[89,] 163 0.003316543459 0.04404104039
[90,] 164 0.00349054497 0.04753158536
[91,] 165 0.003666633263 0.05119821862
[92,] 166 0.003844431065 0.05504264969
[93,] 167 0.004023555033 0.05906620472
[94,] 168 0.004203617829 0.06326982255
[95,] 169 0.004384230146 0.06765405269
[96,] 170 0.004565002691 0.07221905538
[97,] 171 0.00474554808 0.07696460346
[98,] 172 0.004925482663 0.08189008613
[99,] 173 0.005104428255 0.08699451438
[100,] 174 0.005282013762 0.09227652814
[101,] 175 0.005457876702 0.09773440485
[102,] 176 0.005631664612 0.1033660695
[103,] 177 0.005803036336 0.1091691058
[104,] 178 0.005971663192 0.115140769
[105,] 179 0.00613723002 0.121277999
[106,] 180 0.006299436105 0.1275774351
[107,] 181 0.006457995976 0.1340354311
[108,] 182 0.006612640088 0.1406480712
[109,] 183 0.006763115387 0.1474111866
[110,] 184 0.006909185754 0.1543203723
[111,] 185 0.007050632352 0.1613710047
[112,] 186 0.007187253849 0.1685582585
[113,] 187 0.007318866558 0.1758771251
[114,] 188 0.007445304472 0.1833224295
[115,] 189 0.00756641921 0.1908888488
[116,] 190 0.007682079887 0.1985709286
[117,] 191 0.007792172895 0.2063631015
[118,] 192 0.007896601627 0.2142597032
[119,] 193 0.007995286127 0.2222549893
[120,] 194 0.008088162683 0.230343152
[121,] 195 0.008175183375 0.2385183353
[122,] 196 0.008256315567 0.2467746509
[123,] 197 0.008331541368 0.2551061923
[124,] 198 0.008400857051 0.2635070493
[125,] 199 0.008464272454 0.2719713218
[126,] 200 0.008521810344 0.2804931321
[127,] 201 0.008573505773 0.2890666379
[128,] 202 0.008619405417 0.2976860433
[129,] 203 0.008659566903 0.3063456102
[130,] 204 0.008694058136 0.3150396684
[131,] 205 0.008722956616 0.323762625
[132,] 206 0.008746348769 0.3325089737
[133,] 207 0.00876432927 0.341273303
[134,] 208 0.008777000386 0.3500503034
[135,] 209 0.00878447132 0.3588347747
[136,] 210 0.008786857574 0.3676216323
[137,] 211 0.008784280324 0.3764059126
[138,] 212 0.008776865814 0.3851827784
[139,] 213 0.008764744769 0.3939475232
[140,] 214 0.008748051821 0.402695575
[141,] 215 0.008726924967 0.4114225
[142,] 216 0.008701505041 0.420124005
[143,] 217 0.008671935207 0.4287959402
[144,] 218 0.008638360485 0.4374343007
[145,] 219 0.008600927288 0.446035228
[146,] 220 0.008559782991 0.454595011
[147,] 221 0.008515075522 0.4631100865
[148,] 222 0.008466952974 0.4715770395
[149,] 223 0.008415563246 0.4799926027
[150,] 224 0.008361053697 0.4883536564
[151,] 225 0.008303570837 0.4966572273
[152,] 226 0.008243260029 0.5049004873
[153,] 227 0.008180265217 0.5130807525
[154,] 228 0.008114728674 0.5211954812
[155,] 229 0.008046790778 0.529242272
[156,] 230 0.007976589795 0.5372188618
[157,] 231 0.007904261691 0.5451231235
[158,] 232 0.007829939962 0.5529530634
[159,] 233 0.007753755478 0.5607068189
[160,] 234 0.007675836346 0.5683826553
[161,] 235 0.007596307791 0.575978963
[162,] 236 0.00751529205 0.5834942551
[163,] 237 0.007432908282 0.5909271634
[164,] 238 0.00734927249 0.5982764359
[165,] 239 0.007264497462 0.6055409333
[166,] 240 0.007178692717 0.612719626
[167,] 241 0.00709196447 0.6198115905
[168,] 242 0.007004415597 0.6268160061
[169,] 243 0.006916145628 0.6337321517
[170,] 244 0.006827250727 0.6405594025
[171,] 245 0.006737823704 0.6472972262
[172,] 246 0.006647954016 0.6539451802
[173,] 247 0.006557727789 0.660502908
[174,] 248 0.006467227837 0.6669701358
[175,] 249 0.006376533697 0.6733466695
[176,] 250 0.006285721659 0.6796323912
[177,] 251 0.006194864813 0.685827256
[178,] 252 0.006104033092 0.6919312891
[179,] 253 0.006013293322 0.6979445824
[180,] 254 0.005922709276 0.7038672917
[181,] 255 0.005832341735 0.7096996334
[182,] 256 0.005742248541 0.7154418819
[183,] 257 0.005652484669 0.7210943666
[184,] 258 0.005563102286 0.7266574689
[185,] 259 0.00547415082 0.7321316197
[186,] 260 0.00538567703 0.7375172968
[187,] 261 0.005297725075 0.7428150218
[188,] 262 0.005210336583 0.7480253584
[189,] 263 0.005123550728 0.7531489091
[190,] 264 0.005037404297 0.7581863134
[191,] 265 0.004951931765 0.7631382452
[192,] 266 0.004867165368 0.7680054106
[193,] 267 0.004783135175 0.7727885457
[194,] 268 0.004699869157 0.7774884149
[195,] 269 0.004617393267 0.7821058082
[196,] 270 0.0045357315 0.7866415397
[197,] 271 0.004454905973 0.7910964456
[198,] 272 0.00437493699 0.7954713826
[199,] 273 0.00429584311 0.7997672257
[200,] 274 0.004217641216 0.803984867
[201,] 275 0.004140346583 0.8081252135
[202,] 276 0.004063972939 0.8121891865
[203,] 277 0.003988532533 0.816177719
[204,] 278 0.003914036196 0.8200917552
[205,] 279 0.003840493399 0.8239322486
[206,] 280 0.003767912319 0.8277001609
[207,] 281 0.003696299895 0.8313964608
[208,] 282 0.003625661879 0.8350221227
[209,] 283 0.003556002902 0.8385781256
[210,] 284 0.003487326519 0.8420654521
[211,] 285 0.003419635266 0.8454850874
[212,] 286 0.003352930707 0.8488380181
[213,] 287 0.003287213488 0.8521252316
[214,] 288 0.003222483383 0.855347715
[215,] 289 0.003158739337 0.8585064543
[216,] 290 0.003095979514 0.8616024338
[217,] 291 0.003034201342 0.8646366352
[218,] 292 0.002973401549 0.8676100367
[219,] 293 0.002913576209 0.8705236129
[220,] 294 0.002854720778 0.8733783337
[221,] 295 0.002796830131 0.8761751638
[222,] 296 0.002739898601 0.8789150624
[223,] 297 0.002683920011 0.8815989824
[224,] 298 0.002628887706 0.8842278701
[225,] 299 0.002574794592 0.8868026647
[226,] 300 0.002521633158 0.8893242979
[227,] 301 0.002469395511 0.8917936934
[228,] 302 0.002418073403 0.8942117668
[229,] 303 0.002367658259 0.8965794251
[230,] 304 0.002318141201 0.8988975663
[231,] 305 0.002269513074 0.9011670793
[232,] 306 0.002221764471 0.9033888438
[233,] 307 0.002174885753 0.9055637296
[234,] 308 0.002128867072 0.9076925966
[235,] 309 0.002083698394 0.909776295
[236,] 310 0.002039369515 0.9118156645
[237,] 311 0.001995870081 0.9138115346
[238,] 312 0.001953189607 0.9157647242
[239,] 313 0.001911317494 0.9176760417
[240,] 314 0.001870243043 0.9195462848
[241,] 315 0.001829955471 0.9213762402
[242,] 316 0.00179044393 0.9231666842
[243,] 317 0.001751697513 0.9249183817
[244,] 318 0.001713705273 0.926632087
[245,] 319 0.001676456233 0.9283085432
[246,] 320 0.0016399394 0.9299484826
[247,] 321 0.001604143771 0.9315526264
[248,] 322 0.001569058349 0.9331216847
[249,] 323 0.001534672151 0.9346563569
[250,] 324 0.001500974214 0.9361573311
[251,] 325 0.001467953607 0.9376252847
[252,] 326 0.001435599441 0.9390608841
[253,] 327 0.001403900872 0.940464785
[254,] 328 0.001372847109 0.9418376321
[255,] 329 0.001342427424 0.9431800595
[256,] 330 0.001312631155 0.9444926907
[257,] 331 0.001283447714 0.9457761384
[258,] 332 0.00125486659 0.947031005
[259,] 333 0.001226877356 0.9482578823
[260,] 334 0.001199469671 0.949457352
[261,] 335 0.00117263329 0.9506299853
[262,] 336 0.00114635806 0.9517763434
[263,] 337 0.001120633931 0.9528969773
[264,] 338 0.001095450952 0.9539924282
[265,] 339 0.001070799283 0.9550632275
[266,] 340 0.001046669188 0.9561098967
[267,] 341 0.001023051045 0.9571329478
[268,] 342 0.0009999353442 0.9581328831
[269,] 343 0.0009773126913 0.9591101958
[270,] 344 0.0009551738092 0.9600653696
[271,] 345 0.0009335095392 0.9609988791
[272,] 346 0.0009123108424 0.96191119
[273,] 347 0.0008915688013 0.9628027588
[274,] 348 0.0008712746199 0.9636740334
[275,] 349 0.0008514196251 0.964525453
[276,] 350 0.0008319952673 0.9653574483
[277,] 351 0.0008129931206 0.9661704414
[278,] 352 0.000794404883 0.9669648463
[279,] 353 0.0007762223771 0.9677410687
[280,] 354 0.0007584375496 0.9684995062
[281,] 355 0.0007410424716 0.9692405487
[282,] 356 0.0007240293383 0.969964578
[283,] 357 0.0007073904684 0.9706719685
[284,] 358 0.0006911183043 0.9713630868
[285,] 359 0.0006752054111 0.9720382922
[286,] 360 0.0006596444764 0.9726979367
[287,] 361 0.0006444283092 0.973342365
[288,] 362 0.0006295498398 0.9739719149
[289,] 363 0.0006150021182 0.974586917
[290,] 364 0.0006007783141 0.9751876953
[291,] 365 0.0005868717153 0.975774567
[292,] 366 0.0005732757271 0.9763478427
[293,] 367 0.0005599838709 0.9769078266
[294,] 368 0.0005469897836 0.9774548164
[295,] 369 0.0005342872162 0.9779891036
[296,] 370 0.0005218700326 0.9785109736
[297,] 371 0.0005097322084 0.9790207058
[298,] 372 0.00049786783 0.9795185737
[299,] 373 0.0004862710928 0.9800048448
[300,] 374 0.0004749363003 0.9804797811
[301,] 375 0.0004638578628 0.9809436389
[302,] 376 0.0004530302958 0.9813966692
[303,] 377 0.0004424482188 0.9818391174
[304,] 378 0.0004321063542 0.9822712238
[305,] 379 0.0004219995253 0.9826932233
[306,] 380 0.0004121226555 0.983105346
[307,] 381 0.0004024707666 0.9835078167
[308,] 382 0.0003930389775 0.9839008557
[309,] 383 0.0003838225028 0.9842846782
[310,] 384 0.0003748166514 0.9846594949
[311,] 385 0.0003660168248 0.9850255117
[312,] 386 0.0003574185161 0.9853829302
[313,] 387 0.0003490173084 0.9857319475
[314,] 388 0.0003408088733 0.9860727564
[315,] 389 0.0003327889696 0.9864055454
[316,] 390 0.000324953442 0.9867304988
[317,] 391 0.0003172982194 0.987047797
[318,] 392 0.0003098193137 0.9873576163
[319,] 393 0.0003025128184 0.9876601292
[320,] 394 0.0002953749073 0.9879555041
[321,] 395 0.000288401833 0.9882439059
[322,] 396 0.0002815899255 0.9885254958
[323,] 397 0.000274935591 0.9888004314
[324,] 398 0.0002684353105 0.9890688667
[325,] 399 0.0002620856384 0.9893309524
[326,] 400 0.0002558832014 0.9895868356
at least I have a few photos to share
at least 1 of 38
at least 2 of 38
will update
https://sites.google.com/view/krapstuff/coupon-collecting/coupon-collecting-at-least-2
for those that want it
Sally
True, there probably isn't much of a practical use for knowing the mean of 2 or more. However, these problems are still useful since you sometimes learn things that are applicable for other scenarios.Quote: mustangsallyI can only think of fun dice games to play with the distribution data
other than that, hard to imagine what good knowing the mean for at least 2 is.
Sure Ace, it would be my pleasure.Quote: Ace2Can someone run the number for 1000 coupons, getting at least 2 of each ? I’d be interested to know if there’s a limit. .
The answer of 9,862.97 is given by the integral from zero to infinity of :
(1 - ((x/1000) + 1) / e^(x/1000))^999 * (x/1000) / e^(x/1000) * x dx
I could probably give a few more digits but I’m very confident up to those (and can’t imagine any need for more). I had to do this in excel, and couldn’t really space more than 0.1, which requires about 300,000 lines. Unfortunately when I plug the equation into an online integral site it times out.
This is very close to the number given by ThatDonGuy.
I just learned that the formula for the Nth harmonic number can be further refined by adding the term 1/2n - 1/12n^2 + 1/120n^4.Quote: AceI just found this old thread while searching for something else.
In case you didn't know the answer is closely approximated by 38 x (ln 38 + γ) = 160.16, where γ is the Euler constant .57721...
This is a version of the coupon collectors problem.
So the formula for the expected number of roulette spins to get all 38 numbers becomes:
38 * ( Ln(38) + γ + 1/(2*38) - 1/(12*38^2) + 1/(120*38^4) ) = 160.6602765.
This is accurate to at least 10 digits which is as far as my iPhone calculator goes.