How many ways to paint a board

arithmeticcombinatoricscontest-math

How many ways can you paint the squares of a $ 3$ x $3 $ board with $5$ colors so that each row, column and diagonal has $3 $ distinct colors?

What I tried:

  • House $b2 $ can be painted in $ 5$ ways
  • The color of a1 should be different from the color of $ b2$, so $a1$ can be painted in $ 4 $ ways
  • $c3 $ color should be different from $b2$ and $a1$ color, so we have $3 $ shapes
  • $c1$ color should be different from $b2, a1$ and $c3$, so there are $2$ modes
  • The color of $a3 $ should be different from the colors of $b2, a1, c3 $ and $c1, $ so we have $ 1$ mode only
    We have until then $ 5!$ modes let's go to the other houses
  • The color of $a2$ should be distinct from the colors of $ a1, a3$ and $b2$, so there are $ 2$ modes. For houses $b3, c2$ and $b1$ we can do the analogous reasoning, thus having $2 ^ 4 = 16$ ways of painting such houses

Total = $ 5! * 16 = 1920$ modes

I don't know if I'm right, being or not being right, how to formalize a solution to this question?

Best Answer

I think you have the right answer, and I think your argument is essentially the same as mine.

I think you could write it more efficiently, by looking at the five squares on the two diagonals together. Each of these squares is in the same row, column or diagonal as the other four, so they must all be different and can be coloured in $5!$ ways.

Then there are only two possible choices for the remaining ('side') squares ie the two colours of the opposite corners (the ones a knight's move away), giving the factor $2^4=16$. Note that all these colourings do work because the colour of a corner square can only appear in the two side squares a knight's move away, and these three squares are not in the same row, column or diagonal. The colour of the centre square is only used once.

I think you have argued nicely, but have not quite shown that all the $16$ arrangements qualify (it looks obvious) - and have got the right result.

Related Question