I was wondering if someone could help me answer the following question:
Calculate the probability that in $37 $ consecutive spins of a roulette wheel (using an European Roulette wheel) you will have $24$ different numbers.
I was wondering if someone could help me answer the following question:
Calculate the probability that in $37 $ consecutive spins of a roulette wheel (using an European Roulette wheel) you will have $24$ different numbers.
We interpret the problem as asking for the probability that there are exactly $24$ distinct numbers in the $37$ spins.
There are $37^{37}$ equally likely sequences of length $37$ over the alphabet $\{0,1,\dots,36\}$. It remains to count the good sequences, the ones that have exactly $24$ distinct numbers.
Which $24$ numbers? They can be chosen in $\binom{37}{24}$ ways. Now we count the number of strings of length $37$ formed out of these $24$ letters, and use all of them. The tricky thing is that we must make sure we don't count strings that use fewer than $24$ of these letters.
For dealing with that, we can use Stirling numbers of the second kind or Inclusion/Exclusion. We describe the Inclusion/Exclusion approach.
For any of the chosen sets of $24$, there are $24^{37}$ words of length $37$ that use our chosen alphabet.
We must subtract the words that use $23$ or fewer of the letters. So a first step is to subtract $\binom{24}{23}23^{37}$. However, we have subtracted too much, we have for example subtracted the words that are missing two of the digits. There are $\binom{24}{2}22^{37}$ of these. So add back $\binom{24}{2}22^{37}$.
We have added back too much, for we have added back more than once the $\binom{24}{3}21^{37}$ words that only use $21$ of the digits. And so on.
We will use the Generalized Inclusion-Exclusion Principle.
Let $S_k$ be the set of results where $k$ has not been spun in $n$ spins.
$N_k=\binom{37}{k}(37-k)^n$; that is, $\binom{37}{k}$ ways to choose the $k$ numbers not spun and $(37-k)^n$ spins consisting of the remaining $37-k$ numbers.
To have exactly $m$ different numbers, our result must be in exactly $37-m$ of the $S_k$. The formula gives $$ \sum_{k=0}^{37}(-1)^{k+m-37}\binom{k}{37-m}\binom{37}{k}(37-k)^n\tag{1} $$ Plugging in $m=24$ and $n=37$, we get $$ 2157142399433325078661979618737564774321235951616000000000 $$ outcomes with exactly $24$ unique numbers. Dividing by $37^{37}$, yields $$ \color{#C00000}{\text{a }0.20436900224118169585\text{ probability of spinning exactly }24\text{ unique numbers.}} $$ The Corollary says that the number of ways to get at least $m$ unique numbers is $$ \sum_{k=0}^{37}(-1)^{k+m-37}\binom{k-1}{37-m}\binom{37}{k}(37-k)^n\tag{2} $$ Plugging in $m=24$ and $n=37$, we get $$ 5459199453945632178044406986558392583191882135240704000000 $$ outcomes with at least $24$ unique numbers. Dividing by $37^{37}$, yields $$ \text{a }0.51720792550902599350\text{ probability of spinning at least }24\text{ unique numbers.} $$
Expected Value
Suppose that the expected number of unique numbers spun on the wheel after $n$ spins is $u_n$. The number of unspun numbers is $37-u_n$ so the probability of getting a unique number on the next roll would be $\frac{37-u_n}{37}$. The linearity of expectation yields $$ u_{n+1}=u_n+\frac{37-u_n}{37} $$ Therefore, $$ \begin{align} 37-u_{n+1}&=37-u_n-\frac{37-u_n}{37}\\ &=\frac{36}{37}(37-u_n) \end{align} $$ and thus, $$ u_n=37-37\left(\frac{36}{37}\right)^n $$ Plugging in $n=37$ yields the expected number of unique spins to be $$ u_{37}\doteq23.574500214341572103 $$ We can also compute the expected value using $(1)$: $$ u_n=\sum_{m=0}^{37}\sum_{k=0}^{37}(-1)^{k+m-37}m\binom{k}{37-m}\binom{37}{k}(37-k)^n $$ Plugging in $n=37$ yields the expected number of unique spins to be $$ u_{37}\doteq23.574500214341572103 $$
Confirming André Nicolas' Answer
André Nicolas' answer is $$ \binom{37}{24}\sum_{k=0}^{37}(-1)^k\binom{24}{k}(24-k)^{37}\tag{3} $$ Starting from $(1)$, we get $$ \begin{align} &\sum_{k=0}^{37}(-1)^{k+m-37}\binom{k}{37-m}\binom{37}{k}(37-k)^n\\ &=\sum_{k=0}^{37}(-1)^{k+m-37}\binom{m}{37-k}\binom{37}{m}(37-k)^n\\ &=\binom{37}{m}\sum_{k=0}^{37}(-1)^{k+m-37}\binom{m}{37-k}(37-k)^n\\ &=\binom{37}{m}\sum_{k=m-37}^{m}(-1)^{k}\binom{m}{m-k}(m-k)^n\\ &=\binom{37}{m}\sum_{k=0}^{m}(-1)^{k}\binom{m}{k}(m-k)^n\\ \end{align} $$ Plugging in $m=24$ and $n=37$, we get $(3)$.