Solution

ID: past-exam-of-the-year-1-of-the-computer-science-course-of-the-university-of-oxford/2019/discrete-mathematics-continuous-mathematics-and-probability-resit/2/b/solution

Let be the set of permutations fixing object . If a specified collection of objects is fixed, the remaining objects can be arranged in ways. There are such collections. Applying the inclusion-exclusion principle to exclude all fixed objects gives
For , the terms and cancel. Thus the number of derangements is , interpreting the remaining sum as empty when . The full inclusion-exclusion formula also gives .

New to topics? Read the docs here!