0

I am trying to use the stars and bars technique to calculate the number of ways 3 dice rolls can add up to 16. To my understanding, this can rephrased as:

$$x + y + z = 16 | x,y,z \in \mathbb{Z}^+ \land x,y,z \leq 6$$

I am not anywhere close to being a mathematician, so simple solutions are much appreciated. My main motivation to the question, is that I am trying to see if there is a cooler way to do it rather than count by hand, and stars and bars came to my mind as a potential solution. However, other simple solutions are also welcome.

alt-f4
  • 175
  • 1
  • 6
  • The upper bound makes it difficult to use stars and bars. Easier to use generating functions, or just write it out in cases (according to how many $6's$ there are, say). – lulu Oct 31 '20 at 12:06
  • here is an example of a stars and bars style computation that uses an upper bound. Honestly, though, the numbers are so small here that just writing it out in cases only takes a few seconds (or you can do it mentally). – lulu Oct 31 '20 at 12:08

4 Answers4

2

We wish to find the number of solutions of the equation $$x + y + z = 16 \tag{1}$$ in the positive integers subject to the constraints that $x, y, z \leq 6$. Observe that since $x, y, z \leq 6$, \begin{align*} x' & = 7 - x\\ y' & = 7 - y\\ z' & = 7 - z \end{align*} are also positive integers which are at most $6$. Substituting $7 - x'$ for $x$, $7 - y'$ for $y$, and $7 - z'$ for $z$ in equation 1 yields \begin{align*} 7 - x' + 7 - y' + 7 - z' & = 16\\ -x' - y' - z' & = -5\\ x' + y' + z' & = 5\tag{2} \end{align*} which is an equation in the positive integers. Moreover, we cannot violate the constraints that $x', y', z' \leq 6$.

A particular solution in the positive integers corresponds to the placement of $3 - 1 = 2$ addition signs in the $5 - 1 = 4$ spaces between successive ones in a row of five ones. $$1 \square 1 \square 1 \square 1 \square 1$$ For instance, placing addition signs in the second and third spaces corresponds to the solution $x' = 2$, $y' = 1$, $z' = 2$ of equation 2 and $x = 5$, $y = 6$, and $z = 6$ of equation 1. The number of such solutions is the number of ways we can select two of those four spaces in which to place an addition sign.

$$\binom{5 - 1}{3 - 1} = \binom{4}{2} = 6$$

N. F. Taussig
  • 76,571
2

We start with: $$x+y+z=16$$ where $x,y,z$ are positive integers with $x,y,z\leq 6$.

Then we make it: $$x'+y'+z'=13$$ where $x',y',z'$ are nonnegative integers with $x',y',z'\leq 5$.

(here we take $x'=x-1$, $y'=y-1$ and $z'=z-1$)

Finally we make it: $$x''+y''+z''=15-13=2$$ where $x'',y'',z''$ are nonnegative integers with $x'',y'',z''\leq 5$.

(here we take $x''=5-x'$, $y''=5-y'$ and $z''=5-z$)

Now observe that the extra condition $x'',y'',z''\leq 5$ can be neglected in this setting because that is a consequence of the other conditions.

So we can apply stars and bars and find: $$\binom{2+3-1}{3-1}=6$$ solutions.


This is a trick that works here but not always.

drhab
  • 151,093
0

The max sum of two dice is $12$ so the lowest die must be $\geq 4$. Then we have $4,6,6$. If the lowest die is $5$ we have $5,5,6$. If you count the dice as distinct then you can permute these possibilities.

Derek Luna
  • 2,732
  • 8
  • 19
0

The lowest roll a single dice could be and this work would be $4$, since we need $16$ and the maximum of the other two is $12$. Now the "closest" the numbers can be to each other would be $6,5,5$ and so far we have:

  • $6,6,4$
  • $6,5,5$ Now these are the only two combinations possible, now its just whether or not you care about permutations or combinations
Henry Lee
  • 12,215