number of options to divide $n$ white balls into $r$ cells I am trying to solve the following question:
number of options to divide $n$ white balls into $r$ cells.
or, more specifically:
what is the number of options to divide 4 white balls into 3 cells?
Thank you!
 A: I will assume that there can be empty cells, in which case this problem can be solved using stars and bars.
If there are $n$ white balls and $r$ cells, we can think of this as arranging $r-1$ dividers among $n$ objects. Equivalently, we are choosing the places of $r-1$ objects in a line of length $n+r-1$. This is a combination:
$$\binom{n+r-1}{r-1}=\binom{n+r-1}{n}$$

In your example with $4$ white balls and $3$ cells, we have $2$ dividers and $6$ total objects, so the number of ways to place the balls in the cells is $$\binom{6}{2}= \frac{6 \cdot 5}{2}=\boxed{15}$$
A: This can be done using the stars and bars method.  What you do is you lay out the four white balls, then you place two bars somewhere in between each ball to create three partitions:
\begin{align}
|&& ||****&&| \\
|&&|*|***&&| \\
|&&|**|**&&| \\
|&&|***|*&&| \\
|&& |****|&& |\\
|&& *||***&& |\\
|&&*|*|** && |\\
|&&*|**|* && |\\
|&&*|***| && |\\
|&& **||** && |\\
|&&**|*|* && |\\
|&& **|**|&& |\\
|&&***||* && |\\
|&&***|*| && |\\
|&&****|| && |\\
\end{align}
In the first five, the first partition holds zero balls.  There are two bars plus four stars.  This means there are $2 + 4 = 6$ total positions (in the middle--I only drew the two bars on the outside to show the partitions).  All we need to do is choose the $4$ places for the $4$ stars or choose the $2$ places for the two bars: $\binom{6}{2}$$=$$\binom{6}{4}$$=15$.
In general, if you have $n$ balls (stars) and $r$ cells (thus $r - 1$ bars--think about that), then there are$\binom{n + r - 1}{n} = \binom{n + r - 1}{r - 1}$ ways to fill those $r$ partitions.
