To work with the puzzle systematically, we need a way to record a board as a mathematical object. On
this page we begin with 7-puzzle boards whose blank is already in the lower-right corner. Reading the
numbered tiles across the top row and then across the bottom row gives a rearrangement of
\(1,2,\dots,7\), so it gives a permutation.
Solved 7 puzzle
1234567
The solved 7 puzzle corresponds to the two-row permutation notation with top row 1 through 7 and bottom row 1 through 7.
The answer is the identity permutation in two-row notation, with 1 through 7 on both rows.
\[
\begin{bmatrix}
1 & 2 & 3 & 4 & 5 & 6 & 7 \\
1 & 2 & 3 & 4 & 5 & 6 & 7
\end{bmatrix}
\]
Another 7-puzzle board
3142576
This 7-puzzle board corresponds to the two-row permutation notation with top row 1 through 7 and bottom row 3, 1, 4, 2, 5, 7, 6.
\[
\begin{bmatrix}
1 & 2 & 3 & 4 & 5 & 6 & 7 \\
3 & 1 & 4 & 2 & 5 & 7 & 6
\end{bmatrix}
\]
1. Two-row notation
A permutation of \(\{1,2,\dots,n\}\) is a rearrangement of the numbers \(1,2,\dots,n\). The set of
all permutations of \(\{1,2,\dots,n\}\) is denoted \(S_n\).
For the second board above, write
Sigma is the permutation sending 1 to 3, 2 to 1, 3 to 4, 4 to 2, 5 to 5, 6 to 7, and 7 to 6.
\[
\sigma=
\begin{bmatrix}
1 & 2 & 3 & 4 & 5 & 6 & 7 \\
3 & 1 & 4 & 2 & 5 & 7 & 6
\end{bmatrix}.
\]
This means
\(\sigma(1)=3\), \(\sigma(2)=1\), \(\sigma(3)=4\), \(\sigma(4)=2\), \(\sigma(5)=5\), \(\sigma(6)=7\),
and \(\sigma(7)=6\).
Draw the 7-puzzle board associated to
the two-row permutation with top row 1 through 7 and bottom row 4, 1, 7, 3, 2, 5, 6.
\[
\begin{bmatrix}
1 & 2 & 3 & 4 & 5 & 6 & 7 \\
4 & 1 & 7 & 3 & 2 & 5 & 6
\end{bmatrix}
\]
Draw the 7-puzzle board associated to
the two-row permutation with top row 1 through 7 and bottom row 2, 6, 1, 5, 4, 7, 3.
\[
\begin{bmatrix}
1 & 2 & 3 & 4 & 5 & 6 & 7 \\
2 & 6 & 1 & 5 & 4 & 7 & 3
\end{bmatrix}
\]
Write this board in two-row notation.
This 7-puzzle board has top row 2, 3, 1, 4 and bottom row 5, 6, 7, blank.
2314567
Check your work
1.
The associated 7-puzzle board has top row 4, 1, 7, 3 and bottom row 2, 5, 6, blank.
4173256
2.
The associated 7-puzzle board has top row 2, 6, 1, 5 and bottom row 4, 7, 3, blank.
2615473
3.
The answer is the two-row permutation with top row 1 through 7 and bottom row 2, 3, 1, 4, 5, 6, 7.
The one-row list 2, 3, 1, 4, 5, 6, 7 becomes the two-row permutation with top row 1 through 7.
\[
\begin{bmatrix}
1 & 2 & 3 & 4 & 5 & 6 & 7 \\
2 & 3 & 1 & 4 & 5 & 6 & 7
\end{bmatrix}
\]
2. One-row notation
In two-row notation, the top row is always the standard list \(1,2,\dots,n\). Because of that, it is
often omitted. This gives the shorter one-row notation.
The same permutation can be written in two-row notation or shortened to the one-row list 3, 1, 4, 2, 5, 7, 6.
\[
\begin{bmatrix}
1 & 2 & 3 & 4 & 5 & 6 & 7 \\
3 & 1 & 4 & 2 & 5 & 7 & 6
\end{bmatrix}
\qquad \longleftrightarrow \qquad
[3\ 1\ 4\ 2\ 5\ 7\ 6].
\]
3.
The board corresponding to the permutation 3, 1, 2, 4, 5, 6, 7 has top row 3, 1, 2, 4 and bottom row 5, 6, 7, blank.
3124567
3. Cycle notation
Theorem
Every permutation can be written as a product of disjoint cycles. To find the cycles, start with a
number, follow where it goes, and keep going until you return to your starting point. Then repeat
with a number not yet used.
For \([3\ 1\ 4\ 2\ 5\ 7\ 6]\), start with \(1\):
\(1\mapsto3\mapsto4\mapsto2\mapsto1\). This gives \((1\ 3\ 4\ 2)\).
Then start with \(6\): \(6\mapsto7\mapsto6\). This gives \((6\ 7)\). The number \(5\) is fixed, so it
is usually omitted. Therefore
The permutation 3, 1, 4, 2, 5, 7, 6 decomposes into the disjoint cycles (1 3 4 2) and (6 7).
\[
[3\ 1\ 4\ 2\ 5\ 7\ 6]=(1\ 3\ 4\ 2)(6\ 7).
\]
This board
This board has top row 2, 3, 1, 4 and bottom row 5, 6, 7, blank.
Convert the following examples of cycle notation to one-row notation. The ambient set matters here,
because fixed points are omitted from the cycle notation.
Convert \((1\ 4\ 2)(3\ 5)\in S_5\) to one-row notation.
Convert \((2\ 5\ 6\ 8)\in S_8\) to one-row notation.
Convert \((2\ 5\ 6\ 8)\in S_{10}\) to one-row notation.
Convert \((1\ 2\ 5)(3\ 4\ 6)\in S_6\) to one-row notation.
A useful picture places \(1,2,\dots,n\) across the top and again across the bottom, then connects the
point labeled \(i\) on top to the point labeled \(\sigma(i)\) on the bottom.
The diagram for \([3\ 1\ 2\ 4\ 5]\).
The diagram contains the same information as the list. It is just another way to see the same
permutation.
5. Composition of permutations
If \(\sigma\) and \(\tau\) are permutations, then so is their composition. We write
\((\sigma\tau)(i)=\sigma(\tau(i))\), so the rightmost permutation acts first.
Let
Let tau be the permutation 2, 1, 3, 4, 5 and let sigma be the permutation 1, 3, 2, 4, 5.
\[
\tau=[2\ 1\ 3\ 4\ 5], \qquad \sigma=[1\ 3\ 2\ 4\ 5].
\]
Then
\((\sigma\tau)(1)=\sigma(\tau(1))=\sigma(2)=3\),
\((\sigma\tau)(2)=\sigma(\tau(2))=\sigma(1)=1\), and
\((\sigma\tau)(3)=\sigma(\tau(3))=\sigma(3)=2\). Therefore
The composition sigma tau is the permutation 3, 1, 2, 4, 5.
\[
\sigma\tau=[3\ 1\ 2\ 4\ 5].
\]
Solid blue lines give \(\tau\), dashed gold lines give \(\sigma\).
For practice, use the following permutations.
Let sigma a be the permutation 3, 9, 10, 4, 5, 6, 1, 2, 8, 7; sigma b be 7, 8, 1, 4, 5, 6, 10, 9, 2, 3; sigma c be 1, 9, 8, 3, 5, 6, 2, 7, 4, 10; tau a be the cycle 2, 5, 6, 8 in S 10; tau c be the product of cycles 1, 2, 5 and 3, 4, 6 in S 6; and tau d be the product of transpositions 1, 2; 2, 3; 3, 4; 4, 5; 5, 6 in S 6.
\[
\sigma_a=[3\ 9\ 10\ 4\ 5\ 6\ 1\ 2\ 8\ 7],\qquad
\sigma_b=[7\ 8\ 1\ 4\ 5\ 6\ 10\ 9\ 2\ 3],
\]
\[
\sigma_c=[1\ 9\ 8\ 3\ 5\ 6\ 2\ 7\ 4\ 10],\qquad
\tau_a=(2\ 5\ 6\ 8)\in S_{10},
\]
\[
\tau_c=(1\ 2\ 5)(3\ 4\ 6)\in S_6,\qquad
\tau_d=(1\ 2)(2\ 3)(3\ 4)(4\ 5)(5\ 6)\in S_6.
\]
Composition exercises
Compute \(\sigma_a\sigma_b\).
Compute \(\sigma_b\sigma_a\).
Compute \(\sigma_a\tau_a\).
Compute \(\tau_a\sigma_c\).
Compute \(\tau_c\tau_d\).
Compute \(\tau_d\tau_c\).
Inverses
The identity permutation is \(e=[1\ 2\ \dots\ n]\). The inverse \(\tau^{-1}\) is the permutation that
undoes \(\tau\), so \(\tau\tau^{-1}=\tau^{-1}\tau=e\).