How many integers from 1 to 10000 do not conain digit 8?

This topic has expert replies
Source: — Problem Solving |

Legendary Member
Posts: 829
Joined: Mon Jul 07, 2008 10:09 pm
Location: INDIA
Thanked: 84 times
Followed by:3 members
4meonly wrote:How many integers from 1 to 10000, inclusive, do not conain digit 8?

I dont remember answers and OA.


what is the best approach to solve this question and this type of questions?
IMO 9^4-1 assuming we dont consider zero...
9^4 if we take zero into consideration.
Last edited by sudhir3127 on Thu Aug 21, 2008 1:44 am, edited 2 times in total.

Legendary Member
Posts: 1153
Joined: Wed Jun 20, 2007 6:21 am
Thanked: 146 times
Followed by:2 members

by parallel_chase » Thu Aug 21, 2008 1:17 am
one digit = 8 ways = 8
two digit = 8*9 ways = 72
three digit = 8*9*9 ways = 648
four digit = 8*9*9*9 ways = 729*8 = 5832
five digit = 1*1*1*1*1 ways = 1

8+72+648+5832+1

Legendary Member
Posts: 891
Joined: Sat Aug 16, 2008 4:21 am
Thanked: 27 times
Followed by:1 members
GMAT Score:660(

by 4meonly » Thu Aug 21, 2008 2:29 am
I fond the answer

it is 6562

parallel_chase,

could you please explain?

one digit = 8 ways = 8
two digit = 8*9 ways = 72
three digit = 8*9*9 ways = 648
four digit = 8*9*9*9 ways = 729*8 = 5832
five digit = 1*1*1*1*1 ways = 1

8+72+648+5832+1 =6561

You are on the right way but I don't the logic

Legendary Member
Posts: 829
Joined: Mon Jul 07, 2008 10:09 pm
Location: INDIA
Thanked: 84 times
Followed by:3 members

by sudhir3127 » Thu Aug 21, 2008 2:48 am
sudhir3127 wrote:
4meonly wrote:I fond the answer

it is 6562

parallel_chase,

could you please explain?

one digit = 8 ways = 8
two digit = 8*9 ways = 72
three digit = 8*9*9 ways = 648
four digit = 8*9*9*9 ways = 729*8 = 5832
five digit = 1*1*1*1*1 ways = 1

8+72+648+5832+1 =6561

You are on the right way but I don't the logic
are u sure abt the Answer because for me its 9^4 = 6561.. when u consider zero.

Senior | Next Rank: 100 Posts
Posts: 35
Joined: Mon Jun 09, 2008 3:05 am
Thanked: 2 times

by Senator 153 » Thu Aug 21, 2008 4:18 am
I wrote an algorithm to check. It's 6561.

Legendary Member
Posts: 891
Joined: Sat Aug 16, 2008 4:21 am
Thanked: 27 times
Followed by:1 members
GMAT Score:660(

by 4meonly » Thu Aug 21, 2008 4:26 am
Senator 153 wrote:I wrote an algorithm to check. It's 6561.
Could you please specify an algorithm to me as to a kindergardener?

thank u!

Senior | Next Rank: 100 Posts
Posts: 35
Joined: Mon Jun 09, 2008 3:05 am
Thanked: 2 times

by Senator 153 » Thu Aug 21, 2008 4:41 am
It's just a way of checking; it's a computer script that counts the numbers that don't have eight in them.

I solved it using the same method as sudhir3127. 9 out of ten numbers will "survive" the test, per digit -- and four digits are tested, so it's 9^4.

Legendary Member
Posts: 891
Joined: Sat Aug 16, 2008 4:21 am
Thanked: 27 times
Followed by:1 members
GMAT Score:660(

by 4meonly » Thu Aug 21, 2008 5:07 am
Senator 153 wrote:It's just a way of checking; it's a computer script that counts the numbers that don't have eight in them.

I solved it using the same method as sudhir3127. 9 out of ten numbers will "survive" the test, per digit -- and four digits are tested, so it's 9^4.
It means that for every place we have only 9 digits?
_ _ _ _
9*9*9*9
but this is for 4-digit number. What about 3, 2 and 1 digit numbers?
About 1-digit there is only one that will not survive. What about 3, 2 digit numbers?

Master | Next Rank: 500 Posts
Posts: 258
Joined: Thu Mar 29, 2007 3:15 am
Thanked: 7 times
Followed by:1 members

by anju » Fri Aug 22, 2008 12:54 pm
sudhir3127 wrote:
sudhir3127 wrote:
4meonly wrote:I fond the answer

it is 6562

parallel_chase,

could you please explain?

one digit = 8 ways = 8
two digit = 8*9 ways = 72
three digit = 8*9*9 ways = 648
four digit = 8*9*9*9 ways = 729*8 = 5832
five digit = 1*1*1*1*1 ways = 1

8+72+648+5832+1 =6561

You are on the right way but I don't the logic
are u sure abt the Answer because for me its 9^4 = 6561.. when u consider zero.
Sudhir, can you pls. elaborate why you did 9^4?

thanks

Legendary Member
Posts: 1153
Joined: Wed Jun 20, 2007 6:21 am
Thanked: 146 times
Followed by:2 members

by parallel_chase » Fri Aug 22, 2008 1:21 pm
Here is the process:

For example:

You have to find the number of integers between 1-999 that doesnt contain 3

formula : (9^3) - 1 = 728

Long method.
one digit number (1,2,4,5,6,7,8,9) = 8 ways
two digit number (0,1,2,4,5,6,7,8,9), first digit cannot be 0 = 8*9 ways
three digit number (0,1,2,4,5,6,7,8,9), first digit cannot be 0 = 8*9*9 ways

8 + 72 + 648 = 728

You have to find the number of integers between 1-1000 that doesnt contain 3

formula : 9^3 = 729

Long Method.
one digit number (1,2,4,5,6,7,8,9) = 8 ways
two digit number (0,1,2,4,5,6,7,8,9), first digit cannot be 0 = 8*9 ways
three digit number (0,1,2,4,5,6,7,8,9), first digit cannot be 0 = 8*9*9 ways
four digit number (0,1), first digit cannot be 0 and remaining digit cannot be greater than 0 = 1*1*1*1 = 1 ways

8 + 8*9 + 8*9*9 + 1 = 729

Try to solve the posted question with the same method.

"4meonly" i think you have got the wrong answer, the answer should 6561.

And the algorithm used by "Senator" is a computer program written probably in C++ or php, therefore i dont think he would be able to explain you the program unless you have any prior knowledge of computer programming.

Let me know if you still have any doubts.

Master | Next Rank: 500 Posts
Posts: 258
Joined: Thu Mar 29, 2007 3:15 am
Thanked: 7 times
Followed by:1 members

by anju » Fri Aug 22, 2008 1:25 pm
parallel_chase wrote:Here is the process:

For example:

You have to find the number of integers between 1-999 that doesnt contain 3

formula : (9^3) - 1 = 728

Long method.
one digit number (1,2,4,5,6,7,8,9) = 8 ways
two digit number (0,1,2,4,5,6,7,8,9), first digit cannot be 0 = 8*9 ways
three digit number (0,1,2,4,5,6,7,8,9), first digit cannot be 0 = 8*9*9 ways

8 + 72 + 648 = 728

You have to find the number of integers between 1-1000 that doesnt contain 3

formula : 9^3 = 729

Long Method.
one digit number (1,2,4,5,6,7,8,9) = 8 ways
two digit number (0,1,2,4,5,6,7,8,9), first digit cannot be 0 = 8*9 ways
three digit number (0,1,2,4,5,6,7,8,9), first digit cannot be 0 = 8*9*9 ways
four digit number (0,1), first digit cannot be 0 and remaining digit cannot be greater than 0 = 1*1*1*1 = 1 ways

8 + 8*9 + 8*9*9 + 1 = 729

Try to solve the posted question with the same method.

"4meonly" i think you have got the wrong answer, the answer should 6561.

And the algorithm used by "Senator" is a computer program written probably in C++ or php, therefore i dont think he would be able to explain you the program unless you have any prior knowledge of computer programming.

Let me know if you still have any doubts.
Great. Thanks. That's an awesome explanation.

Is there a list of all formula's or shortcut methods?

Thanks

Master | Next Rank: 500 Posts
Posts: 447
Joined: Sun Apr 19, 2009 9:08 pm
Location: Kolkata,India
Thanked: 7 times
GMAT Score:670

by uptowngirl92 » Sat Sep 19, 2009 3:42 am
How many integers from 1 to 10000, inclusive, do not conain digit 8?

Hey guys for this type of questions can we proceed by finding the no. of nos. WITH 8 and then substracting??
The nos. bet 0001 to 9999 containing 8 will be 3000 :roll: