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________.
Solution
Core idea. A digit sum condition is an equation in whole numbers with limits.
Concept refresher. The number of solutions of in non-negative integers is
A variable that must be at least is replaced by 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.
Step 1: Shift the digits
Write each digit as with . The digits add to 12, so the seven extras add to .
Step 2: Count without the upper limit
Ignoring the upper limit for the moment, the non-negative solutions of number .
Step 3: Remove the large extras
If some is 4 or 5, give it 4 first; the remaining 1 can go to any of the 7 extras, so there are such solutions, and two extras cannot both be that large. The count is .
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.
More on Distribution Problems
- A person has three different bags and four different books. The number of ways, in which he can put these…
- A building has ground floor and 10 more floors. Nine persons enter in a lift at the ground floor. The lift…
- Let A = {(a, b, c): a, b, c; are non-negative integers and; a + b + 2c = 22}. Then n(A) is equal to:
- All 19 on Distribution Problems ›