Derangements
Derangements
D1 = 0, D2 = 1, D3 = 2, D4 = 9, D5 = 44, D6 = 265.
Problems
1. How many ways can a hatcheck girl hand back the n hats of n gentlemen, one to
each gentleman, with no man gettnig his hat?
1
Nonconsecutive permutations
A permutation of {1, 2, . . . , n} is called nonconsecutive if none of 12, 23, . . . , (n − 1)n
occurs.
Theorem 5. For n ≥ 1, the number Qn of nonconsecutive permutations of {1, 2, . . . , n}
is given by
n−1
k n−1
X
Qn = (−1) (n − k)!
k=0
k
Proposition 6. For n ≥ 2,
Qn = Dn + Dn−1 .
A circular permutation of {1, 2, . . . , n} is called nonconsecutive if none of 12, 23, . . . , (n−
1)n, n1 occurs.
Theorem 7. For n ≥ 1, the number Cn of nonconsecutive circular permutations of
{1, 2, . . . , n} is given by
n−1
k n
X
Cn = (−1) (n − k − 1)! + (−1)n
k=0
k
Problems
1. n camels march in the desert in a caravan. Their journey is very uneventful, and the
camels are tired of always watching the same animals in front of them. Therefore
their owner wants to rearrange them so that every camel has a different camel in
front of it (the position of the original first camel is arbitrary). How many possible
rearrangements are there?
2. How many ways are there for 8 children on a merry-go-round to change places so
that somebody new is in front of each child? (The horses are indistinguishable and
in a circle.)
Surjective Functions
Let X be a set with m objects and let Y be a set with n objects.
The number of all functions from X to Y equals nm .
n
The number of injective functions from X to Y equals m m! = P (n, m).
Theorem 8. The number S(m, n) of surjective functions from X to Y is given by
n
k n
X
S(m, n) = (−1) (n − k)m .
k
k=0
n
X m X
k n
= (−1) (n − k)m .
i1 +i2 +···+in =m,i1 ,i2 ,...,in ≥1
i1 , i2 , . . . , in k=0
k