chameleon puzzle- modified one

433 Views Asked by At

In one island there are 3 colors of chameleon 12 blue,15 green and 7 red. When two different color’s chameleon meet together , they convert into third color. What is the number of minimum no. of meeting required to convert all chameleon into same color?

2

There are 2 best solutions below

0
On

let $(x,y,z)$ mean that No. of R chameleon change by $x$,No. of G by $y$ & No. of B by z.

Now, if R & G meet then $(-1,-1,2)$ , if G & B meet then $(2,-1,-1)$ & if R & B meet then $ (-1,2,-1)$.

That means the change b/w a meeting Color and non-meeting color is of 3 Units(chameleon) with +2 to non-meeting and -1 to meeting.

Now, For all Units to be of same color, we need to have 2 Colors having same no. of Units. So that when they meet no unit is left alone.

There are there possible cases of 2 colors having same no. of units :- RG,GB,&RB. Now you can see for yourself which one gives the minimum number of moves.

(difference of units b/w 2 colors need to be a multiple of 3 if they are to have 2 have same no. of units )

The answer is 15 times. First 1 red and 1 green meet. This gives $6R,14G,14B $ now 14 G and 14 B meet to give 34 R.

0
On

You can work backwards from a sea of a single color (say, blue), counting the number of "unmeetings" required. A single (production) unmeeting is required to produce one of each non-sea color (say, $2B\rightarrow G+R$), or a single (conversion) unmeeting can convert two of one non-sea color to one of the other (say, $2G\rightarrow R+B$). If two conversion unmeetings have different colors, then they have the net effect of reducing each non-sea color by one; but this can be done more cheaply by just reducing the number of production unmeetings by one. So all conversion unmeetings will be of a single color. The result will have $n_1=x-2y$ chameleons of the first non-sea color, and $n_2=x+y$ of the second non-sea color, so $n_2-n_1$ must be a multiple of three, and the number of unmeetings will be $x+y=n_2=\max(n_1,n_2)$. In other words, look for two colors whose counts differ by a multiple of three; the result is the larger of the two counts.

In your case, the two colors whose counts differ by a multiple of three are green ($15$) and blue ($12$); to produce the observed counts from a sea of red takes $15$ unmeetings, consisting of $1$ conversion unmeeting and $14$ production unmeetings. In the other direction, that is, first $R+G\rightarrow 2B$, and then $14B+14G\rightarrow 28R$.

Note that there are configurations with no solution. For instance, given $10$ red chameleons and $2$ blue chameleons, there is no way for all chameleons to reach a single color. One the other hand, starting from $6$ red chameleons and $3$ blue chameleons, it is possible to achieve either $9$ red chameleons (with $3$ meetings), or $9$ green chameleons (with $6$ meetings), or $9$ blue chameleons (with $6$ meetings).