I have five eggs to color for Easter. I can color them red, yellow, or blue. How many ways are there to do this? Not sure if my thinking is correct on this problem.  I have five eggs to color for Easter. I can color them red, yellow, or blue. How many ways are there to do this?
I was thinking 5 * 5 choose 3 since you would have 3 choices for color for each egg.  Not sure if this would be correct though. Let me know what you think.
 A: Let us assume that order does not matter, and that eggs of the same colour are indistinguishable. Then the problem is a standard Stars and Bars problem. The Wikipedia link gives a quite thorough explanation.  
Briefly, we find the number of ways to distribute $5$ eggs (candies) between $3$ colours (kids). One or more kids may get nothing.  
It is easier to think of the distribution as going as follows. We distribute $8=5+3$ candies among the $3$ kids, at least one to each kid, and then take away a candy from each kid. Or, if you want to be less cruel, we assign colours to $8$ eggs, with each colour being used on at least one egg, and then eat an egg of each colour.
Put down the $8$ candies like this
$$\ast \qquad  \ast \qquad\ast \qquad\ast \qquad\ast \qquad\ast \qquad\ast \qquad\ast$$
This determines $7$ intercandy gaps.  Choose $2$ of these gaps to put a separator into, perhaps like this
$$\ast \qquad  \ast \quad|\quad\ast \qquad\ast \qquad\ast \qquad\ast \quad|\quad\ast \qquad\ast$$
This means Kid Red gets $2$ candies, Kid Yellow gets $4$, and Kid Blue gets $2$.
There are just as many ways to insert the two bars as there are to distribute the $8$ candies, at least one to each kid. Since there are $7$ intercandy gaps, there are $\binom{7}{2}$ ways to do the job.
Remark: For our case of $5$ and $3$, and indeed $n$ and $3$, the explicit enumeration of the answer by  drhab is I think better.  But the Stars and Bars technique comes up fairly often, so it is a good idea to get some exposure to it. 
A: Consider a simpler problem. Suppose that you have just one egg. How many ways are there to color that egg using red, yellow or blue? The answer is: $3$, right?
Now, instead of one egg, you have two. How many ways can you color the second one? The answer is again $3$, right? 
But, recall that you had $3$ ways to color the first egg. Thus, for every possible color choice for the first egg, you can color the second one in $3$ ways. Therefore, the two eggs can be colored in $3 * 3$ ways.
So, the final answer is ...?
A: If the order of colouring is relevant then look at the other answers. If not then you must look in how many different ways $5$ can be written as sum of three nonnegative integers. You have $5=R+Y+B$ and:
$5=5+0+0$
$5=4+1+0$
$5=4+0+1$
...
et cetera. This gives $1+2+3+4+5+6=21$ possibilities.
A: First egg you can color red, yellow or blue, for second you can also use red, yellow or blue. This can be applied for each egg.
So you have $$3^5$$ options to color eggs.
For $n$ eggs and $k$ colors you can use $k^n$ options to color eggs.
For example(binary coding): You have two colors $k=2$ (red, blue; green, black; 1, 0;...) and you have $n=3$ eggs, you can color this by $2^3=8$ ways:


*

*$0,0,0$, or $red,red,red$(for red and blue colors)

*$0,0,1$, or $red,red,blue$

*$0,1,0$, or $red,blue,red$

*$0,1,1$, or $red,blue,blue$

*$1,0,0$, or $blue,red,red$

*$1,0,1$, or $blue,red,blue$

*$1,1,0$, or $blue,blue,red$

*$1,1,1$, or $blue,blue,blue$

A: You have five eggs and three colors.  Here is a brute force approach:
five all the same color
say there will be three of these B - blue, R- Red, W white
BBBBB,RRRRR,WWWWW
When we have two colors in play there can be either RB, RW, or BW
say
RBBBB BWWWW RWWWW
RRBBB BBWWW RRWWW
RRRBB BBBWW RRRWW
RRRRB BBBBW RRRRW
So that would add 12 more.
When there are three colors we would have
RBW + either BB,WW,RR, or BW, BR, RW giving
RBWRR RBWBW
RBWBB RBWBR
RBWWW RBWRW
for the remaining eggs
This adds six more for a total of 21 ways of displaying three colors around 5 eggs.
Not sure if I'm overlooking something obvious.  Is there a neat way of solving this with the permutation/combination formulation?
