# Painting a 6x6 with 3 colours

Can you paint a 6x6 grid in red, green and blue, such that its every 3x3 sub-grid contains exactly 5 red, 3 green and 1 blue cell?

Good luck!

Will this work?

$$r r r r r r$$
$$r b r r b r$$
$$g g g g g g$$
$$r r r r r r$$
$$r b r r b r$$
$$g g g g g g$$

• You've go it! In fact there is a simple algorithm that can find solutions for arbitrary grid sizes, number of colors and their counts. – Dmitry Kamenetsky Oct 1 '19 at 0:47
• @DmitryKamenetsky, nice! Thanks. – ppgdev Oct 1 '19 at 0:52

Yes. (I can paint it in such a way)

Reasoning

There are at least $$9!/3!5!=504$$ different arrangements that work
My method of producing them is to take any 3 x 3 grid that satisfies the condition, and tile it into a 6 x 6 grid.
This works because any 3 x 3 sub-grid of a 6 x 6 always contains the same cells of the original 3 x 3 grid.

There are possible arrangements that are not tilings like these, but I have not looked for them.