[Math] Problem about $n$ six-sided dice and the sum of the values

dicediscrete mathematicselementary-number-theoryprobability

(AHSME 1994) When $n$ standard six-sided dice are rolled, the probability of
obtaining a sum of 1994 is greater than zero and is the same as the probability of
obtaining a sum of $S$. What is the smallest possible value of $S$?

(I've been trying to use generating function, but without success. I took this one from The Art and Craft of Problem Solving – Paul Zeitz, second ed, pag. 8, chapter 1 exercise 1.3.6.)

Best Answer

When you roll $n$ dice, the total must be an integer in the interval $[n,6n]$. For $n\le k\le 3n$, the probability of getting a total of $k$ is the same as the probability of getting a total of $7n-k$: each roll that gives you $k$ corresponds to one that gives you $7n-k$ by turning each die over. For $n>1$ these pairs are the only totals with equal probability.

In order for the total $1994$ to be possible, you must have $333\le n\le 1994$. The complementary sum $S$ will be $7n-1994$, and you want to choose $n$ to make this as small as possible. Clearly this is achieved when $n$ is as small as possible, i.e., $333$, in which case $S=7\cdot333-1994=337$.