# Number of ways to color a cube

How many ways can you color the sides of a cube using three distinct colors such that no two opposite sides are painted the same color?

I tried this: Consider any side of the cube. You can color it in $$3$$ ways and then the other side can be colored in $$2$$ ways, which gives $$3\times 2 = 6$$ ways for each "pair" of opposing sides. Since there are $$4$$ such pairs of opposing sides, we get $$6 \times 3 = 18$$ ways.

However, I think that this overcounts the number of ways since I don't take the symmetries of a cube into account. I know that there aren't too many possibilities, and I can probably enumerate them all, but I was trying to find some clever way to count this quantity. Maybe someone knows a way.

• There are $3$ pairs of sides, not $4$, since a cube has $6$ sides (not $8$). So the final result, according to your train of thought, should be $6 \cdot 3 = 18$ ways. – Daniel P Oct 26 '19 at 16:56
• I assume side means face, not edge? – Hagen von Eitzen Oct 26 '19 at 17:07
• Yes, side means "face" not "edge" – user718934 Oct 26 '19 at 17:22

We can first "fix" one side to be at the bottom. We then have $$2\times 3=6$$ possibilities to paint the bottom and the top side. For each of these $$6$$ possibilities, we have another $$6$$ to paint left and right and for each of those another $$6$$ for front and back of the cube. This leaves us with $$6\times 6\times 6=216$$ possibilites.

Now we can take symmetry into account. There are six faces which can be at the bottom and for each of those another 4 ways to rotate the cube. This leaves us with a total of $$\frac{216}{6\times 4}=9$$ ways of painting the cube.

So from each of the axes, exactly one colour of red, green, blue is missing.

• If the same colour (say, green) is missing from all axes, then we can always move the cube in such a way that the top, the left, and the front face are red, and the bottom, the right, and the back face are blue. So there is really just one such pattern, but with three choices of missing colour, we count $$3.$$

• if one colour (green) is missing from one axis and the same other colour (red) from the other axes, then we can move the cube so that the top face is red and the bottom is blue. Now we can still rotate around the $$z$$-axis to achieve that the left and the front are green, and the right and the back are blue. Again there is really just one such pattern, but with three choices of once-missing colour and two choisec of twice-missing colour, we count $$6.$$

• If each colour is missing from one axis, we can move the green-free axis to the vertical and achieve that top is red and bottom is blue. Then we can still rotate to make the front red and the back green (from the blue-free axis). Now the cube is fixed, but we might have blue on the left and green on the right face or vice versa. Thus we have another $$2.$$

In total, I count $$3+6+2=11.$$

I get $$11$$.

Write each pair as either AB, AC or BC.

We have three cases: all the same (3 options - we always get a corner of each colour, and there are three pairs to choose from), two the same, one different (6 options - put the two the same on first (3 ways by colours), the last is non-orientable, and two pairs to choose from) and all three different (2 options as the last pair is orientated and the colours don't matter).