PROFESSOR: The easiest way-- there are lots of ways to solve
this problem, but I think the easiest and most elegant way
to solve it is--
the thing that makes it hard is the fact
that these cubes can be rotated and moved around,
so the easiest thing is, imagine-- let's just sit
a cube, pick one, put it on the table,
and let's paint it with six colors.
And let's pick the first face.
Maybe we paint the top face.
Pick a color for that.
Well, we have six choices.
OK, now we got to paint another face.
Maybe we paint the one facing us.
We have five choices left for the color we choose there,
because we're not allowed to paint two faces the same.
And then we proceed on down.
We have four choices for the next--
3-2-1.
And so, we get 6 times, 5 times, 4 times, 3 times, 2--
or 6 factorial.
That part's easy.
The hard part of the problem is--
but what if we rotate that cube?
We could have made different painting choices
and wound up with the same cube if we rotated it,
and so the solution to that problem
is what's sometimes known as the shepherd's rule.
If you want to count a flock of sheep--
one easy way or maybe not so easy way to count them
is count their legs and divide by 4.
In order to count the different cubes that we can count,
I think the easiest way to do it is,
first, count all the ways you could paint it if you fixed it.
We figured that out.
That was 6 factorial--
and then figure out how many different orientations
are there of the cube?
And that takes a little bit of thought to figure out,
but if you imagine sort of picking up the cube by one
edge with your fingers--
maybe grab an edge.
Sort of as long as you've got a hold of the cube,
it can't move around, so you've sort of fixed in orientation.
Well, how many edges could you have grabbed?
Well, if you think about it for a minute,
there's like four along the top, four along the bottom,
and then four along the side.
So there's 12.
And for each of those edges, you could have grabbed it
with your thumb on either side.
You could grab it like that or like that.
So if I grab it like that, I could twist it.
So there's 12 times 2--
24 different orientations.
There's a lot of other ways to prove that,
but that's maybe the simplest one I can think of.
And so, then to count the number of distinct cubes,
you simply divide 6 factorial by 24, and you get 30.
There you have it.