BCoin 5 sits beside coin 6, so it is skipped, not looked at.
CCoin 3 comes after coin 4 is found to be left.
DCoin 1 is the last the walk looks at.
pen and paper
5question 5about 8 minutes
Run the method by hand on the row 4, 9, 7, 2.
Fill the row of bests.
What is the most money, and how many comparisons did you make?
Walk back from the last coin, leaving a coin where taking ties with leaving: which coins does it take?
a hint
The best of no coins is 0 and of coin 1 is that coin. Then take the larger of the coin plus the best two back, and the best one back.
a worked answer
The bests are drawn below. The last is 11, the most money. Filling makes 3 comparisons. Walking back: at coin 4 the best is 11, the same as one back, so coin 4 is left. At coin 3 it is 11, more than 9, so coin 3 is taken: jump to coin 1. At coin 1 it is 4, more than the best of no coins, so coin 1 is taken. 3 more comparisons, 6 in all. Take 4 and 7.
coin
worth
take it
leave it
best
-
-
-
-
0
1
4
-
-
4
2
9
9
4
9
3
7
11
9
11
4
2
11
11
11
The row 4, 9, 7, 2. At coin 4, taking ties with leaving, so the best stays 11 and the walk leaves it.
Section 4's questions 1 and 2 count the most and the fewest.
a worked answer
At most 299 + 200, which is 499, as two thirds of 300 is 200. At least 299 + 150, which is 449, as half of 300 is 150. The row 1, 2, 1 repeated from the last coin back reaches the most, and every other coin worth 2, ending with the last, the fewest.
Question 1: at most how many comparisons, , can a row of coins cost, from 1 up?18 of 18 shown
1the move: filling
the line:
why it is allowed: Coins 2 to each compare taking with leaving. Coin 1 is written as it is. For 6 coins, 5.
2the move: never two left in a row
the line:
why it is allowed: Take any coin, and call it coin . Say the walk left it, then the coin before it. Leaving a coin means its best equals the one before, so the best at coin equals the best two coins before it. But taking coin gives that coin plus that same best, more than it, as every coin is worth 1 or more. So the walk never does this.
guess it, then
3the move: nor coin 1
the line:
why it is allowed: The best up to coin 1 is the coin, more than 0, so the walk takes coin 1. A walk that leaves coin 2 then visits coin 1 and takes it.
guess it, then
4the move: no more left than taken
the line:
why it is allowed: By lines 2 and 3, the coin visited just after a coin left is taken. So each coin left has a take of its own after it.
guess it, then
5the move: how far back
the line:
visit
at coin
best
one back
move
1
6
4
4
left, back 1
2
5
4
3
taken, back 2
3
3
2
2
left, back 1
4
2
2
1
taken, back 2
The walk on 1, 2, 1, 1, 2, 1. Each coin left is followed by a take. 2 left, 2 taken, moving back 6 in all.
why it is allowed: A coin left moves the walk back 1, and a take 2. It starts at coin and stops at 0, the row of no coins, or one below it after taking coin 1. For 6 coins, at most 7.
guess it, then
6the move: count each visit three times
the line:
why it is allowed: A coin left is 1 visit and moves back 1: 3 is twice 1, plus 1. A take is 1 visit and moves back 2: 3 is twice 2, less 1. Add these over every visit. For the walk in line 5's picture: 3 times 4 is twice 6, plus 2, less 2.
guess it, then
7the move: at most
the line:
why it is allowed: By line 5, twice the moves back is at most . By line 4, the coins left less the taken is at most 0. For 6 coins, at most 14.
guess it, then
8the move: divide by 3
the line:
why it is allowed: Divide line 7 by 3. For 6 coins, at most 14 thirds, which is 4 and two thirds.
guess it, then
9the move: a whole number
the line:
n
2n + 2 over 3
rounded down
2n over 3
rounded up
3
8 over 3
2
6 over 3
2
4
10 over 3
3
8 over 3
3
5
12 over 3
4
10 over 3
4
leaves 0, 2 or 1 over when divided by 3, as for 3, 4 and 5. In each, the two last columns agree. Adding or taking 3 from adds or takes 2 from both, so these rows cover every from 1.
why it is allowed: The visits are whole, so they are at most rounded down. That is two thirds of rounded up, as the table shows. For 6 coins, 4.
guess it, then
10the move: a best grows by at most its coin
the line:
why it is allowed: Taking a coin gives it plus the best two back, and the best two back is at most the best one back, as leaving the coin keeps the old best. Leaving gives the best one back. Coin 1's best is the coin itself, its coin more than 0. For coin 3 of the first example, 13 is at most 9 plus 7.
guess it, then
11the move: what the dearest row does
the line:
coin
worth
best
walk
7
1
5
left
6
2
5
taken
5
1
4
skipped
4
1
3
left
3
2
3
taken
2
1
1
skipped
1
1
1
taken
The dearest row of 7, read from the last coin. Each 2 is taken and the 1 just right of it left; the 1 before it is skipped (jumped over, not visited). Coin 7: taking gives 1 + 4, which is 5, and leaving keeps 5. The same, so it is left. 5 visits.
why it is allowed: At a 2, the coin before is a 1, so by line 10 the best one back is at most 1 more than the best two back. Taking gives 2 more: the 2 is taken. At a 1 just right of a 2, taking gives 1 plus the best two back. The coin two back is a 1, so by line 10 that is at most 2 plus the best three back. Taking that 2 already gave as much: the 1 is left. Where coin 1 is the 2, line 3 takes it, and coin 2 gives 1, less than 2, so it is left.
guess it, then
12the move: two of every three
the line:
n
groups
spare
visits
2n over 3 rounded up
6
2
0
4
4
7
2
1
5
5
8
2
2
6
6
Each group of three costs 2 visits, and each spare coin 1. A spare coin adds a third of 2 to two thirds of , which rounds up to the visit it costs.
why it is allowed: By line 11, from the last coin each 1, 2, 1 costs 2 visits: the 1 left, the 2 taken, the next 1 skipped. One spare coin at the start, coin 1, is visited and taken (line 3). Two spare are a 2 then a 1. The best at coin 2 is 2, the same as at coin 1, so coin 2 is left and coin 1 taken (line 3), both visited. That is two thirds of rounded up, as the table shows. For 7 coins, 2 groups and 1 spare: 5 visits.
guess it, then
13the move: add them
the line:
why it is allowed: By lines 1, 9 and 12, filling and the most visits, which the dearest row makes. For 6 coins, 5 + 4, which is 9.
guess it, then
14the move: a ceiling
the line:
why it is allowed: Two thirds of rounded up is at most , as is whole and more than two thirds of itself. So is less than . For 6 coins, 9 is at most 12.
guess it, then
15the move: read the bound
the line:
why it is allowed: By line 14, with the fixed multiple 2. reads is in, and means at most a fixed multiple of , from some on.
guess it, then
16the move: a floor
the line:
why it is allowed: From 1 up, two thirds of rounded up is at least 1. So is plus at least 1, at least . For 6 coins, 9 is at least 6.
guess it, then
17the move: read the bound
the line:
why it is allowed: By line 16, with the fixed multiple 1. means at least a fixed multiple of , above 0, from some on.
guess it, then
18the move: both together
the line:
why it is allowed: Lines 15 and 17 bound by the same growth. means both.
guess it, then
try it with a small : at , line 13 gives , which you can work out by hand