Go Premium for a chance to win a PS4. Enter to Win

x
Solved

# Need help in equation

Posted on 2011-09-06
Medium Priority
340 Views

How many integers in the set {n belongs to Z | 1 less than equals to n less than equals to 700} are divisible to 2 or 7 ?

0
Question by:mustish1
• 3
• 3
• 2

LVL 37

Expert Comment

ID: 36490263
Well, since this question has an academic nature to it...
How many are divisible by 2 (easy)
How many are divisible by 7 (also easy)
How many are divisible by both (not too hard)

Once you have those, the answer should be pretty easy to come up with (please no one jump in with just the answer).
0

LVL 8

Accepted Solution

stalhw earned 1200 total points
ID: 36490285
1 less than equals to n less than equal to 700
that doesn't make sense...
you probably meant
1 <= n <= 700
So the set is integers from 1 to 700 ?
then it shouldn't be too hard...

one in seven will be divisible by 7... so 100
one in 2 is divisible by 2... so 350
0

LVL 37

Assisted Solution

TommySzalapski earned 800 total points
ID: 36490309
Remember from set theory A or B = A + B - (A and B)
0

Author Comment

ID: 36490311
1 <= n <= 700
divisible to 2 and 7

k. just divide 700/2 and divide 700/7

its easy thanks.
0

LVL 37

Expert Comment

ID: 36490333
Yes, but the answer is not 350 + 100 = 450 because if you do that, you'll count some twice. (i.e. 14 is divisible by both and is counted twice).
0

LVL 8

Expert Comment

ID: 36490349
oh he meant disisible by both?
well half of the divisible by 7 will also be divisible by 2....
(7,14,21,28,35,42,etc easy to see that half are pair)

so 50 will be divisible by both
0

LVL 8

Expert Comment

ID: 36490357
and if you want divisible by 2 OR 7,
just remove the 50 that are divisible by both... so 350+100-50 = 400
0

Author Comment

ID: 36490383
ok thanks
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

With the shift in today’s hiring climate (http://blog.experts-exchange.com/ee-blog/5-tips-on-succeeding-in-the-new-gig-economy/?cid=Blog_031816), many companies are choosing to hire freelancers to get projects completed efficiently and inexpensively…
I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
###### Suggested Courses
Course of the Month6 days, 4 hours left to enroll