Take it or leave it
transcript
You pack a carry-on bag. Each thing goes in once, or stays out. That is zero one knapsack.
Three songs make eight choices. Add up each one. Only two and four total six minutes. So there is one way.
Each song doubles the choices. Thirty songs give over a billion. That is eighteen minutes of checking. Listing every choice stops working.
Eight choices is easy to check by hand. Every new song doubles the list. A table shares work between choices.
Played once, two and four fill six. Played again, three and three also fill six. Two, two and two makes three ways.
A drawer of spoons is different. You take as many as you like. That is unbounded knapsack.
Make a row of counts for each song. Song two fills length two. Song three fills three and five. Song four fills six, with two.
Ask first: once, or any number? A table then answers it. Full breakdown in the lecture.