0

We roll a fair die until $3$ number 4s are thrown (in total, not necessarily in a row). Determine the expected value of the total number of 2s and 3s obtained along the way.

$X =$ number of rolls

$Y =$ number of 2s and 3s obtained along the way

$$\mathbb{P}(X = k) = {{k+2}\choose{2}} \left( \frac{5}{6} \right)^k \left( \frac{1}{6} \right)^2 \frac{1}{6} = {{k+2}\choose{2}} \left( \frac{5}{6} \right)^k \left( \frac{1}{6} \right)^3$$

We choose $2$ places out of $k+2$ to place first two 4s. Then we multiply by probabilities of throwing different number than $4$ $k$ times (that is $\frac{5}{6}$) and number $4$ 2 times (that is $\frac{1}{6}$). The last roll is a $4$, so I multiply by $\frac{1}{6}$

$$\mathbb{E}(Y|X = k) = \frac{2}{5}(k-3)$$ If we had $k$ rolls, $k-3$ of them were not 4s. Out of those $5$, there are $2$ that are of our interest.

Therefore: \begin{align} \mathbb{E} Y &= \sum_{k=1}^{\infty} \mathbb{P}(X = k) \mathbb{E}(Y|X = k) \\ &= \sum_{k=1}^{\infty} {{k+2}\choose{2}} \left( \frac{5}{6} \right)^k \left( \frac{1}{6} \right)^3 \frac{2}{5}(k-3) \\ &= \sum_{k=1}^{\infty} \frac{(k+2)!}{2k!} \left( \frac{5}{6} \right)^k \left( \frac{1}{6} \right)^3 \frac{2}{5}(k-3) \end{align}

From that I don't see any way to make simplify that expression / express the series in the compact form. Any help would be appreciated.

thefool
  • 1,024
  • You expect it to take $6$ tosses to get a $4$, hence $18$ to get three fours. The $18-3=15$ tosses in that sequence that are not $4$ are expected to be distributed uniformly amongst the $5$ non-$4$ values. – lulu Jun 15 '24 at 22:48
  • I don't understand. 15 tosses that are not 4 are expected to be distributed uniformly amongst 5 non-4 values? Where do those 5 non-4 values come from? @lulu – thefool Jun 15 '24 at 22:54
  • @thefool: lulu means the five possibilities on the die that are not $4$—namely, $1, 2, 3, 5, 6$. In other words, if you have $15$ rolls that are $1, 2, 3, 5$, or $6$, then how many of them on average are $2$s or $3$s? – Brian Tung Jun 15 '24 at 22:55
  • I mean that $4$ is a special value, we know there are exactly three $4's$ in the sequence. The other values, ${1,2,3,5,6}$ are all equally likely to be seen. – lulu Jun 15 '24 at 22:56
  • So the answer would be simply $6$? There would be $3$ 2s and $3$ 3s. Can I get to that value with my way of thinking presented in the original question? – thefool Jun 15 '24 at 22:59
  • I don't believe your final sum is correct. See WA I didn't try to follow the argument, but are you claiming that $\binom {k+2}2=\frac {k+2}{2k}$? That's not true. – lulu Jun 15 '24 at 23:05
  • I'm sorry. I forgot the exclamation marks. Do you think that such way of thinking is correct and simplifying the last expression could lead to obtaining $6$? Since, as I understand your former comments, that's the correct answer. – thefool Jun 15 '24 at 23:17
  • there's no reason in principle why such a line of attack shouldn't work, but as you see it is cumbersome and a bit error prone. For instance, I can't sort out what you mean by $k$. Is $k$ the total number of tosses or the total number of tosses excluding the $4's$? But, sure. Something like this ought to be work eventually. – lulu Jun 15 '24 at 23:19
  • here is what I think you intended to write, and you see that the sum is converging to $6$. Here, I assume that $k$ is the number of non-$4$ tosses, so $k+3$ is the total number of tosses. As I mentioned, I believe you were inconsistent in your definition of $k$. – lulu Jun 15 '24 at 23:29
  • @lulu you are right. Now I understand. I Your way of thinking is for sure simpler and more elegant. I just wanted to check my way of thinking (that unfortunately, I've shown with errors) to know if it would be applicable to similar problems (for example, where your way of thinking would not apply). Thank you for help! – thefool Jun 15 '24 at 23:37

3 Answers3

2

Here's an alternative approach that you might find simpler. For $n\in\{0,1,2,3\}$, let $E_n$ be the expected number of $2$s or $3$s when you need $n$ more $4$s. Then $E_0 = 0$. For $n>0$, conditioning on whether the next roll is a $\color{red}{4}$, $\color{green}{\text{$2$ or $3$}}$, or $\color{blue}{\text{other}}$ yields recursion $$ E_n = \color{red}{\frac{1}{6}E_{n-1}} + \color{green}{\frac{2}{6}(1+E_n)} + \color{blue}{\frac{3}{6}E_n}, $$ which implies that $$ E_n = E_{n-1} + 2. $$ (This also makes sense intuitively because you expect to roll two more $2$s or $3$s for each $4$.) Hence, $E_1=2$, $E_2=4$, and $E_3=6$.

RobPratt
  • 50,938
  • +1 A constant increase is a consequence of linearity of expectation. And the law of large numbers justifies that constant being $2$: the proportion of 4s in a large number of throws converges to $\frac16$ while the proportion of 2s or 3s converges to $\frac13$ so the number of 2s or 3s per 4 converges to $\frac{1/3}{1/6}=2$ as the number of throws increases. – Henry Jun 16 '24 at 00:34
  • +1 : Elegant... – user2661923 Jun 16 '24 at 04:38
0

Your general approach works, but if $X=k$, then there are $k-1$ rolls before the final $4$, and $k-3$ of these are not a $4$. So the correct calculation is: $$\mathbb{P}(X = k) = {{k-1}\choose{2}} \left( \frac{5}{6} \right)^{k-3} \left( \frac{1}{6} \right)^2 \frac{1}{6}.$$ With this correction, your final sum over $k\ge 3$ yields $6$.

RobPratt
  • 50,938
0

$\underline{\text{Preliminary Results}}$

Convergent polynomials of infinite degree have uniform continuity, which implies that the sum of the derivatives is equal to the derivative of the sum.

In this section, it is assumed that $~|x| < 1.$

Also, the notation $~[f(x)]', ~[f(x)]'', ~[f(x)]'''~$ is used to represent the first, second, and third derivatives, respectively.

So, start with the formula

$$\sum_{i=0}^\infty ~x^i = \frac{1}{1 - x}. \tag1 $$

Then,

$$\sum_{i=0}^\infty i~x^i = x ~\sum_{i=0}^\infty i~x^{(i-1)} = x ~\left[ ~~\sum_{i=0}^\infty ~x^i ~~\right]'$$

$$= x ~\left[ ~\frac{1}{1 - x} ~\right]' = \frac{x}{(1-x)^2}. \tag2 $$

Then, by similar analysis, extending the answer of Claude Leibovici to this question, you have that

$$\sum_{i=0}^\infty i^2 x^i = \frac{2x^2}{(1-x)^3} + \frac{x}{(1 - x)^2}. \tag3 $$

Then, using the exact same method

$$\sum_{i=0}^\infty i^3 x^i = \sum_{i=0}^\infty i(i-1)(i-2)x^i + \sum_{i=0}^\infty 3i^2x^i - \sum_{i=0}^\infty 2ix^i$$

$$= x^3 \sum_{i=0}^\infty i(i-1)(i-2)x^{i-3} + \sum_{i=0}^\infty 3i^2x^i - \sum_{i=0}^\infty 2ix^i$$

$$= x^3 ~\left[ \sum_{i=0}^\infty x^i ~\right]''' + \sum_{i=0}^\infty 3i^2x^i - \sum_{i=0}^\infty 2ix^i$$

$$= x^3 ~\left[ ~\frac{1}{1 - x} ~\right]''' + \sum_{i=0}^\infty 3i^2x^i - \sum_{i=0}^\infty 2ix^i$$

$$= \frac{6x^3}{(1 - x)^4} + \frac{6x^2}{(1-x)^3} + \frac{3x}{(1 - x)^2} - \frac{2x}{(1-x)^2}$$

$$= \frac{6x^3}{(1 - x)^4} + \frac{6x^2}{(1-x)^3} + \frac{x}{(1 - x)^2}. \tag4 $$

The formulas in (2), (3), and (4), above will be used in the analysis below.


For $~k \in \{3,4,5,\cdots,\},~$ let $~E(k)~$ denote the event that it takes exactly $~k~$ rolls to get three 4's.

Let $~f(k)~$ denote the probability of the event $~E(k)~$ occurring.

Let $~g(k)~$ denote the expected number of 2's and 3's that will be rolled before dice roll number $~k,~$ under the assumption that event $~E(k)~$ has occurred.

Then the desired computation is

$$\sum_{k=3}^\infty \left[ ~f(k) \times g(k) ~\right]. \tag5 $$

In order for event $~E(k)~$ to occur, two things must happen.

  • There must be exactly two 4's rolled in the first $~(k-1)~$ die rolls.
    The probability of this happening is
    $\displaystyle \frac{\binom{k-1}{2}5^{(k-3)}}{6^{(k-1)}}.$

  • The $~k$-th roll must be a 4.
    The probability of this happening is $~\dfrac{1}{6}.$

Therefore,

$$f(k) = [ ~(k-1) ~(k-2) ~] \times \left[ ~\frac{5}{6} ~\right]^{(k-3)} \times \frac{1}{2 \times 6^3}. \tag6 $$

Now, assume that event $~E(k)~$ has occurred. For $~k = 3, ~g(k) = 0.$ So, assume that $~k > 3.~$ Since three of the rolls were equal to 4, there were exactly $~(k-3)~$ rolls that were not equal to $~4.~$ Each of those rolls had a $~(2/5)~$ probability of being a 2 or a 3.

Therefore,

$$g(k) = \frac{2}{5} \times (k-3), \tag7 $$

with the expression in (7) above also holding for $~k = 3.$

So, the expression to be simplified is

$$\sum_{k=3}^\infty \left[ ~f(k) \times g(k) ~\right]$$

$$= \sum_{k=3}^\infty \left\{ ~[ ~(k-1) ~(k-2) ~] \times \left[ ~\frac{5}{6} ~\right]^{(k-3)} \times \frac{1}{2 \times 6^3} \\ \times \left[ ~\frac{2}{5} \times (k-3) ~\right] ~\right\}. \tag 8 $$

Set $~A = \dfrac{1}{5 \times 6^3}, ~x = \dfrac{5}{6}.~$

Then, the expression in (8) above may be equivalently expressed as

$$A \times \sum_{k=3}^\infty [ ~(k-1) ~(k-2) ~(k-3) ~] \times x^{(k-3)}. \tag9$$

Re-index the expression in (9) above, by setting $~j = k-3.$
Then, the expression in (9) above may be equivalently expressed as

$$A \times \sum_{j=0}^\infty [ ~(j+2) ~(j+1) ~(j) ~] \times x^j$$

$$= A \times \sum_{j=0}^\infty [ ~j^3 + 3j^2 + 2j ~] \times x^j. \tag{10}$$


It only remains to plug the formulas given by (2), (3), and (4) into the expression in (10) above.

With $~A = \dfrac{1}{5 \times 6^3}, ~x = \dfrac{5}{6}, ~$ you end up with

$$A \times ~~\text{the following computation}:$$

$$\left\{ ~\frac{6x^3}{(1 - x)^4} + \frac{6x^2}{(1-x)^3} + \frac{x}{(1 - x)^2} ~\right\} \\ + \left\{ ~\frac{6x^2}{(1-x)^3} + \frac{3x}{(1 - x)^2} ~\right\} \\ + \left\{ ~\frac{2x}{(1-x)^2} ~\right\} $$

This equals

$$A \times \left\{ ~\frac{6x^3}{(1 - x)^4} + \frac{12x^2}{(1-x)^3} + \frac{6x}{(1 - x)^2} ~\right\}$$

$$= A \times \left[ ~\frac{6x}{(1-x)^2} ~\right] \times \left[ ~\left( ~\frac{x}{1-x} ~\right) + 1 ~\right]^2$$

$$= A \times \left[ ~\frac{6x}{(1-x)^2} ~\right] \times \left[ ~\frac{1}{1-x} ~\right]^2$$

$$= \frac{1}{5 \times 6^3} \times \left[ ~\frac{5}{1/36} ~\right] \times \left[ ~\frac{1}{1/36} ~\right]$$

$$= 6.$$

user2661923
  • 42,303
  • 3
  • 21
  • 46