How many integer solutions (x1; x2; x3) are there to the equation :-
x1 + x2 + x3 = 25
with all xi satisfying 0 < xi < 10?
Maybe not the most elegant, but:
The lowest possible for x1 is 5, forcing (x2,x3)=(10,10).
Fix x1=6 then it's either (x2,x3)=(9,10) or (10,9)
Fix x2=7 then it's either (x2,x3)=(8,10) or (10,8) or (9,9)
As you can see there really aren't that many options if you continue in this manner.
A generating function solution requires the least thought, in my opinion.
Suppose, more generally, we want to count the integer solutions to
$\displaystyle x_1 + x_2 + x_3 = r$
where $\displaystyle 0 \leq x_i \leq 10$;
let's say the number of solutions is $\displaystyle a_r$.
Then $\displaystyle a_r$ is the coefficient of $\displaystyle x^r$ in
$\displaystyle f(x) = (1 + x + x^2 + \dots + x^{10})^3$.
From here on it's just a matter of manipulating series:
$\displaystyle f(x) = \left( \frac{1-x^{11}}{1-x} \right) ^3$
$\displaystyle = (1- x^{11})^3 (1-x)^{-3}$
$\displaystyle = (1 - 3 x^{11} + 3 x^{22} - x^{33}) \sum_{i=0}^{\infty} \binom{3+i-1}{i} x^i$
Picking out the coefficient of $\displaystyle x^{25}$ from this expression, we can see it is
$\displaystyle a_{25} = \binom{27}{25} - 3 \binom{16}{14} + 3 \binom{5}{3}$.
I think a solution via inclusion/exclusion is also possible (I haven't worked it out), but I think it will lead to the same expression for the answer. Only you will have to think harder. :-P