In how many ways, we can paint 6 faces of a cube with 6 different colors. And the answer is not factorial 6!

To solve this problem, we will need to understand Linear and Circular arrangements.

We will start with a simple problem. What are the possible arrangements of three distinct objects say A, B, and C? Arrangements are ABC, ACB, BCA, BAC, CAB, and CBA. Altogether, we have six arrangements. Another way of looking at the problem is in terms of the number of choices for arrangement. For three objects we have three positions that are to be filled. For the first position we have three choices, we can place either A, B, or C. For the second position we now have two choices as one of the objects is already placed in the first position. And for the third, we have only one choice that is the last remaining object when the first two positions are already filled.

If we generalize the concept, then for n distinct objects, we have n positions. For the first position we have n choices, for the second we have n-1 choices, n-2 for third, and so on till we have last position and last object with only one choice. So the total number of ways of arranging n distinct object is n!

Now, what if, we have to arrange A, B, and C on a circle rather than on a line? On a circle, the possible arrangements are ABC and ACB and there is no other arrangement possible. So on the circle; we just have only 2 arrangements compared to 6 in a line. How do we make sense of that?

Let us try and arrange 6 linear arrangements (ABC, ACB, BCA, BAC, CAB, and CBA) on a circle.

{ABC, BCA, and BAC} are anticlockwise arrangements of ABC and { ACB, CBA, and CAB} are the clockwise arrangement of ABC. If we simply rotate the three arrangements {ABC, BCA, and BAC} they all represent the same arrangement ABC and in the same way rotation of {ACB, CBA, and CAB} reveals they are also same as ACB. So, we have only two cases on a circle instead of 6 cases.

The difference between a line and circle is a line always has a starting point and all the n! arrangements will be different. But on a circle, we do not have that luxury of having a starting point. So basically on a circle what we do is we choose any one object and assign it a place on a circle. And when we fix an object on a circle then all other objects are arranged anticlockwise relative to the first object. So on a circle, all we need to do is fix any object and then arrange remaining n-1 objects relative to it in n-1! Ways. Thus, the number of ways in which we can arrange n distinct object on a circle is (n-1)!

In the case of ABC, fix anyone says A on top of the circle and then arrange the other 2 anticlockwise in 2! Ways that are consistent with our answer that A, B, and C can be arranged in only two ways on a circle.

Now, we will come to 6 colors and 6 faces of a cube. As it is not a linear arrangement, the answer is not 6! All the six faces of a cube are identical and as it was in cyclic permutations there is no starting point here as well. So we need to fix one color on any one face and arrange all the other colors relative to it. So, out of these six colors, we need to paint any one face with any one color. So let us paint one face with say red. For the face opposite to the red color, we have 5 choices. Now let us put a color on the opposite face, say green. So, we now have a cube with two opposite faces painted with red and green and we are left with 4 unpainted faces and 4 colors. If we will rearrange the cube, then the problem now looks familiar. All there four faces are similar to arrangements on a circle. So four objects on a circle can be arranged in 3! Ways. Total number of ways of painting this cube will simply be 5X3!=5X6=30