in Set Theory & Algebra edited by
11,589 views
25 votes
25 votes
The number of integers between $1$ and $500$ (both inclusive) that are divisible by $3$ or $5$ or $7$ is ____________ .
in Set Theory & Algebra edited by
by
11.6k views

4 Comments

@Sanjay Sharma can you give an example to support your point and why we should not use floor??

1
1

@abir_banerjee e.g total numbers  divisible by 7 between 6 and 498 are 71  (first if 7 and last is 497 ) but  floor[(498-6)/7] will give 70 

and if we use a.p,. formula

7+(n-1)7=497 gives n=71

2
2

this Question can also be solved using a probability approach. See this variant https://gateoverflow.in/314348/gate-cse-1995-question-25b, and check out the answer by @techbd123 and read in his comments, to know.

0
0

9 Answers

8 votes
8 votes

Here ,we can find:

$|A| = \left \lfloor \frac{500}{3} \right \rfloor = 166$

$|B| = \left \lfloor \frac{500}{5} \right \rfloor = 100$

$|C| = \left \lfloor \frac{500}{7} \right \rfloor = 71$

$|A\cap B| = \left \lfloor \frac{500}{LCM(3,5)} \right \rfloor =\left \lfloor \frac{500}{15} \right \rfloor = 33 $

$|B\cap C|  = \left \lfloor \frac{500}{LCM(5,7)} \right \rfloor =\left \lfloor \frac{500}{35} \right \rfloor = 14 $

$|A\cap C| = \left \lfloor \frac{500}{LCM(3,7)} \right \rfloor =\left \lfloor \frac{500}{21} \right \rfloor = 23 $

$|A\cap B \cap C| = \left \lfloor \frac{500}{LCM(3,5,7)} \right \rfloor =\left \lfloor \frac{500}{105} \right \rfloor = 4 $

Now we,can Apply Principle of Inclusion - Exclusion:

$(|A| \cup |B| \cup |C|) = |A| + |B| + |C|- | A\cap B| - | B\cap C| - | A\cap C| + | A\cap B\cap C|$

 

Put the values:

$(|A| \cup |B| \cup |C|) = 166+100+71-33-14-23+4$

$(|A| \cup |B| \cup |C|) = 341-70$

$(|A| \cup |B| \cup |C|) = 271$

 Number 1 to 500 is not divisible by either 2,3 or 5:

${(|A| \cup |B| \cup |C|)}' = N(U) - (|A| \cup |B| \cup |C|)$

${(|A| \cup |B| \cup |C|)}' = 500-271$

${(|A| \cup |B| \cup |C|)}' =229$

So, the number of integers between $1$ and $500$ (both inclusive) that are divisible by $3$ or $5$ or $7$ is $:271$ 

4 votes
4 votes
by applying the Principle of Inclusion and Exclusion. Note that all divisions are to be rounded down to the nearest integer.

N = [ 500/3 + 500/5 + 500/7 ] - [ 500/15 + 500/35+ 500/21 ] + [ 500/(105) ]

= 166+100+71 - (33+14+23) + 4 = 271

if the question is of divisible then ans is 271.

if the question is of not divisible then its

500-271=229
edited by

2 Comments

but here u need to take lowershield function also
2
2
In both ways ans is coming same....
0
0
0 votes
0 votes
first no which are divisible by 3 = lwowershield(500/3)+lwowershield(500/5)+lwowershield(500/7)-lwowershield(500/3*5)-lwowershield(500/3*7)-lwowershield(500/5*7)+lwowershield(500/3*7*5)=result

 

now to find not divisible by = 500-result
0 votes
0 votes
Okay,Now in this question concept of the Inclusion-Exclusion  comes into play.how we are getting the formula?

simple formula

P(AUB)=P(a)+P(b)+P(c)-P(ab)-P(bc)-P(ca)+P(abc)

so

 [ 500/3 + 500/5 + 500/7 ] - [ 500/15 + 500/35+ 500/21 ] + [ 500/(105) ]

=271

so 271 should be correct answer

1 comment

Why should I divide 500 or any number by 3 or 5 or anything to get how many numbers between 1 and 500 is divisible by 3 or 5.
0
0
Answer:

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true