pset 1 problem 1b. help, Im confused, i can't understand what the problem im being asked is, i am new to programming and have not heard the log function mentioned in the lecture, am i correct in thinking that as follows n = number entered by user, and i need to show that, all the primes before n, added together, divided by n**2 is less then 1, and as n increases, the answer gets closer to one. (is log another name for exponent? the e**n confused me, surley it would be n ** 2? ) thanks in advance

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.

Get our expert's

answer on brainly

SEE EXPERT ANSWER

Get your free account and access expert answers to this and thousands of other questions.

A community for students.

pset 1 problem 1b. help, Im confused, i can't understand what the problem im being asked is, i am new to programming and have not heard the log function mentioned in the lecture, am i correct in thinking that as follows n = number entered by user, and i need to show that, all the primes before n, added together, divided by n**2 is less then 1, and as n increases, the answer gets closer to one. (is log another name for exponent? the e**n confused me, surley it would be n ** 2? ) thanks in advance

MIT 6.00 Intro Computer Science (OCW)
See more answers at brainly.com
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.

Get this expert

answer on brainly

SEE EXPERT ANSWER

Get your free account and access expert answers to this and thousands of other questions

Your program needs to accept a number n, then take the log of every prime number between 2 and n (inclusive) add up all those logs. Then display 3 things. The sum you computed, n, and the ratio of n and the sum (float(sum)/n).
The log function is part of the math module.
logarithm i guess

Not the answer you are looking for?

Search for more explanations.

Ask your own question

Other answers:

math.log() exists for python...it returns natural logarithm, that is e based logarithm
Jaymorganrice, "log" or logarithm, is the inverse of exponentiation. I suggest the Khan Academy tutorial on logarithms for further reference. http://www.khanacademy.org/video/introduction-to-logarithms?playlist=Pre-algebra Let us not forget that math is an integral part of computer programming and science, and needs to be understood to compliment the knowledge provided here. You wouldn't attend MIT Comp Sci without having a lot of math with it. OCW doesn't make that apparent. :)
I have no math background, so this also confused me. Synthesetic's post and video really jogged my memory on what a logarithm was, but I still had no idea what e**n meant. Well, e is the mathmatical constant, which is the base of a natural logarithm. http://en.wikipedia.org/wiki/Logarithm "The natural logarithm uses the constant e (approximately 2.718) as its base" So e**n is 2.718**n Now this is making a lot of sense.
ahh i see, so is e a function already in python? or do i import it as part of the math? thanks alot for all the help, i actually got A in math but dont recall info on logarithms here in uk, although i finished school at 16 over here and didn't go to colledge as i went streight into work. thanks again for all the help
e is a number. log is a function. Both are available in the math module: import math print math.e print math.e * math.e # e to the power of 2 (or e**2) print log(math.e*math.e) # the log of a power of e is the exponent.
err the last line should be print math.log(math.e*math.e)

Not the answer you are looking for?

Search for more explanations.

Ask your own question