sliding-blocks-puzzles

Sliding Blocks Puzzles

Why are some of these solvable, and others not?

By

I was reading a book of puzzles by Sam Loyd, and my curiosity was piqued. The puzzle concerns a husband and wife who have just moved five pieces of furniture into a six room apartment. Unfortunately, two of the pieces of furniture are in the wrong rooms, and as you can see in the picture, they are puzzling out how to switch them.

As I read the puzzle, I thought "surely this puzzle can't be solved?". Then, I satisfied myself mathematically that it couldn't be done, and checked the back of the book. The so-called solution in the back of the book did indeed swap the two wongly placed pieces of furniture, but at the cost of messing up the rest of the apartment.

If you like, you can try the original puzzle in the java applet below. Select 6 Rooms from the Example menu, and see if you can swap the numbers 1 and 5.

This six rooms puzzle is an example of a sliding blocks puzzle. The most famous sliding blocks puzzle is the 16 puzzle also (unless I'm mistaken) invented by Sam Loyd. The 16 puzzle (or 15 puzzle) is a 4x4 grid of square pieces, with one missing. In one of Sam Loyd's books, he describes the 16 puzzle, and again asks people to swap two tiles. Again, this is actually impossible - you can try, if you like, in the java applet below.

The 6 rooms puzzle
   
The 16 puzzle
The 6 rooms puzzle
   
The 16 puzzle

I should point out that most of the puzzles in Sam Loyd's Books do have solutions, often quite clever ones.

It occurred to me, however, that if the couple's apartment had 7 rooms, then their problems would be over. Or if the 16 puzzle had 20 cells in a star shape, it would be possible to swap two tiles.

The 7 rooms puzzle
   
The 20 puzzle
The 7 rooms puzzle
   
The 20 puzzle

In the java applet below, choosing a puzzle from the Random menu will give you a random (solvable!) puzzle of the selected type. If you choose an Example puzzle, you will be asked to swap two pieces. I've already told you that this is impossible for the 16 puzzle or for the 6 room apartment, but it is possible for the 7 room apartment or for the 20 puzzle. Can you guess some general rules? Or have I made a mistake?

By the way, the most popular game on this site is also a sliding blocks puzzle - the traffic jam game. This site has an online version and also a printable traffic jam game for when you are away from your PC.