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

i am having some problem in understanding pset2 can anyone tell me what we have to do in pset 2 problem 1

OpenStudy (anonymous):

This program will tell you whether or not you can buy a certain number of nuggets given certain package sizes: def nuggets(n,x,y,z): for a in range(0,(n/x)+1): for b in range(0,(n/y)+1): for c in range(0,(n/z)+1): if x*a+y*b+z*c==n: return True You can use this program to show that you can buy 50,51,52,53,54,55 nuggets given packages of 6,9, and 20. Given that you can buy these amounts, you can show that you can buy 56,57,58...by induction or whatever the mathematical term is. Since you can buy 50, you can buy 56 since you can buy a package of 6. Since you can buy 51, you can buy 57 since you can buy a package of 6 and so on... Let me know if you need solutions to the third part of the problem.

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!
Latest Questions
Arriyanalol: i need help
1 day ago 7 Replies 1 Medal
Arriyanalol: CONGRATS to me
1 day ago 8 Replies 2 Medals
Legomaster346: What colleges are good that are near Arab Alabama?
1 week ago 5 Replies 0 Medals
Arriyanalol: i need help
1 week ago 6 Replies 2 Medals
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!