The probability of multiplicity of the sum of the dice

conditional probabilitydiceprobability

A player has $2$ dice. The player throws them until at least one of the dice has a $6$. They sum the intermediate results. Find the probability of the event that at the end of the game (we add the final toss into the sum) the sum will be a multiple of $3$.

My attempt at a solution:

  1. The probability of getting at least one six on two dice in one roll is $\frac{12}{36}$.

So, on average, we need $\frac{36}{12} = 3$ throws to throw one six.

  1. On average, on one roll, when there is no six, the sum on two dice will be:

$$((1+1)+(2+2)+(3+3)+(4+4)+(5+5))\cdot \frac{2}{36}+\frac{1}{36} \cdot 2\cdot ((1+2)+(1+3)+(1+4)+(1+5)+(2+3)+(2+4)+(2+5)+(3+4)+(3+5)+(4+5)) = \frac{5}{3} + \frac{1}{18} \cdot (18+18+15+9) = \frac{5}{3} + \frac{1}{18} \cdot (18+18+15+9) = \frac{15}{3} = 5$$

that is, the average amount on two dice in a throw without sixes is $5$. And there will be $2$ such throws, they will give an average of $10$ points.

  1. On the last roll, we exactly throw $6$ on one of the dice, and on the other dice we get an average of $\frac{1}{6} \cdot (1+2+3+4+5+6) = 3.5$

The sum on this last roll is $9.5$

Then the total sum is $2\cdot 5 + 9.5 = 19.5$

I doubt my decision and answer, did I calculate the conditional sum correctly in this case? How do I get to the multiplicity of three here?

Best Answer

It is a Markov chain with 5 states. An "active state" for each remainder $\mod 3$ of the running sum and two ending states indicating whether the final sum is $0 \pmod 3$ or not. I believe we have this transition matrix (states enumerated as actives $0,1,2$ and end states so that the $0 \pmod 3$ is last

$$ \left(\begin{array}{rrr|rr} \frac{1}{4} & \frac{2}{9} & \frac{2}{9} & \frac{2}{9} & \frac{1}{12} \\ \frac{2}{9} & \frac{1}{4} & \frac{2}{9} & \frac{7}{36} & \frac{1}{9} \\ \frac{2}{9} & \frac{2}{9} & \frac{1}{4} & \frac{7}{36} & \frac{1}{9} \\ \hline 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 & 1 \end{array}\right). $$

The probabilities of being absorbed to the corresponding end states are given by

$$ \left(\left(\begin{array}{rrr} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{array}\right) - \left(\begin{array}{rrr} \frac{1}{4} & \frac{2}{9} & \frac{2}{9} \\ \frac{2}{9} & \frac{1}{4} & \frac{2}{9} \\ \frac{2}{9} & \frac{2}{9} & \frac{1}{4} \end{array}\right) \right)^{-1} \left(\begin{array}{rr} \frac{2}{9} & \frac{1}{12} \\ \frac{7}{36} & \frac{1}{9} \\ \frac{7}{36} & \frac{1}{9} \end{array}\right) = \left(\begin{array}{rr} \frac{24}{35} & \frac{11}{35} \\ \frac{23}{35} & \frac{12}{35} \\ \frac{23}{35} & \frac{12}{35} \end{array}\right). $$

Since we start from $0$ (the first state), the probability that the final sum is a multiple of $3$ is

$$ \frac{11}{35}. $$


Sage code to make:

M = 3
D = 6
matN = M+2
a = [[0 for j in range(matN)] for i in range(matN)]
for i in range(M):
    for d1 in range(1,D+1):
        for d2 in range(1,D+1):
            i2 = (i+d1+d2)%M
            if M in (d1,d2):
                i2 = M + (0 if i2%M else 1)
            a[i][i2] += 1/D**2
a[M][M] += 1
a[M+1][M+1] += 1
A = matrix(QQ, a)
A.subdivide(M,M)
show(A)
show(matrix.identity(M), A[:M,:M],  A[:M,M:])
ps = (matrix.identity(M)-A[:M,:M])^(-1) * A[:M,M:]
show(ps)
Related Question