3
$\begingroup$

How many numbers of $4$ digits contains at least one "$5$"?

My suggestion is:

First I count all the numbers of type 5xxx (where x can be a number between 0 and 9). There is 999.

Then I add all the numbers of type y5xx (where y can be 1, 2, 3, 4, 6, 7, 8, 9). There is 8*99

Then I add all the numbers of type yz5x (where z can be 0, 1, 2, 3, 4, 6, 7, 8, 9). There is 8*9*9

Then I add all the numbers of type yzz5. There is 8*9*9

Total: 999+8*99+8*9*9+8*9*9 = 3087

My problem is, I'm not sure if this is correct OR if there exist a smarter method.

  • 1
    Have you had any thoughts? Can you start with how many between $1000$ and $1999$ have at least one $5$? Maybe counting by hand from $1000$ to $1099$ will give some ideas.2011-09-27
  • 3
    Welcome to MathSE. I see that this is your first question. So I wanted to let you know a few things about MathSE. Posting questions exactly as they appear in a homework, or in the imperative (i.e. Compute all such, Prove that...), is considered rude by some of the members, so it would be nice of you to change that wording; perhaps by adding what are your thoughts or what you have tried in trying to answer the problem. These sort of pleasantries usually result in more and better answers. Thank you.2011-09-27
  • 0
    Ok. I will edit it with my suggestion.2011-09-27
  • 0
    There are several errors. Your first type is missing 000, so you should have 1000 numbers of the form 5rst (it's better not to use the same letter to represent several possibilities). The second type is likewise missing y500, so the answer should be $8\times 100$, not $8\times 99$. The third type is missing one as well. Other than the miscounts, you should be clearer: the first type consists of all numbers where the *first* occurrence of $5$ is in the first digit; the second the ones in which the first occurrence is the second digit; etc. Yes, it's a valid method. Sasha's is cleverer, though.2011-09-27
  • 0
    Using Arturo's suggestion, your total will become $3168$, which can also be obtained in the suggested cleverer way by subtracting numbers with no $5$ ($8 \cdot 9^3$) from all four digit numbers ($9 \cdot 10^3$).2011-09-27
  • 0
    @Arturo: is your first comment fair game for others' use in similar situations? It's more diplomatic than what I usually come up with!2011-09-27
  • 1
    @TheChaz: Since *I* stole^H^H^H^H^Hborrowed it from someone else (mixedmath, I believe), certainly!2011-09-27

7 Answers 7

14

HINT: Compute how many 4 digit numbers contain no 5, and subtract that from the total count of 4 digit numbers.

4

Hint: it's easier to count how many have no 5's.

0

So as to give you an idea of how to do problems like this without doing your homework for you I will do a similar problem with a different answer. Maybe someone else will find it useful.

How many numbers with exactly four digits are there with at least one zero?

$9\cdot 10^3-9^4=9000-6561=2439$

Reason:

There are 9000 numbers with exactly 4 digits

(choices for each digit: 1 to 9,0 to 9,0 to 9,0 to 9)

There are 6561 numbers with 4 digits and no zeros

(choices for each digit: 1 to 9,1 to 9,1 to 9,1 to 9)

0

First I count all the numbers of type 5xxx (where x can be a number between 0 and 9). There are 10*10*10=1000. Let this be A.

Then I add all the numbers of type y5xx (where y can be 1, 2, 3, 4, 5, 6, 7, 8, 9). There are 9*10*10=900. Let this be B.

Then I add all the numbers of type yz5x (where z can be 0, 1, 2, 3, 4, 5, 6, 7, 8, 9). There is 9*10*10. Let this be C.

Then I add all the numbers of type yzz5. There is 9*10*10=900. Let this be D.

So P(A)=1000;

P(B)=900;

P(C)=900;

P(D)=900;

P(A ∩ B)=100; //all numbers of type 55xx (where x can be a number between 0 and 9).

P(A ∩ C)=100; //all numbers of type 5x5x(where x can be a number between 0 and 9).

P(A ∩ D)=100; //all numbers of type 5xx5(where x can be a number between 0 and 9).

P(B ∩ C)= 90; //all numbers of type y55x(where x can be a number between 0 and 9 and y can be a number between 1 and 9).

P(B ∩ D)=90; //all numbers of type y5x5(where x can be a number between 0 and 9 and y can be a number between 1 and 9).

P(C ∩ D)=90; //all numbers of type yx55(where x can be a number between 0 and 9 and y can be a number between 1 and 9).

P(A ∩ B ∩ C)=10; //all numbers of type 555x(where x can be a number between 0 and 9).

P(A ∩ B ∩ D)=10; //all numbers of type 55x5(where x can be a number between 0 and 9).

P(A ∩ C ∩ D)=10; //all numbers of type 5x55(where x can be a number between 0 and 9).

P(B ∩ C ∩ D)=9; //all numbers of type y555(where y can be a number between 1 and 9).

P(A ∩ B ∩ C ∩ D)=1; // this is 5555

so

P (A U B U C U D ) = P (A ) + P (B ) + P (C ) + P (D ) - P (A ∩ B ) - P (A ∩ C ) - P( A ∩ D )- P (B ∩ C ) - P ( B ∩ D ) - P (C ∩ D ) + P (A ∩ B ∩ C ) + P (A ∩ B ∩ D ) + P (A ∩ C ∩ D ) + P (B ∩ C ∩ D ) - P ( A ∩ B ∩ C ∩ D )

which numerically is

P (A U B U C U D ) = 1000 + 900 + 900 + 900 - 100 - 100 - 100 - 90 - 90 - 90 + 10 + 10 + 10 + 9 - 1

=3168

0

There are totally 9000 four digit numbers(1000-9999) Out of this,let's see how many numbers have no 5's in it. There'll be 8*9*9*9=5832 such numbers.Subtract this from 9000.We get 3168.

  • 0
    Welcome to MSE. For some basic information about writing mathematics at this site see, *e.g.*, [basic help on mathjax notation](/help/notation), [mathjax tutorial and quick reference](//math.meta.stackexchange.com/q/5020), [main meta site math tutorial](//meta.stackexchange.com/a/70559) and [equation editing how-to](//math.meta.stackexchange.com/q/1773).2018-07-17
0

Both ways:

  • The complement of the count of numbers with no zero in the first position and no five is $9\cdot10\cdot10\cdot10-8\cdot9\cdot9\cdot9=\color{green}{3168}$.

  • The count of numbers with one, two, three or four fives is

    • either five in the first position, followed by anything: $10\cdot10\cdot10$ combinations;

    • or not a five in the first position, i.e. $8$ times the count of three digits numbers containing one, two or three fives,

$$\binom319^2+\binom329^1+\binom339^0=3\cdot81+3\cdot9+1=271.$$

$$1000+8\cdot271=\color{green}{3168}.$$

This is obtained by interleaving the fives with the other digits in all possible ways and letting the other digits take any of the remaining $9$ possibilities. ($271$ is also $10^3-9^3$.)

-1

If first digit is 5 the rest can't be five 1*9*9*9

If the second digit is five the rest can't be five and the first can't be zero 8*1*9*9

If the third digit is five the rest can't be five and the first can't be zero 8*9*1*9

If the fourth digit is five the rest can't be five and the first can't be zero 8*9*9*1

So in conclusion, (1*9*9*9) + (8*1*9*9) + (8*9*1*9) + (8*9*9*1) = 2673

  • 0
    The 4 digit number could have multiple 5s and should still be counted, e.g. 1055 or 5555 should count but would be missed in your count.2015-06-16