JEE Main 2023 · 13 April · morning · Numerical answer · +4 / −0

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 ___________.

Answer and solution

Answer 413

Solution

Maths sir · 4 steps

Shift each digit down by 1 to turn this into stars and bars, then remove the cases where a digit goes past 4.

  1. Shift the digits. Call the digits d₁, …, d₇, each from 1 to 4, with sum 12. Put yᵢ = dᵢ - 1. Then each yᵢ is from 0 to 3, and y₁ + … + y₇ = 12 - 7 = 5.
  2. Count without the cap. Non-negative solutions of y₁ + … + y₇ = 5 number C(5+6, 6) = C(11, 6) = 462.
  3. Remove the overflows. A bad solution has some yᵢ ≥ 4, which means a digit of 5 or more. Pick that yᵢ in 7 ways and take 4 from it. The remaining total is 1, shared among 7 variables in C(7, 6) = 7 ways, so there are 7 × 7 = 49 bad solutions. Two variables cannot both be 4 or more, because 4 + 4 > 5.

    C(11, 6) - 7C(7, 6) = 462 - 49 = 413

  4. So. There are 413 such seven-digit numbers. Zero is not one of the allowed digits, so every arrangement is a genuine seven-digit number.

The common slip: 462. Forgetting that each digit is at most 4 gives C(11, 6) = 462. That count includes numbers with a digit of 5 or 6.

The idea to keep. For digits with a lower and an upper limit, shift by the lower limit and apply stars and bars. Then subtract the solutions that break the upper limit (inclusion-exclusion).

Answer from the NTA final answer key. Solution by PrepWiser.

Study Permutations & Combinations

Asked about 160 times in JEE Main since 2020. This question is from 2023.