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
  1. 1EnterProvide the known values
  2. 2CalculateResults update automatically
  3. 3VerifyReview the details and units
Try an example

Exact count

Enter valid values to see the result.

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

Feedback

Understand the subject

What is a derangement?

A <strong>derangement</strong> is a permutation in which no object remains in its original position.

Use it for reassignment problems, secret-santa-style matching, and no-fixed-point arrangements.

The relationship

The counting rule

See the structure

Every original match is forbidden

Worked example

Check the rule with a small case

Four objects have !4 = 9 no-fixed-position arrangements.

Interpret with care

Choose the right counting model

This counts a complete one-to-one reassignment, not merely an arrangement with at least one moved object.

Use the Permutation & Combination Generator when a small case needs to be inspected rather than only counted.

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.