From a50b98856e7369630232793c0a49d8ff00d2bcaf Mon Sep 17 00:00:00 2001 From: Peter Norvig Date: Sat, 5 Jun 2021 23:00:13 -0700 Subject: [PATCH] Update Portmantout.ipynb --- ipynb/Portmantout.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ipynb/Portmantout.ipynb b/ipynb/Portmantout.ipynb index 2a8d169..a8c29d2 100644 --- a/ipynb/Portmantout.ipynb +++ b/ipynb/Portmantout.ipynb @@ -35,7 +35,7 @@ "- **Unused word step**: using a word for the first time. (Once we use them all, we're done.)\n", "- **Bridging word step**: if no remaining unused words overlap the previous word, we need to do something to get back on track to consuming unused words. I call that something a **bridge**: a step that **repeats** a previously-used word and has an ending that matches the start of some unused word. Repeating a word may add letters to the final length of $S$, and it doesn't get us closer to the requirement of using all the words, but it is sometimes necessary. Sometimes two words are required to build a bridge, but never more than two (at least with the 100,000 word set we will be dealing with). \n", "\n", - "There's actually a third type of word, but it doesn't need a corresponding type of step: a **subword** is a word that is a substring of another word. If, say, `ajar` is in $W$, then we know we have to place it in some step along the path. But if `jar` is also in $W$, we don't need a separate step for it—whenever we place `ajar`, we have automatically placed `jar`. The program can save computation time save time by initializing the set of **unused words** to be just the **nonsubwords** in $W$. (We are still free to use a subword as a **bridging word** if needed.)\n", + "There's actually a third type of word, but it doesn't need a corresponding type of step: a **subword** is a word that is a substring of another word. If, say, `ajar` is in $W$, then we know we have to place it in some step along the path. But if `jar` is also in $W$, we don't need a separate step for it—whenever we place `ajar`, we have automatically placed `jar`. The program can save computation time by initializing the set of **unused words** to be just the **nonsubwords** in $W$. (We are still free to use a subword as a **bridging word** if needed.)\n", "\n", "(*English trivia:* I use the clumsy term \"nonsubwords\" rather than \"superwords\", because there are a small number of words, like \"cozy\" and \"pugs\" and \"july,\" that are not subwords and also not superwords.)\n", "\n",