Closed Form for Number of Derangements on Finite Set

Theorem
The number of derangements $D_n$ on a finite set $S$ of cardinality $n$ is:

Also see

 * Definition:Subfactorial