What is the probability of winning this game?
I tried some but the closest I get was $\frac 16 \cdot \frac 16$, but it's not right.
What is the probability of winning this game?
I tried some but the closest I get was $\frac 16 \cdot \frac 16$, but it's not right.
Write down the results of the five rolls and then read them backwards. You win if the "first" result is ever repeated, and you lose if it's not. The probability of losing is $(5/6)^4$ -- i.e., a given roll does not repeat the "first" result with probability $5/6$, and there are $4$ "subsequent" rolls -- so the probability of winning is
$$1-\left(5\over6\right)^4={1296-625\over1296}={671\over1296}$$
[This is essentially the same as Dominik's answer, but has less notation.]
Let the die have $n$ sides. Let $m$ be the number of rolls before the last roll. In your question $m=4$ and $n=6$. \begin{align} P(\text{win}) &= \sum_{i=1}^n P(\text{win, and last roll is $i$})\\ &= \sum_{i=1}^n P(\text{last roll is $i$, and one of the first $m$ rolls is $i$})\\ &= \sum_{i=1}^n P(\text{last roll is $i$}) \cdot P(\text{one of the first $m$ rolls is $i$})\\ &= \sum_{i=1}^n P(\text{last roll is $i$}) \cdot (1-P(\text{none of the first $m$ rolls is $i$}))\\ &= \sum_{i=1}^n \frac{1}{n} \cdot \left(1-\left(1 - \frac{1}{n}\right)^m\right)\\ &= 1-\left(1 - \frac{1}{n}\right)^m. \end{align}
Essentially, this question is the same as here. I will shamelessly adapt Byron's answer from there.
Assume we have a die with $n$ sides that we roll $m$ times before our final roll. Let $A_i$ be $1$ if we have rolled $i$ at some point and $0$ else. Also, denote by $X$ the last throw.
Now we will win if and only if the random variable $$Y = \sum \limits_{i = 1}^n A_i I\{X = i\}$$
has a value of one. Note that $Y$ only assumes values $0$ and $1$, so we have $E[Y] = P(Y = 1)$. Knowing that $X$ and $A_i$ are independent, it remains to calculate $$E[A_i] = P(A_i = 1) = 1 - P(A_i = 0).$$ But this is easy, since $P(A_i = 0) = (1 - \tfrac{1}{n})^m$. With this we can calculate the winning probability as $$E[Y] = \sum \limits_{i = 1}^n E[A_i] P(X = i) = (1 - (1 - \tfrac{1}{n})^m) \sum \limits_{i = 1}^n P(X = i) = 1 - (1 - \tfrac{1}{n})^m.$$
Side note: We can actually see in this calculations that $X$ doesn't even need to be a fair die, as long as it only assumes values from $1$ to $n$.
For a die with $n$ sides and $m$ rolls we have $n^m$ possible outcomes and the favorable ones are given by
$$\sum_{q=1}^n q {n\choose q} {m-1\brace q} q! = n\sum_{q=1}^n {n-1\choose q-1} {m-1\brace q} q!.$$
What is happening here is that we choose $q$ values from the $n$ available ones (factor ${n\choose q}$) and partition the initial $m-1$ rolls into non-empty sets, one for each value (${m-1\brace q}q!$). We have $q$ choices for the last value.
Now we have
$${m-1\brace q} = (m-1)! [z^{m-1}] \frac{(\exp(z)-1)^q}{q!}$$
so the sum becomes
$$n (m-1)! [z^{m-1}] \sum_{q=1}^n {n-1\choose q-1} (\exp(z)-1)^q \\ = n (m-1)! [z^{m-1}] (\exp(z)-1) \sum_{q=0}^{n-1} {n-1\choose q} (\exp(z)-1)^q \\ = n (m-1)! [z^{m-1}] (\exp(z)-1) \exp((n-1)z) \\ = n (m-1)! [z^{m-1}] (\exp(nz)-\exp((n-1)z)).$$
Extracting coefficients we get
$$n (n^{m-1} - (n-1)^{m-1}) = n^m - n (n-1)^{m-1}$$
which yields for the proabability
$$1- \frac{(n-1)^{m-1}}{n^{m-1}}$$
which is
$$\bbox[5px,border:2px solid #00A000]{ 1- \left(1-\frac{1}{n}\right)^{m-1}.}$$
We list some very basic Maple code for total enumeration and closed forms as a means of clarifying the interpretation of the question that was used here.
PROB := proc(n, m) option remember; local ind, digits, rolls, last, res; res := 0; for ind from n^m to 2*n^m-1 do digits := convert(ind, base, n); rolls := digits[1..m-1]; last := digits[m]; if member(last, convert(rolls, `set`)) then res := res + 1; fi; od; res/n^m; end; X := (n,m)-> 1-(1-1/n)^(m-1);
Renark. It is actually much easier to count non-favorable outcomes than favorable ones. We have $n$ choices for the last roll and that choice must not occur among the first $m-1$ rolls, giving $(n-1)^{m-1}$ possibilities. The probability of the complementary event then becomes $n (n-1)^{m-1}/n^m$ as before.
The same simple Maple program also served at this MSE link.
I am not gonna go with massive calculations rather simple logic.
I think the probability will change with each dice roll.
On the first roll it doesn't matter what comes up as one cannot win on first roll(according to the rules you stated). Now on second roll the probability of winning will be 1/6 as the probability of repeating what came up on first roll is 1/6. On the third roll however the probability of winning shall increase to 2/6 and so on.