Number of Derangements

Rarely Tested

Number of Derangements

## Formula

$$!0=1$$

$$!1=0$$

$$!2=1$$

$$!3=2$$

$$!4=9$$

## Approximation

$$!n\approx\frac{n!}{e}$$

## Usage

- Used for quick evaluation or approximation of derangement counts.

Question 1

Let $$S = \{x \in \mathbb{N} : 1 \leq x \leq 9\}$$ be a set of the first $$9$$ natural numbers. A bijective function $$f: S \to S$$ is constructed randomly to form a sequence of elements denoted by $$(a_1, a_2, a_3, \dots, a_9)$$, where $$a_i = f(i)$$ for each $$i \in S$$. Let $$E_1$$ be the event that the sequence forms a complete derangement of the set $$S$$, such that $$f(i) \neq i$$ for all $$i \in S$$. Let $$E_2$$ be the event that all prime numbers in the domain map to prime numbers in the codomain, satisfying the structural constraint $$f(\{2, 3, 5, 7\}) = \{2, 3, 5, 7\}$$. If $$N$$ represents the total number of unique bijective functions $$f(x)$$ that simultaneously satisfy the conditions for both events $$E_1$$ and $$E_2$$, then the value of $$N$$ is:

Go back to topics

Join CAT 2026 course by 5-Time CAT 100%iler

Start your IIM journey with the right preparation and crack CAT 2026.