1. Choosing

I am looking at a question from an assignment and it asks

2. Consider 4-digit numbers from 1000 to 9999, inclusive.
1. How many are divisible by 5 ?
2. How many are divisible by 9 ?
3. How many are divisible by both 5 and 9 ?
4. How many are divisible by either 5 or 9 ?
So for a.

If it is divisible by 5 it ends with either 0 or 5.

so 2 out of the 10 possible last digits would be ones divisible by 5.

and there would be 899 groups of these 10 last digit numbers.

would 1798 be divisible by 5?

Sorry but my math intuition is so bad LOL.

2. Re: Choosing

Originally Posted by ehpoc
2. Consider 4-digit numbers from 1000 to 9999, inclusive.
1. How many are divisible by 5 ?
2. How many are divisible by 9 ?
3. How many are divisible by both 5 and 9 ?
4. How many are divisible by either 5 or 9 ?

So for a.
Do you know how to use the floor function?
If K is a positive integer then there are $\left\lfloor {\frac{{9999}}{K}} \right\rfloor - \left\lfloor {\frac{{999}}{K}} \right\rfloor$ numbers from 1000 to 9999 which are divisible by K.

3. Re: Choosing

Does floor function 11/5=2?

4. Re: Choosing

Originally Posted by ehpoc
Does floor function 11/5=2?
Yes. Another name is the greatest integer function.

5. Re: Choosing

How exactly would I do 3 where how many are divisible by both 5 and 9. Would that be k=45?

6. Re: Choosing

Originally Posted by ehpoc
How exactly would I do 3 where how many are divisible by both 5 and 9. Would that be k=45?
Yes $K=45$.

4) $\left\lfloor {\frac{{9999}}{5}} \right\rfloor + \left\lfloor {\frac{{9999}}{9}} \right\rfloor - \left\lfloor {\frac{{9999}}{{45}}} \right\rfloor$

7. Re: Choosing

Thank you kind sir

8. Re: Choosing

Ummm by the theory of inclusion-exclusion would 3 not be....

(9999/5-999/5)+(9999/9-999/9)-(9999/45-999/45)

basically the sum of the two sets of numbers divisible by 5 and 9 minus the sum of numbers divisble by both 9 and 5?

EDIT!!

NVM that would be "numbers that are divisble by 9 or 5", not "both 9 and 5" .