weird combinatorics, combinations question from cambridge challenge exercise 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$
 A: Why is it the case that this problem can be reduced to the problem of finding four non-negative numbers that sum to $10$? That is because in the end, every box is going to be painted with some colour, which  gives $10$ as the total number of blocks,but it's possible that some colours could be left out, in which case their contribution to the above sum would be zero. Thus the problems are the same and have the same answer.
As for the second problem, suppose you have some four non-negative numbers $x_1+x_2+x_3+x_4=10$. Now add $4$ on each side in this fashion: $(x_1 + 1)+(x_2 + 1)+(x_3+1)+(x_4+1)=10+4=14$. Note now  that if we let $y_i=x_i+1$ then the $y_i$ are strictly positive integers summing to $14$. Hence our problem now reduces to finding the number of strictly positive solutions to the problem $y_1+y_2+y_3+y_4=14$.
But now, this can be done in the following manner: Suppose I draw $14$ dots right here:
$$
\cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \ \cdot 
$$
Now we can represent a sum of $14$ using $4$ integers by doing a partition of these dots. I'll explain with an example: Suppose you want to represent $14=4+2+4+4$,then you would show it as:
$$
\cdot \cdot \cdot \ \cdot \mid \cdot \ \cdot  \mid \cdot \cdot \cdot \ \cdot \mid \cdot \cdot \cdot \ \cdot 
$$
Similarly for $14=7+1+5+1$,
$$
\cdot \cdot \cdot \cdot \cdot \cdot \cdot \mid \cdot \mid \cdot \cdot \cdot \cdot \cdot \mid \cdot 
$$ 
Now do you see! To constrcut a partition of $14$ into $4$ positive integers, we had to choose how to put $3$ dividers in $13$ slots, so that $4$ groups of dots are created, each of which are not empty and the total being $14$. It follows that the answer is $\binom{13}{3}$, or $\frac{13!}{3!10!}=286$.
As an exercise, think about what would happen if the blocks were distinct as well, and if blocks had $6$ faces, each face can be differently coloured.
A: HINT:
Calculate the number of ways to write $10$ as a sum of $4$ non-negative integers.
A: If the bocks were numbered $1$ through $10$ then the answer would be simply $4^{10}$. But all the blocks are identical so the problem is a little harder. Imagine you coloured all the blocks and then lined them up by colour, perhaps all the reds then all the greens ect... we would have a picture like this:
$$[\;\;]\ [\;\;]\ {\Big|}\ [\;\;]\ {\Big|}\ [\;\;]\ [\;\;]\ [\;\;]\ {\Big|}\ [\;\;]\ [\;\;]\ [\;\;]\ $$
Where "$|$" divides the groups of boxes. Since this arrangement would uniquely describe the colouring of the blocks (up to order which we don't care about) the number of ways to colour the blocks is the number of ways to make this arrangement, thus the number of ways to choose the position of the dividers "$|$".
$$N={13\choose 3} = 286$$
With $n$ blocks and $m$ colours the number of colourings is given by 
$$N = {n+m-1\choose m-1}$$
which is indeed the number of ways to sum $m$ numbers to $n$.
A: A common way to explain it is known as "stars and bars".
I shall illustrate it by "dipping" identical balls (blocks) 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
