BA shared letter is followed, and following is a visit too.
CWords that share their starts make fewer, 14 places for 10 words in counting order.
DA put walks down its own letters only, one place a letter.
4question 4
Which list makes the most places, put into an empty trie?
the answer, and why
the answer is C
tree, trek and trim make 4, then 1, then 2, which is 7. The others make 5, 6 and 4.
if you chose another
Atrek shares tre with tree, so the two make 5.
Btrue shares tr with tree, so the two make 6.
DThe second tree follows every letter and makes nothing, so 4.
pen and paper
5question 5about 8 minutes
Put tree, trek, trim and tree again into an empty trie, in that order.
Draw the trie after each put.
How many letters does each put follow, and how many places does it make?
What does the last put change, and how many visits does it cost?
a hint
The last put follows every letter of a word already in.
a worked answer
tree makes 4. trek follows 3 and makes 1. trim follows 2 and makes 2. The second tree follows 4 and makes none: the trie already marks it, so nothing changes. 16 visits, 4 a put, and 7 places.
after tree: 4 places
after trek: 5 places
after trim, and after tree again: 7 places
The trie after each put. The second tree changes nothing, so the last drawing stands for both.
The trie with t and r shared, e and i below r, then e and k below the first e, and m below i.
Followed 0, 3, 2 and 4; made 4, 1, 2 and 0.
The last put changes nothing and still costs 4 visits.
6question 6about 6 minutes
Words of five letters go into an empty trie, all different.
Why does every put cost exactly 5 visits?
Why can words make no more than places?
Why must they make at least ?
a hint
A place stands for the letters on the way down to it, and every word ends on level 5.
a worked answer
Each letter is followed or made, one visit, so 5 a word and in all. Each letter makes at most one place, so at most . Every word ends on level 5, at a place of its own, so at least .
Why must different words of five letters make at least places?8 of 8 shown
1the move: each word ends at its own place
the line:
step 14 of 16
No t below, so make a place for it.
visits: 5
step 15 of 16
Mark this place as the end of trait.
visits: 5
trait's last letter, t, is made below i, then marked as its end. train's end stays at n.
why it is allowed: A place stands for the letters on the way down to it. Two words ending at one place would have the same letters, so they would be one word.
2the move: no earlier word reaches the new end
the line:
why it is allowed: Every word has 5 letters, so a put stops on level 5. In the picture, train's path stops at n on level 5 and never reaches trait's t, so trait must make that t. By line 1, no earlier word ends at a new word's end, and none can pass it.
guess it, then
3the move: the last letter is made
the line:
why it is allowed: By lines 1 and 2, its end is a place no earlier word reached, so its last letter makes it.
guess it, then
4the move: add the puts
the line:
why it is allowed: adds line 3's floor, 1 for each put. The first put makes all 5 of its places, so a real list makes more, as aaaaa, aaaab and aaaac make 5, 1 and 1.
guess it, then
5the move: n lots of 1
the line:
why it is allowed: Line 4 adds ones. Counting order comes close, 14 places for 10 words, the 4 places of aaaa shared and 10 last letters.
guess it, then
6the move: a floor
the line:
why it is allowed: By line 5.
guess it, then
7the move: read it as a bound
the line:
why it is allowed: By line 6, with the fixed multiple 1.
guess it, then
8the move: so for the places
the line:
why it is allowed: By line 4, every list of different words makes at least . At 3 words, counting order makes 7, at least 3.
guess it, then
try it with a small : at , line 4 gives , which you can work out by hand