Counting, Permutations & Combinations

Derangement Calculator

Count permutations in which no object remains in its original position.

Counting & Combinatorics

Count arrangements with no fixed positions

Exact subfactorial

Exact count

Enter valid values to see the result.

Your entries are calculated in this browser and are not submitted to 365CALCS.COM.

Quick guide

How to use this calculator

  1. Enter the number of distinct objects.
  2. Every object is required to move from its original position.
  3. Read the exact derangement, also called the subfactorial.

Calculation method

Use the derangement recurrence

The recurrence !n=(n−1)(!(n−1)+!(n−2)) starts from !0=1 and !1=0.

Worked example

Derange four objects

There are nine permutations of four objects with no fixed positions.

!4 = 3(!3+!2) = 9

Supported inputs

Precision and limits

Discrete domain

Inputs are whole counts. Negative, fractional, grouped, and scientific-notation inputs are rejected.

Exact integers

Results use arbitrary-precision integers and are never rounded. Inputs and output size are bounded to keep the page responsive.