QlarIITy

MathematicsJEE Main 2023 · 10 AprilInteger

The number of permutations, of the digits 1,2,3,…,71, 2, 3, \ldots, 7 without repetition, which neither contain the string 153 nor the string 2467, is _______ .

Try it before you look.The full solution is on this page, below the answer box, the moment you check. No sign-in needed.

Solution

Core idea. Objects with neither of two properties are counted by inclusion and exclusion.

Concept refresher. For two properties AA and BB, the number of objects with at least one of them is

n(A∪B)=n(A)+n(B)−n(A∩B)n(A \cup B) = n(A) + n(B) - n(A \cap B)

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.

  1. Step 1: All permutations

    The seven different digits can be arranged in a row in 7!=50407! = 5040 ways.

  2. Step 2: Containing a string

    With 153 as a block there are 5 units and 5!=1205! = 120 permutations. With 2467 as a block there are 4 units and 4!=244! = 24. The two strings share no digit, so both can appear together, as 2 units, in 2!=22! = 2 ways.

  3. Step 3: Neither string

    So 120+24−2=142120 + 24 - 2 = 142 permutations contain at least one string, and 5040−142=48985040 - 142 = 4898 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. 7!−5!−4!+2!7! - 5! - 4! + 2!

More on Inclusion–Exclusion Principle