Counting Problem

This topic has expert replies
Source: — Problem Solving |

User avatar
Legendary Member
Posts: 758
Joined: Sat Aug 29, 2009 9:32 pm
Location: Bangalore,India
Thanked: 67 times
Followed by:2 members

by sumanr84 » Mon Jul 19, 2010 10:38 pm
ankur.agrawal wrote:How many positive integers less than 10,000 are there in which the sum of the digits equals 5?

Pls help to solve this question.
Edited my wrong answer, Here is the link,
https://www.beatthegmat.com/need-help-wi ... 25206.html

User avatar
Legendary Member
Posts: 1893
Joined: Sun May 30, 2010 11:48 pm
Thanked: 215 times
Followed by:7 members

by kvcpk » Mon Jul 19, 2010 11:01 pm
ankur.agrawal wrote:How many positive integers less than 10,000 are there in which the sum of the digits equals 5?

Pls help to solve this question.
Betweeen 1-99
5,14,23,32,41,50

Between 100-999
104,113,122.131,140
203,212,221,230
302,311,320
401,410
500

Between 1000-1999
1004,1013,1022,1031,1040
1103,1112,1121,1130
1202,1211,1220
1301,1310
1400

Between 2000-2999
2003,2012,2021,2030
2102,2111,2120
2201,2210
2300

Between 3000-3999
3002,3011,3020
3101,3110
3200

Between 4000-4999
4001,4010

Between 5000-10000
5000

I did it manually quickly.. But Here is a pattern.

Number of entries between
01-999 is (5-0)+1 =6+5+4+3+2+1
1000-1999 is (5-1)+1 = 5+4+3+2+1=15
2000-2999 is (5-2)+1=4+3+2+1=10
3000-3999 is (5-3)+1=3+2+1=6
4000-4999 is (5-4)+1=2+1 =3
5000-10000 is (5-5)+1=1

21+15+10+6+3+1 = 56

What is the OA?

Senior | Next Rank: 100 Posts
Posts: 97
Joined: Thu Jan 28, 2010 2:07 am
Thanked: 9 times

by aloneontheedge » Tue Jul 20, 2010 12:50 am
kvcpk wrote:
ankur.agrawal wrote:How many positive integers less than 10,000 are there in which the sum of the digits equals 5?

Pls help to solve this question.
Betweeen 1-99
5,14,23,32,41,50

Between 100-999
104,113,122.131,140
203,212,221,230
302,311,320
401,410
500

Between 1000-1999
1004,1013,1022,1031,1040
1103,1112,1121,1130
1202,1211,1220
1301,1310
1400

Between 2000-2999
2003,2012,2021,2030
2102,2111,2120
2201,2210
2300

Between 3000-3999
3002,3011,3020
3101,3110
3200

Between 4000-4999
4001,4010

Between 5000-10000
5000

I did it manually quickly.. But Here is a pattern.

Number of entries between
01-999 is (5-0)+1 =6+5+4+3+2+1
1000-1999 is (5-1)+1 = 5+4+3+2+1=15
2000-2999 is (5-2)+1=4+3+2+1=10
3000-3999 is (5-3)+1=3+2+1=6
4000-4999 is (5-4)+1=2+1 =3
5000-10000 is (5-5)+1=1

21+15+10+6+3+1 = 56

What is the OA?
Hey,
i did not understand how did u arrive at the pattern,would u plz explain?

User avatar
Legendary Member
Posts: 1893
Joined: Sun May 30, 2010 11:48 pm
Thanked: 215 times
Followed by:7 members

by kvcpk » Tue Jul 20, 2010 1:49 am
aloneontheedge wrote: Hey,
i did not understand how did u arrive at the pattern,would u plz explain?
Pattern I found is:

Summation of { [The sum you want to find for - The range header]+1 } upto 1
This will give the number of numbers that have the sum you want in that particular range.
In the current example:

The sum you want to find for =5
The range header = 0,1,2,3,4,5 [because Ranges start with 0001,1000,2000,3000,4000,5000]

Therefore result when range header is 0 can be calculated as
We get (5-0)+1 = 6
Hence summaton of 6 to 1 is 6+5+4+3+2+1 = 21

Similarly when the range header is 1, we will get 5+4+3+2+1 = 15

Summation of all the range headers gives us the total count of numbers with sum of digits as 5.
i.e; 21+15+10+6+3+1 = 56

Hope this helps.. Let me know if you dont get it.

Also, Let us take some other example to see if its correct.
Let us say we need to find the count of numbers less than 10000 with sum of digits as 1.
We know that the numbers are 1,10,100,1000 -> only 4.

Let us see if my pattern works here.

The sum you want to find for =1
For First range header -> 0.
count = (1-0)+1 = 2, Hence summation upto 1 = 2+1 = 3
For second range header ->1
count = (1-1)+1 = 1, Hence summation = 1

Hence total number of numbers with sum of digits as 1 = 3+1 = 4.

Hope this helps!!

Master | Next Rank: 500 Posts
Posts: 219
Joined: Mon Mar 08, 2010 8:51 pm
Thanked: 62 times
Followed by:5 members
GMAT Score:750

by fitzgerald23 » Tue Jul 20, 2010 8:43 am
Here was the way I approached this.

These are the following combinations that can be used to reach 5:

3200
4100
5000
3110
2110
2210

From there you determine the number of ways that you can arrange the digits
3200- 4!/2!= 12 ways
4100= 4!/2!= 12 ways
5000= 4!/3!= 4 ways
3110= 4!/2!= 12 ways
2111= 4!/3!= 4 ways
2210= 4!/2!= 12 ways

Total = 56 ways

Senior | Next Rank: 100 Posts
Posts: 97
Joined: Thu Jan 28, 2010 2:07 am
Thanked: 9 times

by aloneontheedge » Tue Jul 20, 2010 10:35 am
kvcpk wrote:
aloneontheedge wrote: Hey,
i did not understand how did u arrive at the pattern,would u plz explain?
Pattern I found is:

Summation of { [The sum you want to find for - The range header]+1 } upto 1
This will give the number of numbers that have the sum you want in that particular range.
In the current example:

The sum you want to find for =5
The range header = 0,1,2,3,4,5 [because Ranges start with 0001,1000,2000,3000,4000,5000]

Therefore result when range header is 0 can be calculated as
We get (5-0)+1 = 6
Hence summaton of 6 to 1 is 6+5+4+3+2+1 = 21

Similarly when the range header is 1, we will get 5+4+3+2+1 = 15

Summation of all the range headers gives us the total count of numbers with sum of digits as 5.
i.e; 21+15+10+6+3+1 = 56

Hope this helps.. Let me know if you dont get it.

Also, Let us take some other example to see if its correct.
Let us say we need to find the count of numbers less than 10000 with sum of digits as 1.
We know that the numbers are 1,10,100,1000 -> only 4.

Let us see if my pattern works here.

The sum you want to find for =1
For First range header -> 0.
count = (1-0)+1 = 2, Hence summation upto 1 = 2+1 = 3
For second range header ->1
count = (1-1)+1 = 1, Hence summation = 1

Hence total number of numbers with sum of digits as 1 = 3+1 = 4.

Hope this helps!!
Buddy, got it thanks yaa.
In short this can be followed.
Lets say i want to find the sum of 5 till 15000 can i follow the same pattern?

User avatar
Legendary Member
Posts: 1893
Joined: Sun May 30, 2010 11:48 pm
Thanked: 215 times
Followed by:7 members

by kvcpk » Tue Jul 20, 2010 10:49 am
aloneontheedge wrote: Buddy, got it thanks yaa.
In short this can be followed.
Lets say i want to find the sum of 5 till 15000 can i follow the same pattern?
Glad that it was helpful ... Yes.. It can be followed..

Senior | Next Rank: 100 Posts
Posts: 97
Joined: Thu Jan 28, 2010 2:07 am
Thanked: 9 times

by aloneontheedge » Tue Jul 20, 2010 11:04 am
kvcpk wrote:
aloneontheedge wrote: Buddy, got it thanks yaa.
In short this can be followed.
Lets say i want to find the sum of 5 till 15000 can i follow the same pattern?
Glad that it was helpful ... Yes.. It can be followed..
Hey,
Tell me how can i use if i have to find the sum of 6 till 1000

User avatar
Legendary Member
Posts: 1893
Joined: Sun May 30, 2010 11:48 pm
Thanked: 215 times
Followed by:7 members

by kvcpk » Tue Jul 20, 2010 11:14 am
aloneontheedge wrote: Tell me how can i use if i have to find the sum of 6 till 1000
Range header is 0 [because we want between 0-999]
(6-0)+1 = 7 -> 7+6+5+4+3+2+1 = 28

Let us see if we got it rite:
6,15,24,33,42,51,60
105,114,123,132,141,150
204,213,222,231,240
303,312,321,330
402,411,420
501,510
600

Hope this helps!!

Senior | Next Rank: 100 Posts
Posts: 97
Joined: Thu Jan 28, 2010 2:07 am
Thanked: 9 times

by aloneontheedge » Tue Jul 20, 2010 11:28 am
kvcpk wrote:
aloneontheedge wrote: Tell me how can i use if i have to find the sum of 6 till 1000
Range header is 0 [because we want between 0-999]
(6-0)+1 = 7 -> 7+6+5+4+3+2+1 = 28

Let us see if we got it rite:
6,15,24,33,42,51,60
105,114,123,132,141,150
204,213,222,231,240
303,312,321,330
402,411,420
501,510
600
Thanks man...still iam unable to figure out how to find the range
Hope this helps!!

User avatar
Legendary Member
Posts: 1893
Joined: Sun May 30, 2010 11:48 pm
Thanked: 215 times
Followed by:7 members

by kvcpk » Tue Jul 20, 2010 11:54 am
aloneontheedge wrote:
kvcpk wrote:
aloneontheedge wrote: Tell me how can i use if i have to find the sum of 6 till 1000
Range header is 0 [because we want between 0-999]
(6-0)+1 = 7 -> 7+6+5+4+3+2+1 = 28

Let us see if we got it rite:
6,15,24,33,42,51,60
105,114,123,132,141,150
204,213,222,231,240
303,312,321,330
402,411,420
501,510
600
Thanks man...still iam unable to figure out how to find the range
Hope this helps!!
Its simple.
For numbers below 1000, range header is 0
For numbers between 1000-1999, range header is 1
2000-2999 range header is 2.
and so on..

Helpful?

Senior | Next Rank: 100 Posts
Posts: 97
Joined: Thu Jan 28, 2010 2:07 am
Thanked: 9 times

by aloneontheedge » Tue Jul 20, 2010 12:00 pm
kvcpk wrote:
aloneontheedge wrote:
kvcpk wrote:
aloneontheedge wrote: Tell me how can i use if i have to find the sum of 6 till 1000
Range header is 0 [because we want between 0-999]
(6-0)+1 = 7 -> 7+6+5+4+3+2+1 = 28

Let us see if we got it rite:
6,15,24,33,42,51,60
105,114,123,132,141,150
204,213,222,231,240
303,312,321,330
402,411,420
501,510
600
Thanks man...still iam unable to figure out how to find the range
Hope this helps!!
Its simple.
For numbers below 1000, range header is 0
For numbers between 1000-1999, range header is 1
2000-2999 range header is 2.
and so on..

Helpful?
Thanks Bro...
soory for the trouble

User avatar
Legendary Member
Posts: 1893
Joined: Sun May 30, 2010 11:48 pm
Thanked: 215 times
Followed by:7 members

by kvcpk » Tue Jul 20, 2010 12:05 pm
aloneontheedge wrote: Thanks Bro...
soory for the trouble
Common Buddy!! Glad to be helpful!!

Cheers!!

Master | Next Rank: 500 Posts
Posts: 265
Joined: Mon Dec 28, 2009 9:45 pm
Thanked: 26 times
Followed by:2 members
GMAT Score:760

by mj78ind » Mon Aug 16, 2010 8:35 pm
fitzgerald23 wrote:Here was the way I approached this.

These are the following combinations that can be used to reach 5:

3200
4100
5000
3110
2110
2210

From there you determine the number of ways that you can arrange the digits
3200- 4!/2!= 12 ways
4100= 4!/2!= 12 ways
5000= 4!/3!= 4 ways
3110= 4!/2!= 12 ways
2111= 4!/3!= 4 ways
2210= 4!/2!= 12 ways

Total = 56 ways
Great solution man!

Cheers