ATo the left is C's own row at a smaller room, which the rule never reads.
BThe rule reads the row above, never its own row.
DIt reads only two cells, the same room and the room C leaves.
pen and paper
5question 5about 8 minutes
Run the method by hand on three items in a bag that holds 4. A weighs 1 and is worth 15, B weighs 3 and is worth 35, and C weighs 2 and is worth 25.
Fill the table.
What is the most value, and how many cells did you fill?
Read back which items go in.
a hint
The first row and column hold 0. An item too heavy for the room copies the cell above. Otherwise take the more of the cell above, and the item's value plus the row above at the room it leaves.
a worked answer
The table is drawn below. The last cell says 50, and you fill 12 cells, 3 rows of 4. Reading back: C at room 4 holds 50, the same as above, so C stays out. B at room 4 holds 50, more than the 15 above it, so B goes in and leaves room 1. A at room 1 holds 15, more than the 0 above it, so A goes in. Take A and B.
item
0
1
2
3
4
-
0
0
0
0
0
A
0
15
15
15
15
B
0
15
15
35
50
C
0
15
25
40
50
A, B and C in a bag that holds 4. The last cell holds 50.
A and B, as C's cell equals the one above and B's and A's beat theirs.
6question 6about 6 minutes
A team picks from 20 features to build, each costing whole dollars and worth some value to the team, within a budget of 400 dollars.
How many cells does the method fill, with the budget as the room?
The budget grows to 40,000 dollars. How many cells now?
Count the digits in 400 and in 40,000. What did the 2 extra digits do to the cells?
a hint
Each feature is an item, its cost its weight, and the budget the room. Question 1 of the learn page's section 4 counts the cells, and question 5 the digits.
a worked answer
20 times 400, which is 8,000 cells. At 40,000 dollars, 20 times 40,000, which is 800,000 cells, 100 times as many. 400 has 3 digits and 40,000 has 5. 40,000 is 400 with 2 more zeros, 100 times as big, so the cells are 100 times as many.
Question 5: how fast do the cells grow with the length of in digits? Take 3 items and from 1 up, let be how many digits has, and let be the cells the smallest of digits fills.5 of 5 shown
1the move: the smallest of d digits
the line:
d
smallest W
cells
3 times d
1
1
3
3
2
10
30
6
3
100
300
9
4
1,000
3,000
12
7
1,000,000
3,000,000
21
The watch page's 3 items in the smallest bag of digits. One digit more, and the cells are 10 times as many. Beside them, 3 times , a cost that grows with the length in digits, adds only 3.
why it is allowed: A number of digits starts with a digit of 1 or more, and digits follow. The smallest is 1 and then zeros. For 3 digits, 100.
2the move: write it as a power
the line:
why it is allowed: 1 and then zeros is tens multiplied together, written . For 1 digit there are no tens to multiply, which leaves 1. For 3 digits, 100.
guess it, then
3the move: its cells
the line:
why it is allowed: By question 1 of section 4, the cells are 3 times the room. So by line 2, the smallest of digits fills : that is . For 3 digits, 300.
guess it, then
4the move: every room of d digits
the line:
why it is allowed: By line 1, every such is at least the smallest. By question 1 of section 4, a bigger fills more cells, , so is the fewest.
guess it, then
5the move: each digit more
the line:
why it is allowed: One digit more multiplies by one more 10, so grows 10 times with each digit. Against the room, the cells grow in a straight line, . Against its length in digits, the fewest grow tenfold a digit, and 7 digits, a bag of 1,000,000, already make 3,000,000 cells. A cost like this is called pseudo-polynomial.
guess it, then
try it with a small : at , line 3 gives , which you can work out by hand