Fifteen Puzzle - Maple Help (2024)

There are two properties of the initial configuration that determine whether the puzzle is solvable.

To start, imagine first replacing the empty space by a 16th block and converting the resulting block configuration to a row of numbers, by reading the blocks first from left to right and then top to bottom.

61584111523121691310147→6,1,5,8,4,11,15,2,3,12,16,9,13,10,14,7

This row can be considered a permutation of the ordered sequence [1, 2, 3, ..., 16]. Now, any such permutation can be decomposed into a set of swaps of consecutive elements, and while there are many ways of doing this, the number of such swaps that make up this set is always even or odd for a given permutation. This property is known as the parityof the permutation.

The second property is the location of the empty block (labeled "16" earlier) with respect to its natural location on the bottom right corner of the grid. This is calculated using the taxicab distancebetween the two points, which is defined as the sum of the differences between horizontal and vertical coordinates on a Cartesian grid.

The fifteen puzzle's solvability can now be expressed as follows:

For an initial configuration, the fifteen puzzle is solvable when the parity of the permutation for all the blocks and the parity of the taxicab distance between the empty block and the bottom right corner of the grid are both even, or are both odd. The puzzle cannot be solved if one is even and the other is odd.

Fifteen Puzzle - Maple Help (2024)
Top Articles
Latest Posts
Article information

Author: Twana Towne Ret

Last Updated:

Views: 6230

Rating: 4.3 / 5 (44 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Twana Towne Ret

Birthday: 1994-03-19

Address: Apt. 990 97439 Corwin Motorway, Port Eliseoburgh, NM 99144-2618

Phone: +5958753152963

Job: National Specialist

Hobby: Kayaking, Photography, Skydiving, Embroidery, Leather crafting, Orienteering, Cooking

Introduction: My name is Twana Towne Ret, I am a famous, talented, joyous, perfect, powerful, inquisitive, lovely person who loves writing and wants to share my knowledge and understanding with you.