What is the probability that $XYZ$ is divisible by $5$? A solution of $X + Y + Z = 20$ in non-negative integers is chosen at random. What is the probability that $XYZ$ is divisible by $5$?
Edit:
This happens to be an exam question. So I can't use calculators or computers and have to get the answer in less than 20 minutes while showing systematic workings. I appreciate the answers below, but can someone instruct me on solving the question given the mentioned constraints?

There are two questions here:

*

*How many triples of numbers $(X,Y,Z)$ add to 20?  We can call this $A$.


*How many of these are divisible by 5?  We can call this $B$.
The answer will then be $B/A$.
First we calculate $A$. Let us write $C(x)$ for the total number of ways of choosing $(X,Y,Z)$ so that $X=x$ and $X+Y+Z=20$.
There are 21 possible choices for $X$.  For each such $X$, there are $21-X$ possible choices for $Y$ that make $X+Y\le 20$, namely $\{0, 1, \ldots 20-X\}$.  The other choices have $X+Y>20$ and therefore $X+Y+Z>20$. Once we have chosen $X$ and $Y$ at random, there is exactly one possible choice for $Z$ that makes $X+Y+Z=20$. So we have $C(x) = 21-x$.
We want the total of $C(x)$ for each $x$ between 0 and 20:
$$\begin{eqnarray}
A&=&\sum_{x=0}^{20} C(x) \\ &=& \sum_{x=0}^{20} (21-x)\\
&=& \sum_{x=0}^{20} 21 - \sum_{x=0}^{20} x \\
&=& 441 - 210 \\ &=& 231.
\end{eqnarray}$$
Now we calculate $B$.  5 is prime, so $XYZ$ is divisible by 5 if and only if one of $X$, $Y$, or $Z$ is divisible by 5. We can use inclusion-exclusion: $B$ is the sum of the cases where (at least) $X$, $Y$, or $Z$ is divisible by 5, minus the cases where (at least) two are divisible by 5, plus the cases where all three are divisible by 5. That is, $$\begin{eqnarray}B&=&D_x + D_{y} + D_z \\ &&- D_{xy} - D_{xz} - D_{yz} \\ &&+ D_{xyz}\end{eqnarray}$$
Where $D_{xy}$ denotes the number of choices of $(X,Y,Z)$ where $5\mid X$ and $5\mid Y$, and similarly for the others.
By symmetry, $D_x = D_y = D_z$, and $D_{xy} = D_{xz} = D_{yz}$.  Also, it is impossible to have two of $(X,Y,Z)$ divisible by 5 without the third also being divisible by 5, so $D_{xy} = D_{xyz}$.  So the previous equation reduces to:
$$B = 3D_x - 2D_{xyz}$$
We calculate $D_x$: $X$ will be a multiple of 5 whenever $X\in\{0,5,10,15,20\}$, so we want
$$\begin{eqnarray}
&&\sum_{5\mid X} C(X) \\
&=& \sum_{X\in\{0,5,10,15,20\}} (21-X) \\
&=& 21\cdot5 - (0+5+10+15+20) \\
&=& 105 - 50 \\ &=& 55
\end{eqnarray}$$
To calculate $D_{xyz}$ is quick because there are very few such triples, and we can enumerate them by brute force:
$(0,0,20)\ldots (0,20,0), (5,0,15)\ldots (5,15,0),\ldots (20,0,0)$. This is 5+4+3+2+1 = 15.
So we have $B = 3\cdot 55 - 2\cdot 15 = 135$.

Thus the answer is $B/A = 135/231 = 45/77$.

