All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 Roulette (Posted on 2005-03-23)
If I spin the roulette (numbers from 0 to 36) N consecutive times, how many different numbers should I expect to get?

(If N=1, your formula should give 1 as an answer, but for N=2, it should be a little under 2, and for all other N, the formula should be less than the minimum of N and 37.)

Another question: how many times should you spin the roulette, so chances are better than one in a million, that all 37 numbers will have appeared?

 See The Solution Submitted by e.g. Rating: 4.5000 (2 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
 Part 2 spoiler | Comment 2 of 4 |

I take the second part to ask that the chances are less than 1 in a million that not all 37 numbers will have appeared.

For any number of spins, n, the probability that all 37 will have appeared is the sum of the individual probabilities that each of the 37 will have appeared minus the sum of all the pairwise probabilities of two numbers either having appeared, plus the sum of all the triple probabilities of each set of three having any of its members appear, etc., alternating adding and subtracting.  This is the inclusion/exclusion principle.

For each number of numbers (i) grouped together, the probability that any of that group appears is 1 - ((37-i)/37)^n. But there are C(n,i) of these groups of i, so that must be multiplied by this number of combinations.

The following program evaluates this until the probability of getting all 37 exceeds 0.999999:

` 80   point 10 90   for N=100 to 1000100    Tot=0:Sg=1:Max=0110    for I=1 to 37115      Term=combi(37,I)*(1-((37-I)/37)^N)120      Tot=Tot+Sg*Term130      Sg=-Sg135      if Term>Max then Max=Term150    next155    if Tot>0.999999 then V=N:cancel for:goto 170160   next170   print V,Tot175   print int(log(Max)/log(10))`

It finds that with 637 spins, the probability that all 37 numbers will have appeared is 0.99999902636....  For 636, the probability was only 0.99999899319....

For various numbers of spins, the following probabilities of getting all 37 hold:

`10      0.0000000000000000000020      0.0000000000000000000030     -0.0000000000000000000040      0.0000000000016539482350      0.0000001069832832034660      0.0000249582761507758870      0.0006573831089080488680      0.0055035099855426759390      0.02331592425229716104100     0.06400279952819619846110     0.13156539831501980046120     0.22167643435616123275130     0.32475135713799814463140     0.43045181626847988941150     0.53064414760620373959160     0.62033665280691750640170     0.69733598524002930598180     0.76142938367428298851190     0.81357459429078856175200     0.85528439911428127653210     0.88822726587365426941220     0.91400076770282579428230     0.93402273061448979724240     0.94949416534209705145250     0.96140165687487348191260     0.97053871299807833180270     0.97753409642474361697280     0.98288070563161651749290     0.98696191899189586105300     0.99007421717460486023310     0.99244590400801203824320     0.99425222718133654571330     0.99562738990095437315340     0.99667398183906396282350     0.99747032197818228900360     0.99807614090726738291370     0.99853695844328321334380     0.99888744498641655464390     0.99915399619163322839400     0.99935670145309412327410     0.99951084685815949448420     0.99962806152427668241430     0.99971719126031161792440     0.99978496402596513266450     0.99983649658420865493`

It checks out that for 10, 20 and 30 spins, there is zero probability.

 Posted by Charlie on 2005-03-23 16:05:43

 Search: Search body:
Forums (0)