Counting & Number Theory

Permutation Fixed Points & Derangement Calculator

Count permutations that leave exactly k of n labelled objects in their original positions.

How the calculation works

Choose the k fixed objects in C(n,k) ways and derange the remaining n−k. Derangements satisfy D(0)=1, D(1)=0 and D(n)=(n−1)[D(n−1)+D(n−2)]. Divide the count by n! for a uniform-permutation probability, using logarithms for large values.

Worked example

Example inputs — Number of labelled objects n: 5; Exactly this many fixed positions k: 0. Expected results — Permutations with exactly k fixed positions: 44; All permutations of n objects: 120; Probability under a uniform permutation: 0.3666666667 fraction.

Assumptions and limits

Exact integer arithmetic is used for counts and integer results. Computation limits keep this browser tool responsive. Specify whether objects/groups are distinguishable and whether order matters; different conventions count different outcomes. Exactly k, not at least k. The k=0 mode is the derangement count; it shares this page with other fixed-point outcomes. The empty permutation has one outcome and zero fixed points. Probability is floating-point and may underflow for extremely rare cases.

Reference and further reading

Read the underlying subject reference. Calculith is an independent implementation; the reference does not endorse or certify this tool.

Related calculators

Browse all 1000 calculators →

Example values are editable. Results are estimates where assumptions apply. Calculations run in your browser. Updated 2026-11-16.