Chameleons Riddle – Modular Arithmetic Puzzle

modular arithmeticpuzzle

There are 10 red, 11 blue, 12 green chameleons. Sometimes, two
chameleons meet. If they are the same color, nothing happens. If they
are different colors, they will both change to the third color. Can
all chameleons ever be the same color?

Doesn't seem like it is possible but not quite sure how to prove it. Seems like it might have something to do with modular arithmetic.

Best Answer

Let $R$, $B$, and $G$ be the number of red, blue, and green chameleons at the moment. After any meeting of chameleons, we have one of $$R\mapsto R,\quad B\mapsto B,\quad G\mapsto G$$

$$R\mapsto R-1,\quad B\mapsto B-1,\quad G\mapsto G+2$$ $$R\mapsto R+2,\quad B\mapsto B-1,\quad G\mapsto G-1$$ $$R\mapsto R-1,\quad B\mapsto B+2,\quad G\mapsto G-1$$ Note that $B-G\pmod 3$, $R-B\pmod 3$, and $G-R\pmod 3$ are preserved under any meeting. Supposing (WLOG) that all chameleons at some point became green, then both $R$ and $B$ would be $0$, and thus $R-B\equiv 0\pmod 3$. But having started with $R-B\equiv 2\pmod 3$, this is impossible. Thus, the chameleons can never all be the same color.