# Squares, Circles, and Triangles

As in the Squares and Circles game, here too one is presented with a row of shapes. Each shape is either a square, or a circle, or a triangle. A move consists in selecting any two different shapes. The puzzle has two variants depending on what happens next.

• Move with elimination
Two selected shapes are replaced with a single one of the remaining variety. The question here is whether it's always possible to reduce the configuration to a single shape. If so, what shape might it be?

• Move without elimination
Two selected shapes are replaced by two shapes of the remaining variety. The question is whether or not it's possible to achieve the configuration with identical shapes only. If yes, what shape might it be?

In both cases, provided the required state is attainable, how do you get there?

### If you are reading this, your browser is not set to run Java applets. Try IE11 or Safari and declare the site https://www.cut-the-knot.org as trusted in the Java setup. What if applet does not run?

Explanation ## Explanation

Since obviously the order of objects in the row is not important, any configuration of objects of three different shapes can be represented by a triple of numbers (s, c, t) where s is the number of squares, c the number of circles, and t is the number of triangles.

• Move with elimination
Given a configuration (s, c, t). A move may result in one of the three possible configurations: (s - 1, c - 1, t + 1), (s - 1, c + 1, t - 1), or (s + 1, c - 1, t - 1), depending on what shapes have been selected. From here it follows that, modulo 2, the differences of any two of the numbers s,c, or t remain invariant under all eligible moves. A necessary condition for getting a single triangle is s = c (mod 2). Is it sufficient?

• Move without elimination
As before, but now a move may convert (s, c, t) into one of (s - 1, c - 1, t + 2), (s - 1, c + 2, t - 1), or (s + 2, c - 1, t - 1). Therefore, the difference of any two numbers remain invariant modulo 3. In this case, a necessary condition to get a row of triangles is s = c (mod 3). Is it a sufficient condition?

The latter problem appears in a different guise in [Cofman, p. 97] with a reference to Kvant (1985). Chameleons on an island come in three colors. They wonder and meet in pairs. When two chameleons of different colors meet, they both change to the third color. Given initial amounts of the lizards of each color are 13, 15, and 17, may this happen that, after a while, all of them acquire the same color? [Tao, p. 83], too, discusses this variant with a reference the Tournaments of Towns competition (1989). We consider two solutions to that problem elsewhere.

### References

1. J. Cofman, What To Solve?, Oxford Science Publications, 1996.
2. T. Tao, Solving Mathematical Problems, Oxford University Press • Chessboard
• Changing Colors, an Interactive Activity
• Plus or Minus Game
• Solitaire on a Circle
• Calendar Magic
• Counting Diagonals in a Convex Polygon
• The Game of Fif
• Nim
•  