Permutation Sign Calculator
Enter a permutation of 1..n to find its sign and parity.
Result
How it is calculated
The tool counts inversions: pairs of positions i < j where the value at i is larger than the value at j. The sign is (−1)inversions, so an even count gives +1 (even permutation) and an odd count gives −1 (odd permutation). Enter the numbers separated by spaces or commas, with no brackets. The list must be exactly a rearrangement of 1..n: every number from 1 to n once. A repeated number, a gap (1 2 4), a 0, a single entry such as 5, or brackets such as (2,1,3) return no result. The count is a plain double loop, so there is no rounding, and the rule does not depend on country or year.
Worked example
Permutation 3 1 4 2 5. Check each pair where an earlier number is larger than a later one: (3,1), (3,2) and (4,2). That is 3 inversions; 5 is in its place and creates none. Three is odd, so the sign is (−1)3 = −1. The tool shows −1 (odd), 3 inversions, parity odd.
Common mistakes
- Typing the cycle notation or brackets, (2,1,3) or [2 1 3]; only bare numbers separated by spaces or commas are read.
- Entering a list that is not a rearrangement of 1..n, for example 1 2 4 or 2 3 4, or one with a repeat; the tool returns nothing rather than guessing.
- Starting from 0, as many programming languages index; the numbers must run 1 to n.
- Counting only neighbouring pairs or only the numbers out of place: an inversion is any pair, however far apart, so 3 1 2 has two inversions (3 before 1, 3 before 2).
- Confusing the sign with the number of inversions: 10 inversions or 4 inversions both give +1; only the odd or even parity matters.
About this calculator
The sign (or parity) of a permutation of 1..n tells you whether it can be built from an even or odd number of pairwise swaps (transpositions) of the identity order. This calculator counts inversions — pairs of positions where a larger number appears before a smaller one — and reports even inversions as sign +1, odd as sign −1.
For example, the permutation (2,1,3) has exactly one inversion (2 before 1), so it's odd with sign −1, while (2,3,1) has two inversions and is even with sign +1. This is exactly the quantity that appears in the Leibniz formula for a matrix determinant, where each term in the sum is weighted by the sign of the permutation defining that term.
Linear algebra and combinatorics students use it to check determinant expansions by hand, and it comes up in group theory when classifying elements of the symmetric group S_n as belonging to the alternating group (even permutations only).
Was this helpful?
You can pick up to 3 reactions.
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
- Loan Calculator
- Profit Calculator
- Discount Calculator
- BMI Calculator
- Percentage Calculator
- Ideal Weight Calculator
- Age Calculator
- Pregnancy Due Date Calculator
- Compound Interest Calculator
- BMR Calculator (Basal Metabolic Rate)
- Tip Calculator
- Fuel Cost Calculator
- Date Difference Calculator
- Sleep Cycle Calculator
- Daily Water Intake Calculator
- Simple Interest Calculator
- Heart Rate Zones Calculator
- Running Pace Calculator
- Pet Age Calculator
- Calories Burned Calculator
- Macro Calculator
- TDEE Calculator (Total Daily Energy Expenditure)
- Waist-to-Hip Ratio Calculator
- Honor Roll Calculator
- One Rep Max (1RM) Calculator
- Ovulation Calculator
- Electricity Cost Calculator
- Unit Price Calculator
- Savings Goal Calculator
- Break-Even Point Calculator
- Paint Calculator
- Course Grade Average Calculator
- Business Days Calculator
- Time Duration Calculator
- Fuel Economy Calculator
- Temperature Converter
- Tile Calculator
- Aspect Ratio Calculator
- Roman Numeral Converter
- Goal Weight Timeline Calculator
- Salary Converter (Hourly to Annual)
- Credit Card Validator (Luhn)
- Body Surface Area (BSA) Calculator
- Feels-Like Temperature Calculator
- Ohm’s Law Calculator
- PPI (Pixel Density) Calculator
- Molar Mass Calculator
- Zodiac Sign Calculator (Western + Chinese)
- IBAN Validator
- Shoe Size Converter
- Country Info & Dialing Code Lookup
- Time Zone Difference (World Clock)
- CAGR (Compound Annual Growth Rate) Calculator
- Rule of 72 Calculator
- Blood Alcohol Content (BAC) Calculator
- Lean Body Mass (LBM) Calculator
- Pythagorean Theorem Calculator
- Speed Converter
- Download Time Calculator
- Date Calculator (Add/Subtract)
No calculators found
Comments