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.

Start the pathStart with Week 0: setupSee it on one map

0Week 0: setupTools, the repo, the books and games, your calendar. Doesn't count toward the 145.

Sample dates for the next cohort, starting Jan 4, 2027. Pick your own start and they become yours.ReadingCodeNeetCodeCheckpointGame

1

Crafting Interpreters

Weeks 1 to 28 · 28 weeks · about 245 hours

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. 1 Chapters 1, 2 and 3 2 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.

    Open week 1

  2. 2 Ch 4: Scanning 2 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.

    Open week 2

  3. 3 Ch 5: Representing Code 2 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.

    Open week 3

  4. 4 Ch 6: Parsing Expressions 2 9 h

    By the end you can

    • Implement a recursive descent parser with one method per grammar rule.
    • Trace how precedence makes 1 + 2 * 3 multiply before adding.
    • Explain how panic-mode recovery reports an error and keeps parsing.

    Open week 4

  5. 5 Ch 7: Evaluating Expressions 2 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.

    Open week 5

  6. 6 Ch 8: Statements and State 2 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.

    Open week 6

  7. 7 Ch 9: Control Flow 2 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.

    Open week 7

  8. 8 Ch 10: Functions 2 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.

    Open week 8

  9. 9 Ch 11: Resolving and Binding 2 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.

    Open week 9

  10. 10 Ch 12: Classes 2 10 h

    By the end you can

    • Implement class declarations, instances, and property get and set.
    • Explain how methods bind this through an extra environment.
    • Use init() to set up a new instance's fields.

    Open week 10

  11. 11 Ch 13: Inheritance 2 10 h

    By the end you can

    • Implement superclass declarations and method lookup up the inheritance chain.
    • Explain how super is bound through an extra environment.
    • Recognize inheritance errors caught by the resolver or at runtime.

    Open week 11

  12. 12 Ch 14: Chunks of Bytecode 2 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.

    Open week 12

  13. 13 Ch 15: A Virtual Machine 2 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.

    Open week 13

  14. 14 Ch 16: Scanning on Demand 2 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.

    Open week 14

  15. 15 Ch 17: Compiling Expressions 2 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.

    Open week 15

  16. 16 Ch 18: Types of Values 2 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.

    Open week 16

  17. 17 Ch 19: Strings 2 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.

    Open week 17

  18. 18 Ch 20: Hash Tables 2 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.

    Open week 18

  19. 19 Ch 21: Global Variables 2 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.

    Open week 19

  20. 20 Ch 22: Local Variables 2 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.

    Open week 20

  21. 21 Ch 23: Jumping Back and Forth 2 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 and and or short-circuit using conditional jumps.

    Open week 21

  22. 22 Ch 24: Calls and Functions 2 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.

    Open week 22

  23. 23 Ch 25: Closures 2 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.

    Open week 23

  24. 24 Ch 26: Garbage Collection 2 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.

    Open week 24

  25. 25 Ch 27: Classes and Instances 2 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.

    Open week 25

  26. 26 Ch 28: Methods and Initializers 2 10 h

    By the end you can

    • Implement methods, bound methods and this stored 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.

    Open week 26

  27. 27 Ch 29: Superclasses 2 9 h

    By the end you can

    • Implement copy-down inheritance by copying superclass methods into the subclass.
    • Explain how super is captured from a hidden local in a synthetic scope.
    • Use OP_SUPER_INVOKE to make super calls faster.

    Open week 27

  28. 28 Ch 30: Optimization 2 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.

    Open week 28

2

TAOCP Vol 1: Fundamental Algorithms

Weeks 29 to 63 · 35 weeks · about 336 hours

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)

  1. 29 1.1 Algorithms 2 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.

    Open week 29

  2. 30 1.2.1 Mathematical Induction 2 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.

    Open week 30

  3. 31 1.2.2 Numbers, Powers, and Logarithms 2 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.

    Open week 31

  4. 32 1.2.3 Sums and Products 2 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.

    Open week 32

  5. 33 1.2.4 Integer Functions and Elementary Number Theory 2 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.

    Open week 33

  6. 34 1.2.5 Permutations and Factorials 2 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.

    Open week 34

  7. 35 1.2.6 Binomial Coefficients (part 1) 2 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.

    Open week 35

  8. 36 1.2.6 Binomial Coefficients (part 2) 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.

    Open week 36

  9. 37 1.2.7 Harmonic Numbers 2 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.

    Open week 37

  10. 38 1.2.8 Fibonacci Numbers 2 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.

    Open week 38

  11. 39 1.2.9 Generating Functions 2 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.

    Open week 39

  12. 40 1.2.10 Analysis of an Algorithm 2 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.

    Open week 40

  13. 41 1.2.11 Asymptotic Representations 2 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.

    Open week 41

  14. 42 1.3.1 Description of MIX 2 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.

    Open week 42

  15. 43 1.3.2 The MIX Assembly Language 2 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.

    Open week 43

  16. 44 1.3.3 Applications to Permutations 2 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.

    Open week 44

  17. 45 1.4.1 Subroutines 2 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.

    Open week 45

  18. 46 1.4.2 Coroutines 2 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.

    Open week 46

  19. 47 1.4.3 Interpretive Routines 2 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.

    Open week 47

  20. 48 1.4.4 and 1.4.5 2 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.

    Open week 48

  21. 49 2.1 and 2.2.1 2 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.

    Open week 49

  22. 50 2.2.2 Sequential Allocation 2 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.

    Open week 50

  23. 51 2.2.3 Linked Allocation 2 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.

    Open week 51

  24. 52 2.2.4 Circular Lists 2 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.

    Open week 52

  25. 53 2.2.5 Doubly Linked Lists 2 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.

    Open week 53

  26. 54 2.2.6 Arrays and Orthogonal Lists 2 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.

    Open week 54

  27. 55 2.3.1 Traversing Binary Trees 2 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.

    Open week 55

  28. 56 2.3.2 Binary Tree Representation of Trees 2 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.

    Open week 56

  29. 57 2.3.3 Other Representations of Trees 2 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.

    Open week 57

  30. 58 2.3.4 Basic Mathematical Properties of Trees (part 1) 2 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.

    Open week 58

  31. 59 2.3.4 Basic Mathematical Properties of Trees (part 2) 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.

    Open week 59

  32. 60 2.3.5 Lists and Garbage Collection 2 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.

    Open week 60

  33. 61 2.4 Multilinked Structures 2 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.

    Open week 61

  34. 62 2.5 Dynamic Storage Allocation 2 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.

    Open week 62

  35. 63 2.6 and the Vol 1 review 2 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.

    Open week 63

3

TAOCP Vol 2: Seminumerical Algorithms

Weeks 64 to 89 · 26 weeks · about 236 hours

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)

  1. 64 3.1 Introduction 2 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.

    Open week 64

  2. 65 3.2.1 The Linear Congruential Method 2 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.

    Open week 65

  3. 66 3.2.2 Other Methods 2 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.

    Open week 66

  4. 67 3.3.1 General Test Procedures 2 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.

    Open week 67

  5. 68 3.3.2 Empirical Tests 2 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.

    Open week 68

  6. 69 3.3.3 Theoretical Tests 2 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.

    Open week 69

  7. 70 3.3.4 The Spectral Test 2 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.

    Open week 70

  8. 71 3.4.1 Numerical Distributions 2 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.

    Open week 71

  9. 72 3.4.2 Random Sampling and Shuffling 2 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.

    Open week 72

  10. 73 3.5 and 3.6 2 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.

    Open week 73

  11. 74 4.1 Positional Number Systems 2 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.

    Open week 74

  12. 75 4.2.1 Single-Precision Calculations 2 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.

    Open week 75

  13. 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.

    Open week 76

  14. 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.

    Open week 77

  15. 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.

    Open week 78

  16. 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.

    Open week 79

  17. 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.

    Open week 80

  18. 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.

    Open week 81

  19. 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.

    Open week 82

  20. 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.

    Open week 83

  21. 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.

    Open week 84

  22. 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.

    Open week 85

  23. 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.

    Open week 86

  24. 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.

    Open week 87

  25. 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.

    Open week 88

  26. 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.

    Open week 89

4

TAOCP Vol 3: Sorting and Searching

Weeks 90 to 117 · 28 weeks · about 233 hours

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)

  1. 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.

    Open week 90

  2. 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.

    Open week 91

  3. 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.

    Open week 92

  4. 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.

    Open week 93

  5. 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.

    Open week 94

  6. 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.

    Open week 95

  7. 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.

    Open week 96

  8. 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.

    Open week 97

  9. 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.

    Open week 98

  10. 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.

    Open week 99

  11. 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.

    Open week 100

  12. 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.

    Open week 101

  13. 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.

    Open week 102

  14. 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.

    Open week 103

  15. 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.

    Open week 104

  16. 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.

    Open week 105

  17. 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.

    Open week 106

  18. 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.

    Open week 107

  19. 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.

    Open week 108

  20. 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.

    Open week 109

  21. 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.

    Open week 110

  22. 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.

    Open week 111

  23. 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.

    Open week 112

  24. 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.

    Open week 113

  25. 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.

    Open week 114

  26. 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.

    Open week 115

  27. 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.

    Open week 116

  28. 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.

    Open week 117

5

TAOCP Vol 4A: Combinatorial Algorithms, Part 1

Weeks 118 to 133 · 16 weeks · about 126 hours

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)

  1. 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.

    Open week 118

  2. 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.

    Open week 119

  3. 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.

    Open week 120

  4. 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.

    Open week 121

  5. 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.

    Open week 122

  6. 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.

    Open week 123

  7. 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.

    Open week 124

  8. 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.

    Open week 125

  9. 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.

    Open week 126

  10. 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.

    Open week 127

  11. 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.

    Open week 128

  12. 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.

    Open week 129

  13. 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.

    Open week 130

  14. 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.

    Open week 131

  15. 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.

    Open week 132

  16. 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.

    Open week 133

6

TAOCP Vol 4B: Combinatorial Algorithms, Part 2

Weeks 134 to 145 · 12 weeks · about 93 hours

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.

  1. 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.

    Open week 134

  2. 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.

    Open week 135

  3. 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.

    Open week 136

  4. 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.

    Open week 137

  5. 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.

    Open week 138

  6. 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.

    Open week 139

  7. 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.

    Open week 140

  8. 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.

    Open week 141

  9. 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.

    Open week 142

  10. 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.

    Open week 143

  11. 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.

    Open week 144

  12. 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.

    Open week 145

The Play track

Alongside every phase · 10 games, each with a start week and a checkpoint

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.

  1. Weeks 1–7TIS-100 Solve the first 15 puzzles
  2. Weeks 11–17Shenzhen I/O Solve the first 12 puzzles
  3. Weeks 19–27EXAPUNKS Solve the first 12 puzzles
  4. Weeks 31–38SpaceChem Solve the first 12 puzzles
  5. Weeks 46–52Infinifactory Solve the first 12 puzzles
  6. Weeks 64–72Opus Magnum Solve the first 12 puzzles
  7. Weeks 79–92Factorio Launch a rocket
  8. Weeks 96–105MOLEK-SYNTEZ Solve the first 8 puzzles
  9. Weeks 108–117Satisfactory Complete Space Elevator Phase 2: 1,000 Smart Plating, 1,000 Versatile Framework and 100 Automated Wiring
  10. Weeks 122–131Last Call BBS Solve the first 5 puzzles in 20th Century Food Court and the first 5 in ChipWizard Professional