# The Chameleons Problem

At one point, a remote island’s population of chameleons was divided as follows:

* 13 red chameleons
* 15 green chameleons
* 17 blue chameleons

Each time two different colored chameleons would meet, they would change their color to the third one. (i.e.. If green meets red, they both change their color to blue.) is it ever possible for all chameleons to become the same color? why or why not? If the number iof chameleons are a,b and c., is it possible to arrive at a condition for this to be possible??

Here is the solution:

let f(a,b,c) = |a-b| + |b-c| + |c-a|.

Then for each operation, the f() value changes by 0,3,6; anyway the changes is 3k. So if finally all have the same color,

then f() = 2(a+b+c).

In the case a=13, b=15, c=17, f()=8;
Finally we need f()=2(13+15+17)=90.

This implies 8+3k = 90. This is impossible for an integer value of k.

If a=6, b=6, c=33,

Intially, f()=0+27+27=54

Final value would be f()=2*(45).

54+3k=90 is possible when k=12.

I guess that solves it.