not all configurations of the puzzle are solvable
This Numberphile video explains the math behind.
Alexander
In reply to Re^3: The 15 Puzzle by afoken in thread The 15 Puzzle by msh210