combinatorics problem

This topic has expert replies
Source: — Problem Solving |

GMAT/MBA Expert

User avatar
GMAT Instructor
Posts: 1179
Joined: Sun Apr 11, 2010 9:07 pm
Location: Milpitas, CA
Thanked: 447 times
Followed by:88 members

by Rahul@gurome » Thu Oct 28, 2010 1:48 pm
replayyyy wrote:How many positive integers less than 10 000 are there in which the sum of digits equal 5?
A. 31
B. 51
C. 56
D. 62
E. 93
Positive integer less than 10,000 means the integer can be 1 or 2 or 3 or 4 digit integer.
Sum of digits equal to 5 is possible in the following ways,

(0, 0, 0, 5) => 4!/3! combinations = 4
(0, 0, 1, 4) => 4!/2! combinations = 12
(0, 0, 2, 3) => 4!/2! combinations = 12
(0, 1, 1, 3) => 4!/2! combinations = 12
(0, 1, 2, 2) => 4!/2! combinations = 12
(1, 1, 1, 2) => 4!/3! combinations = 4

Total number of combination possible = (4 +12 +12 +12 +12 +4) = 56

The correct answer is C.

There is an efficient method to solve this kind of problems.
The question can be rephrased as in how many ways a sum of 5 can be spread among 4 digits (including those in the form 0XXX, 00XX, 000X).

Let's assume 'X' represents 1 and '|' represents a digit separator.
Thus, 2012 becomes XX| |X|XX, 0050 becomes ||XXXXX|, 2003 becomes XX|||XXX etc.

As we are working with 4 digit number, we'll use three digit separators and as the sum of digits is 5, we'll use five 'X's. Now the problem is in how many ways 5 X's and 3 digit separators can be arranged among themselves.

Number of ways to arrange them = 8!/(3!*5!) = 56
Rahul Lakhani
Quant Expert
Gurome, Inc.
https://www.GuroMe.com
On MBA sabbatical (at ISB) for 2011-12 - will stay active as time permits
1-800-566-4043 (USA)
+91-99201 32411 (India)

Newbie | Next Rank: 10 Posts
Posts: 1
Joined: Fri Oct 29, 2010 3:15 am

by arrgos » Fri Oct 29, 2010 4:43 am
Hello Rauhl - et al,
Here's what I did w/o using the factorial method you used (I had no other idea of how to solve it until I read yours):
1. 10000 - 1 = 9999
2. I selected "9" as the point of work
3. I listed all of combinations of numbers that add "9" (1+8, 2+7, 3+6, 4+5)
4. then, I multiplied each combination (1*8=8, 2*7=14, 3*6=18, 4*5=20) and added their results = 60
5. Since I had already 'minus' 1 from 10,000, I went ahead and substracted 4 additional, to get a result of 56; as the correct answer.

What did I do to get it right? Thanks for your reply.