QlarIITy

MathematicsJEE Main 2023 · 13 AprilInteger

The number of seven digit positive integers formed using the digits 1, 2, 3 and 4 only and sum of the digits equal to 12 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. A digit sum condition is an equation in whole numbers with limits.

Concept refresher. The number of solutions of x1+x2+…+xk=nx_1 + x_2 + \ldots + x_k = n in non-negative integers is

N=n+k−1Ck−1N = {}^{n+k-1}C_{k-1}

A variable that must be at least mm is replaced by mm plus a new non-negative variable.

Picture the situation. Each of the seven digits is 1, 2, 3 or 4, and the digits add to 12. If every digit were 1 the sum would be 7, so the digits carry 5 extra units in all. A digit can carry at most 3 extra units. So the question is how 5 units can be shared among seven places with at most 3 in any place.

Approach. Count the ways to share the extra units, then subtract the ways that overload a place.

  1. Step 1: Shift the digits

    Write each digit as 1+ei1 + e_i with 0≤ei≤30 \leq e_i \leq 3. The digits add to 12, so the seven extras add to 12−7=512 - 7 = 5.

  2. Step 2: Count without the upper limit

    Ignoring the upper limit for the moment, the non-negative solutions of e1+e2+…+e7=5e_1 + e_2 + \ldots + e_7 = 5 number 5+6C6=11C6=462{}^{5+6}C_6 = {}^{11}C_6 = 462.

  3. Step 3: Remove the large extras

    If some eie_i is 4 or 5, give it 4 first; the remaining 1 can go to any of the 7 extras, so there are 7×7=497 \times 7 = 49 such solutions, and two extras cannot both be that large. The count is 462−49=413462 - 49 = 413.

Answer. 413

Sanity check. The removed solutions are those with a digit 5 or 6: the digit 6 with six 1s, in 7 ways, and the digit 5 with one 2 and five 1s, in 42 ways, which is 49.

Common wrong answers

  • 462: Ignoring the upper limit of 4 on each digit gives 462.

Key takeaway

The trap. A digit cannot exceed the largest digit allowed.

How toppers think. They shift every digit down to zero before applying the formula.

Remember. N=n+k−1Ck−1N = {}^{n+k-1}C_{k-1}

More on Distribution Problems