Solved

Need help in equation

Posted on 2011-09-06
8
326 Views
Last Modified: 2012-05-12
Hi guys: Can any one please help me in that question ? Thanks.

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
Comment
Question by:mustish1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
8 Comments
 
LVL 37

Expert Comment

by:TommySzalapski
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

by:
stalhw earned 300 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

by:TommySzalapski
TommySzalapski earned 200 total points
ID: 36490309
Remember from set theory A or B = A + B - (A and B)
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:mustish1
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

by:TommySzalapski
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

by:stalhw
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

by:stalhw
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

by:mustish1
ID: 36490383
ok thanks
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Finding a job can be stressful - searches, resume tweaks, and networking events can be super boring. Luckily we're here to help you land your dream job!
CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
Saved searches can save you time by quickly referencing commonly searched terms on any topic. Whether you are looking for questions you can answer or hoping to learn about a specific issue, a saved search can help you get the most out of your time o…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question