How many solutions of $ x+y+z+t = 7 $ I have an equation: $ x+y+z+t = 7$. I want to know how many solutions does this equation have? $x,y,z$, and $t$ are positive integers. I have no idea how to solve this. Can you please help me to solve this question?
 A: This is classic stars and bars combinatorics question.
We need to find 4 numbers, i.e. 4-tuples of positive integers such their sum is 7. So the number of solution is:
$$\binom{k-1}{n-1}$$
Where $k$ is their sum and $n$ is the the number of terms in the summation. So for our case we have:
$$\binom{7-1}{4-1} = \binom{6}{3} = 20 \text{ solutions}$$
Note that some of this solution are permutations because $(x,y,z,y) = (1,2,2,2)$ and $(x,y,z,y) = (2,1,2,2)$ are calculated twice. If you want solutions like these to be included just once, I can't think of a better way than counting. 
A: This is just a hint to help you get started thinking about the problem. There might be a cleaver way to look at this, but you could also simply just count the number of solutions. So you start
$$
1 + 1 + 1 + 4 = 7 \\
1 + 1 + 2 + 3 = 7 \\
1 + 1 + 3 + 2 = 7 \\
1 + 1 + 4 + 1 = 7 \\
1 + 2 + 1 + 3 = 7 \\
1 + 2 + 2 + 2 = 7 \\
\vdots
$$
Maybe a slightly smarter way to do it would be first to notice that $x,y,z,t$ need to be from $\{1,2,3,4\}$. Then figure out how many ways you can add these up to get $7$. You get (Note for example that if one number is $3$, then the other numbers have to be $1$ or $2$):
$$
1, 1, 1, 4 \\
1, 1, 2, 3 \\
1, 2, 2, 2. \\
$$
If you pick $1,1,1,4$ then how many ways can you add these up?
A: $x+y+z+t=7$, but since they are all integers we write $x=m+1$,  $y=n+1$, $z=o+1$, and $t =p+1$ (where $m,n,o,p$ are non negative integers). Then $m+n+o+p=3$. There are three options. One of them is $3$ and the others are $0$. One is $2$ and another is $1$ or three are $1$.
The first case gives $4$ solutions, the second $12$ (number ordered pairs of the subset $\{m,n,o,p\}$) and the third $4$. Therefore there are $20$ solutions all in all.
