How to know if a 8 puzzle is solvable Consider the following $3\times3$ sliding puzzle:

This is not solvable from the following state:

The explanation is that there are 11 inversions, and therefore it is unsolvable. How do they arrive at that conclusion?

An inversion is an unordered pair of distinct numbers, such as $\{5,7\}$, where the two numbers are not placed in the order they are supposed to be in the puzzle (in this case, listing the numbers row-by-row, $5$ comes after $7$, which makes this an inversion).
Each time you slide a tile horizontally, you neither create nor remove any inversions. Each time you slide a tile vertically, two pairs of numbers are changed from being an inversion to not being an inversion, or vice versa. Which is to say, for any move you make, the number of inversions either increases by $2$, decreases by $2$, or remains constant.
So no matter what you do, you cannot change the fact that you have an odd number of inversions, which means you can't get to a solved state.
