3
1
2
Permutations
Swap numbers freely and watch a permutation turn even or odd — and see the cycles behind it.
Shuffle a fresh board of that many numbers…
Any distinct numbers, separated by spaces or commas.
A permutation is a row of numbers in some order. Start from 1, 2, 3, … and swap any two to build one.
Click two numbers to swap them. Each swap is a transposition. The Parity badge shows whether the arrangement is even or odd right now — it flips with every swap.
Press Show cycles for the arrows. Follow a number's arrow to the slot it belongs in; the arrows close into loops called cycles, each in its own colour.
A loop of k numbers unwinds in k−1 swaps. Add those up over all the loops and you get the arrangement's parity: even total → even, odd total → odd.
Here's the magic: every swap flips even ↔ odd, because it always splits one loop in two or merges two into one. So the parity is fixed by the arrangement alone — you can never sneak from even to odd in an even number of swaps.
Click two numbers to swap them.