# How many 5-digit numbers are there that include the digit 5 and exclude the digit 8? Explain your solutionit is sth about permutation , confusing me a lot.

william1941 | Student

You require five digit numbers that include 5 and exclude 8. Now the number of 5 digit numbers is 99999 - 9999 = 90000.

As the numbers need to have a 5 (though there can be more than 1 instance) and should not have 8, we go as follows:

Let 5 be the 1st digit. The other four digits can have either of the other 9 choices, as we have excluded 8. This gives 9^4 numbers.

Let 5 be the 2nd digit. The first digit can have either of 7 choices, excluding 5, 8 and 0. The other three digits can have any of the 9 choices. This gives 7 * 9^3 numbers.

Let 5 be the 3rd digit. The first digit can have either of 7 choices, excluding 5, 8 and 0. The 2nd digit can have 8 choices excluding 5 and 8. The other two digits can have any of the 9 choices. This gives 7 * 8 *9^2 numbers.

Let 5 be the 4th digit. The first digit can have either of 7 choices, excluding 5, 8 and 0. The 2nd and 3rd digits can have any of 8 choices. This gives 7 * 8^2*9 numbers.

Let 5 be the 5th digit. The first digit can have either of 7 choices, excluding 5, 8 and 0. The 2nd, 3rd and 4th digits can have any of 8 choices. This gives 7 * 8^3 numbers.

Therefore the total possible numbers is 9^4 + 7*9^3 + 7*8*9^2 + 7*8^2*9 + 7*8^3= 23816

The required number of 5 digit numbers is 23816.

neela | Student

(1) To find the number 5 digit number that includes 5.

We pressume the 1st digit is not zero.

The number of 5 digit numbers = 99999 - 10000 +1 = 9000.

First place escluding zero 9 elligible digits and each of the other 4 digits 10.

So 9*10^4 = 9000 possible .

Numbers excluding 5  : In the 1st place in left , we can have any digit other than 0 and 5 = 8digits are elligible.

In each of other 4 places we can have any of the 9 digits other than 5.

So the number of numbers that  have the digit 5 is 8*9^4.

Therefore the number of numbers of 5digit which include  5 is 10*0^4-8*9^4  = 9^4{9-8} = 9^4 = 6561.

(2) Number of numbers of 5 digit that exclude the digit 8:

Wihout loss of generality ( whether it is 8 or 5) we did it already in the above case itself.

Numbers excluding 8 in 5 digit numbers:

In the left first place , the digit 0 and 8 are not elligible. So out of 10 digits only 8 are ellible.

In  each of the other 4 digits  any digit except 8 are elligible.So we can write each of the other 4 places from any of the 9 digits other than 8

So the total ways we write 5 digit number excluding 8 = 8*9^4 = 52488.