Size of Permutation: Show building helper

One line notation:
Cycle notation:
 Two line notation:
 1 2 3 4 5 6 7 8 9

In general, a permutation is a rearrangement of objects. Frequently, a permutation is represented as an arrangement of the set $$\{1,2,\ldots , n\}$$, where $$n$$ is a positive integer called the size of the permutation. There are $$n!$$ possible permutations of this set. For instance, the 6 permutations of the set $$\{1,2,3\}$$ are $$\{1,2,3\}$$, $$\{1,3,2\}$$, $$\{2,1,3\}$$, $$\{2,3,1\}$$, $$\{3,1,2\}$$, $$\{3,2,1\}$$. A permutation $$\pi$$ is a map, and we write $$\pi(x) = y$$ if $$\pi$$ sends the element $$x$$ to the $$y$$th position.

A permutation $$\pi$$ can be described using a variety of notations, several of which are seen in this applet:
• Matrix: A permutation matrix is a square $$n \times n$$ matrix with exactly one entry of 1 in each row and in each column, where the entry in position $$(i,j)$$ is 1 if $$\pi(i) = j$$. The remaining entries are zero.
• Two Line: The numbers 1 through $$n$$ are listed in order from left to right, with $$\pi(i)$$ written beneath $$i$$ in the top row.
• One Line: A list of the numbers $$\pi(i)$$ as $$i$$ goes from 1 to $$n$$. Note that the one line notation is the second row of the two line notation.
• Cycles: Suppose $$\pi$$ sends $$x_1$$ to $$x_2$$, $$x_2$$ to $$x_3$$, and $$x_3$$ back to $$x_1$$. In this case, we say $$\pi$$ has a 3-cycle, denoted $$(x_1 \ \ x_2 \ \ x_3)$$. We can write a permutation as a product of each of its cycles. Cycles of longer or shorter lengths are possible. The identity permutation on $$n$$ letters being a product of $$n$$ 1-cycles. The cycle notation is not unique; as long as the cycles are disjoint (that is, the same number does not appear in more than one cycle) their product commutes so they may be written in any order. Furthermore, each cycle can be written in multiple ways. For instance, the 3-cycle above could be written in 3 ways: $(x_1 \ \ x_2 \ \ x_3) = (x_2 \ \ x_3 \ \ x_1) = (x_3 \ \ x_1 \ \ x_2)$
• Diagrams: A permutation can be represented graphically in a variety of ways, one of which is displayed in this applet. A braid diagram is a two row diagram in which each number in the top row is connected to its image in the bottom row, and can be of use when counting the crossings of a permutation. In addition, the cycle diagram is shown. These are disjoint diagrams indicating which numbers appear in the same cycle, with arrows indicating the directions of the cycle. A cycle with only one number (a singleton cycle) indicates the permutation has a fixed point at that value.

A wide range of mathematical areas make use of permutations. Algebraists might study the symmetric group $$S_n$$, whose elements are the permutations on $$n$$ numbers. This group has identity $$\{1, 2, 3, \ldots, n\}$$ and its operation is composition. Every permutation $$\pi$$ has an inverse, defined by $$\pi^{-1}(j) =i$$ if $$\pi(i) = j$$.

## Using the Applet

Enter a permutation in one of four ways:
• Matrix: Change matrix entries (either 0 or 1) by clicking on them. Use the pull-down menu to change the size. The applet will determine if the matrix is a valid permutation matrix. If the 'Show building helper' box is checked, the applet will highlight any issues with the matrix, such as a column with only 0 entries or a row with more than one entry of 1. When a valid permutation is entered, the applet shows how the matrix acts on the vector $$[1, 2, \ldots, n]$$, and displays the permutation in other notations.
• Two Line: Change the entries of the second row to enter a permutation in two line notation. Use the + and - buttons to change the size of the permutation.
• One Line: Enter the permutation as a sequence, with each entry seperated by commas. For example, $$2,1,3,6,4,5$$
• Cycles: Surround each cycle with parentheses, and seperate entries within cycles by a space or comma. For example, $$(1 \ 2)(3)(4 \ 6 \ 5)$$.
A message will be displayed if an invalid permutation is entered. In particular, and each element of the set $$\{1, 2, \ldots, n\}$$ must be used exactly once where $$n$$ is the size of the permutation. The size can range from 2 to 9. When a valid permutation is entered, each notation will be displayed and some data relevant to the permutation will be displayed, including:
• Size: The number of objects being permuted.
• Shape: A (weakly decreasing) list of the lengths of (disjoint) cycles forming the permutation.
• Ascents: The permutation $$\pi$$ has an ascent at $$x$$ if $$\pi(x+1) > \pi(x)$$.
• Descents: The permutation $$\pi$$ has an descent at $$x$$ if $$\pi(x) > \pi(x+1)$$.
• Inverse: The inverse of the permutation, in one-line notation.
• Square: The square of the permutation, in one-line notation.
• Coxeter Length: The number of inversions in the permutation $$\pi$$, where an inversion is a pair $$\{a, b\}$$ with $$b > a$$ but $$\pi(a) > \pi(b)$$.
• Signature: A value of -1 or +1 indicating the parity of the permutation. A permutation is even if it can be written as a product of an even number of transpositions, and odd if it cannot.
• Peaks: The permutation $$\pi$$ has a peak at $$x$$ if $$\pi(x) > \pi(x-1)$$ and $$\pi(x) > \pi(x+1)$$.