Q:

Determine the number of ways n distinct marbles can be placed inside five jars.

Determine the number of ways n marbles can be placed inside five distint jars, if the 1st jar must contain 1 marble, 2nd jar must contain 4 marbles, 3rd jar must contain 5 marbles, 4th and 5th marble must contain 1 marble.
I figured this would mean subset is ($a_1$, $a_2$ + 4, $a_3$ + 9,  $a_4$ + 9, $a_5$ + 9) But I am not sure how to approach after this. Thank you for the help.
I know that base case for n is 12 marbles which will provide 1 combination does that mean the answer is $\binom{n-7}{5}$
This somehow does not seem right

A:

You're trying to solve the equation $$a_1+a_2+a_3+a_4+a_5+12 = n $$
So we have 5 categories and n-12 objects. So we can use the "stars and bars" method, sometimes known as combinations with repetition. We have to place 4 dividers amongst the n-12 objects. In other words, we have n-12+4=n-8 positions and want to choose 4 positions to place the dividers. The number of slots between divider $i$ and $i+1$ will be the value of $a_{i+1}$, with the proper understanding that the slots before the first divider is the value for $a_1$ and after the 4th divider constitutes $a_5$.
Thus we have $\binom{n-8}{4}=\binom{n-8}{n-12}$ ways to solve the equation.

