At the end of the day, a bakery gives everything that is unsold to food banks for the needy. If it has $12$ apple pies left at the end of a given day, in how many different ways can it distribute these pies among six food banks for the needy?
How many different ways can the bakery distribute the $12$ apple pies if each of the six food banks is to receive at least one pie?
In order to solve this problem we use the formula
$$\binom{n+x-1}{x-1} $$
Does anyone know where this formula is derived from?
$ n= 12$ and $x =6$
$\Rightarrow \binom{12+6-1}{6-1} = \binom{17}{5}= \binom{17!}{5!*12!} = 6188$
The second part of the problem is where I get stuck at, any tips on how to solve this would be appreciated.
Matthew Conroy has given you a link. When you read it, you will find that the second part can be solved using Theorem $1$ therein.
However, I shall explain a way of solving it that requires you to remember only one formula, the one given.
Firstly, give one pie to each of the food banks. Now you need to distribute only $6$ in any which way, thus $\binom{6+6-1}{6-1}$