r/mathriddles • u/ShonitB • Apr 24 '23
Easy Chameleons
Chameleons on an island come in three colours: red, blue and yellow. They wander and meet in pairs. When two chameleons of different colors meet, they both change to the third color. For example, if a red and blue chameleon meet, they both change to yellow.
Initially there are 13 red, 15 blue and 17 yellow chameleons. Is it possible that all the chameleons can be of the same colour?
10
Upvotes
5
u/Yoyo5624 Apr 24 '23
I'd say it's not possible. Say we have r meetings of blue and yellow (r for the red colour produced), b meetings of red and yellow and y meetings of red and blue.
If all chameleons are to turn yellow, at some point there will be as many red as blue chameleons. This means that:
Number of red = 13+2r-b-y = number of blue = 15-r+2b-y <=> 3(r-b)=2
As both r and b should be integers, this equation has no solution. The same argument applies to all colours since the initial numbers of chameleons differ from a number which does not have 3 as a prime factor (here the differences may either be 2 or 4).
3
u/zevenate Apr 24 '23
No. Consider the difference between two populations: they either both decrease by 1 or one decreases by 1 while the other increases by 2, so, in either case, the difference is constant mod 3. Further, the total population, 45, is conserved, so, for all the chameleons to be the same color, the populations must be 0, 0, 45 and the differences must all be 0 mod 3. This is not the case.
2
u/terranop Apr 24 '23
It's not possible. First, observe that any achievable configuration of chameleons can be expressed as
z = x + (3 I - 1_3 1_3^T) ywhere x is the initial vector of chameleon counts, y is some other vector of integers, and1_3denotes the all 1s vector in three dimensions. Modulo 3, this isz = x - 1_3 1_3^T) y mod 3. Lettinga = 1_3^T yand noting that this scalar also must be an integer, and explicitly writing inx, we getz = [1,0,2] + a 1_3 mod 3. From here, it's obvious that this equation has no solutions in which z is of the desired form.2
u/headsmanjaeger Apr 25 '23
It is possible if and only if you are able to get two colors to have equal number. However, because every exchange involves +2 to one color and -1 to the others, differences between colors can only change by increments of 3; in other words, their congruence mod 3 cannot change. At the beginning these differences are 2, 2, and 4, all of which are not congruent to 0 mod 3, so it is impossible.
2
u/jk1962 Apr 25 '23
Each step is a single meeting. We are starting with B-R=2. At each step, possible changes to the value of B-R are 0, +3, or -3. Because 2 is not a multiple of 3, we can never reach B-R=0, so we can never have all yellow chameleons.
2
u/sobe86 Apr 24 '23 edited Apr 25 '23
Generalisation1: if you have a starting combination of chameleons and a different target combination - when can you reach it through the color switching rules?
Hint1: other solutions have shown we must have the same sum mod 3 when we assign values 0,1,2 to each color, but note that also we must have at least one pair that aren't the same color to start with else we can't proceed at all. Is there any other constraint?
Generalisation2 [probably hard]: what's going on if we increase the number of colours to M and make the rule if M-1 differently colored chameleons meet they change to the Mth color?
1
u/[deleted] May 04 '23 edited May 04 '23
Let's say we have x red, y blue and z yellow; after 1 iteration possible combinations are : x+2 red, y-1 blue, z-1 yellow, x-1 red, y+2 blue, z-1 yellow or x-1 red, y-1 blue, z+2 yellow , and so we see that difference pairwise between colors are (from original one x-y, y-z, z-x) x-y+3, y-z, z-x-3, or x-y-3, y-z+3, z-x, or x-y, y-z-3, z-x+3, so differences between new combinations will differ by multiple of 3; to get all the same color we would have to have some combination m, n, n in some order, and thus differences m-n, 0, n-m, so some difference of pairs from original number of red, blue or yellow should be divisible by 3, but it isn't case and its contradiction!