JEE Advanced 2025 Mathematics question — Arrangements with restrictions
Let S be the set of all seven-digit numbers that can be formed using the digits 0, 1 and 2. For example, 2210222 is in S, but 0210222 is NOT in S.
Then the number of elements x in S such that at least one of the digits 0 and 1 appears exactly twice in x, is equal to ________.
SOLUTION
Let a seven-digit number x contain a0 zeros, a1 ones and a2 twos, so that
a0+a1+a2=7 and a0,a1,a2≥0.
Because the first (left-most) digit cannot be 0, we count the admissible arrangements for each triple (a0,a1,a2) as follows.
Total arrangements with these counts = a0!a1!a2!7!.
Arrangements whose first digit is 0: fix a zero at the first place and permute the remaining 6 digits, giving (a0−1)!a1!a2!6! (this term appears only when a0≥1).
Hence the required number for the triple (a0,a1,a2) is
The problem asks for the count of all numbers in which at least one of the digits 0 or 1 appears exactly twice. We split this into three disjoint cases.
Case 1:a0=2,a1=2
Let the possible values of a1 be 0,1,3,4,5 (they must stay within 0≤a1≤5). For each value we compute a2=7−2−a1 and use (1).