Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 7 Online
OpenStudy (anonymous):

Obviously I don't completely understand the PS1B assignment. Can someone explain to me what exactly is the ratio they are looking for and why it slowly gets closer to 1 ?! I'll include the code I have so far. Pastebin link : http://pastebin.com/pjRqW0rn

OpenStudy (anonymous):

The Pset explained the why: "There is a cute result from number theory that states .... " you want to keep a running total/sum of the log of each prime that you find so; find all the primes less than 100 ratio100 = the sum of the logs of each of those primes divided by 100 find all the primes less than 1000 ratio1000 = the sum of the logs of each of those primes divided by 1000 ratio1000 should be closer to one than ratio100

OpenStudy (anonymous):

Thn for the explanation....I will rewrite my code and see if the result is there !!

OpenStudy (anonymous):

Finally got it !!! I was taking N for the number of primes FOUND....and mixed up the ratio ! Once again thnx for explanation !!!

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!