Every permutation can be built by swapping two items at a time, and although there are many different ways to do it, the number of swaps is always even or always odd for a given permutation. Permutations that need an even number of swaps are called even; they have sign +1 and form the alternating group Aₙ. This calculator counts them for any n up to 10,000, lists them for small n, and checks the parity of any permutation you type.
How to use the even permutations calculator
- Choose Count even permutations or Check a permutation.
- To count, enter Number of items (n). Tick List the even permutations to see all of them for n ≤ 6, each with its cycle form and inversion count.
- To check, type the permutation in one-line notation (the new order of 1…n, such as 2 1 4 3 5) or in cycle notation, such as (1 2)(3 4).
- Read the answer on the tape. The steps show the cycles, the number of swaps and the inversion check.
Formulas
For n ≥ 2, exactly half of the permutations are even:
Why half? Pair each permutation with the one you get by swapping the items in the first two positions. A single swap always flips parity, and swapping again undoes it, so this pairing matches the even permutations one-to-one with the odd ones.
To test one permutation σ, split it into c disjoint cycles (fixed points count as cycles of length 1). Each cycle of length L is L − 1 swaps, so
The number of inversions — pairs of positions i < j whose entries appear in decreasing order — always has the same parity, which gives an independent check.
Worked example
Count: 5 items have 5! = 120 permutations, so 120 ÷ 2 = 60 are even.
Check 2 1 4 3 5: 1→2→1 and 3→4→3, with 5 fixed. Cycles: (1 2)(3 4). Swaps: (2 − 1) + (2 − 1) = 2, or n − c = 5 − 3 = 2.
Inversions: (2, 1) and (4, 3), so 2. Both counts are even: the permutation is even, sign +1.
Even and odd counts for small n
| n | All permutations (n!) | Even (n!/2) | Odd |
|---|---|---|---|
| 1 | 1 | 1 | 0 |
| 2 | 2 | 1 | 1 |
| 3 | 6 | 3 | 3 |
| 4 | 24 | 12 | 12 |
| 5 | 120 | 60 | 60 |
| 6 | 720 | 360 | 360 |
| 7 | 5,040 | 2,520 | 2,520 |
| 8 | 40,320 | 20,160 | 20,160 |
For three items the even permutations are the identity and the two 3-cycles, (1 2 3) and (1 3 2) — exactly the rotations of a triangle.
Quick parity rules
- A cycle of odd length is an even permutation, and a cycle of even length is odd. A 3-cycle is even; a 4-cycle is odd.
- Composing permutations adds their swap counts: even ∘ even = even, odd ∘ odd = even, even ∘ odd = odd.
- A permutation and its inverse have the same parity.
- For n ≥ 3, every even permutation is a product of 3-cycles, which is why puzzles whose moves are 3-cycles can reach only even arrangements.
Where the alternating group shows up
The alternating groups are among the most important objects in algebra. A₄, with 12 elements, is the group of rotations of a regular tetrahedron, and A₅, with 60 elements, is the group of rotations of an icosahedron or dodecahedron. A₅ is also the smallest simple group that is not commutative, a fact at the heart of Galois theory’s explanation of why there is no general formula in radicals for fifth-degree equations. Determinants use the same sign: in the Leibniz formula, each product of matrix entries is weighted by sgn(σ).
For the complementary count and more on what makes a permutation odd, see the odd permutations calculator. For counting arrangements rather than classifying them, use the permutations calculator.
Frequently asked questions
What is an even permutation?
A permutation is even if it can be produced by an even number of swaps of two items (transpositions). The identity, which needs zero swaps, is even, and so is every 3-cycle such as (1 2 3), which equals two swaps.
How many even permutations do n items have?
Exactly half of all n! permutations when n is 2 or more, so n!/2. Five items have 120 permutations, of which 60 are even. With 0 or 1 item the only permutation is the identity, which is even.
How do I tell whether a permutation is even?
Write it as disjoint cycles. A cycle of length L equals L − 1 swaps, so add up L − 1 over all cycles; the permutation is even when that total is even. Equivalently, it is even when its number of inversions is even.
What is the alternating group Aₙ?
Aₙ is the set of even permutations of n items. It is a group because composing two even permutations gives an even one. Its order is n!/2, so A₄ has 12 elements and A₅ has 60.
Can I type a permutation that starts at 0?
Yes. One-line notation such as 2 0 1 is read as a permutation of 0, 1 and 2. Cycle notation that contains a 0 is read the same way.