guess the next step: 0/1 knapsack
Before each step plays, guess what it does. The page then shows the step as the run takes it and says why, the same sentence the watch page says there.
Step 1 of 17
Question 1 of 15
Step 1 of 17
Step 2 of 17
Step 3 of 17
Step 4 of 17
Step 5 of 17
Step 6 of 17
Step 7 of 17
Question 1 of 15
Question 1 of 15
Right.
You guessed: Item A weighs more than the room of 1, so it cannot go in.
What the run did:
Item A weighs 4, more than the room of 1, so it cannot go in. Keep 0 from the cell above.
Question 1 of 15
Not this time.
You guessed: With room 1, taking item A is better, so take it.
What the run did:
Item A weighs 4, more than the room of 1, so it cannot go in. Keep 0 from the cell above.
Question 1 of 15
Not this time.
You guessed: With room 1, taking item A is no better, so leave it.
What the run did:
Item A weighs 4, more than the room of 1, so it cannot go in. Keep 0 from the cell above.
Question 2 of 15
Question 2 of 15
Right.
You guessed: Item A weighs more than the room of 2, so it cannot go in.
What the run did:
Item A weighs 4, more than the room of 2, so it cannot go in. Keep 0 from the cell above.
Question 2 of 15
Not this time.
You guessed: With room 2, taking item A is better, so take it.
What the run did:
Item A weighs 4, more than the room of 2, so it cannot go in. Keep 0 from the cell above.
Question 2 of 15
Not this time.
You guessed: With room 2, taking item A is no better, so leave it.
What the run did:
Item A weighs 4, more than the room of 2, so it cannot go in. Keep 0 from the cell above.
Question 3 of 15
Question 3 of 15
Right.
You guessed: Item A weighs more than the room of 3, so it cannot go in.
What the run did:
Item A weighs 4, more than the room of 3, so it cannot go in. Keep 0 from the cell above.
Question 3 of 15
Not this time.
You guessed: With room 3, taking item A is better, so take it.
What the run did:
Item A weighs 4, more than the room of 3, so it cannot go in. Keep 0 from the cell above.
Question 3 of 15
Not this time.
You guessed: With room 3, taking item A is no better, so leave it.
What the run did:
Item A weighs 4, more than the room of 3, so it cannot go in. Keep 0 from the cell above.
Question 4 of 15
Question 4 of 15
Not this time.
You guessed: Item A weighs more than the room of 4, so it cannot go in.
What the run did:
With room 4, leaving A out keeps 0. Taking it is worth 50, plus 0 for the room it leaves: 50. Taking it is better, so write 50.
Question 4 of 15
Right.
You guessed: With room 4, taking item A is better, so take it.
What the run did:
With room 4, leaving A out keeps 0. Taking it is worth 50, plus 0 for the room it leaves: 50. Taking it is better, so write 50.
Question 4 of 15
Not this time.
You guessed: With room 4, taking item A is no better, so leave it.
What the run did:
With room 4, leaving A out keeps 0. Taking it is worth 50, plus 0 for the room it leaves: 50. Taking it is better, so write 50.
Question 5 of 15
Question 5 of 15
Not this time.
You guessed: Item A weighs more than the room of 5, so it cannot go in.
What the run did:
With room 5, leaving A out keeps 0. Taking it is worth 50, plus 0 for the room it leaves: 50. Taking it is better, so write 50.
Question 5 of 15
Right.
You guessed: With room 5, taking item A is better, so take it.
What the run did:
With room 5, leaving A out keeps 0. Taking it is worth 50, plus 0 for the room it leaves: 50. Taking it is better, so write 50.
Question 5 of 15
Not this time.
You guessed: With room 5, taking item A is no better, so leave it.
What the run did:
With room 5, leaving A out keeps 0. Taking it is worth 50, plus 0 for the room it leaves: 50. Taking it is better, so write 50.
Question 6 of 15
Question 6 of 15
Right.
You guessed: Item B weighs more than the room of 1, so it cannot go in.
What the run did:
Item B weighs 2, more than the room of 1, so it cannot go in. Keep 0 from the cell above.
Question 6 of 15
Not this time.
You guessed: With room 1, taking item B is better, so take it.
What the run did:
Item B weighs 2, more than the room of 1, so it cannot go in. Keep 0 from the cell above.
Question 6 of 15
Not this time.
You guessed: With room 1, taking item B is no better, so leave it.
What the run did:
Item B weighs 2, more than the room of 1, so it cannot go in. Keep 0 from the cell above.