Calculators

Involution Calculator

Calculate the exact number of self-inverse permutations of distinct items using browser-only BigInt arithmetic.

Count permutations that are their own inverse: every item stays fixed or swaps with one other item. Enter n from 0 to 1000. Calculations stay in your browser.

Enter an item count to calculate involutions.

Count permutations made of fixed items and disjoint swaps.

An involution is a permutation that is its own inverse: applying it twice restores every item. Each cycle has length one or two, so items either stay fixed or swap in disjoint pairs. For n distinct items, I(n) = I(n − 1) + (n − 1) × I(n − 2), with I(0) = I(1) = 1. The last item either stays fixed or chooses one of n − 1 partners. The sequence begins 1, 1, 2, 4, 10, 26, 76. For three items the four involutions are the identity and each of the three single swaps. The empty permutation contributes one involution. Unlike a derangement, an involution can have fixed positions; unlike a general permutation, it cannot contain cycles longer than two. This counts all possible numbers of fixed positions, including the identity. Enter a whole number from 0 to 1000. Leading zeros and surrounding whitespace are accepted; signs, decimals and scientific notation are rejected. Exact BigInt arithmetic preserves every digit. Inputs stay in your browser.

Frequently Asked Questions

Everything you need to know about this tool, how it works, and privacy.

What is an involution?

A permutation that is its own inverse. Applying it twice restores the original order. Each item stays fixed or swaps with exactly one other item.

How are involutions counted?

Use I(n) = I(n − 1) + (n − 1) × I(n − 2), starting with I(0) = I(1) = 1. The last item either stays fixed or pairs with one of the other items.

How many involutions are there for five items?

There are 26, including the identity. For three items there are four: the identity and three possible single swaps.

How does this differ from derangements?

Derangements forbid fixed positions but allow longer cycles. Involutions allow fixed positions but only cycles of length one or two.

Why does zero items give one?

The empty permutation is its own inverse, so I(0) = 1.

Are results exact and private?

Yes. Whole-number inputs from 0 to 1000 use exact browser BigInt arithmetic without uploading your input.