Home > Riddles > Chameleons with a possible ending

Chameleons with a possible ending

Pure logicLevel 4/5

It is one of those problems where chasing specific configurations tends to get tiring rather than clarifying. The way out is to look at something more stable than the colors visible at each step.

On an island there are 4 red, 7 green and 10 blue chameleons. Every time two chameleons of different colors meet, they both change to the third color. 1. Is it possible to reach a state where everyone has the same color?

  1. If yes, what color or colors?

Hints

Show hints
  1. Don't follow specific one-on-one encounters; look for a magnitude that changes in a controlled way.
  2. Differences between quantities of colors behave in a particularly rigid manner.
  3. If an ending is possible, you will have to respect that restriction from the beginning.

Solution

Show full solution

Answer: Yes it is possible; The minimum is 7 meetings. Initial state:

$$ (R,G,B)=(4,7,10),\quad R+G+B=21. $$ Let: - $x$ = Red-Green encounters, - $y$ = Red-Blue matches, - $z$ = Green-Blue encounters. To finish all blue, we want $R'=0$ and $G'=0$ with: $$

R'=4-x-y+2z,

$$ $$

G'=7-x-z+2y.
$$ Solving:

$$ y=z-1,\quad x=z+5. $$ Total number of meetings: $$

x+y+z=(z+5)+(z-1)+z=3z+4.
$$ Minimum with $y\ge 0$ is $z=1$, then:

$$ (x,y,z)=(6,0,1),\quad x+y+z=7. $$ Concrete sequence (7 steps): 1. A Green-Blue match: $(4,7,10)\to(6,6,9)$. 2. Six Red-Green matches in a row: $(6,6,9)\to(5,5,11)\to(4,4,13)\to(3,3,15)\to(2,2,17)\to(1,1,19)\to(0,0,21)$. They are all blue. **Reusable idea:** in population dynamics, combine modular invariant with linear system to construct an optimal sequence. $$

Related riddles

Keep practicing

If you enjoyed this one, try more pure-logic riddles, explore this theme, browse the full archive, or read the riddle-solving guide.

← Previous: Mutilated board and dominoes · Next: The modular oracle →