0

Question: Suppose that we are given a fair die with 6 sides. On average, how many tosses are required to obtain a repeat number?

My attempt:

Let $X_n$ be the number of tosses to obtain a repeat number after $n$ distinct numbers showed up. Note that $0\leq n\leq 6$. For example, if we obtained $2,1,3,2$, then $X_3=4$. Then, $E(X_0 )=1$ and \begin{align*} E(X_n ) & =\frac{n}{6} (1)+ \frac{6-n}{6} (1+E(X_{n+1} )). \end{align*} I understand that the equation is not correct as it gives $E(X_1) = 0$ where it should be $2.$

Can anyone pinpoint error?

Idonknow
  • 15,643
  • Note that the answer is $$\sum\limits_{n=1}^6\frac {n^2}6\cdot\prod\limits_{i=0}^{n-1}1-\frac i6$$ – Rushabh Mehta Dec 09 '19 at 14:35
  • @DonThousand Can you elaborate on how to obtain the formula? – Idonknow Dec 09 '19 at 14:38
  • What part? What the formula means or how to evaluate – Rushabh Mehta Dec 09 '19 at 14:39
  • From your attempt: $$\begin{align}E(X_6) & = \dfrac{6}{6}(1) + \dfrac{6-6}{6}(1+E(X_7)) = 1 \ E(X_5) & = \dfrac{5}{6}+\dfrac{6-5}{6}(1+E(X_6)) = \dfrac{7}{6} \ E(X_4) & = \dfrac{4}{6}+\dfrac{6-4}{6}(1+E(X_5)) = \dfrac{25}{18} \ E(X_3) & = \dfrac{3}{6}+\dfrac{6-3}{6}(1+E(X_4)) = \dfrac{61}{36} \ E(X_2) & = \dfrac{2}{6}+\dfrac{6-2}{6}(1+E(X_3)) = \dfrac{115}{54} \ E(X_1) & = \dfrac{1}{6}+\dfrac{6-1}{6}(1+E(X_2)) = \dfrac{899}{324} \ E(X_0) & = \dfrac{0}{6}+\dfrac{6-0}{6}(1+E(X_1)) = \dfrac{1223}{324}\end{align}$$ – SlipEternal Dec 09 '19 at 14:49
  • @InterstellarProbe Yes, the answer is $\frac{1223}{324}$ as shown by Christian Blatter in this post https://math.stackexchange.com/questions/542200/expected-number-of-tosses-before-you-see-a-repeat So my initial condition is not correct. – Idonknow Dec 09 '19 at 14:54
  • @Idonknow Then my comment shows that the formula you proposed yields this answer. I am not sure why you thought it gave $E(X_1)=0$... – SlipEternal Dec 09 '19 at 14:55
  • @DonThousand Now I am interested on how you obtain the formula. – Idonknow Dec 09 '19 at 14:56
  • @InterstellarProbe I'm not particularly surprised. We are essentially doing the same thing. – Rushabh Mehta Dec 09 '19 at 15:06
  • @DonThousand Perhaps you can elaborate your comment and put it as an answer? – Idonknow Dec 14 '19 at 08:05

1 Answers1

1

Your recurrence is correct. The only mistake you made was that the base case should be $E[X_6]=1$, not $E[X_0]=1$. Starting with $E[X_6]=1$, you can use the recurrence do compute $E[X_5]$, then $E[X_4]$, and so on down to $E[X_0]$, which is what you want.

There is a shortcut as well. Let $N$ be number of rolls it takes to get the first repeat, \begin{align} E[N]=\sum_{n=0}^\infty P(N>n)=\sum_{k=0}^{6}\frac{6!}{(6-n)!6^n} \end{align} The first equality is the layer cake formula for expected value of nonnegative integer valued random variables. For the second, note that the event $\{N>n\}$ occurs if and only if the first $n$ rolls are all distinct. The probability the second roll is distinct from the first is $\frac56$, the probability the third is distinct from the first two is $\frac46$, and so on. Multiplying these all together gives $$\frac66\cdot \frac56\cdots \frac{6-n+1}{6}=\frac{6!}{(6-n)!6^n}.$$

Mike Earnest
  • 75,930