**From New Scientist #2781, 9th October 2010** [link]

Joe’s 3-by-3 grid can be made to represent any of the six faces of a die by placing nine counters, coloured on one side and white on the other. Joe placed the nine counters with just the one in the centre coloured side up. Penny’s task this week is to increase the number represented to 4 by turning over counters. But, of course, there is a catch. Every time Penny decides which counter to turn over she has to remember to turn over all counters in squares that are immediately adjacent, horizontally and vertically. Not only that, she has to record how many counters she turns over each time, and the total has to be the minimum possible.

What is that minimum?

In 2018 this puzzle published again by *New Scientist *as a tribute to Bob Walker, who died in February of that year. (*New Scientist* #3171, 31st March 2018)

[enigma1616]

### Like this:

Like Loading...

The following Python program does a breadth first search to find the minimum number of flips required to reach all possible outcomes from the starting position. It runs in 4.3s (2.0s under PyPy).

Solution:The minimum number of counters turned over is 33.Each counter is selected to be turned over once (and it along with its neighbours are flipped). The order the counters are selected in doesn’t matter.

You can also use this program to find the minimum number of flips required to reach other representations of dice faces (1 → 0 flips, 2 → 11 flips, 3 → 22 flips, 4 → 33 flips, 5 → 12 flips, 6 → 13 flips).

This was one of the earlier puzzles I posted to the site in December 2011.

I am revisiting it now, as it was selected as one of Bob Walker‘s best

Enigmapuzzles in a recent tribute to him inNew Scientist[ link ]. (I think I would have chosenEnigma 1475as my favourite puzzle by Bob Walker).This Python program executes in 79ms, and finds all possible finishing positions and their flip count. Positions you want to see the answer for can be placed in the [[

`finish`

]] list.Run:[ @repl.it ]Or, using bit patterns to represent the grid: