TITLE: Integer solutions using PIE
QUESTION [6 upvotes]: Find the number of integer solutions to $a+b+c+d=18$ with $ 0≤a,b,c,d≤6$.

With no restrictions there are:
$$\binom{21}{3} = 1330$$
Ones that are invalid are: $a, b, c, d \ge 7$. 
But how do I take them out?

REPLY [2 votes]: Since you specified PIE, here's the solution (though drhab's solution is slicker). Use stars and bars  and apply PIE putting 7 in one or more "bins" so that it exceeds 6.
$${21\choose 3} - {4\choose 1}{14\choose 3} + {4\choose 2}{7\choose 3} = 84$$