A community for students.
Here's the question you clicked on:
 0 viewing
vaboro
 5 years ago
Would greatly appreciate your comments on my problem set 1 solution:
http://pastebin.com/567ix4FU
vaboro
 5 years ago
Would greatly appreciate your comments on my problem set 1 solution: http://pastebin.com/567ix4FU

This Question is Closed

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0It's little complicated I just gone through it...but it's seriously good....check my solution..

vaboro
 5 years ago
Best ResponseYou've already chosen the best response.0Well, not bad, I think. Though, I suppose, it may lack some generalization and abstraction. Also, you use definition of prime in order to check if number n is prime. This process takes much time when n is relatively large. There is a faster method called a "trial division" method. I also used definition of prime for the check: def is_Prime_slow(n): '''the function returns n if n is prime and 1 if n is not prime''' k = n  1 while k > 1: if n % k == 0: return 1 else: k = k  1 return n But them I realized that it's very slow if I need to check a lot of number and if numbers get bigger and bigger, and I looked up definition of primes in wikipedia and found the "trial division" method that is relatively faster. Good work! Cheers.

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0I see...Thanks .... :)
Ask your own question
Sign UpFind more explanations on OpenStudy
Your question is ready. Sign up for free to start getting answers.
spraguer
(Moderator)
5
→ View Detailed Profile
is replying to Can someone tell me what button the professor is hitting...
23
 Teamwork 19 Teammate
 Problem Solving 19 Hero
 Engagement 19 Mad Hatter
 You have blocked this person.
 ✔ You're a fan Checking fan status...
Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.