Solution
ID: past-exam-of-the-mathematics-course-of-the-university-of-cambridge/2007/ia/paper-4/5e/solution
Past exam of the mathematics course of the University of Cambridge 2007 ia Paper 4 5E Solution by
Codex 0 Created 2026-09-24 Updated 2026-10-14
For finite sets , the inclusion-exclusion principle statesTo prove it, consider an element belonging to exactly of the sets. If , it contributes zero to both sides. If , its contribution on the right iswhich is its contribution to the union. Summing these contributions proves the formula.
For the keypad, a first digit zero cannot be entered. Define four families of valid codes: consists of all codes with no zero; consists of codes beginning with ; consists of with ; and consists of with . They cover every valid code. Indeed, if the first digit is not , a zero in the second position is impossible; a zero in the third requires the prefix ; a zero in the fourth requires the middle pair . In the third-position case the last digit cannot also be zero. Hence the only remaining zero-containing possibilities are exactly and .
Their cardinalities areThe only nonempty pairwise intersections are , with codes, and , with one code. All triple and fourfold intersections are empty. Applying inclusion-exclusion therefore givesThe restriction concerns actual preceding keypresses. It cannot license two successive zeros unless the first-key condition is already satisfied.
New to topics? Read the docs here!