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 7 of 17
Question 7 of 15
Step 7 of 17
Step 8 of 17
Step 9 of 17
Step 10 of 17
Step 11 of 17
Step 12 of 17
Step 13 of 17
Question 7 of 15
Question 7 of 15
Not this time.
You guessed: Item B weighs more than the room of 2, so it cannot go in.
What the run did:
With room 2, leaving B out keeps 0. Taking it is worth 30, plus 0 for the room it leaves: 30. Taking it is better, so write 30.
Question 7 of 15
Right.
You guessed: With room 2, taking item B is better, so take it.
What the run did:
With room 2, leaving B out keeps 0. Taking it is worth 30, plus 0 for the room it leaves: 30. Taking it is better, so write 30.
Question 7 of 15
Not this time.
You guessed: With room 2, taking item B is no better, so leave it.
What the run did:
With room 2, leaving B out keeps 0. Taking it is worth 30, plus 0 for the room it leaves: 30. Taking it is better, so write 30.
Question 8 of 15
Question 8 of 15
Not this time.
You guessed: Item B weighs more than the room of 3, so it cannot go in.
What the run did:
With room 3, leaving B out keeps 0. Taking it is worth 30, plus 0 for the room it leaves: 30. Taking it is better, so write 30.
Question 8 of 15
Right.
You guessed: With room 3, taking item B is better, so take it.
What the run did:
With room 3, leaving B out keeps 0. Taking it is worth 30, plus 0 for the room it leaves: 30. Taking it is better, so write 30.
Question 8 of 15
Not this time.
You guessed: With room 3, taking item B is no better, so leave it.
What the run did:
With room 3, leaving B out keeps 0. Taking it is worth 30, plus 0 for the room it leaves: 30. Taking it is better, so write 30.
Question 9 of 15
Question 9 of 15
Not this time.
You guessed: Item B weighs more than the room of 4, so it cannot go in.
What the run did:
With room 4, leaving B out keeps 50. Taking it is worth 30, plus 0 for the room it leaves: 30. That is no better, so leave it and write 50.
Question 9 of 15
Not this time.
You guessed: With room 4, taking item B is better, so take it.
What the run did:
With room 4, leaving B out keeps 50. Taking it is worth 30, plus 0 for the room it leaves: 30. That is no better, so leave it and write 50.
Question 9 of 15
Right.
You guessed: With room 4, taking item B is no better, so leave it.
What the run did:
With room 4, leaving B out keeps 50. Taking it is worth 30, plus 0 for the room it leaves: 30. That is no better, so leave it and write 50.
Question 10 of 15
Question 10 of 15
Not this time.
You guessed: Item B weighs more than the room of 5, so it cannot go in.
What the run did:
With room 5, leaving B out keeps 50. Taking it is worth 30, plus 0 for the room it leaves: 30. That is no better, so leave it and write 50.
Question 10 of 15
Not this time.
You guessed: With room 5, taking item B is better, so take it.
What the run did:
With room 5, leaving B out keeps 50. Taking it is worth 30, plus 0 for the room it leaves: 30. That is no better, so leave it and write 50.
Question 10 of 15
Right.
You guessed: With room 5, taking item B is no better, so leave it.
What the run did:
With room 5, leaving B out keeps 50. Taking it is worth 30, plus 0 for the room it leaves: 30. That is no better, so leave it and write 50.
Question 11 of 15
Question 11 of 15
Right.
You guessed: Item C weighs more than the room of 1, so it cannot go in.
What the run did:
Item C weighs 3, more than the room of 1, so it cannot go in. Keep 0 from the cell above.
Question 11 of 15
Not this time.
You guessed: With room 1, taking item C is better, so take it.
What the run did:
Item C weighs 3, more than the room of 1, so it cannot go in. Keep 0 from the cell above.
Question 11 of 15
Not this time.
You guessed: With room 1, taking item C is no better, so leave it.
What the run did:
Item C weighs 3, more than the room of 1, so it cannot go in. Keep 0 from the cell above.
Question 12 of 15
Question 12 of 15
Right.
You guessed: Item C weighs more than the room of 2, so it cannot go in.
What the run did:
Item C weighs 3, more than the room of 2, so it cannot go in. Keep 30 from the cell above.
Question 12 of 15
Not this time.
You guessed: With room 2, taking item C is better, so take it.
What the run did:
Item C weighs 3, more than the room of 2, so it cannot go in. Keep 30 from the cell above.
Question 12 of 15
Not this time.
You guessed: With room 2, taking item C is no better, so leave it.
What the run did:
Item C weighs 3, more than the room of 2, so it cannot go in. Keep 30 from the cell above.