# 5. The factory paints cubes in 6 colors (each face in its own color, the set of colors is fixed). How many varieties of cubes can be produced?
Solution: Suppose the procedure of painting the cube goes as follows: an unpainted cube is placed in a machine in a certain fixed position, and then its faces are painted in a certain order: bottom, top, right, left, front, back. First, let's calculate how many ways such a painting can be done. The bottom face can be painted in any of the six colors. After that, there are only five possibilities for the top face, as one color has already been used. Then the right face can be painted in four ways, the left face in three, the front face in two, and there is no choice for the color of the back face - it must be painted in the remaining unused color. Therefore, the total number of ways to paint is $6 \cdot 5 \cdot 4 \cdot 3 \cdot 2=720$. However, the number of different types of cubes is much less, since the cube can be placed in a fixed position in various ways. How many? The cube can be placed on any of its six faces and then rotated in one of four ways - giving a total of $6 \cdot 4=24$ ways. Therefore, the number of types of cubes is 24 times less than the number of ways to paint, which is 30.