Definition:Derangement

A derangement is a permutation $$f: S \to S$$ from a set $$S$$ to itself where $$f(s)\neq s$$ for any $$s\in S$$.

If $$S$$ is finite, the number of derangements is denoted by $$D_n$$ where $$n=|S|$$ (the cardinality of $$S$$.)