Derrangments function for coloring a chess table

37 Views Asked by At

How many ways are there to color a chess table of size n*n with n different colors. We color in such a way that in each horizontal row there are all colors and at the same time in no vertical row there are two fields of the same color next to each other. I think we can use derangements for this but I'm not sure how.

1

There are 1 best solutions below

11
On BEST ANSWER

Fill in the first row any way you like. How many options? Now, you are correct, the second row has to be a derangement of the first. How many options there? Each row in turn is a derangement of the one above.