Bognar's Brainteaser is a puzzle with a frame that has a 3×3 grid of holes (with the centre hole filled),
and consisting of two layers. The layers can rotate around the central filled hole. Inside the holes are pieces
which can move from one layer to another when the layers are lined up. In each layer, two of the holes (one edge
and one corner hole) are a little bit too small to contain a piece.

The version I have has smiley's on both sides of each piece, and in the centre of each layer. The aim is
to get 9 smileys, all in the same orientation, showing on both sides. There is another version as well which
is supplied with various patterns that you have to try to attain.

This puzzle was invented by Jozsef Bognar, who also invented the Bolygok puzzle.

First we need to find out the number of configurations of the pieces and spaces, i.e.
the number of positions if all pieces were indistinguishable. Lets first look only at
the corners. Each layer has one blocked corner location, so there is one layer orientation
where the two blocked locations line up. In that case all three other corner holes have
two fillable locations. There are two spaces and four pieces in these three double locations,
and there are 3+3=6 ways to arrange them (one double location empty, or two half-empty). In
the other three layer orientations there are two double locations, and two singles. These can
be filled with 4 pieces and 2 spaces in 8 ways (spaces separated in 6 ways, or together in 2 ways).
The same numbers occur with the edge locations. Now just multiply the number of edge configurations
by the number of corner configurations for each of the four layer orientations, and add them together
to get 8*8 + 8*8 + 8*6 + 6*8 = 224 configurations. In each of those configurations the four edge
pieces can be permuted in 4! ways, as can the four corner pieces, giving a total of
224·4!^{2} = 129,024 positions.

If you only use gravity to move the pieces from one layer to the other, then it makes sense to
consider it a different position if you turn over the puzzle. In that case you would have
448·4!^{2} = 258,048 positions, two of which are solutions. It should be noted
however that while all of those positions are solvable with gravity only, they are not all
reachable from the start position with gravity only. It turns out that only 29+29+31+31 = 120
configurations are reachable instead of 224. This gives 120·4!^{2} = 69,120 reachable
positions, or 138,240 if you consider the flipped positions different.

I have calculated how many moves each position of Bognar's Brainteaser needs to
solve, as shown in the table below. The first two columns were calculated with the
assumption that only gravity is used to move a pieces from one layer to another,
and that not only is every quarter turn of a layer one move, so is flipping over the
puzzle. There are two solved positions because at the start, either layer can be on top.
One column shows how many moves it takes to reach the solved position, the other shows
how many moves it takes to generate a position from either one of the start positions.

The last column gives the results when pieces are freely pushed from one layer
to another. In this case flips are not necessary, so only layer quarter turns
count.

Moves | Gravity Only Solving | Gravity Only Generating | With fingers |
---|---|---|---|

0 | 2 | 2 | 1 |

1 | 20 | 4 | 32 |

2 | 54 | 6 | 167 |

3 | 76 | 10 | 1,496 |

4 | 178 | 28 | 7,124 |

5 | 350 | 52 | 21,996 |

6 | 630 | 96 | 47,887 |

7 | 1,212 | 178 | 40,852 |

8 | 2,126 | 350 | 9,333 |

9 | 4,060 | 666 | 136 |

10 | 7,372 | 1,200 | |

11 | 12,778 | 2,196 | |

12 | 21,430 | 3,916 | |

13 | 33,624 | 6,736 | |

14 | 47,134 | 10,992 | |

15 | 54,242 | 16,344 | |

16 | 44,944 | 21,396 | |

17 | 22,146 | 23,206 | |

18 | 5,226 | 20,536 | |

19 | 440 | 15,036 | |

20 | 4 | 9,332 | |

21 | 4,452 | ||

22 | 1,306 | ||

23 | 184 | ||

24 | 16 | ||

Total | 258,048 | 138,240 | 129,024 |

Let a clockwise quarter turn of the top layer be denoted R, and an anti-clockwise turn L. Flipping over the puzzle will be denoted by a slash /.

- Twist the layers so that the stickers on the front and back centres are the right way up.
- Hold the puzzle with the blue layer on top. The double holes (i.e. the holes that could contain two pieces, or one piece that can move to either layer) now lie at the top and bottom edges and top right and bottom right corners.
- Now we will do some moves that will cause each hole to have exactly one piece.
- If the top-left corner is empty, then do the moves LLRR.
- If the bottom-left corner is empty, then do the moves /RRLL/.
- If the right edge is empty, then do the moves RLLR.
- If the left edge is empty, then do the moves /RLLR/.

- If the top-right corner is not correct, then do R/R/RL/R/R, and turn the whole puzzle the right way up again. This puts a different piece at the top-right corner. Repeat this until the top-right corner is correct.
- If the bottom-left corner is not correct, then do R/RL/L/LR/. This puts a different piece at the bottom-left corner. Repeat this until the bottom-left corner is correct.
- If the last two corners are not correct (they need to be swapped), then do LL/LL/LR, and turn the whole puzzle the right way up again.
- If the right hand side edge is not correct, then do R/RR/RL/L/LL/LR/ and turn the whole puzzle the right way up again. This puts a different piece at the right edge. Repeat this until the right edge is correct.
- If the top edge is not correct, then do L/LR/R/RL/. This puts a different piece at the top edge location. Repeat this until the top edge is correct.
- If the last two edges are not correct (they need to be swapped), then do /L/LL/L/RLL/R/LR, and turn the whole puzzle the right way up again.

Solving the puzzle using your fingers to push the pieces between the layers is relatively easy, but hard to describe, so I will not describe the steps in much detail.

- Twist the layers so that the stickers on the front and back centres are the right way up.
- Hold the puzzle with the blue layer on top. The double holes (i.e. the holes that could contain two pieces, or one piece that can move to either layer) now lie at the top and bottom edges and top right and bottom right corners.
- Do whatever moves needed to fill all the holes, moving a piece from any hole that has two pieces to any empty hole.
- Solve the two left corner holes first, because they can each contain only one piece. It sometimes helps to put two other pieces together in one of the corner holes on the right so that you have move room to manoeuvre.
- Solve the two right corner holes.
- Solve the left and right edge holes first, because they can each contain only one piece. It sometimes helps to put two other pieces together in the top or bottom edge holes so that you have move room to manoeuvre.
- Solve the top and bottom edge holes.