General Question

LostInParadise's avatar

Can you solve this checkerboard color reversing problem?

Asked by LostInParadise (31915points) August 7th, 2010

To keep the numbers small, consider a 5 by 5 checkerboard. If you are able to reverse the colors in any combination of rows and columns, how many patterns are possible? Note that if a square belongs to both a flipped row and a flipped column it retains its original color. Be careful. The problem has a trap in it for the unwary.

Observing members: 0 Composing members: 0

14 Answers

lapilofu's avatar

Are we to consider rotational symmetries distinct or the same?

gasman's avatar

…mirror reflections, too?

LostInParadise's avatar

Keep it simple. Consider all the various symmetries as distinct.

lapilofu's avatar

Is it 2^8? I haven’t worked it out carefully, but that’s my guess after some cursory work.

Or maybe 2^8*25? Maybe I should do this on paper…

LostInParadise's avatar

You have the right idea, but I don’t know why you are choosing 8 as the exponent.

gasman's avatar

I think this is a non-trivial problem which I haven’t seen before. Haven’t found any traps yet. What’s tricky is that you can flip rows or columns independently in any sequence. My intuition is that it matters whether the side of the board is odd or even. Flipping a row or column in a 5×5 board will change its parity—whether it has an excess of white square or black squares, and that might be relevant to the solution. I think I should work on a 3×3 before tackling 5×5…

The 3×3 can be represented as:

101
010
101

or

010
101
010

[addendum] Just fooling around with it I’m guessing that you might be able to achieve any desired pattern of the 2^n possible, where n is the order of the board. In the case of the 5×5 it would be 2^25. But I’m not actually stating this as a theorem. It’s possible—as with Rubik’s Cube—that not all conceivable states can be reached through an arbitrary sequence of moves. Here’s where it might help to know some group theory, which I don’t.

gasman's avatar

…meant to say 2^(n^2) possible…

gasman's avatar

Actually, for a 5×5 maybe the answer is 2^10, where 10 = 5+5 is the total number of rows or columns. Flipping any twice in a row is the same as doing nothing. None of these observations, unfortunately, seem to actually help.

LostInParadise's avatar

2^10 is the trap answer. Consider the possibility that different sets of flips result in the same color pattern.

LostInParadise's avatar

Here is the solution encoded in ROT13, so that you will not be distracted by the answer if you want to do this on your own.

Gurer ner svir uhaqerq gjryir cnggreaf. Rnpu ebj naq pbyhza vf rvgure syvccrq be abg tvivat gjb gb gur gragu cnggreaf. Ubjrire, gurfr cnggreaf qb abg nyy unir qvfgvapg pbybe cnggreaf. Va cnegvphyne, syvccvat rirel ebj naq pbyhza vf gur fnzr nf abg syvccvat nal bs gurz. Gurer ner guhf gjb syvccvat cnggreaf sbe rirel pbybe cnggrea, tvivat gjb gb gur avagu pbybe cnggreaf. Gb trg gur rdhvinyrag syvccvat cnggrea sbe n tvira bar, whfg nqq gur cnggrea bs syvccvat nyy ebjf naq pbyhzaf, erfhygvat va n xvaq bs artngvir bs gur bevtvany. Sbe rknzcyr, gur rdhvinyrag bs syvccvat gur svefg guerr ebjf naq ab pbyhzaf vf syvccvat gur ynfg gjb ebjf naq nyy gur pbyhzaf.

gasman's avatar

OK, @LostInParadise, I decoded the answer & it makes some sense but I’m not sure I agree with it. Before discussing further, however, I don’t want to spoil it for others.

LostInParadise's avatar

Try working with a 2 by 2 checkerboard. This is small enough that you can write down all the patterns and they are also easy to describe. You will see that the total number of them can be computed by the same type of formula as in the case of the 5 by 5 checkerboard.

gasman's avatar

Since nobody else seems to be working on this, let me start by posting a translation of your earlier encoded answer:

There are five hundred twelve patterns. Each row and column is either flipped or not giving two to the tenth patterns. However, these patterns do not all have distinct color patterns. In particular, flipping every row and column is the same as not flipping any of them. There are thus two flipping patterns for every color pattern, giving two to the ninth color patterns. To get the equivalent flipping pattern for a given one, just add the pattern of flipping all rows and columns, resulting in a kind of negative of the original. For example, the equivalent of flipping the first three rows and no columns is flipping the last two rows and all the columns.

My objection to all of this had been that the sequence of moves matters, i.e., that flipping any row followed by any column is non-transitive—reversing the moves matters. This, however, appears not to be the case—or at least I haven’t found a counter-example. If I could prove that all such operations are pairwise transitive, despite the counter-intuitive feeling I have about it, then I accept your solution.

Is there some key bit of insight leading to an obvious mathematical proof? This is starting to bug me! Interesting problem, btw.

LostInParadise's avatar

Each square will be flipped either no times (neither the square’s column nor row is flipped), once (only its row or only its column is flipped), or twice (both column and row are flipped). This holds true regardless of the order that the flipping is done.

And thanks for your kind words.

Answer this question

Login

or

Join

to answer.

This question is in the General Section. Responses must be helpful and on-topic.

Your answer will be saved while you login or join.

Have a question? Ask Fluther!

What do you know more about?
or
Knowledge Networking @ Fluther