A permutation, also called an “arrangement number” or “order,” may be a rearrangement of the weather of an ordered list S into a one-to-one correspondence with S itself. The amount of permutations on a group of n elements is given by n! (n factorial; Uspensky 1937, p. 18). for instance , 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 an inventory are often found within the Wolfram Language using the command Permutations[list]. an inventory of length n are often tested to ascertain if it’s a permutation of 1, …, n within the Wolfram Language using the command PermutationListQ[list].
Sedgewick (1977) summarizes variety 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 the way of obtaining an ordered subset of k elements from a group of n elements is given by
_nP_k=(n!)/((n-k)!)
(1)
(Uspensky 1937, p. 18), where n! may be a factorial. for instance , 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 referred to as the k-subsets of a given set.
A representation of a permutation as a product of permutation cycles is exclusive (up to the ordering of the cycles). An example of a cyclic decomposition is that the permutation {4,2,1,3} of {1,2,3,4}. this is often denoted (2)(143), like the disjoint permutation cycles (2) and (143). there’s an excellent deal of freedom in picking the representation of a cyclic decomposition since (1) the cycles are disjoint and may therefore be laid out in any order, and (2) any rotation of a given cycle specifies an equivalent cycle (Skiena 1990, p. 20). Therefore, (431)(2), (314)(2), (143)(2), (2)(431), (2)(314), and (2)(143) all describe an equivalent permutation.
Another notation that explicitly identifies the positions occupied by elements before and after application of a permutation on n elements uses a 2×n matrix, where the primary row is (123…n) and therefore the second row is that the new arrangement. for instance , the permutation which switches elements 1 and a couple of and fixes 3 would be written as
[1 2 3; 2 1 3].
(2)
Any permutation is additionally a product of transpositions. Permutations are commonly denoted in lexicographic or transposition order. there’s a correspondence between a permutation and a pair of Young tableaux referred to as the Schensted correspondence.
The number of wrong permutations of n objects is [n!/e] where [x] is that the nearest integer function. A permutation of n ordered objects during which no object is in its natural place is named a derangement (or sometimes, an entire permutation) and therefore 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 the way of selecting 0, 1, …, or n at a time is 2^n.
The set of all permutations of a group of elements 1, …, n are often obtained using the subsequent 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 during 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 therefore the resulting sequence be divided into increasing runs. Denote the typical length of the nth run as N approaches infinity, L_n. the primary few values are summarized within the following table, where e is that the base of the Napierian 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…