# Generating functions or Counting

In how many ways can I collect a total of $20$ dollars from $4$ different children and $3$ different adults, if each child can contribute up to $6$ dollars, each adult can give up to $10$ dollars, and each individual gives a nonnegative whole number of dollars?

How should I start? Generating functions? Counting?

• Sounds like finding term $x^{20}$ coefficient in $(1+x+x^2+x^3+\dots+x^6)^4\cdot (1+x+x^2+x^3+\dots+x^{10})^3$. – Alexey Burdin Jun 6 '15 at 0:26
• And just for fun we can "mark" the number of donors who contributed the "limit" (as Joffan has based his counting argument on). with the bivariate g.f.: nn = 20; CoefficientList[ Series[(y x^6 + (1 - x^6)/(1 - x))^4*(y x^10 + (1 - x^10)/(1 - x))^3, {x, 0, nn}], {x, y}] // Grid – Geoffrey Critzer Jun 6 '15 at 13:34

\begin{align} {26 \choose 6} - 4{19 \choose 6} &- 3{15 \choose 6} + {4 \choose 2}{12 \choose 6} + 4\cdot 3 {8 \choose 6} \\[1em] &= 230230-108528-15015+5544+336 \\ &= 112567 \end{align}