I'm working on an assignment in which I have to count the number of solutions for this particular equation: $$x_1+x_2+x_3+x_4=20$$for non negative integers with $x_1<8 $ and $x_2<6$
I'm aware that this kind of a task isn't that complicated, but I don't get combinatorics in general that well.
So I've tried two following approaches to get this done.
Firstly I tried to substitute the variable x:
$x_1+x_2+x_3+x_4=20 \Leftrightarrow y_1+y_2+y_3+y_4=34$
in which $y_1=x_1+8$ and $y_2=x_2+6$ (casue $x_1=y_1-8$ and $x_2=y_1-6$) Following this approach the total number of possible solutions would be
$${34+3 \choose 3} $$
But I'm not sure if its the right solution.
The second approach is to sum all of the possible values that $x_1$ and $x_2$ could possibly take, also $x_1=0,1,2,3,4,5,6,7$ and $x_2=0,1,2,3,4,5,6$ And then count all the possibilities for each of the variables $${20 -x_1-x_2+1\choose 1}$$ and sum them together like this: $${21\choose 1}+{20\choose 1}+{19\choose 1}+{18\choose 1}+... $$ and so on...
I'm sure I'll get the correct number with this one, but I'm not feeling like summing all of this possibilities. There's got to be a better, more elegant way to deal with this.
My professor gave me a hint that I should do it using the complement.