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

Spring 2011 Course - PS9, Problem 3 I'm having trouble figuring out how to generate all the possible combinations to test using brute force... does anyone have any hints?

OpenStudy (anonymous):

you can go to python library and search for the function combination. Well, I dont remember exactly, but I know the library have a function like that, dont try to reinvent a new one.

OpenStudy (anonymous):

Did the 2011 course have a lecture(s) that introduced the binary decision tree and/or the knapsack problem? This is a Knapsack problem. In one of the 2008 lectures a function that solved the knapsack problem was shown. That can be adapted to this pset problem - at least the way it works will be the same or similar for this pset problem.

OpenStudy (anonymous):

bwCA, yes, we did cover knapsack and I'm pretty sure we provided the code for a brute force search of the solution space.

OpenStudy (anonymous):

Thanks guys, I'll go look back in the lecture.

OpenStudy (anonymous):

I just ended up using Guttag's genPset function from the lecture to help me out. I was already trying to make a similar function myself, but I kept running into problems.

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!