Permutations

Rearrangements of { 1 , … , n } , their cycle structure, and the sign that counts whether a rearrangement is reachable by an even or odd number of swaps. The sign is what the determinant's row-swap rule records and what the Leibniz formula sums over.

Definition

A permutation of { 1 , 2 , … , n } is a bijection σ from that set to itself. The set of all of them is S n , and | S n | = n ! .

Notations. One-line notation lists the images: σ = ( 2 3 1 ) means σ ( 1 ) = 2 , σ ( 2 ) = 3 , σ ( 3 ) = 1 . Cycle notation groups the orbits: the same permutation is the single cycle ( 1 2 3 ) , read as 1 ↦ 2 ↦ 3 ↦ 1 . Fixed points are usually omitted, so ( 1 3 ) in S 4 means the swap of 1 and 3 with 2 and 4 held.

Every permutation decomposes into disjoint cycles, uniquely up to the order in which the cycles are listed.

Transpositions. A transposition is a cycle of length 2, a single swap. Every permutation is a product of transpositions, and a cycle of length k needs exactly k − 1 of them. The decomposition is not unique, the same permutation can be written as a product of transpositions in many ways, but its parity is.

Inversions and sign. An inversion of σ is a pair i < j with σ ( i ) > σ ( j ) : a pair listed out of order. Writing inv ⁡ ( σ ) for the number of inversions, the sign is

sgn ⁡ ( σ ) = ( − 1 ) inv ⁡ ( σ ) .

A permutation is even when its sign is + 1 and odd when it is − 1 . The two definitions agree: a permutation is even exactly when it is a product of an even number of transpositions, because each transposition changes the inversion count by an odd amount.

Sign is multiplicative. sgn ⁡ ( σ τ ) = sgn ⁡ ( σ ) sgn ⁡ ( τ ) , and consequently sgn ⁡ ( σ − 1 ) = sgn ⁡ ( σ ) . For n ≥ 2 exactly half of S n is even.

The Leibniz formula. The determinant is a signed sum over all n ! permutations:

det A = ∑ σ ∈ S n sgn ⁡ ( σ ) ∏ i = 1 n a i , σ ( i ) .

Each term takes one entry from each row and each column, and the sign decides whether it is added or subtracted. This is the definition the cofactor expansion computes, and the source of the determinant's row-swap rule: exchanging two rows composes σ with a transposition and flips every sign at once.

Assumptions and scope

  • The decomposition into transpositions is not unique, but its parity is. The sign is well defined precisely because of that invariance, not because the decomposition is canonical.

  • A cycle of length k contributes k − 1 transpositions, so a cycle of even length is an odd permutation. The lengths and the parities are opposite, which is the usual place this is misread.

  • Fixed points are conventionally omitted from cycle notation, so the same written cycle denotes different permutations in S 3 and S 5 . The ambient n must be known.

  • Composition is not commutative for n ≥ 3 , so σ τ and τ σ generally differ, although they always have the same sign, since sign is multiplicative and commutative in its values.

  • The Leibniz formula has n ! terms and is a definition rather than an algorithm. For n = 10 it has over three million terms, which is why elimination rather than the formula computes determinants in practice.

Forms this is expressed in

The same content in several forms. Each makes something visible that the others leave implicit, so moving between them is part of understanding the topic rather than a presentation choice.

symbolic

A permutation written as the list of its images: σ = ( 2 3 1 ) records σ ( 1 ) = 2 , σ ( 2 ) = 3 , σ ( 3 ) = 1 . Position carries the input, entry carries the output, and the ambient n is visible as the length of the list.

This form makes inversions readable directly: scan the pairs i < j and count how many have σ ( i ) > σ ( j ) . For ( 2 3 1 ) the pairs are ( 2 , 3 ) in order, ( 2 , 1 ) inverted, ( 3 , 1 ) inverted, two inversions, so the sign is + 1 . Nothing has to be traced or reconstructed; the count is a scan of the written symbols.

It is also the form the Leibniz formula indexes: the term for σ takes a 1 , σ ( 1 ) a 2 , σ ( 2 ) ⋯ , reading the entry positions straight off the list, and it is the form a permutation matrix is built from, row i has its 1 in column σ ( i ) .

What it hides is the orbit structure. That ( 2 3 1 ) is a single three-element loop while ( 2 1 4 3 ) is two independent swaps is not apparent from the lists, and neither is the order of the permutation or its decomposition into transpositions. Those require tracing where each element travels, which is the cycle form's business.

Translates into: symbolic

symbolic

The same permutation written as its disjoint orbits: ( 1 2 3 ) means 1 ↦ 2 ↦ 3 ↦ 1 . Following any element until it returns closes one cycle; starting again from an unused element opens the next. The decomposition is unique up to the order the cycles are written and the starting point within each.

This form makes the sign immediate. A cycle of length k is k − 1 transpositions, so its parity is the parity of k − 1 , an even-length cycle is odd, an odd-length cycle is even. The whole permutation's sign is the product over its cycles, which for ( 2 1 4 3 ) = ( 1 2 ) ( 3 4 ) is ( − 1 ) ( − 1 ) = + 1 without counting a single inversion.

It also exposes what one-line notation buries: the order of the permutation is the least common multiple of the cycle lengths, composition with a disjoint cycle is independent, and the structure of S n into conjugacy classes is exactly the classification by cycle type.

Two hazards attach. Fixed points are conventionally omitted, so ( 1 3 ) is a permutation of { 1 , 2 , 3 } or of { 1 , … , 9 } depending on an n the notation does not state. And the length of a cycle is not its parity, the most common error in this representation is reading ( 1 2 3 4 ) as even because 4 is even, when it is three transpositions and odd.

What this form loses is direct access to σ ( i ) for a given i : answering that means locating i in its cycle and stepping once, and building a matrix or a Leibniz term means converting back.

Translates into: symbolic

Worked material

Example

Six permutations and where their signs come from

Each of these is worked by both routes, so the agreement is visible rather than asserted.

The identity, ( 1 2 3 4 ) in S 4 . No pair is out of order, so inv = 0 and the sign is + 1 . As cycles it is four fixed points, contributing no transpositions. It is the one permutation whose matrix is I , with det I = 1 agreeing.

A transposition, ( 2 1 3 4 ) . One pair is inverted, the leading 2 against the 1 , so inv = 1 and the sign is − 1 . As cycles, ( 1 2 ) with 3 and 4 fixed: a single swap. This is the smallest odd permutation, and its matrix is the elementary row-exchange matrix whose determinant the determinants unit gave as − 1 .

A 3-cycle, ( 2 3 1 ) in S 3 . The inverted pairs are ( 2 , 1 ) and ( 3 , 1 ) , so inv = 2 and the sign is + 1 . As cycles it is ( 1 2 3 ) , one cycle of length 3, hence 3 − 1 = 2 transpositions. Odd length, even permutation. The relationship that trips people, seen here in the smallest case.

A 4-cycle, ( 2 3 4 1 ) in S 4 . The inverted pairs are ( 2 , 1 ) , ( 3 , 1 ) and ( 4 , 1 ) , three, so the sign is − 1 . As cycles it is ( 1 2 3 4 ) , one cycle of length 4, hence 3 transpositions. Even length, odd permutation, the mirror of the previous case.

Two disjoint swaps, ( 2 1 4 3 ) in S 4 . Inverted pairs: ( 2 , 1 ) and ( 4 , 3 ) , so inv = 2 and the sign is + 1 . As cycles, ( 1 2 ) ( 3 4 ) : two transpositions, each contributing − 1 , and ( − 1 ) 2 = + 1 . Signs multiply across disjoint cycles.

The reversal, ( 4 3 2 1 ) in S 4 . Every one of the ( 4 2 ) = 6 pairs is inverted, so the sign is ( − 1 ) 6 = + 1 . As cycles it is ( 1 4 ) ( 2 3 ) , again two transpositions. Reversing four elements is even, although reversing three is odd; the parity depends on n through ( n 2 ) and is not a property of "reversing".

Two of them, the 3-cycle and the double swap, have the same sign by different structures. Two others, the 3-cycle and the 4-cycle, differ in sign by one unit of length. And the count of inversions is never the count of transpositions, ( 4 3 2 1 ) has six inversions and two transpositions, only their parity is shared, which is precisely what the sign records.

Contrast

Same length, opposite sign; same sign, different structure

Two permutations of the same size, opposite signs.

σ = ( 2 3 1 ) τ = ( 2 1 3 )
cycles ( 1 2 3 ) ( 1 2 ) , with 3 fixed
transpositions21
inversions21
sign + 1 − 1
moves how many elements32

σ displaces more elements than τ and is nonetheless the even one. Amount of disturbance is not what the sign measures, only the parity of the swap count is.

Same sign, different cycle structure. In S 4 , both ( 1 2 3 ) and ( 1 2 ) ( 3 4 ) are even: the first is one 3-cycle, two transpositions; the second is two 2-cycles, also two transpositions. Their one-line forms are ( 2 3 1 4 ) with inversions 2, and ( 2 1 4 3 ) with inversions 2. Equal signs, and no other structural resemblance, sign is a single bit, and it does not determine the permutation.

The reversal, which alternates. The full reversal of n elements has ( n 2 ) inversions:

n ( n 2 ) sign
21 − 1
33 − 1
46 + 1
510 + 1
615 − 1

Reversing four elements is even; reversing three is odd. Nothing about "reversal" fixes a sign. It depends on n through a binomial coefficient, and the pattern has period 4.

Where the contrast bites. Given a matrix whose rows have been reversed, whether det changes sign depends on the size. For a 4 × 4 the reversal is even, so the determinant is unchanged; for a 3 × 3 it is odd and the determinant negates. Reasoning from "a reversal is a lot of swapping, so it must flip the sign" gives the wrong answer half the time.

Common errors

Common misconception

A cycle of even length is an even permutation, so the 4-cycle ( 1 2 3 4 ) has sign + 1 .

Related units

Connected

Learn this topic

Used in

Sources

Results update as you type. Use the up and down arrow keys to move between results, Enter to open one, and Escape to close.

Type to search.

Settings

Appearance

Interface density

Your record

Your progress is stored in this browser and nowhere else: an identifier, the answers you have given, the mastery states and review schedule derived from them, and the lesson you last opened. Clearing it makes you a new learner on this device. It cannot be undone, and it will not affect your appearance or density settings.

Focus timer

Focus--minutes remaining

Phase

Kept in this browser only, and used to label the session in your own history.

Today

Nothing recorded yet. Finish a focus session and it will appear here.

Settings

Focus sessions between long breaks.

Sessions you are aiming for in a day.

Notifications

Your history

Sessions are stored in this browser and nowhere else. They are not evidence and never reach your mastery record.