The number of permutations, of the digits without repetition, which neither contain the string 153 nor the string 2467, is _______ .
Solution
Core idea. Objects with neither of two properties are counted by inclusion and exclusion.
Concept refresher. For two properties and , the number of objects with at least one of them is
and the remaining objects have neither.
Picture the situation. A permutation contains the string 153 when those three digits appear next to one another in that order, and similarly for 2467. Such permutations are counted by gluing the string into one block. The two strings use different digits, and together they use all seven, so a permutation can contain both.
Approach. Count the permutations containing each string and both, then apply inclusion and exclusion.
Step 1: All permutations
The seven different digits can be arranged in a row in ways.
Step 2: Containing a string
With 153 as a block there are 5 units and permutations. With 2467 as a block there are 4 units and . The two strings share no digit, so both can appear together, as 2 units, in ways.
Step 3: Neither string
So permutations contain at least one string, and contain neither.
Answer. 4898
Sanity check. The two permutations containing both strings are 1532467 and 2467153.
Common wrong answers
- 4896: Not adding back the 2 permutations that contain both strings gives 4896.
- 142: The value 142 counts the permutations that contain at least one of the strings.
Key takeaway
The trap. Permutations with both strings are removed twice unless they are added back.
How toppers think. They check whether the two strings can occur together before subtracting.
Remember.
More on Inclusion–Exclusion Principle
- The number of seven-digit numbers, that can be formed by using the digits 1, 2, 3, 5 and 7 such that each…
- The total number of 4-digit numbers whose greatest common divisor with 54 is 2, is
- Let b₁b₂b₃b₄ be a 4-element permutation with bi ∈ {1, 2, 3, …, 100} for 1 ≤ i ≤ 4 and bi ≠ bj for i ≠ j…
- All 7 on Inclusion–Exclusion Principle ›