Number Theory

Derangement Calculator

Calculate derangements online quickly and easily. Find the number of permutations where no element is in its original position. Perfect for combinatorics and probability calculations.

Result:

Calculation Steps:

What are Derangements?

In combinatorics, a derangement is a permutation of the elements of a set such that no element appears in its original position. For example, if we have the set {(1, 2, 3)}, the derangements are (2, 3, 1) and (3, 1, 2). The number of derangements of a set of size n is denoted by D(n) or !n.

Formula

The number of derangements D(n) can be calculated using the recursive formula:

  • D(0) = 1
  • D(1) = 0
  • D(n) = (n - 1) * [D(n-1) + D(n-2)] for n ≥ 2

Alternatively, it can be calculated using the subfactorial formula, which is closely related to the factorial:

D(n) = n! * [1 - 1/1! + 1/2! - 1/3! + ... + (-1)^n/n!]

Use Cases

Derangements have applications in various fields, including:

  • Probability: Calculating probabilities in scenarios where no match is desired.
  • Statistics: In problems involving permutations and arrangements.
  • Computer Science: Algorithm analysis and problem-solving.
  • Puzzles and Games: In designing and solving combinatorial puzzles.

Sources: Wikipedia, MathWorld

Frequently Asked Questions

What is the Derangement Calculator?
The Derangement Calculator is an online Number Theory calculator. You enter your values, and it returns the answer with the steps shown so you can follow along.
How accurate is the Derangement Calculator?
The solver uses a math engine that avoids the floating-point rounding errors you get from most hardware calculators. For typical homework and professional calculations, the results will match what you would get by hand.
Can I use the Derangement Calculator for professional Number Theory projects?
Yes. The math behind it is standard Number Theory, so the results are reliable for professional use. That said, always double-check that your inputs are in the right format before relying on the output.
Why use the Derangement Calculator instead of calculating by hand?
Manual calculation is slow and error-prone, especially with multiple steps. This tool does the arithmetic for you and shows each step, so you can catch mistakes before they carry forward.
How do I format my inputs for the Derangement Calculator?
Type your numbers into the input fields. Leave out units and symbols unless a field specifically asks for them. The solver handles the rest.