TITLE: Rolling dice such that they add up to 13 — is there a more elegant way to solve this type of problem?
QUESTION [11 upvotes]: Here is the problem:

There are $6^3$ possible outcomes to rolling a die $3$ times. Out of these, how many yield a total of (exactly) $13$ dots?

My solution would be absolutely impractical for problems involving $4$ rolls of the die. And at higher numbers it would be downright impossible without brute-forcing it with a computer. 
Is there a more elegant way to solve this type of problem?

My solution:

First we find all sets $\{a, b, c\}$ such that $a + b + c = 13; \; a, b, c \le 6$:
$\{1, 6, 6\}$
$\{2, 5, 6\}$
$\{3, 4, 6\}, \{3, 5, 5\}$
$\{4, 4, 5\}$
The total number of sets that fit these criteria is $5$. If $a \not= b \not= c$, then there exist $3!$ unique permutations of $\{a, b, c\}$. If $a = b \not= c$, then there exist $3$ unique permutations of $\{a, b, c\}$. -- There cannot be a set such that $a = b = c$.
There are $2$ sets of the first kind and $3$ of the second. It follow that the total number of triple die rolls that can fit the criteria is
\begin{equation*}
2 \cdot 3! + 3 \cdot 3 = 21
\end{equation*}

I can think of a second way to do it, which might be faster for slightly larger numbers... but essentially still comes down to brute force, not a method that can be generalized.

REPLY [3 votes]: If you throw the die a very large number of times, maybe there would be some difficulty in finding the exact number of ways in which a certain total can appear.  But the central limit theorem from probability theory can give some reasonable approximations.
Say you throw the die 40 times.  On average the sum is 140.  There are $6^{40}$ possible outcomes.  How many of those give a total in the closed interval $[135,150]$?
When you throw a die once, the variance of the probability distribution of the number of dots you see is $35/12$, so when you throw it 40 times, the variance is $40\cdot35/12= 10\cdot35/3$, and the standard deviation is therefore $\sqrt{350/3} = 10.801234497\ldots\ {}$.  For this discrete distribution, "$\ge 135$" is the same as "$>134$" and "$\le 150$" is the same as "$<151$", so we do a continuity correction and look at the interval $(134.5,150.5)$.  The number $134.5$ is $(134.5-140)/10.801234497\ldots)$ standard deviations above the mean, i.e. about $0.5092$ standard deviations below the mean, and $150.5$ is about $0.972$ standard deviations above the mean.  Plugging these into the cumulative probability distribution function $\Phi$ of the normal distribution, we get a probability of about $\Phi(0.972)-\Phi(-0.5092)=0.529$.
So $0.529 \times 6^{40} \approx 7.074\times 10^{30}$ is approximately how many ways there are to get a sum in that interval.