Calculator Scope

Even/Odd Permutation Parity Checker

Even/Odd Permutation Parity Checker

Result
—
Calculator Scope
This calculator counts the inversions in your permutation to determine whether it's even or odd, e.g. 2,1,3 has 1 inversion, making it odd.

Every permutation is classified as either even or odd based on the number of inversions it contains — pairs of positions where a larger number appears before a smaller one. Enter a permutation as a comma-separated list of numbers, and this calculator counts the inversions and determines its parity. This distinction matters in determinant calculations and group theory, where swapping any two elements in a sequence always flips its parity, regardless of which two positions are swapped.

  • An inversion is a pair of positions where a larger number appears before a smaller one, e.g. in 2,1,3 the pair (2,1) is an inversion since 2 comes before 1 but is larger.
  • A permutation is even if it has an even number of inversions, and odd if it has an odd number, e.g. 1,2,3 has 0 inversions (even), while 2,1,3 has 1 inversion (odd).
  • Permutation parity matters in determinant calculations and group theory, since swapping any two elements always flips the parity, regardless of which two are swapped.

How do I count inversions in a permutation?

Compare every pair of positions; count a pair as an inversion whenever the earlier position holds a larger number than the later position.

Is the permutation 2,1,3 even or odd?

Odd — it has exactly 1 inversion (the pair 2,1).