Monochrome Lizards

Rating: 2.5
March 29th, 2011

Uniform LizardsThere are 3 types of lizards: yellow, green and blue.

If you rub 2 lizards from different colors, they both change color to the third color. So, for example, if you rub a yellow lizard and a blue lizard, you get 2 green lizards.

Say that you have X yellow lizards, Y green lizards and Z blue lizards. For what values of X, Y and Z can you transform all the lizards to the same color?

E.g. for X=3, Y=3 and Z=1 it is possible (rub the 3 yellow ones with the 3 green ones and get a total of 7 blue ones).

5 Responses to “Monochrome Lizards”

  1. Seb Says:

    Isn’t there a second page anymore to post messages without giving the solution on the first page?

    Anyway, here goes my modest attempt: if (X,Y,Z) can be written in the following way (n,0,0)+(0,k,k)+(0,0,3p)+(0,3q,0)=(n,k+3q,k+3p) then you can get n+2k+3p+3q unicolor lizards.

    This is sufficient, but I do not know (yet) if it is necessary.

    For example, (1,2,3) cannot be written in this way, and it is also not possible to unicolorize (1,2,3).

    The condition is equivalent to “one pair out of the three numbers differs by a multiple of 3″.

  2. Seb Says:

    Very nice riddle by the way!

  3. rouli Says:

    Although I first had to compile a list of sample tuples were one cannot get a solution, see the pattern there and reverse engineer my way why this rule is necessary and sufficient, I still enjoyed it very much.

    Neat riddle, thanks!

  4. R. Says:

    @Seb:

    Assume we are able to make all lizards blue, and consider phi = (X-Y) mod 3.
    Claim: phi is invariant to rubbing.
    Proof:
    - Rubbing yellow and green decreases both X and Y by one, so phi doesn’t change;
    - Rubbing yellow and blue decreases X by one and increases Y by two, so phi still doesn’t change;
    - Rubbing green and blue decreases Y by one and increases X by two, so phi once again doesn’t change.

    Since in the end phi=0 (as X=Y=0), it must be so in the beginning as well, so we must have X=Y mod 3.

    Same goes for the two other colors.

  5. Nadav Says:

    If I’m not mistaken, I told you that riddle about a year ago, after I’ve heard it from my barber, who got it from the minister of industry, Shalom Simhon.

Leave a Reply