How do you determine the number of tuples such that $x+y+z= 30$ and any integer cannot be greater than 15? How do you determine the number of tuples such that $x+y+z= 30$ and any integer cannot be greater than 15?
First I calculated all the the possible tuples by  $\binom{32}{2}$ or 496. Then I tried to figure out how many cases there were where any integer has is greater than 15. I found it to be  $\binom{16}{2}\times 3$ which is equal to $360$. Then I subtracted to obtain $136$ but apparently this is incorrect? Can someone let me know what I did wrong and how to approach the problem? Thanks.
Edit : The full question is jocko, wocko, and docko plan to buy a new toilet for their bathroom. The toilet costs 300
and each of them has saved 200 dollars in 10 dollar bills. They decide that each of them will start with contributing 50 dollars  in 10 dollar bills(everyone contributes at least 50 dollars to the purchase.) Then, each of them will contribute some amount more money to reach the required 300 dollars to buy the toilet. For each $m \in \{\text{jocko, wocko, docko} \}$, we denote by $a_m$ the number of 10 dollar bills that each person m is left with after they buy the toilet. Count the number of possible triples of $\{jocko_m, wocko_m, docko_m \}$. Note that any person can contribute 0 dollars towards the purchase.
 A: Let $x$ go from $0$ to $15$. For $x=0$ the only possibility is $(0,15,15)$
For $x=1$ we have $(1,14,15)$ and $1,15,14$ for two possibilities.
As $x$ increases to $15$, the number of possibilities increases by one for combinations of $y$ and $z$ with a maximum of sixteen possibilities for $x=0$.
Therefore, there are $$1+2+\dots+16=\frac{16\cdot 17}{2}=136$$ possible triples.
A: This is a perfect use of generating functions.
The key observation is that when we multiply two polynomials (or power series, even), the coefficient of $x^n$ in the product is related to the coefficients of the partitions of $n$ in the things we're producting. You can read more about this here.
For a small example, let's look at
$$(1 + x + x^2) \cdot (1 + x + x^2) = 1x^0 + 2x^1 + 3x^2 + 2x^3 + x^4$$
Notice that there's

*

*$1$ way to partition $0$ into two pieces ($0 + 0$)

*$2$ ways to partition $1$ into two pieces ($1+0$ and $0+1$)

*$3$ ways to partition $2$ into two pieces ($2+0$ and $1+1$ and $0+2$)

*$2$ ways to partition $3$ into two pieces ($2+1$ and $1+2$. Notice we only have access to the powers in $1+x+x^2$)

*$1$ way to partition $4$ into two pieces ($2+2$)

It's worth thinking about why this is!
Similarly, the coefficient of $x^n$ in $(1+x+x^2)^3$ will give the number of ways to write $n$ as a partition of three integers, each between $0$ and $2$. Again, it's worth thinking about why this is.
So then, to compute the number of ways to partition $30$ into three pieces, each between $0$ and $15$, we're led to consider the $x^{30}$ coefficient in
$$
\left ( \sum_{k=0}^{15} x^k \right )^3
$$
Of course, we know that $\sum_{k=0}^{15} x^k = \frac{1 - x^{16}}{1 - x}$, so it's easy to ask
sage to compute its cube:
sage: p = (1 - x^(16)) / (1-x)
sage: s = p^3
sage: s.taylor(x,0,30).coefficient(x,30)
136

Which agrees with the computations people have made in the comments.
If you want to read more about this kind of stuff, you can find more in Chapters 14 and 15 of van Lint and Wilson's A Course in Combinatorics. A great reference is also Wilf's (excellent!) book generatingfunctionology which I recommend everybody read.

I hope this helps ^_^
A: Responding to added material by you approx an hour ago.

*

*Since the answer is to be in bills of $10\,$ dollars, cost of toilet is $30$ bills out of which $15$ bills have been paid, $15$ bills remain to be paid, and each person is still having $(20-5) = 15$ bills with them


*After the three have contributed $15$ bills, $30$ bills are remaining with them with an individual having anything between $0$ and $15$ bills


*We now apply stars and bars with inclusion-exclusion to get
Number of tuples remaining
$$= \binom{32}2 - 3\binom{16}2 = 136$$
P.S.
Actually, we could instead use simple stars and bars without inclusion- exclusion as $\large\binom{15+3-1}{3-1} =136$ for contributing for the purchase,
as taking out $15$ from three containers with $15$ each in anywhichway is exactly the same as putting in $30$ in three containers with a maximum of $15$ in each.
A: This problem is best solved using inclusion-exclusion.
Let us count the number of solutions to the equation,
$$ x_1 + x_2 + \dots + x_n = N $$
with the requirement that $1\leq x_i\leq b$.
Let $A$ denote all such $n$-tuples which sum of $N$, and $A_i$ those $n$-tuples whose $i$-th coordinate is $>b$. Then the solution to the problem is,
$$ |A| - \sum_i |A_i| + \sum_{i<j} |A_i\cap A_j| - \cdots $$
We know that $\displaystyle |A| = {{N-1}\choose {n-1}}$. To count $A_i$ that is equivalent to counting solutions to,
$$ x_1 + \dots + (x_i + b) + \dots + x_n = N $$
Therefore, $\displaystyle |A_i| = {{N-b-1}\choose {n-1}}$. A similar argument will show that $\displaystyle |A_i\cap A_j| = {{N-2b-1}\choose {n-1}}$.
Now it only remains how how $i$'s we have, how many pairs $(i,j)$ with $i<j$ we have, ect. Therefore, the total count is equal to,
$$ {{N-1}\choose {n-1}} - {n\choose 1}{{N-b-1}\choose {n-1}} + {n\choose 2}{{N-2b-1}\choose {n-1}} - \cdots $$
