Can you paint the cells of a 5x5 grid in 5 colours such that for each cell its colour and the colour of its orthogonal (horizontal and vertical) neighbours are all different?
3 Answers
Someone had the right idea:
abcde cdeab eabcd bcdea deabc
Now in Technicolor, so you can see it for yourself:
-
1$\begingroup$ And the same applies for the diagonal neighbours independently. And the edges "wrap". $\endgroup$ Oct 27 at 14:03
-
$\begingroup$ This is correct, well done! Love the technicolor :) $\endgroup$ Oct 27 at 14:04
-
$\begingroup$ I wonder why, mathematically, rot13(ebgngvat nopqr ol gjb naq guerr) yield valid solutions. Does it have anything to do with rot13(zbqhyne nevguzrgvp)? $\endgroup$– SomeoneOct 27 at 14:15
-
$\begingroup$ @Someone I think it's more that they're effectively mirrors of the same operation. if you were to flip the board over horizontally and relabel the colors I'm pretty sure one would come out as the other $\endgroup$– juiciferOct 27 at 14:22
-
$\begingroup$ Yeah, they're interchangeable, and reflections of each other. But I'm having trouble finding a non-trivial non-bonus solution. $\endgroup$– SomeoneOct 27 at 14:23
Trivial Solution (similar to others')
And of course, it also grabs the bonus:
Let a, b, c, d, e be the colors. Then:
| a | b | c | d | e |
| d | e | a | b | c |
| b | c | d | e | a |
| e | a | b | c | d |
| c | d | e | a | b |
How I got there:
If you take
abcde
, place it in the first row, and then right-shift it by three for each row, you get this system.
-
$\begingroup$ Oh, I misread the question. Might as well look for another solution… $\endgroup$– SomeoneOct 27 at 14:10
-
$\begingroup$ I made it more readable but unfortunately tables don't work in spoilers. $\endgroup$ Oct 27 at 14:10
-
-
$\begingroup$ Is this the same solution as the accepted one? Are there any other solutions (perhaps without the bonus)? $\endgroup$ Oct 27 at 14:16
-
$\begingroup$ They're not the same, but they have a similar idea to each other and my first solution—rot13(gnxr n ebj bs gur svir pbybef naq fuvsg gurz nebhaq). $\endgroup$– SomeoneOct 27 at 14:17
Initially I assumed this was a Latin square question (but that was not actually mentioned). I got the following symmetrical solution:
-
$\begingroup$ This doesn't work, sorry. It wasn't a latin square question, but it turned into one :) $\endgroup$ Oct 28 at 9:45
-
$\begingroup$ That was my original solution, but I misread the question. $\endgroup$– SomeoneOct 28 at 16:30
-
$\begingroup$ @DmitryKamenetsky Well this is disappointing. I have received two downvotes for my answer even though none of my colored squares have a horizontal or vertical neighbour of the same color. Plus I did use 5 colors as requested. I feel I have correctly answered the question that was asked. $\endgroup$ Oct 28 at 19:44
-
2$\begingroup$ @WeatherVane Okay! I see the difference now. I had interpreted the question to only mean that each cell would be colored different from its orthogonal neighbours but now I see that also the 4 orthogonal neighbours must all be distinctly colored. $\endgroup$ Oct 28 at 23:29
-
1$\begingroup$ @DmitryKamenetsky Thanks! Sometimes it’s hard to word things simply and clearly. I thought about how I would word your question and I couldn’t think of a simple way to express it. $\endgroup$ Oct 29 at 6:09