A permutation, also called an “arrangement number” or “order,” is a rearrangement of the elements of an ordered list S into a one-to-one correspondence with S itself. The number of permutations on a set of n elements is given by n! (n factorial; Uspensky 1937, p. 18). For example, there are 2!=2·1=2 permutations of {1,2}, namely {1,2} and {2,1}, and 3!=3·2·1=6 permutations of {1,2,3}, namely {1,2,3}, {1,3,2}, {2,1,3}, {2,3,1}, {3,1,2}, and {3,2,1}. The permutations of a list can be found in the Wolfram Language using the command Permutations[list]. A list of length n can be tested to see if it is a permutation of 1, …, n in the Wolfram Language using the command PermutationListQ[list].

Sedgewick (1977) summarizes a number of algorithms for generating permutations, and identifies the minimum change permutation algorithm of Heap (1963) to be generally the fastest (Skiena 1990, p. 10). Another method of enumerating permutations was given by Johnson (1963; Séroul 2000, pp. 213-218).

The number of ways of obtaining an ordered subset of k elements from a set of n elements is given by

(Uspensky 1937, p. 18), where n! is a factorial. For example, there are 4!/2!=12 2-subsets of {1,2,3,4}, namely {1,2}, {1,3}, {1,4}, {2,1}, {2,3}, {2,4}, {3,1}, {3,2}, {3,4}, {4,1}, {4,2}, and {4,3}. The unordered subsets containing k elements are known as the k-subsets of a given set.

A portrayal of a change as a result of stage cycles is novel (up to the requesting of the cycles). A case of a cyclic decay is the stage {4,2,1,3} of {1,2,3,4}. This is signified (2)(143), relating to the disjoint change cycles (2) and (143). There is a lot of opportunity in picking the portrayal of a cyclic disintegration since (1) the cycles are disjoint and can thusly be determined in any request, and (2) any pivot of a given cycle indicates a similar cycle (Skiena 1990, p. 20). In this way, (431)(2), (314)(2), (143)(2), (2)(431), (2)(314), and (2)(143) all portray a similar change.

Another documentation that expressly recognizes the positions involved by components when utilization of a change on n components utilizes a 2×n framework, where the primary line is (123…n) and the subsequent line is the new course of action. For instance, the change which switches components 1 and 2 and fixes 3 would be composed as

Any permutation is also a product of transpositions. Permutations are commonly denoted in lexicographic or transposition order. There is a correspondence between a permutation and a pair of Young tableaux known as the Schensted correspondence.

The number of wrong permutations of n objects is [n!/e] where [x] is the nearest integer function. A permutation of n ordered objects in which no object is in its natural place is called a derangement (or sometimes, a complete permutation) and the number of such permutations is given by the subfactorial !n.

Using

(x+y)^n=sum_(r=0)^n(n; r)x^(n-r)y^r

(3)

with x=y=1 gives

2^n=sum_(r=0)^n(n; r),

(4)

so the number of ways of choosing 0, 1, …, or n at a time is 2^n.

The set of all permutations of a set of elements 1, …, n can be obtained using the following recursive procedure

1 2;  / ; 2 1

(5)

1  2 3;    / ; 1 3 2 ;  / ; 3 1 2 ; |    ; 3 2 1 ; \ ; 2 3 1 ;    \ ; 2 1 3

(6)

Consider permutations in which no pair of consecutive elements (i.e., rising or falling successions) occur. For n=1, 2, … elements, the numbers of such permutations are 1, 0, 0, 2, 14, 90, 646, 5242, 47622, … (OEIS A002464).

Let the set of integers 1, 2, …, N be permuted and the resulting sequence be divided into increasing runs. Denote the average length of the nth run as N approaches infinity, L_n. The first few values are summarized in the following table, where e is the base of the natural logarithm (Le Lionnais 1983, pp. 41-42; Knuth 1998).

n L_n OEIS approximate

1 e-1 A091131 1.7182818…

2 e^2-2e A091132 1.9524…

3 e^3-3e^2+3/2e A091133 1.9957…