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

I don't understand why in the problem set 2 - part 1, in the hints, they put the step, 2. Generate all (odd) integers > 1 as candidates to be prime since we don't know how much candidate numbers we need to check to find the 1000th prime number . any other hints :)

OpenStudy (anonymous):

This is coming from who never really did solve this question. :D I just got the concept. You are going to want to check only the odd numbers because even numbers are not prime except 2 so you'd have a better and faster code. And because we don't know how much candidate numbers we're gonna need to check, you'll need a variable (say primecount ) starts at 0 and increases by one when a new prime number is found.. For instance: 2 is prime number 1 3 is prime number 2 5 is prime number 3 7 is prime number 4 ...etc Secondly, you'll find most solutions in this link http://mit.edu/magnus89/Public/Classes/6.00%20F08/ but I found that the Pset1a's solution had one mistake..It missed that 2 is prime and said that 1 is prime Hope I helped ;) Good luck :)

OpenStudy (anonymous):

One last thing, I wouldn't recommend peeking at the solutions just yet. These codes can have multiple forms with the same results. And you'd feel a lot better if you tried to get it by yourself. Again, this is from someone who couldn't solve the problem set. :)

OpenStudy (anonymous):

read thefirst parts of the Python Tutorial that is in the documentation read a couple of chapters of 'How To Think Like A Computer Scientist' parctice the examples that are given in those readings play around in the shell (Idle?) and figure out how statements work write down in words the sequence of steps needed to solve the problem turn those words into code

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!