Roll as many dice as the die has sides

The expected turn score in Hog with an nn-sided die is maximized by rolling exactly nn dice

By Samuel Chen and Mikhail Carmien

Aug 20, 2026

CS61A describes the rules as

In Hog, two players alternate turns trying to be the first to end a turn with at least 100 total points. On each turn, the current player chooses some number of dice to roll, up to 10. That player’s score for the turn is the sum of the dice outcomes. However, a player who rolls too many dice risks:

Sow Sad. If any of the dice outcomes is a 1, the current player’s score for the turn is 1.

In this paper, we show that for an nn-sided die, the expected value is maximized by rolling nn dice for every natural number n2n \geq 2. Therefore, when there is no limit to the number of dice that can be rolled, the optimal choice for an nn-sided die is to roll nn dice.

Derive the expected turn score

For one six-sided die, P(1)=16,P(¬1)=56 P(1)=\frac{1}{6}, \quad P(\neg 1)=\frac{5}{6} And the total expectation is E(X)=16(1)+16(2+3+4+5+6) \text{E}(X) = \frac{1}{6} (1) + \frac{1}{6} (2 + 3 + 4 + 5 + 6) Grouping the five outcomes that are not 11, E(X)=16(1)+56(4)=3.5 \text{E}(X) = \frac{1}{6} (1) + \frac{5}{6}(4) = 3.5 where 44 is the average of the outcomes 22 through 66.

We now generalize this idea to rolling mm dice, each with nn sides. With multiple dice, Sow Sad occurs if at least one of the mm dice rolls a 11.

Then since the dice are independent, the probabilities become P(no 1s)=(n1n)m P(\text{no 1s}) = \left( \frac{n-1}{n} \right)^m and P(at least one 1)=1(n1n)m P(\text{at least one 1}) = 1 - \left( \frac{n-1}{n} \right)^m

From the law of total expectation, if a set of events is mutually exclusive and covers every outcome, then the expected value is the sum of the expected value given each event AiA_i multiplied by the probability of that event. E(X)=iP(Ai)E(XAi) \text{E}(X) = \sum_i P(A_{i}) \cdot \text{E}(X \mid A_{i}) Sow Sad and its complement are two such events, so E(X)=P(at least one 1)E(Xat least one 1)+P(no 1s)E(Xno 1s) \begin{aligned} \text{E}(X) &= P(\text{at least one 1}) \, \text{E}(X \mid \text{at least one 1}) \\ &\quad + P(\text{no 1s}) \, \text{E}(X \mid \text{no 1s}) \end{aligned} Then since Sow Sad gives you 1 point, E(Xat least one 1)=1 \text{E}(X \mid \text{at least one 1}) = 1 Therefore, E(X)=[1(n1n)m](1)+(n1n)mE(Xno 1s)(1) \text{E}(X) = \left[ 1 - \left( \frac{n-1}{n} \right)^m \right](1) + \left( \frac{n-1}{n} \right)^m \text{E}(X \mid \text{no 1s}) \tag{1}

To compute E(Xno 1s)\text{E}(X \mid \text{no 1s}), we start by thinking in terms of a single die.

Let YY be the outcome of rolling 11 die given that it is not a 11, so YY is equally likely to be any of 22 through nn. On a six-sided die, there are 61=56-1=5 ways to roll between a 22 and 66, hence P(Y=i)=161P(Y=i)=\frac{1}{6-1}. To generalize to the probability of rolling an nn-sided die from 22 to nn, we use P(Y=i)=1n1P(Y=i) = \frac{1}{n-1}. The expected value of this is then E(Y)=i=2ni(1n1)=2+3++nn1 \begin{aligned} \text{E}(Y) &= \sum_{i=2}^{n} i \left( \frac{1}{n-1} \right) \\ &= \frac{2 + 3 + \dots + n}{n-1} \end{aligned} To calculate the sum of the first nn positive integers, we use n(n+1)2\frac{n(n+1)}{2}. And since we exclude the outcome 11, we subtract it from that sum and get E(Y)=n(n+1)21n1=n(n+1)22(n1)=(n1)(n+2)2(n1)=n2+1 \begin{aligned} \text{E}(Y) &= \frac{\frac{n(n+1)}{2} - 1}{n-1} \\ &= \frac{n(n+1) - 2}{2(n-1)} \\ &= \frac{(n-1)(n+2)}{2(n-1)} \\ &= \frac{n}{2}+1 \end{aligned} Then note that conditioned on no 1s, each of the mm dice is an independent copy of YY, so the distribution (Xno 1s)(X \mid \text{no 1s}) is the same as the “sum” (convolution) of rolling mm of the YY dice: (Xno 1s)=Y1+Y2++Ymm times(X \mid \text{no 1s})=\underbrace{Y_1+Y_2+\cdots+Y_m}_{m \text{ times}}. We can then use the linearity of expectation: E(Xno 1s)=E(Y1+Y2++Ymm times)=mE(Y)=m(n2+1)\text{E}(X \mid \text{no 1s})=\text{E}(\underbrace{Y_1+Y_2+\cdots+Y_m}_{m \text{ times}})=m \cdot \text{E}(Y)=m \cdot \left(\frac{n}{2}+1\right) Plugging into equation (1), the expected value is E(X)=[1(n1n)m](1)+(n1n)mm(n2+1)=1+(n1n)m(m(n+2)21)(2) \begin{aligned} \text{E}(X) &= \left[ 1 - \left( \frac{n-1}{n} \right)^m \right](1) + \left( \frac{n-1}{n} \right)^m m \left( \frac{n}{2} + 1 \right) \\ &= 1 + \left( \frac{n-1}{n} \right)^m \left( \frac{m(n+2)}{2} - 1 \right) \end{aligned} \tag{2} We write E(m,n)\text{E}(m,n) when we want to make the dependence on mm and nn explicit.

Expected turn score plotted against the number of dice rolled, for 4-, 6-, and 10-sided dice. Each curve rises, peaks at m = n, and then falls.
Figure 1. Expected turn score against the number of dice rolled, for n = 4, 6, and 10. Each curve is maximized at exactly m = n.

Prove the maximum is at m=nm=n

For a fixed number of sides, the line in Figure 1 goes up and then down. We want to determine where the greatest expectation is.

We define Δ=E(m+1,n)E(m,n)\Delta = \text{E}(m+1, n) - \text{E}(m, n), or the difference in expectation between rolling m+1m+1 dice and rolling mm dice.

Substituting equation (2) into this definition and simplifying, we have Δ=(n1n)mn(n+1)m(n+2)2n \Delta = \left( \frac{n-1}{n} \right)^m \frac{n(n+1)-m(n+2)}{2n} Since (n1n)m\left( \frac{n-1}{n} \right)^m and 2n2n are always positive, the sign of Δ\Delta depends only on n(n+1)m(n+2)n(n+1) - m(n+2)

When Δ>0\Delta > 0, the expectation is increasing on the graph and E(m,n)<E(m+1,n)\text{E}(m, n) < \text{E}(m+1, n). Therefore Δ>0\Delta > 0 exactly when minteger<n(n+1)n+2=n1integer+2n+2fractional \underbrace{m}_{\text{integer}} < \frac{n(n+1)}{n+2} = \underbrace{n-1}_{\text{integer}} + \underbrace{\frac{2}{n+2}}_{\text{fractional}}

Since 2n+2\frac{2}{n+2} is fractional, 0<2n+2<1for n2 0 < \frac{2}{n+2} < 1 \qquad \text{for } n \geq 2 and adding n1n-1 to all sides, n1<n1+2n+2<n n-1 < n-1 + \frac{2}{n+2} < n

Since n1n-1 and nn are integers, 2n+2\frac{2}{n+2} is a fraction, and m<n1+2n+2m < n-1 + \frac{2}{n+2}, we have mn1    Δ>0 m \leq n-1 \iff \Delta > 0

To illustrate this, imagine a number line with mm on the left and n1+2n+2n-1 + \frac{2}{n+2} (integer plus a fraction) on the right. Since mm is the integer right before n1+2n+2n-1+ \frac{2}{n+2}, mm must be less than or equal to the integer n1n-1.

Since n1+2n+2n-1 + \frac{2}{n+2} is never an integer, Δ\Delta is never exactly 00. Similarly, by negating terms of the biconditional (and that m,nm,n are integers), Δ<0    mn \Delta < 0 \iff m \geq n

Since Δ\Delta represents the change from mm to m+1m+1, these statements mean E(m,n)\text{E}(m,n) is increasing until m=nm=n, and then exactly at m=nm=n, we have E(m=n,n)>E(m=n+1,n)\text{E}(m=n,n)>\text{E}(m=n+1,n), hence all values E(m>n,n)\text{E}(m>n,n) are less than E(m=n,n)\text{E}(m=n,n), and this means nn is optimal.

For intuition, on the expectation graph, one can imagine expectation increasing when Δ>0\Delta > 0 and expectation decreasing when Δ<0\Delta < 0. The maximum is the turning point when mm switches from being less than or equal to n1n-1 to being greater than or equal to nn, which implies nn is optimal.