Rolling $n$-sided dice $m$ times Here is the problem I came across:

$(\Omega, \mathcal{F}, P)$ models the rolling of 3 dices, therefore $\Omega=\{1, \ldots,6 \}^3$ with uniform distribution. Define $X(i,j,k):=i-j+k$. Find $P_X$.

I noticed that $X(\Omega)=\{-4, \ldots,11 \}$ and started with 
\begin{align} 
X^{-1}(\{-4\}) & = \{(1,6,1)\}, \text{hence } P_X(\{-4\})=1/216
\\ X^{-1}(\{-3\}) & = \{(1,5,1),(2,6,1),(1,6,2)\}, \text{hence } P_X(\{-3\})=3/216
\end{align}
The minus-thing is not very convenient so we can define $Y(i,j,k):=i+j+k$ find $P_Y$ and then shift.
Yet it's still quite confusing to calculate those by hand. My question is: what if we had $m$ dices with $n$ sides each? Which I guess boils down to the number of ways to write $k\in\{m,\ldots,nm \}$ as a sum of $m$ nonnegative integers (order matters).
 A: I am very used to the notation you used so I will say $X,Y,Z$ are the outcomes of die 1, 2 and 3 respectively (order does not matter in fact). Then we want to computet he distribution of $W=X-Y+Z$ and as you said the outcome space is $S=\{-4,-3,\dots,10,11\}$ and all possible combinations of outcomes is $|\Omega| = 216$. Then simply using the Law of total probability by conditioning on two of the results:
\begin{align*}
P(W=n) = P(X-Y+Z=n) = \sum_{k,l\in S} P(X-Y+Z=n|Y=k, Z=l)P(Y=k, Z=l)
\end{align*}
since $X$, $Y$ and $Z$ are independent I can split up the latter probability and then
\begin{align*}
P(W=n) &= \sum_{n+k-l \in S} P(X=n+k-l)P(Y=k)P(Z=l)\\
&= \frac{1}{6^2}\sum_{n+k-l \in S} \frac{1}{6} \textbf{1}_{\{-4\leq n+k-l\leq 11\}}\\
&=\frac{1}{6^3}|\{k,l\in \{1,2,3,4,5,6\} \mbox{ such that } -4\leq n+k-l\leq 11\}|\\
\end{align*}
where
$$|\{k,l\in \{1,2,3,4,5,6\} \mbox{ such that } -4\leq n+k-l\leq 11\}|$$
means that you count the number of indices satisfying the inequality, which indeed will depend on $n$.
I think using this reasoning it should be easier for you now to figure out how to generalize it to $m$ dice with $n$ sides. The only things that change are $|\Omega|=n^m$ and $S$.
