Fog Creek Software
Discussion Board


It is never possible to get the chameleons of the same colors. The only time it is possible, when the chameleons of two different colors in the same number ( for example y Reds, y Greens and the rest blue ). Assuming the x frogs of two different color meet

The three possible scenarios are

Scenario 1:


Scenario 2:

Scenario 3:

None of these equations satisfies the condition to make frogs of 2 different color in equal numbers.

Saturday, December 07, 2002

Hello, Raj
Why do you think this cover all possible cases?

How about some CRC in here?

We can sum up chameleons of different colors with different ratio and mod (%, division by modulo) with some other number, e.g. reds weight 0, greens weight 1 and blues are 2. CRC will be sum % 3. Just a bit different from familiar (mod 256 CRC).

This was just out of instinct to get something stable over chameleon's color changes. Let's check if we can rely on CRC:

Red+Green = 0+1 (CRC=1) => Blue+Blue = 2+2 (CRC=4%3=1)
Red+Blue = 0+2 (CRC=2) => Green+Green = 1+1 (CRC=2)
Green+Blue = 1+2 (CRC=3%3=0) => Red+Red = 0+0 (CRC=0)

Yep, our CRC remains constant while chameleons playing their games. All we have to do now is to compare CRCs for original and all desired paintings:

original CRC = (13*0 + 15*1 + 17*2)%3 = 1

all red CRC = (45*0)%3 = 0
all green CRC = (45*1)%3 = 0
all blue CRC = (45*2)%3 = 0

you were absolutely right, Raj - no way all chameleons can have the same color.

Tuesday, December 17, 2002

*  Recent Topics

*  Fog Creek Home