How many cells does the method fill to turn plank into blank?
the answer, and why
the answer is B
5 rows of 5 cells, a row for each letter of plank. The first row and column are written at the start.
if you chose another
AThat counts the first row and column too, which are written at the start, not filled.
CThat is the fewest edits, replace p with b.
DThat adds the letters, but each row fills a cell for each letter of blank.
2question 2
How few edits turn lion into loin?
the answer, and why
the answer is C
Keep l, replace i with o, replace o with i, keep n. Swapping two letters is not one edit, so it costs 2.
if you chose another
AThat counts a swap as one edit, which it is not.
BThat replaces every letter, but l and n can stay.
D0 is only for equal words. These have the same letters in a different order.
3question 3
Which pair makes the method fill the most cells?
the answer, and why
the answer is B
5 times 5, which is 25.
if you chose another
A3 times 4, which is 12.
CEqual words still fill every cell, but 4 times 4 is 16.
D1 times 7, which is 7.
4question 4
A cell's two last letters are the same. What does the method write in it?
the answer, and why
the answer is C
The matching letters need no edit of their own, so the cell copies up and to the left. Question 4 of the learn page's section 4 shows that this is the cheapest.
Two texts, each 100,000 letters long, are compared with this method.
How many cells does it fill?
How long does that take at a billion cells a second?
How many numbers does the table hold, and how many do two rows hold?
a hint
Questions 1 to 3 of the learn page's section 4 count all three.
a worked answer
100,000 times 100,000, which is 10,000,000,000 cells, about 10 seconds. The table holds 100,001 times 100,001, which is 10,000,200,001 numbers, but two rows hold only 200,002.
Question 1: how many cells, , does the method fill on two words of letters, from 1 up?8 of 8 shown
1the move: a row for each letter
the line:
order
-
p
pe
pea
-
given
given
given
given
a
given
1
2
3
ap
given
4
5
6
ape
given
7
8
9
Ape into pea, each cell numbered in the order it is filled, row by row. Given cells are written first, not counted. 3 rows of 3, 9 cells.
why it is allowed: Each letter of the first word has a row, and each row fills one cell for each letter of the second. Crate into cart fills 5 times 4, 20 cells.
2the move: both of n letters
the line:
why it is allowed: Here the first word has letters too, so is . For 3, 3 times 3, which is 9.
guess it, then
3the move: write it shorter
the line:
why it is allowed: times is written , read squared. For 3, 9.
guess it, then
4the move: a ceiling
the line:
why it is allowed: By line 3, as a number is at most itself.
guess it, then
5the move: read the bound
the line:
why it is allowed: By line 4, with the fixed multiple 1. reads is in, and means at most a fixed multiple of , from some on.
guess it, then
6the move: a floor
the line:
why it is allowed: By line 3, as a number is at least itself.
guess it, then
7the move: read the bound
the line:
why it is allowed: By line 6, with the fixed multiple 1. means at least a fixed multiple of , above 0, from some on.
guess it, then
8the move: both together
the line:
why it is allowed: Lines 5 and 7 bound by the same growth. means both.
guess it, then
try it with a small : at , line 2 gives , which you can work out by hand