8-puzzle which has the numbers in order but has gap in between

318 Views Asked by At

If the numbers of the 8-puzzle are all in order, but the blank tile is somewhere in between, is this puzzle solvable? (for example, $\begin{bmatrix} 1 & 0 & 2 \\ 3 & 4 & 5 \\ 6 & 7 & 8 \end{bmatrix}$, where 0 represents the blank tile)

2

There are 2 best solutions below

0
On

Count how far the gap tile is displaced. In your case it has been moved up 2 and over 1. So that is a displacement of 3. Call that "odd" or 1.

Now do that for every square.

1 is in place. So that's displaced 0.

2 is over 1 so that's displaced 1.

3 is down one and over 3 so that's 3. odd. 1.

4 is over 1. 1.

5 is over 1. 1.

6 is displaced 3. odd. 1.

7 is displace 1.

8 is displaced 1.

Add those all up. 8. even. 0.

Even parity is solvable.

Odd parity is not.

$\begin{bmatrix} 1 & 0 & 2 \\ 3 & 4 & 5 \\ 6 & 7 & 8 \end{bmatrix}$

$\begin{bmatrix} 1 & 2 & 5 \\ 0 & 3 & 4 \\ 6 & 7 & 8 \end{bmatrix}$

$\begin{bmatrix} 2 & 3 & 5 \\ 1 & 0 & 4 \\ 6 & 7 & 8 \end{bmatrix}$

$\begin{bmatrix} 1 & 2 &3 \\ 4 & 5 & 0 \\ 6 & 7 & 8 \end{bmatrix}$

$\begin{bmatrix} 1 & 2 &3 \\ 4 & 5 & 8 \\ 0 & 6 & 7 \end{bmatrix}$

$\begin{bmatrix} 1 & 2 &3 \\ 5 & 0 & 8 \\ 4 & 6 & 7 \end{bmatrix}$

$\begin{bmatrix} 1 & 2 &3 \\ 5 & 6 & 8 \\ 4 & 0 & 7 \end{bmatrix}$

$\begin{bmatrix} 1 & 2 &3 \\ 5 & 6 & 0 \\ 4 & 7 & 8 \end{bmatrix}$

$\begin{bmatrix} 1 & 2 &3 \\ 4 & 5 & 6 \\ 0 & 7 & 8 \end{bmatrix}$

$\begin{bmatrix} 1 & 2 &3 \\ 4 & 5 & 6 \\ 7 & 8 & 0 \end{bmatrix}$

0
On

Wikipedia states that if you move the blank (I assume that is your zero tile) to the final location (lower right?) the puzzle is solvable if the permutation is even. If we slide the $0$ right and then down, we get $$\begin{bmatrix} 1 & 2 & 5 \\ 3 & 4 & 8 \\ 6 & 7 & 0 \end{bmatrix}$$ Now to get to solved, you swap $(5,3),(5,4),(8,6),(8,7)$, an even number of swaps, so it is solvable.