anonymous
  • anonymous
Problem set 1, problem 2. Can someone explain a bit more about what problem 2 wants.
MIT 6.00 Intro Computer Science (OCW)
  • Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
SOLVED
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
katieb
  • katieb
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
anonymous
  • anonymous
They want you to write a program that computes the sum of logarithms of all primes from 2 to some number n. Then print out the sum the number and the ratio of these two quantities. The best place to start is to google both prime numbers and logarithm so you understand the question properly. Then once you understand what a prime and a log is do the problem by hand for a very small number carefully noting how you solve it. Write this out as an algorithm and then translate that algorithm to code.
anonymous
  • anonymous
hint you will have to solve what a prime is from problem 1 to do this
anonymous
  • anonymous
I completed the code for problem 1. Is problem 2 wanting me to add the logs of the primes together, eg: n = 3 sum = log(2) + log(3) + log(5) and then get the ratio by sum / n ? thanks for previously responding.

Looking for something else?

Not the answer you are looking for? Search for more explanations.

More answers

anonymous
  • anonymous
yep you will have to use a loop to iterate up to n. When you run it you should see that the ratio gets closer to 1 as it goes.

Looking for something else?

Not the answer you are looking for? Search for more explanations.