1

$x$$1$+$x$$2$+$x$$3$+$x$$4$+$x$$5$ = 8

where $x$$i$'s can take values $\{0,1,2,3\}$.

s0RRy
  • 61

1 Answers1

2

In this case, it's easy to check by hand that the only solutions are \begin{align*} 0+0+2+3+3&=8\\ 0+1+1+3+3&=8\\ 0+1+2+2+3&=8\\ 0+2+2+2+2&=8\\ 1+1+1+2+3&=8\\ 1+1+2+2+2&=8, \end{align*} up to permutations of the terms in the different sums. Thus the number of solutions is $$\frac{5!}{2!\,2!}+\frac{5!}{2!\,2!}+\frac{5!}{2!}+\frac{5!}{4!}+\frac{5!}{3!}+\frac{5!}{2!\,3!} = \boxed{155}.$$ It's easier to order the set of quintuples (say lexicographically like I did) when coming up with these.

Alternatively, you can construct a generating function for the problem, in this case $(1+x+x^2+x^3)^5$ is suitable, and study the coefficient of $x^8$, which is $\boxed{155}$.


If you are not familiar with generating functions, read this short example of how they can be used to solve counting problems. They are a very useful tool when it comes to solving counting problems like this one.

Luke Collins
  • 8,748