WordWorks
Interactive Combinatorics on Words and String Algorithms
Words, factors, and borders — taught through interactive visualizations and generated practice with explanation-based feedback.
Foundations
Combinatorics
- Lesson 4Counting Unbordered WordsThe Nielsen recurrence for counting unbordered words over a k-letter alphabet.Practice →
- Lesson 5Generating Unbordered WordsA constant-amortized algorithm (GenU) that generates every unbordered word of a given length.Practice →
- Lesson 6Generating Bordered WordsA constant-amortized algorithm (GenB) that generates every bordered word of a given length, via the fact that the shortest border of a bordered word is unbordered.Practice →
Algorithms
Advanced Topics
- Lesson 8Factor AvoidanceCounting words that avoid a pattern using a deterministic finite automaton built from the failure function.Practice →
- Lesson 9Autocorrelation and the Guibas–Odlyzko FormulaThe autocorrelation word, the overlap set B(P), and two counting identities for words avoiding a single pattern.Practice →
- Lesson 10Cross-BordersWords that bridge a pair — cross-borders, the shortest cross-border, and a guided proof that it is unbordered.Practice →