Curriculum
145 weeks. Two interpreters, then Knuth.
Crafting Interpreters first, then The Art of Computer Programming, volumes 1 to 4B, with two NeetCode problems a week for the first 75 weeks and a Play track of Zachtronics games, Factorio and Satisfactory on the side. Every week has a reading guide and a due date once you pick a start.
Dated. Pick a start date and a pace; every week gets a due date, in your calendar too.
Proved. The interpreter chapters check themselves: push your repo and the book's own tests mark them done.
Sample dates for the next cohort, starting Jan 4, 2027. Pick your own start and they become yours.ReadingCodeNeetCodeCheckpointGame
Crafting Interpreters
About half a year building two complete interpreters for Lox, a small but real language with closures and classes. First jlox, a tree-walking interpreter in Java (chapters 1 to 13), then clox, a bytecode virtual machine in C with its own hash table and garbage collector (chapters 14 to 30). A chapter a week, next to two NeetCode problems. You type every line yourself. It is the most fun phase of the path and the one that changes how you see every language you use.
Play track: TIS-100 (week 1), Shenzhen I/O (week 11), EXAPUNKS (week 19)
-
1 Chapters 1, 2 and 3 11 h
By the end you can
- Explain why the book builds two interpreters, jlox and clox, for one language.
- Use the map of the territory to name each phase, scanning to code generation.
- Recognize Lox's core features: dynamic typing, closures, classes and inheritance.
- ReadCh 1: Introduction
- ReadCh 2: A Map of the Territory
- ReadCh 3: The Lox Language
- NeetCode#1 Contains Duplicate#2 Valid Anagram
- PlayTIS-100 Read the manual and solve the first 3 puzzles
-
2 Ch 4: Scanning 9 h
By the end you can
- Implement a scanner that turns Lox source text into a list of tokens.
- Explain the difference between a lexeme and a token.
- Trace the start and current indices while scanning a multi-character lexeme.
- BuildCh 4: Scanning
- NeetCode#3 Two Sum#4 Group Anagrams
-
3 Ch 5: Representing Code 7 h
By the end you can
- Explain how context-free grammar rules describe Lox expressions.
- Implement the Visitor pattern to add operations without editing node classes.
- Use the GenerateAst tool to produce the expression tree classes.
-
4 Ch 6: Parsing Expressions 9 h
By the end you can
- Implement a recursive descent parser with one method per grammar rule.
- Trace how precedence makes
1 + 2 * 3multiply before adding. - Explain how panic-mode recovery reports an error and keeps parsing.
-
5 Ch 7: Evaluating Expressions 8 h
By the end you can
- Implement a tree-walking evaluator that visits each expression node.
- Explain how Lox values map onto Java's Double, Boolean, String and null.
- Recognize where runtime type errors are detected and reported.
-
6 Ch 8: Statements and State 9 h
By the end you can
- Implement print, expression and var statements with a global environment.
- Explain how nested environments implement block scope and shadowing.
- Trace assignment to a declared variable versus an undeclared one.
-
7 Ch 9: Control Flow 9 h
By the end you can
- Implement if, while and the short-circuit logical operators.
- Trace a for loop's desugaring into a block and a while loop.
- Recognize how the parser binds a dangling else.
- BuildCh 9: Control Flow
- NeetCode#13 Container With Most Water#14 Trapping Rain Water
- PlayTIS-100 Solve the first 15 puzzles
-
8 Ch 10: Functions 10 h
By the end you can
- Implement function declarations and calls with an arity check.
- Explain why jlox implements return by throwing an exception.
- Use closures that capture the environment where a function was declared.
-
9 Ch 11: Resolving and Binding 10 h
By the end you can
- Explain the closure bug that motivates a static resolver pass.
- Implement a resolver that records how many scopes away each local is.
- Recognize the errors the resolver reports before the program runs.
-
10 Ch 12: Classes 10 h
By the end you can
- Implement class declarations, instances, and property get and set.
- Explain how methods bind
thisthrough an extra environment. - Use init() to set up a new instance's fields.
-
11 Ch 13: Inheritance 10 h
By the end you can
- Implement superclass declarations and method lookup up the inheritance chain.
- Explain how
superis bound through an extra environment. - Recognize inheritance errors caught by the resolver or at runtime.
- BuildCh 13: Inheritance
- NeetCode#21 Valid Parentheses#22 Min Stack
- PlayShenzhen I/O Read the datasheets and solve the first 3 puzzles
- Checkpointjlox: the tree-walk interpreter Scanning, parsing, resolving, closures and classes, after chapter 13.
-
12 Ch 14: Chunks of Bytecode 8 h
By the end you can
- Implement a growable chunk of bytecode with a constant pool and line info.
- Explain how OP_CONSTANT uses a one-byte operand to index the constants.
- Use the disassembler to read each instruction and its byte offset.
-
13 Ch 15: A Virtual Machine 8 h
By the end you can
- Implement the VM's dispatch loop with an instruction pointer and value stack.
- Trace the value stack as arithmetic instructions push and pop.
- Explain why a binary operator pops its right operand first.
-
14 Ch 16: Scanning on Demand 7 h
By the end you can
- Explain why clox scans tokens on demand instead of all at once.
- Implement tokens as a pointer into the source plus a length.
- Use a trie-shaped switch to recognize keywords.
-
15 Ch 17: Compiling Expressions 10 h
By the end you can
- Implement a Pratt parser with prefix and infix functions per token type.
- Trace parsePrecedence on a small expression through the rule table.
- Explain how a single-pass compiler emits bytecode while it parses.
-
16 Ch 18: Types of Values 7 h
By the end you can
- Implement Value as a tagged union for numbers, booleans and nil.
- Explain why the VM checks a value's type tag before reading the union.
- Use the new OP_NOT, OP_EQUAL, OP_GREATER and OP_LESS instructions.
-
17 Ch 19: Strings 10 h
By the end you can
- Implement heap-allocated string objects that share an Obj header.
- Explain why Obj must be the first field of every object struct.
- Use the VM's list of objects to free every allocation at exit.
- BuildCh 19: Strings
- NeetCode#33 Median of Two Sorted Arrays#34 Reverse Linked List
- PlayShenzhen I/O Solve the first 12 puzzles
-
18 Ch 20: Hash Tables 10 h
By the end you can
- Implement an open-addressing hash table with linear probing and tombstones.
- Compute FNV-1a hashes and turn them into bucket indexes.
- Explain how interning lets string equality compare pointers.
-
19 Ch 21: Global Variables 10 h
By the end you can
- Implement print, expression and var statements in clox's compiler.
- Explain how canAssign rejects invalid targets like
a * b = c. - Trace OP_DEFINE_GLOBAL, OP_GET_GLOBAL and OP_SET_GLOBAL through the globals table.
- BuildCh 21: Global Variables
- NeetCode#37 Reorder List#38 Remove Nth Node From End of List
- PlayEXAPUNKS Read the first zine and solve the first 3 puzzles
-
20 Ch 22: Local Variables 9 h
By the end you can
- Implement locals as stack slots tracked by the compiler.
- Trace endScope as it pops the locals of a finished block.
- Explain why locals are much faster to reach than globals.
-
21 Ch 23: Jumping Back and Forth 8 h
By the end you can
- Implement if, while and for with jump instructions.
- Explain how patchJump fills in a forward jump's offset after the body.
- Trace how
andandorshort-circuit using conditional jumps.
-
22 Ch 24: Calls and Functions 11 h
By the end you can
- Implement function objects, call frames and the OP_CALL instruction.
- Explain why the compiler gives each function its own chunk.
- Trace the value stack and frames during a recursive call.
-
23 Ch 25: Closures 11 h
By the end you can
- Explain how upvalues let a closure reach an enclosing function's variables.
- Implement OP_CLOSURE and closing upvalues when a captured local leaves scope.
- Trace how a captured variable passes through a middle function's upvalue.
-
24 Ch 26: Garbage Collection 11 h
By the end you can
- Explain reachability, roots and the tricolor abstraction.
- Implement mark-sweep collection: mark roots, trace references, sweep white objects.
- Use stress-GC mode to expose objects collected too early.
-
25 Ch 27: Classes and Instances 9 h
By the end you can
- Implement class and instance objects, each instance with a fields table.
- Use OP_GET_PROPERTY and OP_SET_PROPERTY to read and write fields.
- Explain why every field access in clox costs a hash table lookup.
- BuildCh 27: Classes and Instances
- NeetCode#49 Same Tree#50 Subtree of Another Tree
- CheckpointNeetCode mock at 50 problems 2 problems in 45 minutes, picked from the categories you have covered.
-
26 Ch 28: Methods and Initializers 10 h
By the end you can
- Implement methods, bound methods and
thisstored in slot zero. - Explain how OP_INVOKE avoids building a bound method for a direct call.
- Recognize how an initializer returns the new instance automatically.
- Implement methods, bound methods and
-
27 Ch 29: Superclasses 9 h
By the end you can
- Implement copy-down inheritance by copying superclass methods into the subclass.
- Explain how
superis captured from a hidden local in a synthetic scope. - Use OP_SUPER_INVOKE to make super calls faster.
- BuildCh 29: Superclasses
- NeetCode#53 Binary Tree Right Side View#54 Count Good Nodes In Binary Tree
- PlayEXAPUNKS Solve the first 12 puzzles
-
28 Ch 30: Optimization 9 h
By the end you can
- Use a profiler to find a hotspot before changing any code.
- Explain why masking with capacity minus one can replace modulo.
- Implement NaN boxing behind a compile-time flag.
- BuildCh 30: Optimization
- NeetCode#55 Validate Binary Search Tree#56 Kth Smallest Element In a Bst
- Checkpointclox: the bytecode VM Bytecode, the stack VM, upvalues, mark-sweep GC and string interning, after chapter 30.
TAOCP Vol 1: Fundamental Algorithms
Welcome to Knuth. Volume 1 starts with a big block of math (induction, sums, binomial coefficients, generating functions, asymptotics), then MIX, Knuth's imaginary computer and its assembly language, then the data structures everything else is built on: lists, trees, garbage collection and memory allocation. The math weeks are the hardest stretch of the whole path for most people. That is normal. Push through them and the rest of Knuth opens up.
Play track: SpaceChem (week 31), Infinifactory (week 46)
-
29 1.1 Algorithms 9 h
By the end you can
- Trace Euclid's Algorithm E by hand on a pair of integers.
- Explain Knuth's five properties: finiteness, definiteness, input, output, effectiveness.
- Recognize Knuth's step format and his exercise rating scale.
-
30 1.2.1 Mathematical Induction 9 h
By the end you can
- Prove simple statements about integers by mathematical induction.
- Explain how flowchart assertions prove an algorithm correct.
- Recognize the hole in a flawed induction argument.
-
31 1.2.2 Numbers, Powers, and Logarithms 9 h
By the end you can
- Compute logarithms in bases 2, e and 10, and convert between them.
- Explain how powers extend from integers to rational and real exponents.
- Use logarithms to count how many bits a number needs.
- Knuth1.2.2 Numbers, Powers, and Logarithms
- NeetCode#61 Last Stone Weight#62 K Closest Points to Origin
- PlaySpaceChem Solve the first 3 puzzles
-
32 1.2.3 Sums and Products 11 h
By the end you can
- Use Sigma and Pi notation and the rules for manipulating sums.
- Compute small sums by changing the variable and applying the distributive law.
- Explain bracket notation for conditions inside a sum.
-
33 1.2.4 Integer Functions and Elementary Number Theory 10 h
By the end you can
- Compute floors, ceilings and x mod y with negative arguments.
- Explain why Knuth's mod differs from C's % operator on negatives.
- Use congruences and Fermat's theorem on small examples.
-
34 1.2.5 Permutations and Factorials 8 h
By the end you can
- Compute the number of orderings of n objects and of k chosen from n.
- Use the prime-power formula to count factors of p in n!.
- Explain how fast n! grows and how the gamma function extends it.
-
35 1.2.6 Binomial Coefficients (part 1) 10 h
By the end you can
- Compute binomial coefficients with Pascal's triangle and the addition formula.
- Use symmetry, absorption and the binomial theorem on small cases.
- Explain why binomial coefficients make sense for a negative upper index.
-
36 1.2.6 Binomial Coefficients (part 2) 11 h
By the end you can
- Use Vandermonde's convolution to collapse a sum of binomial products.
- Explain negating the upper index and the sign it brings.
- Recognize multinomial coefficients and Stirling numbers in counting problems.
-
37 1.2.7 Harmonic Numbers 7 h
By the end you can
- Compute small harmonic numbers exactly and estimate large ones.
- Explain why H_n - ln n approaches Euler's constant, about 0.5772.
- Use summation by parts on sums that involve H_k.
-
38 1.2.8 Fibonacci Numbers 10 h
By the end you can
- Compute Fibonacci numbers and check identities numerically.
- Explain the closed form in terms of the golden ratio phi.
- Use the unique representation of integers as non-adjacent Fibonacci sums.
- Knuth1.2.8 Fibonacci Numbers
- NeetCode#75 Letter Combinations of a Phone Number#76 N Queens
- PlaySpaceChem Solve the first 12 puzzles
-
39 1.2.9 Generating Functions 11 h
By the end you can
- Use a power series to encode a whole sequence.
- Explain how shifting, scaling and convolution act on coefficients.
- Compute coefficients of products of simple generating functions.
-
40 1.2.10 Analysis of an Algorithm 10 h
By the end you can
- Trace Algorithm M and count how often the running maximum changes.
- Compute the best, worst and average values of that count for small n.
- Explain why the average count involves the harmonic number H_n.
-
41 1.2.11 Asymptotic Representations 11 h
By the end you can
- Use O-notation as a one-way statement about an upper bound.
- Compute simple asymptotic expansions by combining O terms.
- Explain what Euler's summation formula does for approximating sums.
- Knuth1.2.11 Asymptotic Representations
- NeetCode#81 Max Area of Island#82 Clone Graph
- CheckpointVol 1: mathematical preliminaries Induction, sums, binomials, harmonic numbers, generating functions and asymptotics (§1.2).
-
42 1.3.1 Description of MIX 10 h
By the end you can
- Explain MIX's words, signs, registers and comparison indicator.
- Use field specifications like (1:3) to load and store parts of a word.
- Trace loads, stores and arithmetic step by step in a MIX simulator.
-
43 1.3.2 The MIX Assembly Language 11 h
By the end you can
- Use MIXAL symbols and the pseudo-operations EQU, ORIG, CON and END.
- Recognize local symbols like 2H, 2F and 2B.
- Trace a short MIXAL program and its execution-frequency counts.
- Knuth1.3.2 The MIX Assembly Language
- NeetCode#85 Pacific Atlantic Water Flow#86 Surrounded Regions
- CheckpointMIX: a program of your own One MIXAL program you have not passed before, graded on the server.
-
44 1.3.3 Applications to Permutations 11 h
By the end you can
- Compute products of permutations written in cycle notation.
- Implement in-place inversion of a permutation stored in an array.
- Explain fixed points and the average number of cycles of a random permutation.
-
45 1.4.1 Subroutines 8 h
By the end you can
- Implement a MIX subroutine that returns through the rJ register.
- Explain how the entry code stores the return address into the exit jump.
- Compare in-line code with subroutine calls in space and time.
-
46 1.4.2 Coroutines 9 h
By the end you can
- Explain how coroutines resume each other where they last left off.
- Trace Knuth's two-coroutine character pipeline by hand.
- Compare MIX coroutine linkage with generators in Python or JavaScript.
- Knuth1.4.2 Coroutines
- NeetCode#91 Redundant Connection#92 Word Ladder
- PlayInfinifactory Solve the first 3 puzzles
-
47 1.4.3 Interpretive Routines 11 h
By the end you can
- Trace the MIX simulator's fetch, decode and dispatch cycle.
- Compare Knuth's simulator loop with clox's run() dispatch loop.
- Explain how a trace routine watches each instruction of a running program.
-
48 1.4.4 and 1.4.5 8 h
By the end you can
- Explain how buffering overlaps computation with slow input and output.
- Trace buffer swapping as the program and a device trade two buffers.
- Recognize how subroutines, coroutines and interpreters developed historically.
-
49 2.1 and 2.2.1 11 h
By the end you can
- Use Knuth's node and field notation, such as NEXT(TOP) and TAG(P).
- Explain how stacks, queues and deques differ in where items enter and leave.
- Trace which output orders a stack can produce from input 1, 2, 3.
-
50 2.2.2 Sequential Allocation 10 h
By the end you can
- Implement a circular queue in an array with correct full and empty tests.
- Implement two stacks growing toward each other in one array.
- Explain how Garwick's method repacks memory shared by many stacks.
- Knuth2.2.2 Sequential Allocation
- NeetCode#99 Climbing Stairs#100 Min Cost Climbing Stairs
- CheckpointNeetCode mock at 100 problems 2 problems in 45 minutes, picked from the categories you have covered.
-
51 2.2.3 Linked Allocation 12 h
By the end you can
- Implement linked stacks and queues with an available-space list.
- Trace Knuth's topological sort using predecessor counts and successor lists.
- Recognize when input relations contain a cycle and no order exists.
-
52 2.2.4 Circular Lists 10 h
By the end you can
- Implement polynomial addition with circular lists of terms.
- Explain how a special head node ends a trip around a circular list.
- Use a pointer to the rightmost node to reach both list ends.
- Knuth2.2.4 Circular Lists
- NeetCode#103 Longest Palindromic Substring#104 Palindromic Substrings
- PlayInfinifactory Solve the first 12 puzzles
-
53 2.2.5 Doubly Linked Lists 10 h
By the end you can
- Implement insertion and deletion anywhere in a doubly linked list.
- Explain how a list head removes special cases at the ends.
- Recognize how the elevator simulation keeps waiting actions in time order.
-
54 2.2.6 Arrays and Orthogonal Lists 10 h
By the end you can
- Compute row-major addresses for rectangular and triangular arrays.
- Explain orthogonal lists that link sparse matrix entries by row and column.
- Recognize when sparse list storage beats a dense array.
-
55 2.3.1 Traversing Binary Trees 12 h
By the end you can
- Trace preorder, inorder and postorder traversals of a binary tree.
- Implement inorder traversal with an explicit stack instead of recursion.
- Explain how threads reuse null links to point to inorder neighbors.
-
56 2.3.2 Binary Tree Representation of Trees 10 h
By the end you can
- Use the first-child, next-sibling rule to turn a forest into a binary tree.
- Explain why forest postorder matches the binary tree's inorder.
- Trace symbolic differentiation over a formula stored as a tree.
-
57 2.3.3 Other Representations of Trees 10 h
By the end you can
- Recognize sequential tree layouts in preorder or level order with tags.
- Implement the equivalence algorithm with parent links that finds roots first.
- Use parent-link trees to decide whether two items are equivalent.
-
58 2.3.4 Basic Mathematical Properties of Trees (part 1) 10 h
By the end you can
- Explain the difference between free trees, oriented trees and spanning trees.
- Prove that a free tree with n vertices has exactly n - 1 edges.
- Recognize when a directed graph has an Eulerian circuit.
-
59 2.3.4 Basic Mathematical Properties of Trees (part 2) 11 h
By the end you can
- Compute the number of binary trees with n nodes.
- Explain internal and external path length and the rule E = I + 2n.
- Use Huffman's method to build a minimum weighted path length tree.
-
60 2.3.5 Lists and Garbage Collection 12 h
By the end you can
- Explain why reference counts cannot reclaim cyclic List structures.
- Trace link-reversal marking, which needs no auxiliary stack.
- Compare Knuth's marking algorithms with clox's gray-stack collector.
-
61 2.4 Multilinked Structures 9 h
By the end you can
- Explain how one node can belong to several linked lists at once.
- Trace how level-numbered declarations become a table with parent and sibling links.
- Use MOVE CORRESPONDING rules to decide which fields get copied.
-
62 2.5 Dynamic Storage Allocation 12 h
By the end you can
- Compare first-fit and best-fit allocation on the same requests.
- Implement freeing with boundary tags so neighbors merge in constant time.
- Explain the buddy system and Knuth's fifty-percent rule.
-
63 2.6 and the Vol 1 review 10 h
By the end you can
- Use one-page summaries to review chapter 1's mathematics and MIX.
- Compare the chapter 2 structures and pick one that fits a problem.
- Explain how generating functions and harmonic numbers recur in algorithm analysis.
- Knuth2.6 History and Bibliography
- KnuthVol 1 review
- NeetCode#125 Gas Station#126 Hand of Straights
- CheckpointVol 1: Fundamental Algorithms The core ideas of Vol 1, then 3 exercises from it, cold.
TAOCP Vol 2: Seminumerical Algorithms
Volume 2 is about numbers as computers see them. Chapter 3 is random numbers: how to generate them, how to test them, and how to turn them into shuffles and samples. Chapter 4 is arithmetic: floating point, bignums, fast multiplication, gcd, factoring and polynomials. Some sections are deep number theory; the guides tell you where to dig in and where to skim.
Play track: Opus Magnum (week 64), Factorio (week 79)
-
64 3.1 Introduction 8 h
By the end you can
- Explain why a complicated procedure need not produce random numbers.
- Trace the middle-square method on a four-digit seed.
- Recognize why any generator with finite state must eventually cycle.
- Knuth3.1 Introduction
- NeetCode#127 Merge Triplets to Form Target Triplet#128 Partition Labels
- PlayOpus Magnum Solve the first 3 puzzles
-
65 3.2.1 The Linear Congruential Method 11 h
By the end you can
- Compute the next values of a small linear congruential sequence by hand.
- Explain the conditions on a, c and m that give full period.
- Recognize why low bits of a power-of-two LCG are weak.
-
66 3.2.2 Other Methods 10 h
By the end you can
- Explain how additive lagged-Fibonacci generators work and why they are fast.
- Implement a combiner that shuffles one generator's output using another.
- Compare quadratic, additive and combined generators by their main trade-offs.
-
67 3.3.1 General Test Procedures 10 h
By the end you can
- Compute the chi-square statistic for observed counts in a few categories.
- Use the Kolmogorov-Smirnov test on samples from a continuous distribution.
- Explain why both very high and very low statistics are suspicious.
-
68 3.3.2 Empirical Tests 11 h
By the end you can
- Explain what the gap, poker, coupon collector and runs tests each count.
- Implement three empirical tests on a good and a bad generator.
- Recognize why run lengths are correlated and need a special statistic.
-
69 3.3.3 Theoretical Tests 8 h
By the end you can
- Explain how theoretical tests analyze a generator without running it.
- Recognize that an LCG's serial correlation is roughly 1/a when c is small.
- Compare what theoretical and empirical tests can and cannot reveal.
-
70 3.3.4 The Spectral Test 12 h
By the end you can
- Explain why t-tuples from an LCG lie on parallel hyperplanes.
- Recognize that wider spacing between hyperplanes means a worse multiplier.
- Use a scatter plot of successive pairs to spot lattice structure.
-
71 3.4.1 Numerical Distributions 12 h
By the end you can
- Implement an unbiased random integer in a range without modulo bias.
- Explain how the alias method samples a discrete distribution in constant time.
- Use inversion to turn uniform deviates into exponential deviates.
-
72 3.4.2 Random Sampling and Shuffling 11 h
By the end you can
- Implement the standard shuffle and confirm every ordering is equally likely.
- Use selection sampling to choose n records from a known N.
- Use reservoir sampling when the number of records is unknown.
- Knuth3.4.2 Random Sampling and Shuffling
- NeetCode#143 Detect Squares#144 Single Number
- PlayOpus Magnum Solve the first 12 puzzles
-
73 3.5 and 3.6 11 h
By the end you can
- Explain what k-distributed and infinitely distributed sequences mean.
- Recognize why each weaker definition of randomness falls short.
- Use Knuth's summary advice to judge your language's default generator.
-
74 4.1 Positional Number Systems 8 h
By the end you can
- Compute representations of integers in base −2 and balanced ternary.
- Explain why negative bases and balanced ternary need no sign.
- Use mixed-radix notation to convert seconds into hours, minutes and seconds.
-
75 4.2.1 Single-Precision Calculations 11 h
By the end you can
- Explain how a floating number is stored as sign, exponent and fraction.
- Trace floating addition through alignment, normalization and rounding.
- Compare Knuth's floating format with the IEEE 754 layout.
- Knuth4.2.1 Single-Precision Calculations
- NeetCode#149 Sum of Two Integers#150 Reverse Integer
- CheckpointNeetCode mock at 150 problems 2 problems in 45 minutes, picked from the categories you have covered.
-
76 4.2.2 Accuracy of Floating Point Arithmetic 8 h
By the end you can
- Explain which algebraic laws floating addition keeps and which it breaks.
- Recognize catastrophic cancellation when nearly equal values are subtracted.
- Use tolerances scaled to magnitude instead of == to compare floats.
-
77 4.2.3 and 4.2.4 8 h
By the end you can
- Explain how a double-precision value splits into high and low parts.
- Compute leading-digit probabilities with the law log10(1 + 1/d).
- Recognize why scale invariance leads to the logarithmic law.
-
78 4.3.1 The Classical Algorithms 10 h
By the end you can
- Implement multiple-precision addition, subtraction and multiplication on digit arrays.
- Explain why normalizing the divisor makes the quotient estimate nearly right.
- Trace long division with Algorithm D on a small example.
-
79 4.3.2 Modular Arithmetic 10 h
By the end you can
- Use residues modulo several coprime moduli to add and multiply big numbers.
- Compute a number from its residues with the Chinese remainder theorem.
- Compute modular inverses with the extended Euclidean algorithm.
- Knuth4.3.2 Modular Arithmetic
- PlayFactorio Start a default freeplay game and automate red science
-
80 4.3.3 How Fast Can We Multiply? 9 h
By the end you can
- Explain how splitting in halves trades a multiplication for extra additions.
- Implement the half-splitting multiply with a schoolbook cutoff for small sizes.
- Recognize multiplication as a convolution that a Fourier transform speeds up.
-
81 4.4 Radix Conversion 6 h
By the end you can
- Use repeated division to convert an integer to another base.
- Use repeated multiplication to convert a fraction to another base.
- Explain why some short decimal fractions have infinite binary expansions.
- Knuth4.4 Radix Conversion
-
82 4.5.1 and 4.5.2 10 h
By the end you can
- Use gcds of partial terms to add and multiply fractions without overflow.
- Implement Euclid's, binary and extended gcd algorithms.
- Compute modular inverses from extended Euclid's coefficients.
-
83 4.5.3 Analysis of Euclid's Algorithm 8 h
By the end you can
- Prove that consecutive Fibonacci numbers make Euclid's algorithm slowest.
- Compute Euclid's partial quotients and read them as a continued fraction.
- Explain why Euclid's step count grows with the number of digits.
-
84 4.5.4 Factoring into Primes 10 h
By the end you can
- Implement trial division, Pollard's rho and a Miller-Rabin test.
- Trace Fermat's method on a number with two close factors.
- Explain why a probabilistic primality test can only say probably prime.
-
85 4.6.1 Division of Polynomials 7 h
By the end you can
- Implement polynomial division with remainder over integers modulo a prime.
- Use polynomial division over GF(2) to compute a small CRC.
- Explain why fraction-free polynomial gcds must control coefficient growth.
-
86 4.6.2 Factorization of Polynomials 7 h
By the end you can
- Explain how Berlekamp's algorithm factors a squarefree polynomial modulo a prime.
- Recognize irreducible quadratics and cubics modulo 2 by checking for roots.
- Use gcd(u, u′) to detect repeated factors before factoring.
-
87 4.6.3 Evaluation of Powers 7 h
By the end you can
- Trace right-to-left and left-to-right binary exponentiation, counting multiplications.
- Compute short addition chains for small exponents by hand.
- Recognize exponents where the binary method is not optimal.
-
88 4.6.4 Evaluation of Polynomials 9 h
By the end you can
- Use Horner's rule to evaluate a polynomial with n multiplications.
- Explain how preprocessing coefficients saves multiplications for repeated evaluations.
- Recognize the discrete Fourier transform as evaluation at roots of unity.
-
89 4.7 and the Vol 2 review 10 h
By the end you can
- Implement multiplication and reciprocal of truncated power series.
- Use power series reversion to invert a series like z = t/(1 + t).
- Compare your Volume 2 code against Knuth's practical advice.
- Knuth4.7 Manipulation of Power Series
- KnuthVol 2 review
- CheckpointVol 2: Seminumerical Algorithms The core ideas of Vol 2, then 3 exercises from it, cold.
TAOCP Vol 3: Sorting and Searching
The most directly practical volume. Chapter 5 covers sorting: the combinatorics of permutations, every classic internal sort with exact analysis, lower bounds, sorting networks and external sorting. Chapter 6 covers searching: binary search, balanced trees, B-trees, tries, hashing and secondary keys. You will finish it able to read any database or standard library internals. Jonathan Blow put it this way in a clip that helped inspire this path: "If you actually go through [Volume 3] for real, you will know way more data structures than anyone with a CS degree." For real means the exercises too.
Play track: MOLEK-SYNTEZ (week 96), Satisfactory (week 108)
-
90 5.1.1 Inversions 7 h
By the end you can
- Compute the inversion table of a permutation and convert it back.
- Explain why the inversion table determines the permutation uniquely.
- Implement inversion counting in O(n log n) with a modified merge sort.
- Knuth5.1.1 Inversions
-
91 5.1.2 Permutations of a Multiset 7 h
By the end you can
- Compute the number of distinct permutations of a multiset.
- Use the intercalation product on small two-line examples.
- Recognize how a permutation factors into disjoint cycles.
-
92 5.1.3 Runs 10 h
By the end you can
- Compute the ascending runs of a permutation.
- Use the Eulerian number recurrence to count permutations by runs.
- Recognize the difference between ascending runs and alternating runs.
- Knuth5.1.3 Runs
- PlayFactorio Launch a rocket
-
93 5.1.4 Tableaux and Involutions 9 h
By the end you can
- Trace Robinson-Schensted insertion to build a tableau from a permutation.
- Use the hook length formula to count tableaux of a small shape.
- Explain why involutions correspond to single tableaux.
-
94 5.2.1 Sorting by Insertion 9 h
By the end you can
- Trace straight insertion and one Shellsort pass on a small array.
- Explain why binary insertion saves comparisons but not data movement.
- Compare Shellsort increment sequences by measured comparisons and moves.
-
95 5.2.2 Sorting by Exchanging 10 h
By the end you can
- Trace one bubble sort pass and one quicksort partition by hand.
- Implement quicksort with median-of-three and an insertion sort cutoff.
- Explain how radix exchange partitions keys on their bits.
-
96 5.2.3 Sorting by Selection 10 h
By the end you can
- Trace heap construction and the sift-down step of heapsort.
- Implement a priority queue with insert and delete-min on an array heap.
- Compare straight selection, tree selection and heapsort by comparisons used.
- Knuth5.2.3 Sorting by Selection
- PlayMOLEK-SYNTEZ Read the manual and solve the first 3 puzzles
-
97 5.2.4 Sorting by Merging 8 h
By the end you can
- Trace bottom-up straight two-way merging pass by pass.
- Implement list merge sort that relinks records without moving them.
- Explain how to keep merging stable when keys are equal.
-
98 5.2.5 Sorting by Distribution 6 h
By the end you can
- Trace a least-significant-digit radix sort pass on decimal keys.
- Implement LSD radix sort with counting sort on byte-sized digits.
- Explain when radix sorting beats comparison sorting.
-
99 5.3.1 Minimum-Comparison Sorting 8 h
By the end you can
- Explain the information-theoretic lower bound ⌈lg n!⌉ using decision trees.
- Trace merge insertion's pairing, recursion and insertion stages.
- Compare binary insertion's worst-case comparisons with the lower bound.
-
100 5.3.2 and 5.3.3 10 h
By the end you can
- Explain how an adversary argument proves a lower bound for merging.
- Use binary merging when one sorted list is much shorter.
- Compute the comparisons a tournament needs to find the second largest.
-
101 5.3.4 Networks for Sorting 9 h
By the end you can
- Trace values through a small comparator network.
- Use the zero-one principle to verify a network with 2^n tests.
- Explain how Batcher's networks merge with O(n (log n)²) comparators.
-
102 5.4.1 Multiway Merging and Replacement Selection 8 h
By the end you can
- Trace replacement selection with a tiny memory on a short input.
- Implement a k-way merge using a heap or a tree of losers.
- Explain the snowplow argument for runs about twice memory size.
-
103 5.4.2 and 5.4.3 8 h
By the end you can
- Trace a 3-tape polyphase merge from a Fibonacci run distribution.
- Explain why perfect polyphase distributions follow generalized Fibonacci numbers.
- Compare the cascade merge's merge orders with polyphase's.
-
104 5.4.4 and 5.4.5 6 h
By the end you can
- Explain why reading a tape backward reverses each run's order.
- Recognize how backward reading removes rewind time between phases.
- Explain how the oscillating sort interleaves run creation and merging.
-
105 5.4.6 Practical Considerations for Tape Merging 8 h
By the end you can
- Explain how double buffering overlaps input, output and computation.
- Use forecasting to decide which input buffer to refill next.
- Compare block sizes by their gap overhead and memory cost.
- Knuth5.4.6 Practical Considerations for Tape Merging
- PlayMOLEK-SYNTEZ Solve the first 8 puzzles
-
106 5.4.7 and 5.4.8 6 h
By the end you can
- Explain how external radix sorting distributes records into files by digit.
- Compare external radix sorting with the shuffle phase of MapReduce.
- Explain why sorting with only two tapes needs many extra passes.
-
107 5.4.9 and 5.5 10 h
By the end you can
- Explain how seek and latency costs shape merge patterns on disks.
- Use striping to keep several disks busy during an external merge.
- Compare sorting methods by speed, stability, memory and worst case.
-
108 6.1 Sequential Searching 10 h
By the end you can
- Implement sequential search with a sentinel and measure the saving.
- Compute expected search cost when keys have known access probabilities.
- Explain how self-organizing lists adapt to skewed access patterns.
- Knuth6.1 Sequential Searching
- PlaySatisfactory Finish the HUB upgrades and build the Space Elevator
-
109 6.2.1 Searching an Ordered Table 7 h
By the end you can
- Trace binary search and its probe sequence on a small sorted table.
- Explain when interpolation search beats binary search and when it fails.
- Implement binary search and test it exhaustively on small arrays.
-
110 6.2.2 Binary Tree Searching 8 h
By the end you can
- Implement BST insertion, search and deletion, including two-child deletion.
- Explain why inserting keys in sorted order makes a degenerate tree.
- Use dynamic programming to build an optimal BST from access frequencies.
-
111 6.2.3 Balanced Trees 9 h
By the end you can
- Trace AVL insertions that need single and double rotations.
- Explain why AVL height stays within about 1.44 lg N.
- Implement a checker that verifies AVL balance factors after each insert.
- Knuth6.2.3 Balanced Trees
-
112 6.2.4 Multiway Trees 8 h
By the end you can
- Trace a B-tree insertion that splits a full node.
- Explain why B-tree nodes are sized to match a disk page.
- Compare B-trees with the B*-tree and B+-tree variants.
- Knuth6.2.4 Multiway Trees
-
113 6.3 Digital Searching 8 h
By the end you can
- Implement a trie and compare its memory and speed with a hash set.
- Trace insertion into a digital search tree bit by bit.
- Explain how Patricia skips one-way branches using bit positions.
-
114 6.4 Hashing (part 1) 8 h
By the end you can
- Use division and multiplicative hashing and spot keys that defeat them.
- Trace insertions with linear probing and with double hashing.
- Explain how chaining, coalesced chaining and open addressing resolve collisions.
- Knuth6.4 Hashing (part 1)
-
115 6.4 Hashing (part 2) 9 h
By the end you can
- Explain why clearing a slot breaks later searches under open addressing.
- Compute expected probe counts for linear probing at several load factors.
- Compare chaining, linear probing and double hashing as the table fills.
- Knuth6.4 Hashing (part 2)
-
116 6.5 Retrieval on Secondary Keys 7 h
By the end you can
- Use inverted lists to answer AND queries on secondary keys.
- Explain how superimposed coding allows false drops but never false negatives.
- Compute a Bloom filter's best number of hash functions from bits per key.
-
117 Vol 3 review 10 h
By the end you can
- Compare Volume 3's sorts by speed, stability and worst case.
- Recognize which search structure fits a given access pattern.
- Use one benchmark harness to compare your sorting implementations.
- KnuthVol 3 review
- PlaySatisfactory Complete Space Elevator Phase 2: 1,000 Smart Plating, 1,000 Versatile Framework and 100 Automated Wiring
- CheckpointVol 3: Sorting and Searching The core ideas of Vol 3, then 3 exercises from it, cold.
TAOCP Vol 4A: Combinatorial Algorithms, Part 1
Volume 4A is Knuth at his most playful: puzzles, graphs, Boolean functions, bit tricks, binary decision diagrams, and efficient ways to generate every tuple, permutation, combination, partition and tree. It uses MMIX instead of MIX where it shows machine code, but most of it is plain algorithm steps.
Play track: Last Call BBS (week 122)
-
118 7 Combinatorial Searching intro (part 1) 7 h
By the end you can
- Use brute force to find Langford pairings for small n.
- Explain why a graph is bipartite exactly when it has no odd cycle.
- Recognize how splitting a search into phases shrinks the work.
-
119 7 Combinatorial Searching intro (part 2) 8 h
By the end you can
- Recognize tournaments, hypergraphs and the main graph products by definition.
- Use greedy reduction to test whether a degree sequence is graphical.
- Explain how the Stanford GraphBase stores vertices and arcs.
-
120 7.1.1 Boolean Basics (part 1) 7 h
By the end you can
- Recognize the sixteen binary Boolean operations and their truth tables.
- Use Horn clauses and unit propagation to decide satisfiability quickly.
- Implement 2SAT with an implication digraph and strong components.
-
121 7.1.1 Boolean Basics (part 2) 8 h
By the end you can
- Explain how the median operation yields monotone self-dual functions.
- Recognize threshold, symmetric and canalizing functions from their definitions.
- Compute a threshold function's value from its weights and threshold.
-
122 7.1.2 Boolean Evaluation 9 h
By the end you can
- Explain the cost and depth of a Boolean chain.
- Compute a small Boolean chain such as a full adder.
- Use don't-care inputs to find cheaper chains.
- Knuth7.1.2 Boolean Evaluation
- PlayLast Call BBS Download 20th Century Food Court and ChipWizard Professional and solve the first puzzle in each
-
123 7.1.3 Bitwise Tricks and Techniques (part 1) 8 h
By the end you can
- Use x & −x and related tricks to isolate and remove rightmost bits.
- Compute the ruler function, binary logarithm and sideways sum of a word.
- Implement the zero-byte test that checks eight bytes at once.
-
124 7.1.3 Bitwise Tricks and Techniques (part 2) 8 h
By the end you can
- Use bit vectors to compute reachability in a digraph.
- Implement branch-free minimum and maximum with masks.
- Explain how binary labels find nearest common ancestors in a tree.
-
125 7.1.4 Binary Decision Diagrams (part 1) 8 h
By the end you can
- Explain why a reduced ordered BDD is canonical for a fixed order.
- Compute a function's number of solutions from its BDD.
- Implement a BDD base with a unique table and memoized synthesis.
-
126 7.1.4 Binary Decision Diagrams (part 2) 8 h
By the end you can
- Compare BDD sizes for one function under two variable orders.
- Explain how sifting improves an order with adjacent variable swaps.
- Recognize when to use a ZDD instead of a BDD for families of sets.
-
127 7.2.1.1 Generating All n-Tuples 8 h
By the end you can
- Implement mixed-radix counting with Algorithm M.
- Compute binary reflected Gray codes and convert them back to binary.
- Recognize and build de Bruijn cycles that contain every n-tuple once.
-
128 7.2.1.2 Generating All Permutations 8 h
By the end you can
- Trace Algorithm L to find the next permutation in lexicographic order.
- Compare plain changes and Heap's method by swaps per step.
- Use early cutoffs to prune permutation searches like alphametics.
-
129 7.2.1.3 Generating All Combinations 7 h
By the end you can
- Trace lexicographic generation of t-combinations.
- Use a revolving-door order to update a running sum in constant time.
- Compute counts of combinations with repetition.
-
130 7.2.1.4 Generating All Partitions 7 h
By the end you can
- Trace Algorithm P's reverse lexicographic order of integer partitions.
- Compute the conjugate of a partition from its Ferrers diagram.
- Use Euler's pentagonal recurrence to compute partition numbers.
-
131 7.2.1.5 Generating All Set Partitions 8 h
By the end you can
- Use restricted growth strings to list the partitions of a set.
- Compute Bell numbers with Peirce's triangle.
- Compute Stirling numbers of the second kind for small cases.
- Knuth7.2.1.5 Generating All Set Partitions
- PlayLast Call BBS Solve the first 5 puzzles in 20th Century Food Court and the first 5 in ChipWizard Professional
-
132 7.2.1.6 Generating All Trees 8 h
By the end you can
- Trace Algorithm P to generate nested parentheses in lexicographic order.
- Explain the correspondence between nested parentheses, forests and binary trees.
- Compute spanning tree counts with the matrix tree theorem on small graphs.
-
133 7.2.1.7 and the Vol 4A review 9 h
By the end you can
- Recognize early combinatorial patterns like hexagrams and Genji-ko diagrams.
- Compare old lists of patterns with modern systematic generation orders.
- Use your Volume 4A generators to pick the right one for a task.
- Knuth7.2.1.7 History and Further References
- KnuthVol 4A review
- CheckpointVol 4A: Combinatorial Algorithms, Part 1 The core ideas of Vol 4A, then 3 exercises from it, cold.
TAOCP Vol 4B: Combinatorial Algorithms, Part 2
The final stretch: probability tools for analyzing search, backtracking, dancing links for exact cover problems (sudoku, polyominoes and much more), and a deep dive into SAT solving, the technology behind modern verification and constraint solving. You end the path implementing ideas that are still at the research frontier.
-
134 Mathematical Preliminaries Redux 8 h
By the end you can
- Use Markov's and Chebyshev's inequalities to bound tail probabilities.
- Explain why E(X|Y) is a random variable and E X = E(E(X|Y)).
- Recognize pairwise independence that is not full independence.
-
135 7.2.2 Backtrack Programming (part 1) 8 h
By the end you can
- Implement n queens with Algorithm B and with Walker's bitmasks.
- Use sequential lists with swap-to-delete for cheap undo.
- Explain why choosing the most constrained variable first shrinks the search.
-
136 7.2.2 Backtrack Programming (part 2) 8 h
By the end you can
- Compute Knuth's random-path estimate of a backtrack tree's size.
- Explain why the estimate is unbiased yet needs many probes.
- Use factoring to split a puzzle into independent subproblems.
-
137 7.2.2.1 Dancing Links (part 1) 9 h
By the end you can
- Trace Algorithm X's cover and uncover steps on a small exact cover problem.
- Implement dancing links with arrays, restoring links in reverse order.
- Use secondary items to model queen diagonals.
-
138 7.2.2.1 Dancing Links (part 2) 5 h
By the end you can
- Use a board shape and piece orientations to build exact cover options.
- Explain how restricting one piece's placements breaks symmetry.
- Explain how factoring can prove a packing impossible.
-
139 7.2.2.1 Dancing Links (part 3) 5 h
By the end you can
- Use color controls to let options share consistent secondary items.
- Explain how purifying differs from covering in Algorithm C.
- Recognize when multiplicities model items covered between u and v times.
-
140 7.2.2.1 Dancing Links (part 4) 9 h
By the end you can
- Use cost bounds to find minimum-cost exact covers.
- Explain how Algorithm Z builds a ZDD of all solutions.
- Recognize how preprocessing removes options that cannot appear in any solution.
-
141 7.2.2.2 Satisfiability (part 1) 9 h
By the end you can
- Use DIMACS clauses to encode small problems like waerden and coloring.
- Use Tseytin encoding to turn a circuit into clauses.
- Compare naive and Sinz-style encodings for at-most-one constraints.
-
142 7.2.2.2 Satisfiability (part 2) 9 h
By the end you can
- Implement a DPLL-style solver with watched literals.
- Explain the random 3SAT threshold near 4.27 clauses per variable.
- Use resolution to refute small formulas.
-
143 7.2.2.2 Satisfiability (part 3) 10 h
By the end you can
- Trace one conflict analysis that learns a clause and backjumps.
- Implement WalkSAT and compare it with a complete solver.
- Explain the reluctant doubling restart sequence and Moser-Tardos resampling.
-
144 7.2.2.2 Satisfiability (part 4) 8 h
By the end you can
- Use variable elimination and subsumption to shrink a clause set.
- Compare order, log and direct encodings of integer variables.
- Explain why erp rules are needed to rebuild eliminated variables.
-
145 Vol 4B review 5 h
By the end you can
- Compare backtracking, dancing links and SAT solving for a given problem.
- Recognize which Volume 4B methods can prove that no solution exists.
- Use Algorithm E to decide whether a search is worth running.
- KnuthVol 4B review
- CheckpointVol 4B: Combinatorial Algorithms, Part 2 The core ideas of Vol 4B, then 3 exercises from it, cold.
The Play track
Ten programming games run alongside the whole path, each with a start week and a checkpoint a couple of months later, one game at a time: TIS-100, Shenzhen I/O, EXAPUNKS, SpaceChem, Infinifactory, Opus Magnum, Factorio, MOLEK-SYNTEZ, Satisfactory and Last Call BBS. Each one starts in a lighter week of the reading.
The idea comes from a clip of Jonathan Blow, the programmer behind Braid and The Witness, answering how to get good at programming. Roughly: play the Zachtronics games (all of them except Eliza, the visual novel), then Factorio and Satisfactory, then read Knuth and actually do the exercises. This path is that advice with dates on it. It is our reading of his advice, not something he made or endorses.
Why games? The Zachtronics games hand you a made-up machine, a manual written like a real datasheet and a problem that does not fit: a handful of registers, almost no memory, several things running at once. That is the low-level thinking clox and Knuth's MIX ask for, and every solution is scored on cycles, size and cost against everyone else's, so there is always a better one to chase. Factorio and Satisfactory scale the same thinking up to whole systems: throughput, bottlenecks, pipelines and rebuilding something while it keeps running.
- Weeks 1–7TIS-100 Solve the first 15 puzzles
- Weeks 11–17Shenzhen I/O Solve the first 12 puzzles
- Weeks 19–27EXAPUNKS Solve the first 12 puzzles
- Weeks 31–38SpaceChem Solve the first 12 puzzles
- Weeks 46–52Infinifactory Solve the first 12 puzzles
- Weeks 64–72Opus Magnum Solve the first 12 puzzles
- Weeks 79–92Factorio Launch a rocket
- Weeks 96–105MOLEK-SYNTEZ Solve the first 8 puzzles
- Weeks 108–117Satisfactory Complete Space Elevator Phase 2: 1,000 Smart Plating, 1,000 Versatile Framework and 100 Automated Wiring
- Weeks 122–131Last Call BBS Solve the first 5 puzzles in 20th Century Food Court and the first 5 in ChipWizard Professional