0
$\begingroup$

I'm analyzing the game Yahtzee in which a player can roll five dice three times and at each interval can choose to roll/not roll certain dice or stop rolling altogether. The goal is to get different combinations like four-of-a-kind, a straight (1-2-3-4-5 or 2-3-4-5-6), etc.

I found that binomial probability was exactly what I needed. Using the formula P(X=r) = nCr * pʳ * (1-p)ⁿ⁻ʳ I could basically say "if I roll five dice, what are the chances 3 of them match" and that formula gives me a percentage chance. That works great!

However, referencing the research done here, your chances of getting a Yahtzee (five of a kind) is about 4% if you use all three rolls. Your chances of rolling a Yahtzee in your first roll is 0.08% but the probability of doing it over three rolls is much higher because you could set aside some matches and only roll the remaining dice you need to match.

But how can you calculate this at each interval?

Example: Say I want a four-of-a-kind and I roll a 4 5 3 4 2. A smart player would re-roll the 5 3 2 in hopes of getting more 4's. Binomial probability tells us you have a 6.94% chance of getting two 4's in the next roll. So how can I calculate the chance I get two 4's in either the next roll or the one after that?


Here's a representation of how you can accomplish this feat. If you need 2 4's, are rolling three dice, and can roll twice, you have the following win possibilities:

  1. (1) 4 X X - (2) 4 X
  2. (1) X X X - (2) 4 4 X
  3. (1) 4 4 X

I can use binomial probability to calculate the chances of getting each of these. Should I average them to get what I need? I feel like I'm so close, hopefully one of you guys knows a formula or can help me out.

$\endgroup$

1 Answer 1

1
$\begingroup$

Some formality and structure should help you tackle the problem you mention in your example.

Take $E$ as the event of getting at least two more fours in the next roll or the one after that, $X$ as the number of fours in the first roll, and $Y$ as the number of fours in the second roll.

Using total law of probability, $$\begin{eqnarray*}\mathbb{P}(E)=\mathbb{P}(E|X=0)\mathbb{P}(X=0)+\mathbb{P}(E|X=1)\mathbb{P}(X=1)+\mathbb{P}(E|X\geq 2)\mathbb{P}(X\geq 2)\end{eqnarray*}$$ Since $\mathbb{P}(E|X\geq 2)=1$ and $X\sim \text{Binomial}(3,1/6)$ the aforementioned reduces to $$\mathbb{P}(E)=\frac{125}{216}\mathbb{P}(E|X=0)+\frac{25}{72}\mathbb{P}(E|X=1)+\frac{2}{27}$$ Now for $x=0,1$ $$\mathbb{P}(E|X=x)=\sum_{y=0}^{3-x}\mathbb{P}(E|X=x,Y=y)\mathbb{P}(Y=y|X=x)$$ Because $\mathbb{P}(E|X=x,Y=y)=1_{\{x+y\geq 2\}}$ and $Y|X\sim \text{Binomial}(3-X,1/6)$ we have $$\mathbb{P}(E|X=0)=\mathbb{P}(Y\geq 2|X=0)=\frac{2}{27}$$ Furthermore, $$\mathbb{P}(E|X=1)=\mathbb{P}(Y\geq 1|X=1)=\frac{11}{36}$$ Putting all this together, $$\mathbb{P}(E)=\frac{5203}{23328}\approx 0.22$$

$\endgroup$
9
  • $\begingroup$ I've figured it out, but how does the formula change if I was calculating the chances with three turns left? Wouldn't I have a X, Y, and Z, with Z being the number of fours in my third round? How can I implement that? $\endgroup$
    – CyanCoding
    Commented Dec 27, 2021 at 2:16
  • $\begingroup$ Are you familiar with Markov Chains? $\endgroup$
    – user801306
    Commented Dec 27, 2021 at 2:35
  • $\begingroup$ A little above my math knowledge haha. They're referenced in the Yahtzee probability article (which achieves a similar goal of mine but doesn't show all the equations) so I'll do more research on that topic. Thanks! $\endgroup$
    – CyanCoding
    Commented Dec 27, 2021 at 2:49
  • $\begingroup$ Let $X_0=2$ and $X_j$ be the number of fours that appear after $j$ rolls. Then $\{X_j\}_{j\geq 0}$ is a Markov chain with states $\{2,3,4,5\}$ and has state transition matrix $$P=\begin{pmatrix}\frac{125}{216}&\frac{25}{72}&\frac{5}{72}&\frac{1}{216}\\ 0&\frac{25}{36}&\frac{5}{18}&\frac{1}{36}\\ 0&0&\frac{5}{6}&\frac{1}{6}\\ 0&0&0&1\end{pmatrix}$$ The sum of the third and fourth entries in the first row of $P^j$ indicate the probability of having at least four $4$'s after $j$ rolls. $\endgroup$
    – user801306
    Commented Dec 27, 2021 at 2:54
  • $\begingroup$ So, since $$P^3=\begin{pmatrix}\frac{1953125}{10077696}&\frac{1421875}{3359232}&\frac{1035125}{3359232}&\frac{753571}{10077696}\\ 0&\frac{15625}{46656}&\frac{11375}{23328}&\frac{8281}{46656}\\ 0&0&\frac{125}{216}&\frac{91}{216}\\ 0&0&0&1\end{pmatrix}$$ The probability of getting at least four $4$'s after $3$ rolls is $$\frac{1035125}{3359232}+ \frac{753571}{10077696}\approx 0.38$$ $\endgroup$
    – user801306
    Commented Dec 27, 2021 at 2:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .