This question is from an intro to probability course, and while I have the solution, I felt the explanation was lacking so I'm hoping for someone to help understand how one arrives at the answer.
Question:
A candy factory has an endless supply of red, orange, yellow, green, blue, black, white, and violet jelly beans.
The factory packages the jelly beans into jars in such a way that each jar has
200 beans, equal number of red and orange beans, equal number of yellow and green beans,one more
black bean than the number blue beans, and three more violet beans than the number of white
beans.
One possible color distribution, for example, is a jar of 50 yellow, 50 green, one black,
48 white, and 51 violet jelly beans. As a marketing gimmick, the factory guarantees that no
two jars have the same color distribution. What is the maximum number of jars the factory can
produce?
Using basic algebra I was able to get this point:
$x + y + z + v = 98$
So it seems I need to figure out all the ways these 4 variables can add up to to 98.
At first I was thinking ${98 \choose 4}$ , but apparently this is wrong.
The correct solution is ${101 \choose 3}$
Can someone help me understand the solution (remember this is an intro class, so I probably won't be familiar with more advanced concepts)?
Thank you.
Once you clear away the complications, as you have, the 4-way partition of $98$ can be regarded as inserting 3 dividers into a set of 98, which indicate the place where the colour changes. You can satisfy yourself that this accounts for all qualifying options.
This makes it a "stars and bars" problem.
The $101$ in the textbook answer of $\binom{101}{3}$ is the $98$ items plus the $3$ category dividers. Choosing $3$ is selecting where those dividers go.