Combinations/Permutations question (would like the source as well) My friend posed me this question; but she could not remember where she had gotten it from and would like to know, as she reworded the question but the data is still the same; just that the vocabulary was made more succinct.
Also, would appreciate if someone could show how to do it.  
Question:
A pack of sweets contains $25$ sweets, a combination of mini-cupcakes and mini-macarons. If there are $18$ varieties of mini-cupcakes, and $10$ varieties of mini-macarons, how many ways can you fill a pack of sweets assuming that the order does not matter i.e. only the amount of each sweet type in the pack matters?
 A: Hint.
(Preassuming that a pack of sweets is allowed to contain $25$ mini-cupcakes or mini-macrons)
There are $28$ varieties in total, so actually are looking for the number of sums: $$v_1+\cdots+v_{28}=25$$where the $v_i$ are nonnegative numbers.
This can be solved with stars and bars.
If the pack of sweets is not allowed to contain $25$ mini-cupcakes or mini-macrons then this can be repaired by subtracting the number of cases where $v_1+\cdots+v_{18}=0$ and the number of cases where $v_{19}+\cdots+v_{28}=0$.
A: No idea on the source, but as for the solution:
Let the number of cupcakes be $c$, and the number of macarons be $m$.
The first statement gives us $c + m = 25$.
So for each pair of values $c,m$, you'd need to calculate how many different combinations of varieties are possible. To do this, consider the number of ways you can divide $c$ cupcakes between $b$ boxes, where each box represents one variety of cupcake and empty boxes are allowed. Calculate the same quantity for the macarons, and multiply together.
Then you just sum those products for all combinations of $c,m$.
Hint 1:

 You can arrange 3 items into 3 boxes in the following ways:
 XXX||
 XX|X|
 XX||X
 X|XX|
 X|X|X
 X||XX
 |XXX|
 |XX|X
 |X|XX
 ||XXX
 Can you work out a general formula for putting $x$ objects into $b$ boxes?

Hint 2:

 $x$ items can be put into $b$ boxes in $\left(\array{x+b-1\\b-1}\right)$ ways. Imagine the items in a line. You can divide them into $b$ groups by inserting $b-1$ dividers. There are a total of $x+b-1$ objects - items and dividers. So there are $\left(\array{x+b-1\\b-1}\right)$ ways of inserting the dividers.

A: A permutation in which the order does not matter is known as a combination. If the number of permutations of permutations of a set of n objects if given by the factorial $ n! $ then it is a exercise in combinatorics to show that if we want to choose a combination of $k$ objects from a collection of $n$ objects we have $n!/k!(n-k)!$ ways of doing so, which is also given in the notation $ n \choose k$.
Addressing the question, one way is to count according to how many mini-macaroons can be included in a pack of sweets. If for instance, we want to know how many packs of sweets have 8 mini-macaroons, we choose 8 varieties of mini macaroons from the 10 varieties of mini-macaroons, $10 \choose 8$, then to make up the packet of 25 sweets, we choose 17 mini-cupcakes from the 18 varieties of mini-cupcakes, $18 \choose 17$, then the total number of packs of this type is given by the product $10 \choose 8$$18 \choose 17$. Then to find the total of all types, simply sum over all the possible ways
$\sum_{i=7}^{10}$ $10 \choose i $ $18 \choose 25-i$
A: Indicating the number of m.-cupcakes as $x$, and that of m.-macaronis as $y$,
then we shall have
$$
\left\{ \matrix{
  0 \le x \le 18 \hfill \cr 
  0 \le y \le 10 \hfill \cr 
  x + y = 25 \hfill \cr}  \right.
$$
which, geometrically corresponds to the sketch below.

The solution is just
$$
\begin{gathered}
  \left\{ \begin{gathered}
  0 \leqslant x \leqslant 18 \hfill \\
  0 \leqslant y \leqslant 10 \hfill \\
  x + y = 25 \hfill \\ 
\end{gathered}  \right.\quad  \Rightarrow \quad \left\{ \begin{gathered}
  0 \leqslant x \leqslant 18 \hfill \\
  0 \leqslant 25 - x \leqslant 10 \hfill \\
  x + y = 25 \hfill \\ 
\end{gathered}  \right.\quad  \Rightarrow \quad  \hfill \\
   \Rightarrow \quad \left\{ \begin{gathered}
  0 \leqslant x \leqslant 18 \hfill \\
  15 \leqslant x \leqslant 25 \hfill \\
  x + y = 25 \hfill \\ 
\end{gathered}  \right.\quad  \Rightarrow \quad \left\{ \begin{gathered}
  15 \leqslant x \leqslant 18 \hfill \\
  x + y = 25 \hfill \\ 
\end{gathered}  \right. \hfill \\ 
\end{gathered} 
$$
