A community for students.
Here's the question you clicked on:
 0 viewing
anonymous
 5 years ago
Where did you all find your info in the lectures and reading for coming up with the answer for PS1. I've been through it numerous times and I'm not getting it.
Thanks.
anonymous
 5 years ago
Where did you all find your info in the lectures and reading for coming up with the answer for PS1. I've been through it numerous times and I'm not getting it. Thanks.

This Question is Closed

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0The syntax necessary is in the lecture and readings but the logic behind what to do isn't. You kind of just have to figure that part out.

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0If you give me what you have so far I may be able to help you.

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0Ahh, I see. I was wondering that. I really wanted to try and figure it out by myself but I'm not getting there. I know what I need the program to do but its the entering it in that's my obstacle. For example, where can I find out what Python's 29 generators (key words) all do? I'm also not totally familiar with the modulus concept and what it's purpose is.

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0modulus basically means remainder. % is the symbol for modulus so if you do 10%3 your answer will be one because 10/3 leaves a remainder of 1. It is very useful in telling if a number is even because if you take a number%2 and the answer is 0 then there was no remainder therefor it is even.**** It is also very useful in telling if a number is divisible by another ****(USEFULL FOR PSET1). look back at what the other guy that helped you said about assuming that a number is prime and prove that it is not. Put together my stared sentence and his explanation and you should be able to figure it out. If not keep asking questions...I have school but I check openstudy a good 3 to 4x a day. You don't need to jump into learning all 29 keywords just yet they will just confuse you because you may no what they mean but you wont know the good uses for them.

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0Here's a script that contains examples for all the tools you'll need for solving ps1a. Hope it helps!

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0Thanks! 10/3 leaves a remainder of one? 10/3 = 3.33333333333333. Can you explain this remainder concept a bit more? I also watched lecture 3, something I didn't do before, I hope it helps me. Thanks again!

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.010/3 if you do int division (don't go into decimal )it leaves a remainder of 1. integer division 10/3=3 but 3*3 is only 9 so 10/3 = 3 with a remainder 1 because 9 is one less than 10. Sorry I don't know how else to explain it if anyone can explain this better please do. Here is the book explanation http://www.greenteapress.com/thinkpython/thinkCSpy/html/chap04.html If you still don't understand. Let me know I will try and explain better.

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0Thanks for the try, I'm still not following. I've poured over internet results on what modulus but no one seems to explain how the remainder comes to be. Wikipedia isn't helping me either.

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0Ok for explanation sake lets say you have 10 books which you want to divide evenly among 3 friends(which is 10/3). You would give each person 3 books and there would be 1 left over(the remainder) that you can't give to any, one person because it would make one person have more than the other two. So 10/3 would be 3 Remainder 1 because you can give 3 evenly and then you will have 1 left over. here is a link with explanations similar to this http://www.homeschoolmath.net/teaching/md/not_exact_division.php if this doesn't help either I will try to find another way to explain it.

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0Maybe this will help clarify 10%3: 103=7 73= 4 43=1

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0Hi Onyx, that makes sense. Thanks. I wondered about that but all the info I read didn't put in those terms. So how does this work if you did 3%10?

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.03 is already less than 10, so you'd get 3

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0The remainder would just be 3 because you don't have enough to divide it out to lets say 10 people.

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0So 5%25 is 5, 35%3992 is 35, etc...?

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0Glad I could help is that all or do you have anymore questions?

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0So with regards to PS1, if the modulus operator tells me if a number is even or odd, and I know that all odd integers are a place to start for being prime candidates, I should probably begin here...right? I want my program to only work with odd numbers. Then I want to build a command that tests if the odd number is prime. Then I want build a command that counts how many primes there are until I get to the 1000th prime. It's putting it into programming language that's the hardest for me at this point and the occasional math concept like modulo.

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0Yea that's a good place to start. What I'm about to say may not be proper technique but whatever just start out by putting what you know in to the code even if the code doesn't run or make sense. Usually from this point I can problem solve and see what I need to do to make it work. The proper way to do it is to write it out in words or a flow chart and then convert it into python syntax. When you write it out in words you have a guideline basically for your code which can be very helpful.

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0by put in what you know I mean like any assignment variables such as count to count how many primes you get or any assignments, In the lectures you have learned so far have you learned loops?

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0in the lectures you have watched so far.**correction**
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.