1. The problem statement, all variables and given/known data I was asked this question by my friend, unable to do it I did a google search. Here's the question: http://math.stackexchange.com/questions/64857/painting-the-faces-of-a-cube-with-distinct-colours I am quoting the question and the answer posted at stackexchange: 2. Relevant equations 3. The attempt at a solution I need some help in understanding the solution. The first post (answer) in that link finds out the number of configurations. Doesn't these configurations depend on the colour of the face which is just opposite to the red coloured face? I can't even understand the step the poster has done next. Any help is appreciated. Thanks!