TITLE: weird combinatorics, combinations question from cambridge challenge exercise
QUESTION [5 upvotes]: A child has $10$ identical blocks, each of which is to be painted with one of $4$ colours. 
how many different ways can the $10$ blocks be painted?
Answer is $286$ but I have no idea how they got it.
From cambridge year ten book $2$

REPLY [12 votes]: A common way to explain it is known as "stars and bars". 
I shall illustrate it by "dipping" identical balls (boxes) into distinct bins (of colours) numbered $1-4$, and depict the results obtained
One result could be $\;\;\bullet\bullet\bullet|\bullet\bullet\bullet\bullet|\bullet
|\bullet\bullet\;\to\;\;  3-4-1-2$ of each of the colours.
Make two notes: only $3$ dividers are needed to depict $4$ bins, and some bins could remain empty, e.g. $|\bullet\bullet\bullet\bullet\bullet\bullet\bullet|\bullet\bullet\bullet|$ depicting $\;\;0-7-3-0$
So if there are $n$ balls and $k$ bins ($k-1$ dividers), the only choice you have is to place the dividers among the lot, thus
$\dbinom{n+k-1}{k-1}$ which works out to $\dbinom{10+3}{3} = 286$ for your particular example.
You can look here if you need a a more technical explanation