#separator:tab
#html:true
#notetype:Basic
#tags column:3
#deck column:4
#columns:Front	Back	Tags	Deck
Crafting Interpreters: what is the phase about?	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.	cracked.guide cracked.guide::phase::interpreters cracked.guide::kind::about	cracked.guide::Crafting Interpreters::About this phase
Crafting Interpreters: what should you be able to do by the end?	<ul><li>Explain exactly what happens between typing code and it running: scanning, parsing, resolving, compiling, executing.</li><li>Write a recursive descent parser and a Pratt parser for any expression language.</li><li>Build a hash table, a bytecode VM, closures with upvalues and a mark-sweep garbage collector in C.</li><li>Debug memory bugs in C with sanitizers instead of guessing.</li></ul>	cracked.guide cracked.guide::phase::interpreters cracked.guide::kind::outcomes	cracked.guide::Crafting Interpreters::About this phase
Crafting Interpreters: what do you need before you start?	<ul><li>Comfort with one programming language, including classes and recursion.</li><li>Enough Java to read and write classes, interfaces and generics (see Week 0).</li><li>Enough C for pointers, structs and malloc/free before chapter 14, where clox starts (see Week 0).</li><li>A JDK, a C compiler, git and a public GitHub repo for verification.</li></ul>	cracked.guide cracked.guide::phase::interpreters cracked.guide::kind::need	cracked.guide::Crafting Interpreters::About this phase
Crafting Interpreters: how do you get the book?	Free. The whole book is online at craftinginterpreters.com, and the full source plus test suite is on GitHub. A print copy or eBook is nice to have and supports the author, but it is not needed.	cracked.guide cracked.guide::phase::interpreters cracked.guide::kind::book	cracked.guide::Crafting Interpreters::About this phase
Crafting Interpreters: tips for getting through it?	<ul><li>Type the code, do not paste it. The typing is where the learning happens.</li><li>Run the official test suite for each chapter; cracked.guide verifies your repo the same way.</li><li>Do challenges on a branch so semantic changes do not break the tests.</li><li>Compile clox with -Wall -Wextra -fsanitize=address,undefined from the first C chapter.</li></ul>	cracked.guide cracked.guide::phase::interpreters cracked.guide::kind::tips	cracked.guide::Crafting Interpreters::About this phase
Crafting Interpreters ch 1, Introduction: what does it cover?	Why build a language, who the book is for, and the plan: two interpreters for the same small language, Lox. Bob explains the book's style of showing every line of code.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::01 cracked.guide::kind::about	cracked.guide::Crafting Interpreters::Ch 01 Introduction
Crafting Interpreters ch 1, Introduction: why does it matter?	Sets expectations. You are about to write every line of two real interpreters yourself, which is the best way to stop seeing compilers as magic.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::01 cracked.guide::kind::why	cracked.guide::Crafting Interpreters::Ch 01 Introduction
Crafting Interpreters ch 1, Introduction: which part of the book is it in?	Welcome	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::01 cracked.guide::kind::part	cracked.guide::Crafting Interpreters::Ch 01 Introduction
Crafting Interpreters ch 1, a common trap: “Skipping the C linked-list challenge.” What's the catch?	It is a preview of exactly the pointer skills clox needs from chapter 14.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::01 cracked.guide::kind::trap	cracked.guide::Crafting Interpreters::Ch 01 Introduction
Crafting Interpreters ch 1, a common trap: “Overthinking editor and build setup.” What's the catch?	A Makefile or a single javac command is enough for jlox.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::01 cracked.guide::kind::trap	cracked.guide::Crafting Interpreters::Ch 01 Introduction
Crafting Interpreters ch 1: which end-of-chapter challenges are worth your time?	Challenge 1 is a reading exercise about little languages in the book's own build system; worth 10 minutes. Challenges 2 and 3 (hello world in Java, then a doubly linked list in C) are effectively your setup check. If the C linked list feels hard, spend extra time on pointers now; clox will demand it.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::01 cracked.guide::kind::challenges	cracked.guide::Crafting Interpreters::Ch 01 Introduction
Crafting Interpreters ch 1, Introduction: how should you work through it?	Read it in one sitting. Set up your environment now: a JDK, a C compiler, an editor and your lox repo. Do not skip the setup challenges; they are the real homework this week.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::01 cracked.guide::kind::approach	cracked.guide::Crafting Interpreters::Ch 01 Introduction
Crafting Interpreters ch 2, A Map of the Territory: what does it cover?	A tour of the parts of a language implementation: scanning, parsing, static analysis, intermediate representations, optimization, code generation, virtual machines and runtimes, plus the shortcuts and alternate routes like transpilers and JITs.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::02 cracked.guide::kind::about	cracked.guide::Crafting Interpreters::Ch 02 A Map of the Territory
Crafting Interpreters ch 2, A Map of the Territory: why does it matter?	This map tells you where every later chapter fits. It is also the vocabulary you need to read about any real compiler or VM.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::02 cracked.guide::kind::why	cracked.guide::Crafting Interpreters::Ch 02 A Map of the Territory
Crafting Interpreters ch 2, A Map of the Territory: which part of the book is it in?	Welcome	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::02 cracked.guide::kind::part	cracked.guide::Crafting Interpreters::Ch 02 A Map of the Territory
Crafting Interpreters ch 2, a common trap: “Trying to memorize every term.” What's the catch?	You will learn them by building them.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::02 cracked.guide::kind::trap	cracked.guide::Crafting Interpreters::Ch 02 A Map of the Territory
Crafting Interpreters ch 2: which end-of-chapter challenges are worth your time?	Challenge 1 (find the scanner and parser in a real open source implementation) is the most valuable; pick a language you use and actually open the source. The other two are think-about-it questions.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::02 cracked.guide::kind::challenges	cracked.guide::Crafting Interpreters::Ch 02 A Map of the Territory
Crafting Interpreters ch 2, A Map of the Territory: how should you work through it?	Read it once now, then come back to it when you start clox in chapter 14; it will make more sense the second time. Sketch the mountain diagram from memory afterward.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::02 cracked.guide::kind::approach	cracked.guide::Crafting Interpreters::Ch 02 A Map of the Territory
Crafting Interpreters ch 3, The Lox Language: what does it cover?	An informal tour of Lox: dynamic typing, automatic memory management, the data types, expressions, statements, variables, control flow, functions, closures, classes and inheritance.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::03 cracked.guide::kind::about	cracked.guide::Crafting Interpreters::Ch 03 The Lox Language
Crafting Interpreters ch 3, The Lox Language: why does it matter?	You need to know the target language before you implement it. Lox is small but has real closures and classes, so it exercises the hard parts.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::03 cracked.guide::kind::why	cracked.guide::Crafting Interpreters::Ch 03 The Lox Language
Crafting Interpreters ch 3, The Lox Language: which part of the book is it in?	Welcome	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::03 cracked.guide::kind::part	cracked.guide::Crafting Interpreters::Ch 03 The Lox Language
Lox: what is it?	Lox is a small, dynamically typed scripting language designed by Robert Nystrom for the book Crafting Interpreters, implemented twice in it: as jlox and as clox.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::03 cracked.guide::kind::definition	cracked.guide::Crafting Interpreters::Ch 03 The Lox Language
Lox: Is Lox used in production?	No. It is a teaching language. Its value is that you can understand and build every part of it.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::03 cracked.guide::kind::definition	cracked.guide::Crafting Interpreters::Ch 03 The Lox Language
Lox: Where is the Lox language described?	Chapter 3 of Crafting Interpreters, &quot;The Lox Language&quot;, free at craftinginterpreters.com.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::03 cracked.guide::kind::definition	cracked.guide::Crafting Interpreters::Ch 03 The Lox Language
Crafting Interpreters ch 3, a common trap: “Assuming Lox behaves like JavaScript or Python in edge cases.” What's the catch?	Check the chapter.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::03 cracked.guide::kind::trap	cracked.guide::Crafting Interpreters::Ch 03 The Lox Language
Crafting Interpreters ch 3: which end-of-chapter challenges are worth your time?	Challenge 1 (write and run sample programs) is good to do once you have an interpreter. Keep your answer to challenge 3 (features you would add) in a notes file: chapter 13 asks you to implement one of them.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::03 cracked.guide::kind::challenges	cracked.guide::Crafting Interpreters::Ch 03 The Lox Language
Crafting Interpreters ch 3, The Lox Language: how should you work through it?	Read it, then write a few Lox programs in a text file now (you can run them later with your own interpreter, or try the reference build from the repo). Keep a list of questions about the semantics; the book answers most of them later.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::03 cracked.guide::kind::approach	cracked.guide::Crafting Interpreters::Ch 03 The Lox Language
Crafting Interpreters ch 4, Scanning: what does it cover?	You build the scanner for jlox: turning source text into a list of tokens, handling lexemes, literals, keywords and identifiers, line numbers for errors, and the first bits of error reporting.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::04 cracked.guide::kind::about	cracked.guide::Crafting Interpreters::Ch 04 Scanning
Crafting Interpreters ch 4, Scanning: why does it matter?	Every tool that reads text (config parsers, linters, syntax highlighters) starts with a scanner. It is the cleanest first step into the codebase.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::04 cracked.guide::kind::why	cracked.guide::Crafting Interpreters::Ch 04 Scanning
Crafting Interpreters ch 4, Scanning: which part of the book is it in?	jlox (tree-walk interpreter, Java)	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::04 cracked.guide::kind::part	cracked.guide::Crafting Interpreters::Ch 04 Scanning
jlox: what is it?	jlox is the tree-walk interpreter for the Lox language, written in Java in chapters 4 to 13 of Crafting Interpreters.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::04 cracked.guide::kind::definition	cracked.guide::Crafting Interpreters::Ch 04 Scanning
jlox: Can I write jlox in another language?	Yes, many people do, but you have to translate the book's Java as you go. The test suite still works: point it at your executable.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::04 cracked.guide::kind::definition	cracked.guide::Crafting Interpreters::Ch 04 Scanning
jlox: Does jlox need a specific Java version?	No recent feature is required. Any current JDK works; the book's code is plain Java.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::04 cracked.guide::kind::definition	cracked.guide::Crafting Interpreters::Ch 04 Scanning
Crafting Interpreters ch 4, a common trap: “Writing jlox in a language other than Java: totally fine, but you translate every snippet yourself and the Visitor-heavy code in later chapters is more work in some languages.” What's the catch?	Check the wiki of other implementations for your language.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::04 cracked.guide::kind::trap	cracked.guide::Crafting Interpreters::Ch 04 Scanning
Crafting Interpreters ch 4, a common trap: “Using a Java version too old for the code.” What's the catch?	Any modern JDK (17 or 21) works.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::04 cracked.guide::kind::trap	cracked.guide::Crafting Interpreters::Ch 04 Scanning
Crafting Interpreters ch 4: what traps should you watch for?	<ul><li>Off-by-one errors in current/start indices when extracting lexemes.</li><li>Forgetting to increment the line counter inside multi-line strings.</li></ul>	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::04 cracked.guide::kind::traps	cracked.guide::Crafting Interpreters::Ch 04 Scanning
Crafting Interpreters ch 4: which end-of-chapter challenges are worth your time?	Challenge 4 (C-style block comments) is the one to actually implement; consider supporting nesting as the challenge suggests. Challenges 1 to 3 are discussion questions; think about them briefly. Do challenges that change Lox's behavior on a separate git branch. The cracked.guide check runs the official test suite for this chapter, and a challenge that changes semantics (new syntax, different errors) can make tests fail on main.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::04 cracked.guide::kind::challenges	cracked.guide::Crafting Interpreters::Ch 04 Scanning
Crafting Interpreters ch 4, Scanning: how should you work through it?	Type the code yourself instead of copying; that is the whole point of the book. Run it on small inputs after each step. Set up the official test runner this week so every later chapter is checked automatically.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::04 cracked.guide::kind::approach	cracked.guide::Crafting Interpreters::Ch 04 Scanning
Crafting Interpreters ch 5, Representing Code: what does it cover?	You design the syntax tree for expressions: context-free grammars, the expression grammar for Lox, a small Java program that generates the AST classes, and the Visitor pattern for operating on trees, ending with an AST pretty printer.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::05 cracked.guide::kind::about	cracked.guide::Crafting Interpreters::Ch 05 Representing Code
Crafting Interpreters ch 5, Representing Code: why does it matter?	ASTs are the central data structure of every compiler, linter and code formatter. The Visitor pattern explanation here is one of the clearest anywhere.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::05 cracked.guide::kind::why	cracked.guide::Crafting Interpreters::Ch 05 Representing Code
Crafting Interpreters ch 5, Representing Code: which part of the book is it in?	jlox (tree-walk interpreter, Java)	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::05 cracked.guide::kind::part	cracked.guide::Crafting Interpreters::Ch 05 Representing Code
Crafting Interpreters ch 5, a common trap: “In other languages, a sum type plus pattern matching (Rust enums, TypeScript unions) can replace the Visitor pattern.” What's the catch?	That is fine, but understand what the Visitor is doing first.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::05 cracked.guide::kind::trap	cracked.guide::Crafting Interpreters::Ch 05 Representing Code
Crafting Interpreters ch 5: what traps should you watch for?	<ul><li>Forgetting to rerun GenerateAst after changing the grammar, then wondering why classes are missing.</li></ul>	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::05 cracked.guide::kind::traps	cracked.guide::Crafting Interpreters::Ch 05 Representing Code
Crafting Interpreters ch 5: which end-of-chapter challenges are worth your time?	Challenge 3 (an RPN printer) is short and a nice check that you understand visitors. Challenges 1 and 2 are thought exercises about grammars and functional versus object-oriented style.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::05 cracked.guide::kind::challenges	cracked.guide::Crafting Interpreters::Ch 05 Representing Code
Crafting Interpreters ch 5, Representing Code: how should you work through it?	Write the GenerateAst tool exactly as shown; it saves a lot of typing later. Spend real time on the section about the expression problem and the Visitor pattern until you can explain why it exists.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::05 cracked.guide::kind::approach	cracked.guide::Crafting Interpreters::Ch 05 Representing Code
Crafting Interpreters ch 6, Parsing Expressions: what does it cover?	A recursive descent parser for Lox expressions, with precedence and associativity encoded in the grammar, plus syntax error reporting and panic-mode recovery by synchronizing at statement boundaries.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::06 cracked.guide::kind::about	cracked.guide::Crafting Interpreters::Ch 06 Parsing Expressions
Crafting Interpreters ch 6, Parsing Expressions: why does it matter?	Recursive descent is how most production compilers (GCC, Clang, V8, Roslyn) parse. Once you can write one, you can parse almost anything.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::06 cracked.guide::kind::why	cracked.guide::Crafting Interpreters::Ch 06 Parsing Expressions
Crafting Interpreters ch 6, Parsing Expressions: which part of the book is it in?	jlox (tree-walk interpreter, Java)	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::06 cracked.guide::kind::part	cracked.guide::Crafting Interpreters::Ch 06 Parsing Expressions
Recursive descent parser: what is it?	A recursive descent parser is a top-down parser in which each grammar rule becomes a function, and functions call each other to match nested structure.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::06 cracked.guide::kind::definition	cracked.guide::Crafting Interpreters::Ch 06 Parsing Expressions
Recursive descent parser: Why not use a parser generator?	You can, but a hand-written recursive descent parser is easy to read, gives better error messages and needs no extra tool. Many large compilers use one.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::06 cracked.guide::kind::definition	cracked.guide::Crafting Interpreters::Ch 06 Parsing Expressions
Recursive descent parser: Can recursive descent handle left recursion?	Not directly; a rule like expr -&gt; expr + term loops forever. You rewrite it as a loop, which is what the Lox grammar does.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::06 cracked.guide::kind::definition	cracked.guide::Crafting Interpreters::Ch 06 Parsing Expressions
Crafting Interpreters ch 6: what traps should you watch for?	<ul><li>Getting associativity wrong by using recursion where the book uses a loop.</li><li>Error recovery that never resynchronizes, causing a cascade of bogus errors.</li></ul>	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::06 cracked.guide::kind::traps	cracked.guide::Crafting Interpreters::Ch 06 Parsing Expressions
Crafting Interpreters ch 6: which end-of-chapter challenges are worth your time?	Challenges 1 (comma operator) and 2 (the ternary ?: operator) are great practice at adding grammar rules with the right precedence. Challenge 3 (error productions for binary operators missing a left operand) teaches good error messages. Do challenges that change Lox's behavior on a separate git branch. The cracked.guide check runs the official test suite for this chapter, and a challenge that changes semantics (new syntax, different errors) can make tests fail on main.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::06 cracked.guide::kind::challenges	cracked.guide::Crafting Interpreters::Ch 06 Parsing Expressions
Crafting Interpreters ch 6, Parsing Expressions: how should you work through it?	Map each grammar rule to its parsing method and check them side by side. Trace the parse of an expression like 1 - 2 * 3 == 4 on paper through the call stack.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::06 cracked.guide::kind::approach	cracked.guide::Crafting Interpreters::Ch 06 Parsing Expressions
Crafting Interpreters ch 7, Evaluating Expressions: what does it cover?	You make expressions run: a tree-walking evaluator over the AST, mapping Lox values to Java objects, truthiness, equality, runtime type checks and runtime error reporting.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::07 cracked.guide::kind::about	cracked.guide::Crafting Interpreters::Ch 07 Evaluating Expressions
Crafting Interpreters ch 7, Evaluating Expressions: why does it matter?	This is the moment your interpreter actually computes something. Mapping a dynamic language's values onto a host language is the core design decision of any interpreter.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::07 cracked.guide::kind::why	cracked.guide::Crafting Interpreters::Ch 07 Evaluating Expressions
Crafting Interpreters ch 7, Evaluating Expressions: which part of the book is it in?	jlox (tree-walk interpreter, Java)	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::07 cracked.guide::kind::part	cracked.guide::Crafting Interpreters::Ch 07 Evaluating Expressions
Tree-walk interpreter: what is it?	A tree-walk interpreter executes a program by recursively evaluating the nodes of its abstract syntax tree, with no compilation to another form.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::07 cracked.guide::kind::definition	cracked.guide::Crafting Interpreters::Ch 07 Evaluating Expressions
Tree-walk interpreter: Are tree-walk interpreters used in real languages?	Yes, mostly early in a language's life or where simplicity matters more than speed. Many mature languages moved to bytecode VMs or JIT compilers later.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::07 cracked.guide::kind::definition	cracked.guide::Crafting Interpreters::Ch 07 Evaluating Expressions
Crafting Interpreters ch 7, a common trap: “Printing doubles: whole numbers should print without a trailing .0, as the book shows.” What's the catch?	The test suite checks exact output.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::07 cracked.guide::kind::trap	cracked.guide::Crafting Interpreters::Ch 07 Evaluating Expressions
Crafting Interpreters ch 7: what traps should you watch for?	<ul><li>Comparing Java Doubles with == instead of equals, or mishandling nil equality.</li></ul>	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::07 cracked.guide::kind::traps	cracked.guide::Crafting Interpreters::Ch 07 Evaluating Expressions
Crafting Interpreters ch 7: which end-of-chapter challenges are worth your time?	Challenge 2 (string concatenation with a non-string operand) and challenge 3 (division by zero) make you decide semantics and implement them. Do challenges that change Lox's behavior on a separate git branch. The cracked.guide check runs the official test suite for this chapter, and a challenge that changes semantics (new syntax, different errors) can make tests fail on main.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::07 cracked.guide::kind::challenges	cracked.guide::Crafting Interpreters::Ch 07 Evaluating Expressions
Crafting Interpreters ch 7, Evaluating Expressions: how should you work through it?	Write the evaluator, then try every operator with wrong types to see your runtime errors. Compare how Lox equality and truthiness work with your favorite language.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::07 cracked.guide::kind::approach	cracked.guide::Crafting Interpreters::Ch 07 Evaluating Expressions
Crafting Interpreters ch 8, Statements and State: what does it cover?	Statements and state: expression and print statements, global variable declarations, the environment that maps names to values, assignment, and block scope with nested environments.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::08 cracked.guide::kind::about	cracked.guide::Crafting Interpreters::Ch 08 Statements and State
Crafting Interpreters ch 8, Statements and State: why does it matter?	Scopes and environments are where interpreters get interesting, and every closure bug later traces back to understanding this chapter.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::08 cracked.guide::kind::why	cracked.guide::Crafting Interpreters::Ch 08 Statements and State
Crafting Interpreters ch 8, Statements and State: which part of the book is it in?	jlox (tree-walk interpreter, Java)	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::08 cracked.guide::kind::part	cracked.guide::Crafting Interpreters::Ch 08 Statements and State
Crafting Interpreters ch 8, a common trap: “Not restoring the previous environment when a block throws.” What's the catch?	Use try/finally as the book does.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::08 cracked.guide::kind::trap	cracked.guide::Crafting Interpreters::Ch 08 Statements and State
Crafting Interpreters ch 8: what traps should you watch for?	<ul><li>Treating assignment to an undefined variable as an implicit declaration.</li></ul>	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::08 cracked.guide::kind::traps	cracked.guide::Crafting Interpreters::Ch 08 Statements and State
Crafting Interpreters ch 8: which end-of-chapter challenges are worth your time?	Challenge 1 (make the REPL print bare expressions) is a nice usability win. Challenge 2 (runtime error for uninitialized variables) changes semantics, so keep it on a branch. Challenge 3 is a scoping puzzle; answer it before running.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::08 cracked.guide::kind::challenges	cracked.guide::Crafting Interpreters::Ch 08 Statements and State
Crafting Interpreters ch 8, Statements and State: how should you work through it?	Draw the environment chain for a few nested blocks. Run the shadowing examples in the chapter and predict the output before running.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::08 cracked.guide::kind::approach	cracked.guide::Crafting Interpreters::Ch 08 Statements and State
Crafting Interpreters ch 9, Control Flow: what does it cover?	Control flow: if/else, logical operators with short-circuiting, while loops, and for loops implemented by desugaring into while. Lox becomes Turing-complete.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::09 cracked.guide::kind::about	cracked.guide::Crafting Interpreters::Ch 09 Control Flow
Crafting Interpreters ch 9, Control Flow: why does it matter?	Desugaring (implementing a feature by rewriting it into simpler features) is a key compiler technique. Short-circuit evaluation shows up in every language.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::09 cracked.guide::kind::why	cracked.guide::Crafting Interpreters::Ch 09 Control Flow
Crafting Interpreters ch 9, Control Flow: which part of the book is it in?	jlox (tree-walk interpreter, Java)	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::09 cracked.guide::kind::part	cracked.guide::Crafting Interpreters::Ch 09 Control Flow
Crafting Interpreters ch 9: what traps should you watch for?	<ul><li>The dangling else: make sure else binds to the nearest if.</li><li>Logical operators must return the operand value, not a converted boolean.</li></ul>	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::09 cracked.guide::kind::traps	cracked.guide::Crafting Interpreters::Ch 09 Control Flow
Crafting Interpreters ch 9: which end-of-chapter challenges are worth your time?	Challenge 3 (add break) is the one to implement; it is a good exercise in parser state and in using an exception or flag to unwind. Challenges 1 and 2 are thought exercises. Do challenges that change Lox's behavior on a separate git branch. The cracked.guide check runs the official test suite for this chapter, and a challenge that changes semantics (new syntax, different errors) can make tests fail on main.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::09 cracked.guide::kind::challenges	cracked.guide::Crafting Interpreters::Ch 09 Control Flow
Crafting Interpreters ch 9, Control Flow: how should you work through it?	After implementing for-loop desugaring, print the AST of a for loop to see the rewritten while loop.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::09 cracked.guide::kind::approach	cracked.guide::Crafting Interpreters::Ch 09 Control Flow
Crafting Interpreters ch 10, Functions: what does it cover?	Functions: call expressions, arity checks, native functions like clock(), function declarations, return statements (implemented with an exception), and closures that capture their defining environment.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::10 cracked.guide::kind::about	cracked.guide::Crafting Interpreters::Ch 10 Functions
Crafting Interpreters ch 10, Functions: why does it matter?	Functions and closures are the heart of most modern languages. Implementing them makes callbacks, higher-order functions and closures in JavaScript or Python fully transparent.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::10 cracked.guide::kind::why	cracked.guide::Crafting Interpreters::Ch 10 Functions
Crafting Interpreters ch 10, Functions: which part of the book is it in?	jlox (tree-walk interpreter, Java)	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::10 cracked.guide::kind::part	cracked.guide::Crafting Interpreters::Ch 10 Functions
Crafting Interpreters ch 10: what traps should you watch for?	<ul><li>Using an exception for return is correct here; do not try to &quot;fix&quot; it with flags unless you understand the trade-off.</li><li>Binding the closure to the global environment instead of the current one breaks closures.</li></ul>	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::10 cracked.guide::kind::traps	cracked.guide::Crafting Interpreters::Ch 10 Functions
Crafting Interpreters ch 10: which end-of-chapter challenges are worth your time?	Challenge 2 (anonymous functions) is the best one to implement. Challenge 3 is a short validity puzzle about parameters and locals. Do challenges that change Lox's behavior on a separate git branch. The cracked.guide check runs the official test suite for this chapter, and a challenge that changes semantics (new syntax, different errors) can make tests fail on main.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::10 cracked.guide::kind::challenges	cracked.guide::Crafting Interpreters::Ch 10 Functions
Crafting Interpreters ch 10, Functions: how should you work through it?	Implement, then write a counter-making function to test closures. Write a recursive Fibonacci and time it with clock() so you have a baseline to compare against clox later.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::10 cracked.guide::kind::approach	cracked.guide::Crafting Interpreters::Ch 10 Functions
Crafting Interpreters ch 11, Resolving and Binding: what does it cover?	A static resolver pass that walks the AST before execution and records, for each variable use, how many scopes up its definition is. This fixes a closure bug caused by mutable environments and adds compile-time errors like reading a local in its own initializer.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::11 cracked.guide::kind::about	cracked.guide::Crafting Interpreters::Ch 11 Resolving and Binding
Crafting Interpreters ch 11, Resolving and Binding: why does it matter?	This is your first semantic analysis pass. Linters, type checkers and compilers all work this way: a separate walk over the tree that computes facts about it.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::11 cracked.guide::kind::why	cracked.guide::Crafting Interpreters::Ch 11 Resolving and Binding
Crafting Interpreters ch 11, Resolving and Binding: which part of the book is it in?	jlox (tree-walk interpreter, Java)	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::11 cracked.guide::kind::part	cracked.guide::Crafting Interpreters::Ch 11 Resolving and Binding
Crafting Interpreters ch 11: what traps should you watch for?	<ul><li>Forgetting to resolve some node type, which leaves variables silently treated as globals.</li><li>Mismatched beginScope/endScope calls.</li><li>Resolving a function body in the wrong function type context, which breaks later return checks.</li></ul>	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::11 cracked.guide::kind::traps	cracked.guide::Crafting Interpreters::Ch 11 Resolving and Binding
Crafting Interpreters ch 11: which end-of-chapter challenges are worth your time?	Challenge 3 (error on unused locals) is a nice small analysis to add. Challenge 4 (store locals in arrays indexed by slot instead of maps) is a real performance improvement and previews clox. Do challenges that change Lox's behavior on a separate git branch. The cracked.guide check runs the official test suite for this chapter, and a challenge that changes semantics (new syntax, different errors) can make tests fail on main.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::11 cracked.guide::kind::challenges	cracked.guide::Crafting Interpreters::Ch 11 Resolving and Binding
Crafting Interpreters ch 11, Resolving and Binding: how should you work through it?	Before reading the fix, run the example that shows the bug and make sure you understand why it misbehaves. Then implement the resolver. This chapter is subtle; plan for extra time.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::11 cracked.guide::kind::approach	cracked.guide::Crafting Interpreters::Ch 11 Resolving and Binding
Crafting Interpreters ch 12, Classes: what does it cover?	Classes: class declarations, instances with fields, property get and set, methods, this bound via a small closure, and initializers with init().	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::12 cracked.guide::kind::about	cracked.guide::Crafting Interpreters::Ch 12 Classes
Crafting Interpreters ch 12, Classes: why does it matter?	Seeing how objects, methods and this are built from closures and maps explains a lot about JavaScript and Python object models.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::12 cracked.guide::kind::why	cracked.guide::Crafting Interpreters::Ch 12 Classes
Crafting Interpreters ch 12, Classes: which part of the book is it in?	jlox (tree-walk interpreter, Java)	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::12 cracked.guide::kind::part	cracked.guide::Crafting Interpreters::Ch 12 Classes
Crafting Interpreters ch 12: what traps should you watch for?	<ul><li>Returning the wrong value from init() when called directly.</li><li>Forgetting to bind this when a method is accessed but not immediately called.</li></ul>	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::12 cracked.guide::kind::traps	cracked.guide::Crafting Interpreters::Ch 12 Classes
Crafting Interpreters ch 12: which end-of-chapter challenges are worth your time?	Challenges 1 (static methods) and 2 (getter methods) are both good. Challenge 3 is a design discussion about encapsulation. Do challenges that change Lox's behavior on a separate git branch. The cracked.guide check runs the official test suite for this chapter, and a challenge that changes semantics (new syntax, different errors) can make tests fail on main.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::12 cracked.guide::kind::challenges	cracked.guide::Crafting Interpreters::Ch 12 Classes
Crafting Interpreters ch 12, Classes: how should you work through it?	Implement in order and test after each step. Work through the explanation of how this is bound by an extra environment; draw it.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::12 cracked.guide::kind::approach	cracked.guide::Crafting Interpreters::Ch 12 Classes
Crafting Interpreters ch 13, Inheritance: what does it cover?	Single inheritance: superclass declarations, method lookup through the chain, and super calls, finishing jlox.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::13 cracked.guide::kind::about	cracked.guide::Crafting Interpreters::Ch 13 Inheritance
Crafting Interpreters ch 13, Inheritance: why does it matter?	Method resolution order and super are how every OO language reuses code. Finishing jlox is a real milestone.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::13 cracked.guide::kind::why	cracked.guide::Crafting Interpreters::Ch 13 Inheritance
Crafting Interpreters ch 13, Inheritance: which part of the book is it in?	jlox (tree-walk interpreter, Java)	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::13 cracked.guide::kind::part	cracked.guide::Crafting Interpreters::Ch 13 Inheritance
Crafting Interpreters ch 13: what traps should you watch for?	<ul><li>A class inheriting from itself: make sure it is an error.</li><li>super lookups must use the superclass of the class where the method was defined, not of the instance.</li></ul>	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::13 cracked.guide::kind::traps	cracked.guide::Crafting Interpreters::Ch 13 Inheritance
Crafting Interpreters ch 13: which end-of-chapter challenges are worth your time?	Challenge 3 (implement a feature you listed back in chapter 3) is the most rewarding. Challenge 2 (BETA-style inner) comes back in chapter 29, so if you skip it now, expect to meet it again. Do challenges that change Lox's behavior on a separate git branch. The cracked.guide check runs the official test suite for this chapter, and a challenge that changes semantics (new syntax, different errors) can make tests fail on main.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::13 cracked.guide::kind::challenges	cracked.guide::Crafting Interpreters::Ch 13 Inheritance
Crafting Interpreters ch 13, Inheritance: how should you work through it?	Implement, then run the full jlox test suite. Celebrate, then take a day before starting C.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::13 cracked.guide::kind::approach	cracked.guide::Crafting Interpreters::Ch 13 Inheritance
Crafting Interpreters ch 14, Chunks of Bytecode: what does it cover?	Start of clox: a C project with a dynamic array of bytecode (a chunk), a constant pool, line information, a disassembler and a memory reallocation function used for all allocation.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::14 cracked.guide::kind::about	cracked.guide::Crafting Interpreters::Ch 14 Chunks of Bytecode
Crafting Interpreters ch 14, Chunks of Bytecode: why does it matter?	Bytecode is how CPython, Lua, the JVM and many other runtimes execute code. This chapter is also a crash course in writing careful C.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::14 cracked.guide::kind::why	cracked.guide::Crafting Interpreters::Ch 14 Chunks of Bytecode
Crafting Interpreters ch 14, Chunks of Bytecode: which part of the book is it in?	clox (bytecode VM, C)	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::14 cracked.guide::kind::part	cracked.guide::Crafting Interpreters::Ch 14 Chunks of Bytecode
clox: what is it?	clox is the bytecode virtual machine for the Lox language, written in C in chapters 14 to 30 of Crafting Interpreters.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::14 cracked.guide::kind::definition	cracked.guide::Crafting Interpreters::Ch 14 Chunks of Bytecode
clox: Do I need to finish jlox before clox?	The book assumes it, because clox explains its design by contrast with jlox. You could start at chapter 14, but you would miss the reasons.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::14 cracked.guide::kind::definition	cracked.guide::Crafting Interpreters::Ch 14 Chunks of Bytecode
clox: How fast is clox compared with jlox?	Much faster on the book's benchmarks, because it runs compact bytecode in a tight loop instead of walking Java objects. The exact factor depends on the program.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::14 cracked.guide::kind::definition	cracked.guide::Crafting Interpreters::Ch 14 Chunks of Bytecode
Bytecode virtual machine: what is it?	A bytecode virtual machine runs a program that has been compiled into a compact sequence of simple instructions (bytecode), decoding and executing one instruction at a time in a loop.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::14 cracked.guide::kind::definition	cracked.guide::Crafting Interpreters::Ch 14 Chunks of Bytecode
Bytecode virtual machine: Is bytecode the same as machine code?	No. Machine code runs on real hardware. Bytecode runs on a virtual machine, which is itself a program.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::14 cracked.guide::kind::definition	cracked.guide::Crafting Interpreters::Ch 14 Chunks of Bytecode
Bytecode virtual machine: Is a bytecode VM a compiler?	It usually comes with one: a compiler turns source into bytecode, then the VM runs it. clox does both in one pass.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::14 cracked.guide::kind::definition	cracked.guide::Crafting Interpreters::Ch 14 Chunks of Bytecode
Crafting Interpreters ch 14, a common trap: “Reading freed memory after a reallocation moves the array.” What's the catch?	AddressSanitizer catches this.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::14 cracked.guide::kind::trap	cracked.guide::Crafting Interpreters::Ch 14 Chunks of Bytecode
Crafting Interpreters ch 14: what traps should you watch for?	<ul><li>Forgetting to update capacity or count when growing an array.</li><li>Missing include guards or mixing up .h and .c responsibilities.</li></ul>	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::14 cracked.guide::kind::traps	cracked.guide::Crafting Interpreters::Ch 14 Chunks of Bytecode
Crafting Interpreters ch 14: which end-of-chapter challenges are worth your time?	Challenge 1 (compress line info, for example with run-length encoding) and challenge 2 (add a long constant instruction for more than 256 constants) are both worth doing. Challenge 3 (write your own allocator) is a big stretch; save it for later or connect it to Knuth 2.5.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::14 cracked.guide::kind::challenges	cracked.guide::Crafting Interpreters::Ch 14 Chunks of Bytecode
Crafting Interpreters ch 14, Chunks of Bytecode: how should you work through it?	Compile with warnings on (-Wall -Wextra) and use AddressSanitizer (-fsanitize=address) from day one. Build the disassembler and use it constantly.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::14 cracked.guide::kind::approach	cracked.guide::Crafting Interpreters::Ch 14 Chunks of Bytecode
Crafting Interpreters ch 15, A Virtual Machine: what does it cover?	The virtual machine: the instruction pointer, the main dispatch loop, a value stack, and arithmetic instructions, with tracing of the stack as it runs.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::15 cracked.guide::kind::about	cracked.guide::Crafting Interpreters::Ch 15 A Virtual Machine
Crafting Interpreters ch 15, A Virtual Machine: why does it matter?	This loop is the beating heart of every bytecode interpreter. Understanding stack machines also helps you read JVM or WebAssembly bytecode.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::15 cracked.guide::kind::why	cracked.guide::Crafting Interpreters::Ch 15 A Virtual Machine
Crafting Interpreters ch 15, A Virtual Machine: which part of the book is it in?	clox (bytecode VM, C)	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::15 cracked.guide::kind::part	cracked.guide::Crafting Interpreters::Ch 15 A Virtual Machine
Crafting Interpreters ch 15: what traps should you watch for?	<ul><li>Stack overflow with the fixed-size stack, since pushes are unchecked.</li><li>Pop order for binary operators: the right operand is on top.</li></ul>	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::15 cracked.guide::kind::traps	cracked.guide::Crafting Interpreters::Ch 15 A Virtual Machine
Crafting Interpreters ch 15: which end-of-chapter challenges are worth your time?	Challenge 1 (write out bytecode for several expressions) is a quick and useful exercise. Challenge 3 (grow the stack dynamically) and challenge 4 (negate in place) are short C exercises worth doing.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::15 cracked.guide::kind::challenges	cracked.guide::Crafting Interpreters::Ch 15 A Virtual Machine
Crafting Interpreters ch 15, A Virtual Machine: how should you work through it?	Enable the execution trace and step through a few hand-built chunks. Notice how each instruction pushes and pops.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::15 cracked.guide::kind::approach	cracked.guide::Crafting Interpreters::Ch 15 A Virtual Machine
Crafting Interpreters ch 16, Scanning on Demand: what does it cover?	A new scanner for clox that produces tokens on demand instead of all at once, pointing into the source string rather than copying lexemes, with a hand-written trie-like switch for keywords.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::16 cracked.guide::kind::about	cracked.guide::Crafting Interpreters::Ch 16 Scanning on Demand
Crafting Interpreters ch 16, Scanning on Demand: why does it matter?	Zero-copy scanning is how fast real-world parsers work. The keyword switch is a neat trick worth stealing.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::16 cracked.guide::kind::why	cracked.guide::Crafting Interpreters::Ch 16 Scanning on Demand
Crafting Interpreters ch 16, Scanning on Demand: which part of the book is it in?	clox (bytecode VM, C)	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::16 cracked.guide::kind::part	cracked.guide::Crafting Interpreters::Ch 16 Scanning on Demand
Crafting Interpreters ch 16, a common trap: “Token lexemes are not null-terminated.” What's the catch?	Never pass them to printf with %s; use %.*s.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::16 cracked.guide::kind::trap	cracked.guide::Crafting Interpreters::Ch 16 Scanning on Demand
Crafting Interpreters ch 16: what traps should you watch for?	<ul><li>The source buffer must outlive all tokens.</li></ul>	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::16 cracked.guide::kind::traps	cracked.guide::Crafting Interpreters::Ch 16 Scanning on Demand
Crafting Interpreters ch 16: which end-of-chapter challenges are worth your time?	Challenge 1 (string interpolation) is a great design problem; think through how the scanner would need to cooperate with the parser. Challenges 2 and 3 are design discussions.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::16 cracked.guide::kind::challenges	cracked.guide::Crafting Interpreters::Ch 16 Scanning on Demand
Crafting Interpreters ch 16, Scanning on Demand: how should you work through it?	Compare each function with your jlox scanner. Note how lexemes are pointers plus lengths, not strings.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::16 cracked.guide::kind::approach	cracked.guide::Crafting Interpreters::Ch 16 Scanning on Demand
Crafting Interpreters ch 17, Compiling Expressions: what does it cover?	A single-pass compiler that parses expressions with a Pratt parser (a table of prefix and infix parse functions with precedence) and emits bytecode directly, with no AST.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::17 cracked.guide::kind::about	cracked.guide::Crafting Interpreters::Ch 17 Compiling Expressions
Crafting Interpreters ch 17, Compiling Expressions: why does it matter?	Pratt parsing is an elegant, compact way to handle operator precedence and is used in many real compilers and tools.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::17 cracked.guide::kind::why	cracked.guide::Crafting Interpreters::Ch 17 Compiling Expressions
Crafting Interpreters ch 17, Compiling Expressions: which part of the book is it in?	clox (bytecode VM, C)	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::17 cracked.guide::kind::part	cracked.guide::Crafting Interpreters::Ch 17 Compiling Expressions
Pratt parser: what is it?	A Pratt parser, or top-down operator precedence parser, parses expressions using a table that gives each token a prefix function, an infix function and a precedence.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::17 cracked.guide::kind::definition	cracked.guide::Crafting Interpreters::Ch 17 Compiling Expressions
Pratt parser: Is a Pratt parser recursive descent?	It is a top-down recursive parser too, but it drives precedence from a table instead of from a chain of grammar rules.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::17 cracked.guide::kind::definition	cracked.guide::Crafting Interpreters::Ch 17 Compiling Expressions
Pratt parser: What is binding power?	Another name for precedence in Pratt parsing: how strongly an operator holds on to the operands around it.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::17 cracked.guide::kind::definition	cracked.guide::Crafting Interpreters::Ch 17 Compiling Expressions
Crafting Interpreters ch 17: what traps should you watch for?	<ul><li>Getting precedence levels off by one in the rule table.</li><li>Forgetting that the compiler emits code as it parses, so order matters.</li></ul>	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::17 cracked.guide::kind::traps	cracked.guide::Crafting Interpreters::Ch 17 Compiling Expressions
Crafting Interpreters ch 17: which end-of-chapter challenges are worth your time?	Challenge 1 (trace a tricky expression through the parse functions) is the most important; do it on paper. Challenge 3 (add the ternary operator) is a good stretch. Do challenges that change Lox's behavior on a separate git branch. The cracked.guide check runs the official test suite for this chapter, and a challenge that changes semantics (new syntax, different errors) can make tests fail on main.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::17 cracked.guide::kind::challenges	cracked.guide::Crafting Interpreters::Ch 17 Compiling Expressions
Crafting Interpreters ch 17, Compiling Expressions: how should you work through it?	This chapter is dense. Read the Pratt parser part twice. Trace the parse of a small expression through parsePrecedence and the rule table by hand, which is exactly what challenge 1 asks.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::17 cracked.guide::kind::approach	cracked.guide::Crafting Interpreters::Ch 17 Compiling Expressions
Crafting Interpreters ch 18, Types of Values: what does it cover?	Tagged unions for Lox values in C (numbers, booleans, nil), type checks in the VM, runtime errors, and new instructions for comparison and logical not.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::18 cracked.guide::kind::about	cracked.guide::Crafting Interpreters::Ch 18 Types of Values
Crafting Interpreters ch 18, Types of Values: why does it matter?	Tagged unions are how dynamic languages represent values in a statically typed host. This design shows up in Lua, JavaScript engines and Ruby.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::18 cracked.guide::kind::why	cracked.guide::Crafting Interpreters::Ch 18 Types of Values
Crafting Interpreters ch 18, Types of Values: which part of the book is it in?	clox (bytecode VM, C)	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::18 cracked.guide::kind::part	cracked.guide::Crafting Interpreters::Ch 18 Types of Values
Crafting Interpreters ch 18: what traps should you watch for?	<ul><li>Accessing the wrong union member without checking the tag first.</li><li>Forgetting to reset the stack after a runtime error.</li></ul>	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::18 cracked.guide::kind::traps	cracked.guide::Crafting Interpreters::Ch 18 Types of Values
Crafting Interpreters ch 18: which end-of-chapter challenges are worth your time?	Both challenges are design discussions about instruction set size versus speed; think about them and maybe benchmark one idea.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::18 cracked.guide::kind::challenges	cracked.guide::Crafting Interpreters::Ch 18 Types of Values
Crafting Interpreters ch 18, Types of Values: how should you work through it?	Draw the memory layout of the Value struct. Check sizeof(Value) on your machine.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::18 cracked.guide::kind::approach	cracked.guide::Crafting Interpreters::Ch 18 Types of Values
Crafting Interpreters ch 19, Strings: what does it cover?	Heap-allocated objects in clox, starting with strings: an Obj header, string objects, concatenation, and a linked list of all objects so they can be freed at exit.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::19 cracked.guide::kind::about	cracked.guide::Crafting Interpreters::Ch 19 Strings
Crafting Interpreters ch 19, Strings: why does it matter?	This is where manual memory management starts in earnest. The object header plus linked list is the foundation for the garbage collector later.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::19 cracked.guide::kind::why	cracked.guide::Crafting Interpreters::Ch 19 Strings
Crafting Interpreters ch 19, Strings: which part of the book is it in?	clox (bytecode VM, C)	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::19 cracked.guide::kind::part	cracked.guide::Crafting Interpreters::Ch 19 Strings
Crafting Interpreters ch 19: what traps should you watch for?	<ul><li>Forgetting the null terminator or the +1 in allocations.</li><li>Leaking the intermediate string in concatenation.</li><li>Casting between Obj* and ObjString* incorrectly.</li></ul>	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::19 cracked.guide::kind::traps	cracked.guide::Crafting Interpreters::Ch 19 Strings
Crafting Interpreters ch 19: which end-of-chapter challenges are worth your time?	Challenge 1 (flexible array members to store characters inline) is a classic C optimization worth doing. Challenge 2 (strings that do not own their characters) is a good follow-up.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::19 cracked.guide::kind::challenges	cracked.guide::Crafting Interpreters::Ch 19 Strings
Crafting Interpreters ch 19, Strings: how should you work through it?	Run every test under AddressSanitizer and LeakSanitizer. Understand the struct inheritance trick (an Obj as the first field) before moving on.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::19 cracked.guide::kind::approach	cracked.guide::Crafting Interpreters::Ch 19 Strings
Crafting Interpreters ch 20, Hash Tables: what does it cover?	A hash table from scratch with open addressing and linear probing, FNV-1a hashing, tombstones for deletion, growth by load factor, and string interning so string equality becomes pointer equality.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::20 cracked.guide::kind::about	cracked.guide::Crafting Interpreters::Ch 20 Hash Tables
Crafting Interpreters ch 20, Hash Tables: why does it matter?	Hash tables are the most used data structure in practice. Building one yourself demystifies every dictionary and map you use, and Knuth 6.4 later analyzes exactly this design.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::20 cracked.guide::kind::why	cracked.guide::Crafting Interpreters::Ch 20 Hash Tables
Crafting Interpreters ch 20, Hash Tables: which part of the book is it in?	clox (bytecode VM, C)	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::20 cracked.guide::kind::part	cracked.guide::Crafting Interpreters::Ch 20 Hash Tables
String interning: what is it?	String interning stores exactly one copy of each distinct string value, so two equal strings are always the same object and can be compared by address.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::20 cracked.guide::kind::definition	cracked.guide::Crafting Interpreters::Ch 20 Hash Tables
String interning: Do real languages intern strings?	Many do for identifiers and literals, and some intern all strings. Java interns string literals, for example, and exposes intern() for others.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::20 cracked.guide::kind::definition	cracked.guide::Crafting Interpreters::Ch 20 Hash Tables
Open addressing: what is it?	Open addressing is a hash table collision strategy in which every entry lives in the table's own array, and a collision is resolved by probing other slots until a free one is found.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::20 cracked.guide::kind::definition	cracked.guide::Crafting Interpreters::Ch 20 Hash Tables
Open addressing: Open addressing or chaining?	Open addressing is cache friendly and avoids allocations; chaining tolerates high load factors and simpler deletes. Knuth's §6.4 compares them with exact numbers.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::20 cracked.guide::kind::definition	cracked.guide::Crafting Interpreters::Ch 20 Hash Tables
Crafting Interpreters ch 20: what traps should you watch for?	<ul><li>Not treating tombstones correctly on insert versus lookup.</li><li>Infinite loop when the table has no empty slots (load factor too high).</li><li>Counting tombstones in the load factor or not, inconsistently.</li></ul>	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::20 cracked.guide::kind::traps	cracked.guide::Crafting Interpreters::Ch 20 Hash Tables
Crafting Interpreters ch 20: which end-of-chapter challenges are worth your time?	Challenge 1 (support non-string keys) and challenge 2 (tune and compare hash table designs) are great; challenge 3 (benchmarking) pairs well with 2.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::20 cracked.guide::kind::challenges	cracked.guide::Crafting Interpreters::Ch 20 Hash Tables
Crafting Interpreters ch 20, Hash Tables: how should you work through it?	Implement, then write a small stress test that inserts and deletes many keys and checks lookups. Re-read the tombstone section twice; it is the subtle part.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::20 cracked.guide::kind::approach	cracked.guide::Crafting Interpreters::Ch 20 Hash Tables
Crafting Interpreters ch 21, Global Variables: what does it cover?	Statements and global variables in clox: print and expression statements, declarations, global variable get and set via the hash table, and assignment with correct precedence.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::21 cracked.guide::kind::about	cracked.guide::Crafting Interpreters::Ch 21 Global Variables
Crafting Interpreters ch 21, Global Variables: why does it matter?	Shows how a single-pass compiler handles declarations and l-values, a trickier problem than in jlox.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::21 cracked.guide::kind::why	cracked.guide::Crafting Interpreters::Ch 21 Global Variables
Crafting Interpreters ch 21, Global Variables: which part of the book is it in?	clox (bytecode VM, C)	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::21 cracked.guide::kind::part	cracked.guide::Crafting Interpreters::Ch 21 Global Variables
Crafting Interpreters ch 21: what traps should you watch for?	<ul><li>Invalid assignment targets silently accepted when canAssign is not threaded through correctly.</li></ul>	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::21 cracked.guide::kind::traps	cracked.guide::Crafting Interpreters::Ch 21 Global Variables
Crafting Interpreters ch 21: which end-of-chapter challenges are worth your time?	Challenge 1 (stop adding duplicate name constants) and challenge 2 (faster global lookup) are both good engineering exercises. Challenge 3 (REPL-friendly forward references) is a design puzzle.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::21 cracked.guide::kind::challenges	cracked.guide::Crafting Interpreters::Ch 21 Global Variables
Crafting Interpreters ch 21, Global Variables: how should you work through it?	Pay attention to how the canAssign flag prevents invalid assignment targets. Test with expressions like a * b = c.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::21 cracked.guide::kind::approach	cracked.guide::Crafting Interpreters::Ch 21 Global Variables
Crafting Interpreters ch 22, Local Variables: what does it cover?	Local variables on the VM stack: the compiler tracks locals and scope depth, so each local is just a stack slot index, making access much faster than hash lookups.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::22 cracked.guide::kind::about	cracked.guide::Crafting Interpreters::Ch 22 Local Variables
Crafting Interpreters ch 22, Local Variables: why does it matter?	This is how real compilers do register and stack slot allocation in simple form. It also explains why locals are faster than globals in Python and Lua.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::22 cracked.guide::kind::why	cracked.guide::Crafting Interpreters::Ch 22 Local Variables
Crafting Interpreters ch 22, Local Variables: which part of the book is it in?	clox (bytecode VM, C)	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::22 cracked.guide::kind::part	cracked.guide::Crafting Interpreters::Ch 22 Local Variables
Crafting Interpreters ch 22: what traps should you watch for?	<ul><li>Popping the wrong number of locals at the end of a scope.</li><li>Reading a local in its own initializer must be an error.</li></ul>	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::22 cracked.guide::kind::traps	cracked.guide::Crafting Interpreters::Ch 22 Local Variables
Crafting Interpreters ch 22: which end-of-chapter challenges are worth your time?	Challenge 3 (const or final variables) and challenge 4 (more than 256 locals) are the implementable ones. Challenge 1 asks about faster local resolution.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::22 cracked.guide::kind::challenges	cracked.guide::Crafting Interpreters::Ch 22 Local Variables
Crafting Interpreters ch 22, Local Variables: how should you work through it?	Use the disassembler to watch GET_LOCAL and SET_LOCAL slot numbers. Trace a nested block example on paper.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::22 cracked.guide::kind::approach	cracked.guide::Crafting Interpreters::Ch 22 Local Variables
Crafting Interpreters ch 23, Jumping Back and Forth: what does it cover?	Control flow in bytecode: jump instructions with backpatching for if/else, logical operators, while loops with backward jumps, and for loops.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::23 cracked.guide::kind::about	cracked.guide::Crafting Interpreters::Ch 23 Jumping Back and Forth
Crafting Interpreters ch 23, Jumping Back and Forth: why does it matter?	Backpatching is how every assembler and compiler resolves forward jumps. You will see it again in real assemblers and in Knuth's MIX.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::23 cracked.guide::kind::why	cracked.guide::Crafting Interpreters::Ch 23 Jumping Back and Forth
Crafting Interpreters ch 23, Jumping Back and Forth: which part of the book is it in?	clox (bytecode VM, C)	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::23 cracked.guide::kind::part	cracked.guide::Crafting Interpreters::Ch 23 Jumping Back and Forth
Crafting Interpreters ch 23: what traps should you watch for?	<ul><li>Jump offsets off by the size of the operand bytes.</li><li>Not popping the condition value on both branches.</li></ul>	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::23 cracked.guide::kind::traps	cracked.guide::Crafting Interpreters::Ch 23 Jumping Back and Forth
Crafting Interpreters ch 23: which end-of-chapter challenges are worth your time?	Challenge 1 (a switch statement) and challenge 2 (continue) are both excellent. Challenge 3 is an open design question. Do challenges that change Lox's behavior on a separate git branch. The cracked.guide check runs the official test suite for this chapter, and a challenge that changes semantics (new syntax, different errors) can make tests fail on main.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::23 cracked.guide::kind::challenges	cracked.guide::Crafting Interpreters::Ch 23 Jumping Back and Forth
Crafting Interpreters ch 23, Jumping Back and Forth: how should you work through it?	Disassemble each control structure and draw the jump arrows. Off-by-one jump offsets are the usual bug; the disassembler shows them immediately.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::23 cracked.guide::kind::approach	cracked.guide::Crafting Interpreters::Ch 23 Jumping Back and Forth
Crafting Interpreters ch 24, Calls and Functions: what does it cover?	Function objects, call frames, a compiler per function, the call instruction, return, stack traces for errors, and native functions.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::24 cracked.guide::kind::about	cracked.guide::Crafting Interpreters::Ch 24 Calls and Functions
Crafting Interpreters ch 24, Calls and Functions: why does it matter?	Call frames are exactly how your CPU and every runtime manage function calls. After this chapter, stack traces make complete sense.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::24 cracked.guide::kind::why	cracked.guide::Crafting Interpreters::Ch 24 Calls and Functions
Crafting Interpreters ch 24, Calls and Functions: which part of the book is it in?	clox (bytecode VM, C)	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::24 cracked.guide::kind::part	cracked.guide::Crafting Interpreters::Ch 24 Calls and Functions
Crafting Interpreters ch 24: what traps should you watch for?	<ul><li>Wrong slot offset for the callee and arguments in a frame.</li><li>Not checking frame count for stack overflow on deep recursion.</li><li>Forgetting to update the cached frame pointer after a call or return.</li></ul>	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::24 cracked.guide::kind::traps	cracked.guide::Crafting Interpreters::Ch 24 Calls and Functions
Crafting Interpreters ch 24: which end-of-chapter challenges are worth your time?	Challenge 1 (cache ip in a local or register) is a real speedup worth measuring. Challenges 2 and 3 (arity and error handling for natives) make the VM safer. Challenge 4 (add your own natives) is fun.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::24 cracked.guide::kind::challenges	cracked.guide::Crafting Interpreters::Ch 24 Calls and Functions
Crafting Interpreters ch 24, Calls and Functions: how should you work through it?	One of the biggest chapters; plan two sessions. Draw the value stack and frames during a recursive call. Compare your Fibonacci benchmark against jlox from chapter 10.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::24 cracked.guide::kind::approach	cracked.guide::Crafting Interpreters::Ch 24 Calls and Functions
Crafting Interpreters ch 25, Closures: what does it cover?	Closures in clox with upvalues: variables captured from enclosing functions live on the stack until their frame returns, then get &quot;closed&quot; by moving them to the heap.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::25 cracked.guide::kind::about	cracked.guide::Crafting Interpreters::Ch 25 Closures
Crafting Interpreters ch 25, Closures: why does it matter?	Upvalues are Lua's clever design for fast closures. This is widely considered the hardest chapter in the book and the most satisfying to get right.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::25 cracked.guide::kind::why	cracked.guide::Crafting Interpreters::Ch 25 Closures
Crafting Interpreters ch 25, Closures: which part of the book is it in?	clox (bytecode VM, C)	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::25 cracked.guide::kind::part	cracked.guide::Crafting Interpreters::Ch 25 Closures
Upvalue: what is it?	An upvalue is a reference from a closure to a local variable of an enclosing function, which stays valid after that function returns.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::25 cracked.guide::kind::definition	cracked.guide::Crafting Interpreters::Ch 25 Closures
Upvalue: Does jlox use upvalues?	No. jlox closures hold a reference to their whole enclosing environment, a heap-allocated Java map, so the problem never arises.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::25 cracked.guide::kind::definition	cracked.guide::Crafting Interpreters::Ch 25 Closures
Crafting Interpreters ch 25: what traps should you watch for?	<ul><li>Keeping the open upvalues list unsorted, which breaks closing.</li><li>Closing upvalues in the wrong place (must happen when locals leave scope and at return).</li><li>Upvalue index versus local slot confusion in the compiler.</li></ul>	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::25 cracked.guide::kind::traps	cracked.guide::Crafting Interpreters::Ch 25 Closures
Crafting Interpreters ch 25: which end-of-chapter challenges are worth your time?	Challenge 2 (a fresh variable per loop iteration) is a semantics change; do it on a branch. Challenge 3 (objects from closures) is a fun Lox program to write. Challenge 1 is a performance design question. 	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::25 cracked.guide::kind::challenges	cracked.guide::Crafting Interpreters::Ch 25 Closures
Crafting Interpreters ch 25, Closures: how should you work through it?	Read the whole chapter once before coding. Draw the open upvalues list and the stack for the counter example. Use the test suite heavily; closure bugs are subtle.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::25 cracked.guide::kind::approach	cracked.guide::Crafting Interpreters::Ch 25 Closures
Crafting Interpreters ch 26, Garbage Collection: what does it cover?	A mark-sweep garbage collector: roots, marking with a gray stack (tricolor abstraction), tracing references, sweeping unreachable objects, weak references for the string table, and when to trigger collection.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::26 cracked.guide::kind::about	cracked.guide::Crafting Interpreters::Ch 26 Garbage Collection
Crafting Interpreters ch 26, Garbage Collection: why does it matter?	GC is one of the most misunderstood parts of every runtime. After this, Java, Go and JavaScript GC logs make sense, and Knuth 2.3.5 will feel familiar.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::26 cracked.guide::kind::why	cracked.guide::Crafting Interpreters::Ch 26 Garbage Collection
Crafting Interpreters ch 26, Garbage Collection: which part of the book is it in?	clox (bytecode VM, C)	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::26 cracked.guide::kind::part	cracked.guide::Crafting Interpreters::Ch 26 Garbage Collection
Mark-sweep garbage collection: what is it?	Mark-sweep is a garbage collection algorithm that first marks every object reachable from a set of roots, then sweeps through all objects and frees the unmarked ones.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::26 cracked.guide::kind::definition	cracked.guide::Crafting Interpreters::Ch 26 Garbage Collection
Mark-sweep garbage collection: Does mark-sweep move objects?	No. That is mark-compact or copying collection. Plain mark-sweep frees in place, so memory can fragment.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::26 cracked.guide::kind::definition	cracked.guide::Crafting Interpreters::Ch 26 Garbage Collection
Mark-sweep garbage collection: What is a stress-test GC mode?	Collecting on every allocation. clox has a flag for it; it makes GC bugs show up immediately instead of rarely.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::26 cracked.guide::kind::definition	cracked.guide::Crafting Interpreters::Ch 26 Garbage Collection
Crafting Interpreters ch 26, a common trap: “An object allocated but not yet reachable gets collected mid-operation.” What's the catch?	Push temporaries on the stack before allocating again.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::26 cracked.guide::kind::trap	cracked.guide::Crafting Interpreters::Ch 26 Garbage Collection
Crafting Interpreters ch 26: what traps should you watch for?	<ul><li>Forgetting to mark compiler roots while compiling.</li><li>Not removing unmarked strings from the intern table before sweeping.</li></ul>	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::26 cracked.guide::kind::traps	cracked.guide::Crafting Interpreters::Ch 26 Garbage Collection
Crafting Interpreters ch 26: which end-of-chapter challenges are worth your time?	Challenge 1 (shrink the object header) and challenge 2 (avoid clearing mark bits on every sweep) are good optimizations. Challenge 3 (try another GC algorithm) is a big project; save it for after the book.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::26 cracked.guide::kind::challenges	cracked.guide::Crafting Interpreters::Ch 26 Garbage Collection
Crafting Interpreters ch 26, Garbage Collection: how should you work through it?	Enable the stress-GC mode (collect on every allocation) and the GC log as the book suggests. Most bugs only show up under stress mode.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::26 cracked.guide::kind::approach	cracked.guide::Crafting Interpreters::Ch 26 Garbage Collection
Crafting Interpreters ch 27, Classes and Instances: what does it cover?	Classes and instances in clox: class objects, instance objects with a fields hash table, and get and set property instructions.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::27 cracked.guide::kind::about	cracked.guide::Crafting Interpreters::Ch 27 Classes and Instances
Crafting Interpreters ch 27, Classes and Instances: why does it matter?	Shows the real cost of dynamic objects: every field access is a hash lookup, which is why engines like V8 invented hidden classes.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::27 cracked.guide::kind::why	cracked.guide::Crafting Interpreters::Ch 27 Classes and Instances
Crafting Interpreters ch 27, Classes and Instances: which part of the book is it in?	clox (bytecode VM, C)	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::27 cracked.guide::kind::part	cracked.guide::Crafting Interpreters::Ch 27 Classes and Instances
Crafting Interpreters ch 27: what traps should you watch for?	<ul><li>Forgetting to blacken new object types in the GC, which causes use-after-free bugs.</li></ul>	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::27 cracked.guide::kind::traps	cracked.guide::Crafting Interpreters::Ch 27 Classes and Instances
Crafting Interpreters ch 27: which end-of-chapter challenges are worth your time?	Challenges 1 (handling missing fields gracefully), 2 (dynamic field access by string) and 3 (deleting fields) all involve language design choices; pick one. Challenge 4 asks about faster field access, which connects to hidden classes.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::27 cracked.guide::kind::challenges	cracked.guide::Crafting Interpreters::Ch 27 Classes and Instances
Crafting Interpreters ch 27, Classes and Instances: how should you work through it?	Remember to mark new object types in the GC. Run under stress GC again.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::27 cracked.guide::kind::approach	cracked.guide::Crafting Interpreters::Ch 27 Classes and Instances
Crafting Interpreters ch 28, Methods and Initializers: what does it cover?	Methods, bound methods, this, initializers, and the OP_INVOKE optimization that combines property lookup and call.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::28 cracked.guide::kind::about	cracked.guide::Crafting Interpreters::Ch 28 Methods and Initializers
Crafting Interpreters ch 28, Methods and Initializers: why does it matter?	The invoke optimization is a real technique that production VMs use, and you get to measure its effect.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::28 cracked.guide::kind::why	cracked.guide::Crafting Interpreters::Ch 28 Methods and Initializers
Crafting Interpreters ch 28, Methods and Initializers: which part of the book is it in?	clox (bytecode VM, C)	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::28 cracked.guide::kind::part	cracked.guide::Crafting Interpreters::Ch 28 Methods and Initializers
Crafting Interpreters ch 28: what traps should you watch for?	<ul><li>Not handling the case where a field shadows a method in OP_INVOKE.</li><li>Leaking bound method objects or forgetting to mark them.</li></ul>	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::28 cracked.guide::kind::traps	cracked.guide::Crafting Interpreters::Ch 28 Methods and Initializers
Crafting Interpreters ch 28: which end-of-chapter challenges are worth your time?	Challenge 1 (faster init lookup) is quick. Challenge 2 is about inline caching, which is how fast JS engines work; reading about it is worthwhile even if you do not implement it.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::28 cracked.guide::kind::challenges	cracked.guide::Crafting Interpreters::Ch 28 Methods and Initializers
Crafting Interpreters ch 28, Methods and Initializers: how should you work through it?	Benchmark method calls before and after OP_INVOKE.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::28 cracked.guide::kind::approach	cracked.guide::Crafting Interpreters::Ch 28 Methods and Initializers
Crafting Interpreters ch 29, Superclasses: what does it cover?	Inheritance in clox with copy-down inheritance (copy superclass methods into the subclass at definition time), and super calls, including an optimized super invoke instruction.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::29 cracked.guide::kind::about	cracked.guide::Crafting Interpreters::Ch 29 Superclasses
Crafting Interpreters ch 29, Superclasses: why does it matter?	Copy-down is a neat trick that trades flexibility for speed, a classic VM design trade-off.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::29 cracked.guide::kind::why	cracked.guide::Crafting Interpreters::Ch 29 Superclasses
Crafting Interpreters ch 29, Superclasses: which part of the book is it in?	clox (bytecode VM, C)	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::29 cracked.guide::kind::part	cracked.guide::Crafting Interpreters::Ch 29 Superclasses
Crafting Interpreters ch 29: what traps should you watch for?	<ul><li>A class inheriting from a non-class value must be a runtime error.</li></ul>	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::29 cracked.guide::kind::traps	cracked.guide::Crafting Interpreters::Ch 29 Superclasses
Crafting Interpreters ch 29: which end-of-chapter challenges are worth your time?	Challenge 3 (BETA-style inner, again, now in C) is satisfying if you did it in jlox. Do challenges that change Lox's behavior on a separate git branch. The cracked.guide check runs the official test suite for this chapter, and a challenge that changes semantics (new syntax, different errors) can make tests fail on main.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::29 cracked.guide::kind::challenges	cracked.guide::Crafting Interpreters::Ch 29 Superclasses
Crafting Interpreters ch 29, Superclasses: how should you work through it?	Short chapter; run the full clox test suite at the end.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::29 cracked.guide::kind::approach	cracked.guide::Crafting Interpreters::Ch 29 Superclasses
Crafting Interpreters ch 30, Optimization: what does it cover?	Profiling and optimization: replacing modulo with bit masking in the hash table, then NaN boxing to pack every Lox value into 64 bits, with benchmarks showing the speedup.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::30 cracked.guide::kind::about	cracked.guide::Crafting Interpreters::Ch 30 Optimization
Crafting Interpreters ch 30, Optimization: why does it matter?	Measuring before optimizing is the most important performance habit. NaN boxing is used in real engines like LuaJIT and some JavaScript engines.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::30 cracked.guide::kind::why	cracked.guide::Crafting Interpreters::Ch 30 Optimization
Crafting Interpreters ch 30, Optimization: which part of the book is it in?	clox (bytecode VM, C)	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::30 cracked.guide::kind::part	cracked.guide::Crafting Interpreters::Ch 30 Optimization
NaN boxing: what is it?	NaN boxing is a value representation that stores non-number values such as pointers, booleans and nil inside the spare bits of IEEE 754 double-precision NaN values, so that every value fits in 64 bits.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::30 cracked.guide::kind::definition	cracked.guide::Crafting Interpreters::Ch 30 Optimization
NaN boxing: Is NaN boxing portable?	Mostly, on 64-bit systems where pointers use 48 bits or so. It assumes IEEE 754 doubles and a pointer layout that fits, so it is a deliberate trade of portability for speed.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::30 cracked.guide::kind::definition	cracked.guide::Crafting Interpreters::Ch 30 Optimization
Crafting Interpreters ch 30: what traps should you watch for?	<ul><li>NaN boxing assumes 64-bit pointers fit in 48 bits; this is true on mainstream platforms today.</li><li>Optimizing without benchmarks.</li></ul>	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::30 cracked.guide::kind::traps	cracked.guide::Crafting Interpreters::Ch 30 Optimization
Crafting Interpreters ch 30: which end-of-chapter challenges are worth your time?	Challenge 1 (find and fix another hotspot with a profiler) is the most valuable. Challenge 2 (small string optimization) is a nice C exercise. Challenge 3 asks you to reflect on the book; actually write it down.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::30 cracked.guide::kind::challenges	cracked.guide::Crafting Interpreters::Ch 30 Optimization
Crafting Interpreters ch 30, Optimization: how should you work through it?	Use a real profiler (perf, Instruments or VTune) on the benchmarks. Keep NaN boxing behind the compile-time flag the book uses so you can switch back to debug.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::30 cracked.guide::kind::approach	cracked.guide::Crafting Interpreters::Ch 30 Optimization
TAOCP Vol 1: Fundamental Algorithms: what is the phase about?	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.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::kind::about	cracked.guide::TAOCP Vol 1::About this phase
TAOCP Vol 1: what should you be able to do by the end?	<ul><li>Analyze an algorithm exactly, not just in big-O: best case, worst case, average and variance.</li><li>Manipulate sums, binomial coefficients and generating functions with confidence.</li><li>Read and write assembly for a simple machine and count the cost of every instruction.</li><li>Implement linked structures, tree traversals, topological sort, a garbage collector and a malloc-style allocator from first principles.</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::kind::outcomes	cracked.guide::TAOCP Vol 1::About this phase
TAOCP Vol 1: what do you need before you start?	<ul><li>Finished Crafting Interpreters (you will see the same ideas again in 1.4.3, 2.3.5 and 2.5).</li><li>High-school algebra and comfort with proofs by induction (Week 0 math covers it).</li><li>Basic calculus helps for 1.2.9 and 1.2.11; you can skim the heaviest parts.</li><li>A MIX simulator such as GNU MDK.</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::kind::need	cracked.guide::TAOCP Vol 1::About this phase
TAOCP Vol 1: how do you get the book?	TAOCP is not free. Vol 1, 3rd edition is about $64 new from InformIT (the publisher's store) and much less used. Borrow before you buy: many public and university libraries give you free access to O'Reilly Learning, which carries TAOCP; Libby/OverDrive and interlibrary loan (search WorldCat) work too. Older used editions are fine for Vols 1 to 3; section numbers barely changed. If you buy the eBook, get the PDF from InformIT. Knuth himself warns that the Kindle and ePUB versions mangle the math.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::kind::book	cracked.guide::TAOCP Vol 1::About this phase
TAOCP Vol 1: tips for getting through it?	<ul><li>Read the front matter on exercise ratings before 1.1. You will use that scale for two years.</li><li>Keep a notebook of identities and tricks; you will refer back to it in every later volume.</li><li>Concrete Mathematics (Graham, Knuth, Patashnik) is the best companion if 1.2 feels too terse.</li><li>Expect to not finish every exercise. Nobody does. The guides tell you which ones matter.</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::kind::tips	cracked.guide::TAOCP Vol 1::About this phase
TAOCP §1.1 Algorithms: what does it cover?	Knuth opens with Euclid's algorithm for the greatest common divisor and uses it to pin down what an algorithm actually is: finite, definite, with input, output and effective steps. He also introduces his house style for writing algorithms as lettered, numbered steps, and sketches a formal model of computation at the end.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.1 cracked.guide::kind::about	cracked.guide::TAOCP Vol 1::1.1 Algorithms
TAOCP §1.1: why does it matter?	Every later section uses this step-by-step format, so getting comfortable with it now pays off for 100+ weeks. The five properties are also a decent checklist for any spec you write at work: if a step is not definite or not guaranteed to terminate, you have a bug waiting to happen.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.1 cracked.guide::kind::why	cracked.guide::TAOCP Vol 1::1.1 Algorithms
Euclid's algorithm: what is it?	Euclid's algorithm computes the greatest common divisor of two positive integers by repeatedly replacing the larger with its remainder modulo the smaller until the remainder is zero.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.1 cracked.guide::kind::definition	cracked.guide::TAOCP Vol 1::1.1 Algorithms
Euclid's algorithm: What is the extended Euclidean algorithm?	The same loop, also tracking coefficients so that it returns x and y with mx + ny = gcd(m, n). It is how you compute modular inverses.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.1 cracked.guide::kind::definition	cracked.guide::TAOCP Vol 1::1.1 Algorithms
TAOCP §1.1, a common trap: “Getting stuck on the formal definition at the end of the section.” What's the catch?	It is optional on a first read.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.1 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 1::1.1 Algorithms
TAOCP §1.1, a common trap: “Treating the exercise ratings as difficulty for you personally.” What's the catch?	They are Knuth's estimate of time for a prepared reader; a 20 can take you an hour early on and that is normal.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.1 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 1::1.1 Algorithms
TAOCP §1.1, a common trap: “Buying an old edition by accident.” What's the catch?	You want Vol 1, 3rd edition (1997, with later printings).	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.1 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 1::1.1 Algorithms
TAOCP §1.1, exercise 1 (rated 10): what is it asking?	Rearrange four variables with as few replacement steps as possible. The same ordering problem that bites people in swap code.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.1 Algorithms
TAOCP §1.1, exercise 2 (rated 15): what is it asking?	Prove a fact about m and n at the top of the loop. First practice reasoning about an algorithm's state instead of just running it.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.1 Algorithms
TAOCP §1.1, exercise 3 (rated 20): what is it asking?	Rework Euclid's algorithm so it never does a pure copy step, written in Knuth's step format. Very doable and a good first rewrite.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.1 Algorithms
TAOCP §1.1, exercise 5 (rated 12, recommended): what is it asking?	Audit the reading procedure from the preface against the five properties of an algorithm. Fun, and it makes the definitions stick.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.1 Algorithms
TAOCP §1.1: how many exercises, and how are they rated?	9 exercises, rated 10 to M30.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.1 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 1::1.1 Algorithms
TAOCP §1.1: what should you be comfortable with first?	<ul><li>Comfort reading pseudocode</li><li>Remainders and division (week 0 math)</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.1 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 1::1.1 Algorithms
TAOCP §1.1: how should you work through it?	Before the section itself, read Knuth's &quot;Notes on the Exercises&quot; at the front of the book (the preface's reading procedure sends you there too). It explains the rating scale (00 to 50 in steps of ten, M for mathematical, HM for higher math like calculus) and the triangle that marks recommended exercises, which you will rely on for the next two years. Then trace Algorithm E by hand on a few pairs of numbers until it feels boring. Read the five properties slowly. The last few pages on a set-theoretic definition of computation are fine to skim on a first pass; come back to them later if you are curious.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.1 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 1::1.1 Algorithms
TAOCP §1.2.1 Mathematical Induction: what does it cover?	Induction as the main tool for proving things about integers and about programs. Knuth goes further than a typical math class by showing how to prove an algorithm correct by attaching assertions to each step of a flowchart, using an extended version of Euclid's algorithm as the worked example.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.1 cracked.guide::kind::about	cracked.guide::TAOCP Vol 1::1.2.1 Mathematical Induction
TAOCP §1.2.1: why does it matter?	Loop invariants, the thing that makes binary search and in-place algorithms correct, are induction in disguise. Once you can write the invariant, debugging off-by-one errors gets a lot less random.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.1 cracked.guide::kind::why	cracked.guide::TAOCP Vol 1::1.2.1 Mathematical Induction
TAOCP §1.2.1, a common trap: “Reading the assertion proof without actually checking each arrow.” What's the catch?	You will not absorb it passively.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.1 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 1::1.2.1 Mathematical Induction
TAOCP §1.2.1: what traps should you watch for?	<ul><li>Forgetting the base case or proving the step only for large n.</li><li>Strengthening the hypothesis is often the trick: if the induction step will not go through, try proving something stronger.</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.1 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 1::1.2.1 Mathematical Induction
TAOCP §1.2.1, exercise 1 (rated 05): what is it asking?	Adapt induction to start from zero. Checks you know what the base case is actually for.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.1 Mathematical Induction
TAOCP §1.2.1, exercise 2 (rated 15): what is it asking?	Find the hole in a bogus induction proof. Great training for code review.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.1 Mathematical Induction
TAOCP §1.2.1, exercise 3 (rated 18): what is it asking?	Another plausible proof that fails at a specific n. Subtler than the last one.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.1 Mathematical Induction
TAOCP §1.2.1, exercise 5 (rated 21): what is it asking?	Prove every integer above 1 factors into primes, using strong induction.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.1 Mathematical Induction
TAOCP §1.2.1, exercise 6 (rated 20): what is it asking?	Check that the extended Euclid invariants survive one step. This is the core technique of the section in miniature.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.1 Mathematical Induction
TAOCP §1.2.1, exercise 8 (rated 25, recommended): what is it asking?	Prove a pattern about odd numbers summing to cubes, then use it to get the closed form for the sum of cubes.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.1 Mathematical Induction
TAOCP §1.2.1, exercise 13 (rated M23, recommended): what is it asking?	Add a step counter to extended Euclid and prove a bound on it with assertions. Program proofs meet running time.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.1 Mathematical Induction
TAOCP §1.2.1, exercise 15 (rated HM28, recommended): what is it asking?	Work out how induction should go for statements about two integers. The stretch, and it leads to well-ordering.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.1 Mathematical Induction
TAOCP §1.2.1: how many exercises, and how are they rated?	15 exercises, rated 05 to 50.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.1 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 1::1.2.1 Mathematical Induction
TAOCP §1.2.1: what should you be comfortable with first?	<ul><li>1.1 Algorithms</li><li>Basic induction proofs (week 0)</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.1 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 1::1.2.1 Mathematical Induction
TAOCP §1.2.1: how should you work through it?	Read the basic induction material quickly if you have seen it before. Slow way down for the flowchart-with-assertions proof of the extended Euclid algorithm: copy the flowchart onto paper and check every assertion yourself, step by step. That technique is the payoff of the section.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.1 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 1::1.2.1 Mathematical Induction
TAOCP §1.2.2 Numbers, Powers, and Logarithms: what does it cover?	A careful build-up of integers, rationals and reals, then powers with real exponents and logarithms in any base. It ends with practical ways to compute logarithms by hand-style methods.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.2 cracked.guide::kind::about	cracked.guide::TAOCP Vol 1::1.2.2 Numbers, Powers, and Logarithms
TAOCP §1.2.2: why does it matter?	Logs are everywhere in complexity analysis, bit counts and data sizes. Knowing exactly how log base changes work, and why lg n and ln n differ only by a constant, makes big-O arguments feel obvious instead of magical.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.2 cracked.guide::kind::why	cracked.guide::TAOCP Vol 1::1.2.2 Numbers, Powers, and Logarithms
TAOCP §1.2.2, a common trap: “Mixing up lg (base 2), ln (base e) and log10.” What's the catch?	Knuth uses lg for base 2 throughout the series.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.2 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 1::1.2.2 Numbers, Powers, and Logarithms
TAOCP §1.2.2, a common trap: “Spending the whole week on the real-number construction.” What's the catch?	It is background, not the point.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.2 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 1::1.2.2 Numbers, Powers, and Logarithms
TAOCP §1.2.2, exercise 4 (rated 05, recommended): what is it asking?	Evaluate a fractional power by hand. Quick check on the exponent rules.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.2 Numbers, Powers, and Logarithms
TAOCP §1.2.2, exercise 11 (rated 10, recommended): what is it asking?	Work out how many digits of a logarithm you need for a given accuracy in the power. Error propagation in miniature.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.2 Numbers, Powers, and Logarithms
TAOCP §1.2.2, exercise 17 (rated 05, recommended): what is it asking?	A quick round of logs in various bases, a couple of which do not exist.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.2 Numbers, Powers, and Logarithms
TAOCP §1.2.2, exercise 19 (rated 20, recommended): what is it asking?	Decide whether a 14-digit decimal number fits in a 47-bit word. The log-to-count-bits skill you use when sizing integers.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.2 Numbers, Powers, and Logarithms
TAOCP §1.2.2, exercise 22 (rated 20, recommended): what is it asking?	Show a cheap approximation of the base-2 log from ln and log10, and bound its error.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.2 Numbers, Powers, and Logarithms
TAOCP §1.2.2, exercise 25 (rated 22): what is it asking?	Prove that a method using only shifts, additions and subtractions computes a binary logarithm. How machines did logs without multiplying.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.2 Numbers, Powers, and Logarithms
TAOCP §1.2.2, exercise 27 (rated M25, recommended): what is it asking?	Error analysis of the text's log10 method when each step is computed with limited precision.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.2 Numbers, Powers, and Logarithms
TAOCP §1.2.2, exercise 28 (rated M30): what is it asking?	Design and analyze a shift-and-add method for exponentials, the inverse of exercise 25. The stretch.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.2 Numbers, Powers, and Logarithms
TAOCP §1.2.2: how many exercises, and how are they rated?	29 exercises, rated 00 to M30.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.2 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 1::1.2.2 Numbers, Powers, and Logarithms
TAOCP §1.2.2: what should you be comfortable with first?	<ul><li>High-school algebra</li><li>Exponent rules</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.2 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 1::1.2.2 Numbers, Powers, and Logarithms
TAOCP §1.2.2: how should you work through it?	Skim the construction of the real numbers unless you enjoy it. Work through the logarithm identities with pencil and make a cheat sheet of lg, ln and log10 conversions. Try the method for computing a logarithm digit by digit on a small example.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.2 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 1::1.2.2 Numbers, Powers, and Logarithms
TAOCP §1.2.3 Sums and Products: what does it cover?	Sigma and Pi notation, and the rules for manipulating sums: distributive, change of variable, interchanging order of summation, and handling sums over relations instead of just ranges. Knuth also introduces the bracket notation for conditions (later called Iverson brackets).	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.3 cracked.guide::kind::about	cracked.guide::TAOCP Vol 1::1.2.3 Sums and Products
TAOCP §1.2.3: why does it matter?	Analyzing loops means analyzing sums. Being able to swap the order of a double sum or reindex cleanly is the core skill behind every running-time derivation you will meet in Vol 3.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.3 cracked.guide::kind::why	cracked.guide::TAOCP Vol 1::1.2.3 Sums and Products
TAOCP §1.2.3, a common trap: “Swapping a double sum with dependent limits incorrectly.” What's the catch?	Draw the region.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.3 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 1::1.2.3 Sums and Products
TAOCP §1.2.3: what traps should you watch for?	<ul><li>Changing a variable but forgetting to change the bounds.</li><li>If you find this section rough, Concrete Mathematics (Graham, Knuth, Patashnik) chapter 2 covers the same ground more gently.</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.3 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 1::1.2.3 Sums and Products
TAOCP §1.2.3, exercise 3 (rated 13, recommended): what is it asking?	Explain why two sums that look like the same substitution come out different. Change of variable only works when the map is one-to-one.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.3 Sums and Products
TAOCP §1.2.3, exercise 9 (rated 05, recommended): what is it asking?	Check an edge case of the geometric-series derivation.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.3 Sums and Products
TAOCP §1.2.3, exercise 17 (rated M00, recommended): what is it asking?	What a sum of 1s over a set counts. Thirty seconds, but it is the bracket idea in its simplest form.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.3 Sums and Products
TAOCP §1.2.3, exercise 25 (rated 15, recommended): what is it asking?	Find the bug in a slick-looking double-sum derivation. Reused index names are the classic sum bug.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.3 Sums and Products
TAOCP §1.2.3, exercise 22 (rated 20, recommended): what is it asking?	Restate the sum manipulation rules for products.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.3 Sums and Products
TAOCP §1.2.3, exercise 15 (rated M22, recommended): what is it asking?	Get a closed form for a sum of k times a power by manipulating the sum, not by guessing.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.3 Sums and Products
TAOCP §1.2.3, exercise 20 (rated 25, recommended): what is it asking?	Turn a cute numeric pattern into a general formula and prove it with sum manipulation.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.3 Sums and Products
TAOCP §1.2.3, exercise 29 (rated M30, recommended): what is it asking?	Express a triple sum over ordered indices through power sums. The stretch, and a preview of symmetric functions in 1.2.9.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.3 Sums and Products
TAOCP §1.2.3: how many exercises, and how are they rated?	47 exercises, rated M00 to M30.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.3 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 1::1.2.3 Sums and Products
TAOCP §1.2.3: what should you be comfortable with first?	<ul><li>1.2.1 Mathematical Induction</li><li>Arithmetic and geometric series</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.3 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 1::1.2.3 Sums and Products
TAOCP §1.2.3: how should you work through it?	Do not read this like prose. For every manipulation rule, write a tiny concrete example with numbers (say n = 4) and check both sides agree. Pay special attention to interchanging the order of summation with dependent bounds; draw the grid of (i, j) pairs to see it. The exercises come in two sets; the second is about determinants and is optional.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.3 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 1::1.2.3 Sums and Products
TAOCP §1.2.4 Integer Functions and Elementary Number Theory: what does it cover?	Floor, ceiling, the mod operation defined for any real numbers, and the basics of congruences: divisibility, primes, relatively prime numbers, and Fermat's theorem.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.4 cracked.guide::kind::about	cracked.guide::TAOCP Vol 1::1.2.4 Integer Functions and Elementary Number Theory
TAOCP §1.2.4: why does it matter?	Floor and mod show up in every array index calculation, hash function, ring buffer and pagination bug you will ever write. Knuth's definition of mod for negative numbers is worth comparing with how your favorite language does it, because they differ.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.4 cracked.guide::kind::why	cracked.guide::TAOCP Vol 1::1.2.4 Integer Functions and Elementary Number Theory
TAOCP §1.2.4, a common trap: “Assuming floor(-x) = -floor(x).” What's the catch?	It does not.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.4 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 1::1.2.4 Integer Functions and Elementary Number Theory
TAOCP §1.2.4, a common trap: “Assuming C's % is Knuth's mod.” What's the catch?	For negative operands it is not.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.4 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 1::1.2.4 Integer Functions and Elementary Number Theory
TAOCP §1.2.4, exercise 4 (rated M10, recommended): what is it asking?	Relate the floor of -x to the ceiling of x. The identity behind half the off-by-one fixes you will ever write.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.4 Integer Functions and Elementary Number Theory
TAOCP §1.2.4, exercise 6 (rated 20, recommended): what is it asking?	Decide which floor and ceiling of square root identities really hold.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.4 Integer Functions and Elementary Number Theory
TAOCP §1.2.4, exercise 8 (rated 00): what is it asking?	Quick mod values with negative operands. Compare each one with what % gives in your language.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.4 Integer Functions and Elementary Number Theory
TAOCP §1.2.4, exercise 10 (rated 10, recommended): what is it asking?	Mod with non-integer and negative arguments under Knuth's definition.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.4 Integer Functions and Elementary Number Theory
TAOCP §1.2.4, exercise 14 (rated 12, recommended): what is it asking?	Combine two remainders into one. A tiny Chinese remainder problem.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.4 Integer Functions and Elementary Number Theory
TAOCP §1.2.4, exercise 19 (rated M10, recommended): what is it asking?	Prove modular inverses exist using extended Euclid. The basis of division mod m.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.4 Integer Functions and Elementary Number Theory
TAOCP §1.2.4, exercise 35 (rated M20, recommended): what is it asking?	Show that nested integer divisions can be flattened. Why floor((x+m)/n) does not care whether x was floored first.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.4 Integer Functions and Elementary Number Theory
TAOCP §1.2.4, exercise 37 (rated M30, recommended): what is it asking?	Evaluate a floor sum in closed form, with the gcd showing up. The stretch.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.4 Integer Functions and Elementary Number Theory
TAOCP §1.2.4: how many exercises, and how are they rated?	49 exercises, rated 00 to HM46.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.4 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 1::1.2.4 Integer Functions and Elementary Number Theory
TAOCP §1.2.4: what should you be comfortable with first?	<ul><li>1.2.2 Numbers, Powers, and Logarithms</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.4 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 1::1.2.4 Integer Functions and Elementary Number Theory
TAOCP §1.2.4: how should you work through it?	Work every identity about floor and ceiling with a few positive and negative examples. Then write a short program in C or Python comparing x mod y for negative x in Knuth's definition versus your language's % operator. Read the congruence material with pencil; it returns in Vol 2 chapter 4.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.4 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 1::1.2.4 Integer Functions and Elementary Number Theory
TAOCP §1.2.5 Permutations and Factorials: what does it cover?	Counting arrangements, factorials, and how fast n! grows, including Stirling's approximation. Knuth also extends factorials to non-integers via the gamma function and shows how to count the power of a prime dividing n!.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.5 cracked.guide::kind::about	cracked.guide::TAOCP Vol 1::1.2.5 Permutations and Factorials
TAOCP §1.2.5: why does it matter?	Factorials set the lower bound for comparison sorting (you need about lg n! comparisons) and they tell you instantly when brute force over permutations is hopeless.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.5 cracked.guide::kind::why	cracked.guide::TAOCP Vol 1::1.2.5 Permutations and Factorials
TAOCP §1.2.5, a common trap: “Getting lost in the gamma function.” What's the catch?	It is optional depth for now.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.5 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 1::1.2.5 Permutations and Factorials
TAOCP §1.2.5: what traps should you watch for?	<ul><li>Off-by-one between permutations of n things and arrangements of k out of n.</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.5 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 1::1.2.5 Permutations and Factorials
TAOCP §1.2.5, exercise 1 (rated 00): what is it asking?	Count the orderings of a deck of cards. Warm-up.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.5 Permutations and Factorials
TAOCP §1.2.5, exercise 4 (rated 13, recommended): what is it asking?	Use a given log of a big factorial to get its digit count and its leading and trailing digits.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.5 Permutations and Factorials
TAOCP §1.2.5, exercise 5 (rated 15): what is it asking?	Estimate a small factorial with the refined Stirling formula and compare with the exact value.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.5 Permutations and Factorials
TAOCP §1.2.5, exercise 6 (rated 17, recommended): what is it asking?	Factor a factorial into primes with the prime-power formula, no multiplying out.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.5 Permutations and Factorials
TAOCP §1.2.5, exercise 11 (rated M15): what is it asking?	Count the factors of 2 in n! straight from the binary digits of n.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.5 Permutations and Factorials
TAOCP §1.2.5, exercise 12 (rated M22, recommended): what is it asking?	Generalize that to any prime using base-p digits.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.5 Permutations and Factorials
TAOCP §1.2.5, exercise 24 (rated HM21, recommended): what is it asking?	Prove simple upper and lower bounds for n! with e. Handy whenever you estimate.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.5 Permutations and Factorials
TAOCP §1.2.5, exercise 14 (rated M28, recommended): what is it asking?	Compute n! mod p from the base-p digits of n. The stretch.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.5 Permutations and Factorials
TAOCP §1.2.5: how many exercises, and how are they rated?	25 exercises, rated 00 to M28.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.5 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 1::1.2.5 Permutations and Factorials
TAOCP §1.2.5: what should you be comfortable with first?	<ul><li>1.2.3 Sums and Products</li><li>1.2.4 Integer Functions</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.5 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 1::1.2.5 Permutations and Factorials
TAOCP §1.2.5: how should you work through it?	Read the counting arguments carefully and do them on small n. Compute a few values of Stirling's approximation against real n! to feel the error. The gamma function part is fine to read for the idea and skim the proofs.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.5 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 1::1.2.5 Permutations and Factorials
TAOCP §1.2.6 Binomial Coefficients (part 1): what does it cover?	Part 1 covers what binomial coefficients count, their definition for general upper index, and the core toolbox of identities: symmetry, absorption, the addition formula (Pascal's rule) and the binomial theorem. Aim to get through the main list of basic properties.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.6 cracked.guide::kind::about	cracked.guide::TAOCP Vol 1::1.2.6 Binomial Coefficients (part 1)
TAOCP §1.2.6 (part 1): why does it matter?	Binomial coefficients are the vocabulary of combinatorics and of probability analysis for algorithms. Half the derivations in Vol 3 lean on these identities.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.6 cracked.guide::kind::why	cracked.guide::TAOCP Vol 1::1.2.6 Binomial Coefficients (part 1)
TAOCP §1.2.6 (part 1), a common trap: “Assuming the upper index must be a nonnegative integer.” What's the catch?	Knuth allows general values, and that generality matters.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.6 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 1::1.2.6 Binomial Coefficients (part 1)
TAOCP §1.2.6 (part 1): what traps should you watch for?	<ul><li>Trying to memorize identities instead of understanding them through Pascal's triangle.</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.6 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 1::1.2.6 Binomial Coefficients (part 1)
TAOCP §1.2.6 (part 1), exercise 5 (rated 05, recommended): what is it asking?	Explain a power-of-eleven pattern with Pascal's triangle.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.6 Binomial Coefficients (part 1)
TAOCP §1.2.6 (part 1), exercise 6 (rated 10, recommended): what is it asking?	Extend Pascal's triangle upward to negative rows with the addition formula. Shows why general upper indices are natural.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.6 Binomial Coefficients (part 1)
TAOCP §1.2.6 (part 1), exercise 7 (rated 12): what is it asking?	Find which k makes a binomial coefficient largest.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.6 Binomial Coefficients (part 1)
TAOCP §1.2.6 (part 1), exercise 36 (rated M10): what is it asking?	Row sums and alternating row sums of Pascal's triangle.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.6 Binomial Coefficients (part 1)
TAOCP §1.2.6 (part 1), exercise 11 (rated M20, recommended): what is it asking?	Show the power of p dividing a binomial coefficient counts carries when adding in base p.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.6 Binomial Coefficients (part 1)
TAOCP §1.2.6 (part 1), exercise 12 (rated M22): what is it asking?	Which rows of Pascal's triangle are all odd. A nice tie to binary.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.6 Binomial Coefficients (part 1)
TAOCP §1.2.6 (part 1), exercise 67 (rated M20, recommended): what is it asking?	Prove the easy upper bound for binomial coefficients that you will actually use when estimating.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.6 Binomial Coefficients (part 1)
TAOCP §1.2.6 (part 1), exercise 10 (rated M25, recommended): what is it asking?	Binomial coefficients modulo a prime. The facts behind a lot of modular tricks; the harder one this week.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.6 Binomial Coefficients (part 1)
TAOCP §1.2.6 (part 1): how many exercises, and how are they rated?	68 exercises, rated 00 to HM35.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.6 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 1::1.2.6 Binomial Coefficients (part 1)
TAOCP §1.2.6 (part 1): what should you be comfortable with first?	<ul><li>1.2.5 Permutations and Factorials</li><li>1.2.3 Sums and Products</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.6 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 1::1.2.6 Binomial Coefficients (part 1)
TAOCP §1.2.6 (part 1): how should you work through it?	This is one of the densest sections in Vol 1, so it is split over two weeks. This week: build Pascal's triangle up to row 10 by hand and verify each basic identity against it. Make your own one-page summary of the identities with a numeric example next to each. Stop around the point where the text turns to harder summation techniques.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.6 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 1::1.2.6 Binomial Coefficients (part 1)
TAOCP §1.2.6 Binomial Coefficients (part 2): what does it cover?	Part 2 finishes the section: summing products of binomial coefficients (Vandermonde-style convolution), negating the upper index, and the general strategy for attacking a sum involving binomials. It closes with related numbers like multinomial coefficients and Stirling numbers.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.6 cracked.guide::kind::about	cracked.guide::TAOCP Vol 1::1.2.6 Binomial Coefficients (part 2)
TAOCP §1.2.6 (part 2): why does it matter?	This is where you learn to actually evaluate sums that pop out of algorithm analysis, rather than just recognize them.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.6 cracked.guide::kind::why	cracked.guide::TAOCP Vol 1::1.2.6 Binomial Coefficients (part 2)
TAOCP §1.2.6 (part 2), a common trap: “Spending three weeks here.” What's the catch?	Set a timer, move on, and revisit later; Vol 3 will send you back anyway.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.6 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 1::1.2.6 Binomial Coefficients (part 2)
TAOCP §1.2.6 (part 2): what traps should you watch for?	<ul><li>Losing track of signs when negating the upper index.</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.6 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 1::1.2.6 Binomial Coefficients (part 2)
TAOCP §1.2.6 (part 2), exercise 17 (rated M18, recommended): what is it asking?	Prove the Vandermonde convolution by comparing coefficients in a product of powers.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.6 Binomial Coefficients (part 2)
TAOCP §1.2.6 (part 2), exercise 21 (rated M05, recommended): what is it asking?	Why a polynomial equation in the text is not an identity in every variable. Read the side conditions.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.6 Binomial Coefficients (part 2)
TAOCP §1.2.6 (part 2), exercise 31 (rated M20, recommended): what is it asking?	Evaluate a three-binomial sum by expanding one factor first. A standard move worth owning.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.6 Binomial Coefficients (part 2)
TAOCP §1.2.6 (part 2), exercise 30 (rated M24, recommended): what is it asking?	Find a slicker route to one of the text's worked sums.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.6 Binomial Coefficients (part 2)
TAOCP §1.2.6 (part 2), exercise 60 (rated M23, recommended): what is it asking?	Count combinations with repetition and write the answer as a binomial coefficient.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.6 Binomial Coefficients (part 2)
TAOCP §1.2.6 (part 2), exercise 64 (rated M20, recommended): what is it asking?	Show Stirling numbers of the second kind count set partitions.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.6 Binomial Coefficients (part 2)
TAOCP §1.2.6 (part 2), exercise 46 (rated M21, recommended): what is it asking?	Use Stirling's formula to approximate a large binomial coefficient.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.6 Binomial Coefficients (part 2)
TAOCP §1.2.6 (part 2), exercise 63 (rated M30): what is it asking?	A hard sum identity with three indices that leans on everything in the section. The stretch.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.6 Binomial Coefficients (part 2)
TAOCP §1.2.6 (part 2): how many exercises, and how are they rated?	68 exercises, rated 00 to HM35.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.6 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 1::1.2.6 Binomial Coefficients (part 2)
TAOCP §1.2.6 (part 2): what should you be comfortable with first?	<ul><li>1.2.6 Binomial Coefficients (part 1)</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.6 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 1::1.2.6 Binomial Coefficients (part 2)
TAOCP §1.2.6 (part 2): how should you work through it?	Go back over your part 1 summary first. For each worked example of a tricky sum, try to do it yourself before reading Knuth's solution. Expect to reread a few pages; that is normal.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.6 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 1::1.2.6 Binomial Coefficients (part 2)
TAOCP §1.2.7 Harmonic Numbers: what does it cover?	The harmonic numbers H_n = 1 + 1/2 + ... + 1/n, how they grow like ln n, and how to sum expressions involving them. They show up whenever you average over random positions.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.7 cracked.guide::kind::about	cracked.guide::TAOCP Vol 1::1.2.7 Harmonic Numbers
TAOCP §1.2.7: why does it matter?	H_n is behind the average cost of quicksort, the expected number of times a running maximum changes, and the coupon collector problem. You will see it constantly in Vol 3.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.7 cracked.guide::kind::why	cracked.guide::TAOCP Vol 1::1.2.7 Harmonic Numbers
Harmonic numbers: what is it?	The n-th harmonic number is H(n) = 1 + 1/2 + 1/3 + ... + 1/n, which grows like the natural logarithm of n plus Euler's constant (about 0.5772).	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.7 cracked.guide::kind::definition	cracked.guide::TAOCP Vol 1::1.2.7 Harmonic Numbers
Harmonic numbers: Is H(n) the same as log n?	Not exactly, but close: H(n) is ln n plus Euler's constant plus a correction that shrinks like 1/(2n).	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.7 cracked.guide::kind::definition	cracked.guide::TAOCP Vol 1::1.2.7 Harmonic Numbers
TAOCP §1.2.7: what traps should you watch for?	<ul><li>Confusing H_n with ln n exactly; the difference tends to Euler's constant, it does not vanish.</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.7 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 1::1.2.7 Harmonic Numbers
TAOCP §1.2.7, exercise 2 (rated 13): what is it asking?	Adapt the text's halving argument to get an upper bound on the harmonic numbers.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.7 Harmonic Numbers
TAOCP §1.2.7, exercise 4 (rated 10, recommended): what is it asking?	Decide which inequalities between H_n and ln n hold for every n.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.7 Harmonic Numbers
TAOCP §1.2.7, exercise 5 (rated 15): what is it asking?	Compute a large harmonic number to many places from the asymptotic formula.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.7 Harmonic Numbers
TAOCP §1.2.7, exercise 9 (rated M18, recommended): what is it asking?	Check an edge case of the section's main summation theorem.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.7 Harmonic Numbers
TAOCP §1.2.7, exercise 11 (rated M21, recommended): what is it asking?	Practice summation by parts on a sum involving H_k.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.7 Harmonic Numbers
TAOCP §1.2.7, exercise 12 (rated M10, recommended): what is it asking?	A precision question that turns out to be easy once you see how fast the terms vanish.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.7 Harmonic Numbers
TAOCP §1.2.7, exercise 15 (rated M23, recommended): what is it asking?	Find a closed form for the sum of the first n harmonic numbers squared.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.7 Harmonic Numbers
TAOCP §1.2.7, exercise 19 (rated M30, recommended): what is it asking?	Find every n for which H_n is an integer, using a parity argument. The stretch.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.7 Harmonic Numbers
TAOCP §1.2.7: how many exercises, and how are they rated?	24 exercises, rated 01 to M33.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.7 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 1::1.2.7 Harmonic Numbers
TAOCP §1.2.7: what should you be comfortable with first?	<ul><li>1.2.3 Sums and Products</li><li>1.2.2 Logarithms</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.7 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 1::1.2.7 Harmonic Numbers
TAOCP §1.2.7: how should you work through it?	Short section. Compute H_n for n up to 10 and compare to ln n + 0.577. Work through the summation by parts style manipulations with pencil.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.7 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 1::1.2.7 Harmonic Numbers
TAOCP §1.2.8 Fibonacci Numbers: what does it cover?	The Fibonacci sequence, its closed form in terms of the golden ratio, and a pile of identities. Knuth introduces generating functions here as the tool for deriving the closed form, a preview of 1.2.9.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.8 cracked.guide::kind::about	cracked.guide::TAOCP Vol 1::1.2.8 Fibonacci Numbers
TAOCP §1.2.8: why does it matter?	Fibonacci numbers show up in the worst case of Euclid's algorithm, Fibonacci heaps, AVL tree heights and Fibonacci hashing. It is also the cleanest first example of solving a recurrence.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.8 cracked.guide::kind::why	cracked.guide::TAOCP Vol 1::1.2.8 Fibonacci Numbers
TAOCP §1.2.8: what traps should you watch for?	<ul><li>Floating-point closed forms break for large n; use integers when you code it.</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.8 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 1::1.2.8 Fibonacci Numbers
TAOCP §1.2.8, exercise 2 (rated 20, recommended): what is it asking?	Estimate a far-out Fibonacci number from the closed form and logs.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.8 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.8 Fibonacci Numbers
TAOCP §1.2.8, exercise 3 (rated 25): what is it asking?	Write a program printing the first thousand Fibonacci numbers exactly. You need your own bignum addition.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.8 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.8 Fibonacci Numbers
TAOCP §1.2.8, exercise 4 (rated 14, recommended): what is it asking?	Find all n where F_n equals n.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.8 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.8 Fibonacci Numbers
TAOCP §1.2.8, exercise 7 (rated 15, recommended): what is it asking?	Show a composite index gives a composite Fibonacci number, with one exception.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.8 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.8 Fibonacci Numbers
TAOCP §1.2.8, exercise 13 (rated M22, recommended): what is it asking?	Solve Fibonacci-like recurrences with added constants by expressing them through F_n.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.8 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.8 Fibonacci Numbers
TAOCP §1.2.8, exercise 22 (rated M20, recommended): what is it asking?	Show a binomial-weighted sum of Fibonacci numbers is again a Fibonacci number.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.8 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.8 Fibonacci Numbers
TAOCP §1.2.8, exercise 34 (rated M24, recommended): what is it asking?	Prove every positive integer has a unique representation as a sum of non-adjacent Fibonacci numbers.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.8 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.8 Fibonacci Numbers
TAOCP §1.2.8, exercise 36 (rated M32, recommended): what is it asking?	Fibonacci strings: words built like the sequence, and their structure. The stretch.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.8 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.8 Fibonacci Numbers
TAOCP §1.2.8: how many exercises, and how are they rated?	42 exercises, rated 10 to M38.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.8 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 1::1.2.8 Fibonacci Numbers
TAOCP §1.2.8: what should you be comfortable with first?	<ul><li>1.2.1 Mathematical Induction</li><li>1.2.6 Binomial Coefficients</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.8 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 1::1.2.8 Fibonacci Numbers
TAOCP §1.2.8: how should you work through it?	Follow the generating-function derivation of the closed form line by line on paper. Then write a quick program checking several identities numerically for n up to 50.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.8 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 1::1.2.8 Fibonacci Numbers
TAOCP §1.2.9 Generating Functions: what does it cover?	Treating a whole sequence as the coefficients of a power series, then manipulating the series (adding, shifting, multiplying, differentiating) to solve recurrences and evaluate sums.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.9 cracked.guide::kind::about	cracked.guide::TAOCP Vol 1::1.2.9 Generating Functions
TAOCP §1.2.9: why does it matter?	Generating functions are the single most powerful tool in algorithm analysis. Everything from counting binary trees to averaging hashing costs uses them.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.9 cracked.guide::kind::why	cracked.guide::TAOCP Vol 1::1.2.9 Generating Functions
Generating function: what is it?	A generating function represents a sequence a0, a1, a2, ... as the coefficients of a power series a0 + a1 z + a2 z^2 + ..., so that operations on the series correspond to operations on the sequence.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.9 cracked.guide::kind::definition	cracked.guide::TAOCP Vol 1::1.2.9 Generating Functions
Generating function: Do I need calculus for generating functions?	Mostly algebra. Differentiation shows up for things like averages, but a first course in calculus is plenty.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.9 cracked.guide::kind::definition	cracked.guide::TAOCP Vol 1::1.2.9 Generating Functions
TAOCP §1.2.9, a common trap: “Worrying about convergence.” What's the catch?	Knuth mostly treats these as formal power series, so you can manipulate first and ask questions later.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.9 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 1::1.2.9 Generating Functions
TAOCP §1.2.9: what traps should you watch for?	<ul><li>Forgetting the convolution rule; it is the one you will use most.</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.9 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 1::1.2.9 Generating Functions
TAOCP §1.2.9, exercise 1 (rated M12): what is it asking?	Write down the generating function for a sum of two geometric sequences.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.9 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.9 Generating Functions
TAOCP §1.2.9, exercise 2 (rated M13, recommended): what is it asking?	Prove the product rule for exponential generating functions.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.9 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.9 Generating Functions
TAOCP §1.2.9, exercise 5 (rated M20): what is it asking?	Prove a generating-function expansion involving Stirling numbers by induction.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.9 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.9 Generating Functions
TAOCP §1.2.9, exercise 8 (rated M23): what is it asking?	Find the generating function for the number of partitions of n.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.9 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.9 Generating Functions
TAOCP §1.2.9, exercise 12 (rated M20, recommended): what is it asking?	Encode a doubly indexed sequence in a single generating function.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.9 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.9 Generating Functions
TAOCP §1.2.9, exercise 10 (rated M25, recommended): what is it asking?	Get the generating function for the elementary symmetric functions and relate it to the complete ones.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.9 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.9 Generating Functions
TAOCP §1.2.9, exercise 18 (rated M25, recommended): what is it asking?	Evaluate sums over increasing index tuples in closed form.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.9 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.9 Generating Functions
TAOCP §1.2.9, exercise 15 (rated M28): what is it asking?	Find a closed form for a whole family of generating functions using a second variable. The stretch.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.9 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.9 Generating Functions
TAOCP §1.2.9: how many exercises, and how are they rated?	26 exercises, rated M01 to M40.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.9 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 1::1.2.9 Generating Functions
TAOCP §1.2.9: what should you be comfortable with first?	<ul><li>1.2.8 Fibonacci Numbers</li><li>Basic calculus (derivatives, geometric series)</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.9 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 1::1.2.9 Generating Functions
TAOCP §1.2.9: how should you work through it?	Make a table of the basic operations (shift, multiply by z, differentiate, convolution) and what each does to the coefficients. For each worked example, close the book and redo it. If it does not click, Concrete Mathematics chapter 7 and Wilf's free book generatingfunctionology are excellent companions.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.9 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 1::1.2.9 Generating Functions
TAOCP §1.2.10 Analysis of an Algorithm: what does it cover?	A complete worked analysis of a simple algorithm (finding the maximum of n elements): best case, worst case, average, and full probability distribution of how often the running maximum changes. It is the template for every analysis in the series.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.10 cracked.guide::kind::about	cracked.guide::TAOCP Vol 1::1.2.10 Analysis of an Algorithm
TAOCP §1.2.10: why does it matter?	This is the method behind every &quot;average case O(n log n)&quot; claim. Seeing it done end to end on a small example teaches you what those claims actually mean.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.10 cracked.guide::kind::why	cracked.guide::TAOCP Vol 1::1.2.10 Analysis of an Algorithm
TAOCP §1.2.10, fill in the blank:<br>This is the method behind every &quot;average case <span class="cg-blank">&nbsp;</span>&quot; claim.	This is the method behind every &quot;average case <b>O(n log n)</b>&quot; claim.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.10 cracked.guide::kind::complexity	cracked.guide::TAOCP Vol 1::1.2.10 Analysis of an Algorithm
TAOCP §1.2.10, a common trap: “Skipping the variance.” What's the catch?	The mean alone hides how spread out the cost is.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.10 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 1::1.2.10 Analysis of an Algorithm
TAOCP §1.2.10, a common trap: “Confusing the number of comparisons with the number of updates.” What's the catch?	Knuth counts specific steps.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.10 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 1::1.2.10 Analysis of an Algorithm
TAOCP §1.2.10, exercise 1 (rated 10): what is it asking?	Interpret a boundary probability in terms of the max-finding algorithm.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.10 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.10 Analysis of an Algorithm
TAOCP §1.2.10, exercise 3 (rated M15): what is it asking?	Min, max, mean and standard deviation of the update count for a concrete n.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.10 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.10 Analysis of an Algorithm
TAOCP §1.2.10, exercise 5 (rated M13): what is it asking?	Read the mean and standard deviation off a pictured distribution.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.10 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.10 Analysis of an Algorithm
TAOCP §1.2.10, exercise 8 (rated M20, recommended): what is it asking?	Redo part of the analysis when values are drawn with repetition from a finite set.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.10 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.10 Analysis of an Algorithm
TAOCP §1.2.10, exercise 11 (rated M15, recommended): what is it asking?	See what shifting a distribution does to its cumulants.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.10 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.10 Analysis of an Algorithm
TAOCP §1.2.10, exercise 19 (rated M21): what is it asking?	Left-to-right maxima of a random permutation. The same quantity in another costume.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.10 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.10 Analysis of an Algorithm
TAOCP §1.2.10, exercise 20 (rated M22, recommended): what is it asking?	Use sortedness to cut the work of a max-of-differences computation. A real optimization.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.10 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.10 Analysis of an Algorithm
TAOCP §1.2.10, exercise 7 (rated M27, recommended): what is it asking?	Redo the analysis of the max algorithm without assuming distinct values. The stretch.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.10 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.10 Analysis of an Algorithm
TAOCP §1.2.10: how many exercises, and how are they rated?	23 exercises, rated 10 to HM38.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.10 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 1::1.2.10 Analysis of an Algorithm
TAOCP §1.2.10: what should you be comfortable with first?	<ul><li>1.2.7 Harmonic Numbers</li><li>1.2.9 Generating Functions</li><li>Basic probability: mean and variance</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.10 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 1::1.2.10 Analysis of an Algorithm
TAOCP §1.2.10: how should you work through it?	Write the algorithm in a real language, instrument it to count how often the max changes, and run it over many random permutations. Compare your measured mean to Knuth's formula. Then go through the probability generating function derivation with pencil.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.10 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 1::1.2.10 Analysis of an Algorithm
TAOCP §1.2.11 Asymptotic Representations: what does it cover?	Big-O notation done properly in 1.2.11.1, Euler's summation formula in 1.2.11.2, and in 1.2.11.3 a long worked example: the asymptotics of a function Q(n) that comes back in later analyses, using the formula and some integral estimates.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.11 cracked.guide::kind::about	cracked.guide::TAOCP Vol 1::1.2.11 Asymptotic Representations
TAOCP §1.2.11: why does it matter?	Big-O as most people use it is sloppy. Knuth's version lets you say &quot;this is n lg n plus a smaller term&quot; with real meaning, which matters when you compare two algorithms with the same big-O.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.11 cracked.guide::kind::why	cracked.guide::TAOCP Vol 1::1.2.11 Asymptotic Representations
TAOCP §1.2.11, a common trap: “Treating O( ) as an equality in both directions.” What's the catch?	It is one-way.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.11 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 1::1.2.11 Asymptotic Representations
TAOCP §1.2.11: what traps should you watch for?	<ul><li>Getting bogged down in the Euler-Maclaurin details on a first pass.</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.11 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 1::1.2.11 Asymptotic Representations
TAOCP §1.2.11, exercise 2 of §1.2.11.1 (rated M10, recommended): what is it asking?	Find the fallacy in subtracting two O terms.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.11 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.11 Asymptotic Representations
TAOCP §1.2.11, exercise 3 of §1.2.11.1 (rated M15): what is it asking?	Multiply two asymptotic expressions and keep only what is justified.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.11 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.11 Asymptotic Representations
TAOCP §1.2.11, exercise 4 of §1.2.11.1 (rated M15, recommended): what is it asking?	Expand a simple expression asymptotically to a few terms.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.11 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.11 Asymptotic Representations
TAOCP §1.2.11, exercise 6 of §1.2.11.1 (rated M20, recommended): what is it asking?	Spot the bug in a sum of O(n) terms that proves a false bound. You will see this mistake in real code reviews.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.11 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.11 Asymptotic Representations
TAOCP §1.2.11, exercise 13 of §1.2.11.1 (rated M10, recommended): what is it asking?	Relate Omega and O precisely.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.11 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.11 Asymptotic Representations
TAOCP §1.2.11, exercise 9 of §1.2.11.2 (rated M25, recommended): what is it asking?	Approximate a central binomial coefficient two different ways and compare.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.11 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.11 Asymptotic Representations
TAOCP §1.2.11, exercise 16 of §1.2.11.3 (rated M24): what is it asking?	Prove an alternating-sum identity for the Q(n) function of 1.2.11.3.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.11 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.11 Asymptotic Representations
TAOCP §1.2.11, exercise 6 of §1.2.11.2 (rated HM30, recommended): what is it asking?	Show Stirling's approximation holds for real arguments via Euler's summation formula. The stretch.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.11 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.2.11 Asymptotic Representations
TAOCP §1.2.11: how many exercises, and how are they rated?	42 exercises, rated HM01 to HM42.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.11 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 1::1.2.11 Asymptotic Representations
TAOCP §1.2.11: what should you be comfortable with first?	<ul><li>1.2.10 Analysis of an Algorithm</li><li>Calculus: integrals and Taylor series</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.11 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 1::1.2.11 Asymptotic Representations
TAOCP §1.2.11: how should you work through it?	Read 1.2.11.1 (O-notation) carefully and do its exercises. Euler's summation formula and the later examples are heavy calculus; read for the ideas and follow one example fully. It is fine to leave the HM exercises for later.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.11 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 1::1.2.11 Asymptotic Representations
TAOCP §1.3.1 Description of MIX: what does it cover?	MIX, Knuth's imaginary 1960s-style computer: its words made of bytes and signs, registers, memory, comparison indicator, and the full instruction set. Every program in the original volumes is written for it.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.1 cracked.guide::kind::about	cracked.guide::TAOCP Vol 1::1.3.1 Description of MIX
TAOCP §1.3.1: why does it matter?	Reading and writing assembly for a simple machine teaches what high-level code costs. Even though modern hardware is different, the habit of counting memory references and instruction cycles is timeless.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.1 cracked.guide::kind::why	cracked.guide::TAOCP Vol 1::1.3.1 Description of MIX
MIX: what is it?	MIX is the imaginary computer Donald Knuth designed for The Art of Computer Programming, so that every algorithm in the books could be written, run and timed on one simple machine.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.1 cracked.guide::kind::definition	cracked.guide::TAOCP Vol 1::1.3.1 Description of MIX
MIX: Is MIX a real computer?	No. It was never built in hardware. It exists in Knuth's books and in emulators like GNU MDK and the one at cracked.guide/mix.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.1 cracked.guide::kind::definition	cracked.guide::TAOCP Vol 1::1.3.1 Description of MIX
MIX: Do I have to learn MIX to read TAOCP?	You can skim it, but you lose the exact running-time analysis, which is the point of the books. A few weeks of MIX in Volume 1 is enough to read every program after it.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.1 cracked.guide::kind::definition	cracked.guide::TAOCP Vol 1::1.3.1 Description of MIX
MIX: What replaced MIX?	MMIX, a 64-bit RISC design described in Volume 1 Fascicle 1 (2005). Volume 4A and later use it; Volumes 1 to 3 have not yet been rewritten for it.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.1 cracked.guide::kind::definition	cracked.guide::TAOCP Vol 1::1.3.1 Description of MIX
TAOCP §1.3.1, a common trap: “Assuming bytes are 8 bits.” What's the catch?	A MIX byte holds at least 64 values and programs must not depend on its exact size.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.1 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 1::1.3.1 Description of MIX
TAOCP §1.3.1, a common trap: “Misreading field specs (L:R).” What's the catch?	Test them in the simulator.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.1 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 1::1.3.1 Description of MIX
TAOCP §1.3.1: what traps should you watch for?	<ul><li>Wondering whether to skip MIX for MMIX: Knuth is replacing MIX with MMIX (see the Vol 1 Fascicle 1 and his MMIX page), but the 3rd-edition text you are reading uses MIX, so learn MIX now.</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.1 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 1::1.3.1 Description of MIX
TAOCP §1.3.1, exercise 6 (rated 10, recommended): what is it asking?	Predict what several loads with field specs do. Field-spec drill.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.3.1 Description of MIX
TAOCP §1.3.1, exercise 9 (rated 15, recommended): what is it asking?	List every instruction that can touch the overflow toggle.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.3.1 Description of MIX
TAOCP §1.3.1, exercise 13 (rated 10, recommended): what is it asking?	Subtle behavior of overflow jumps that jump to themselves.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.3.1 Description of MIX
TAOCP §1.3.1, exercise 16 (rated 20): what is it asking?	Clear 100 words of memory two ways: shortest program, then fastest. Try MOVE.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.3.1 Description of MIX
TAOCP §1.3.1, exercise 18 (rated 22, recommended): what is it asking?	Hand-execute a tricky little program that touches nearly every register. The best MIX fluency check there is.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.3.1 Description of MIX
TAOCP §1.3.1, exercise 19 (rated 14, recommended): what is it asking?	Time that same program in units of u.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.3.1 Description of MIX
TAOCP §1.3.1, exercise 21 (rated 24, recommended): what is it asking?	Set rJ to an arbitrary value without changing memory. A puzzle about how jumps set rJ.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.3.1 Description of MIX
TAOCP §1.3.1, exercise 22 (rated 28, recommended): what is it asking?	Compute a 13th power with minimum memory, then with minimum time. The stretch.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.3.1 Description of MIX
TAOCP §1.3.1: how many exercises, and how are they rated?	26 exercises, rated 00 to 32.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.1 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 1::1.3.1 Description of MIX
TAOCP §1.3.1: what should you be comfortable with first?	<ul><li>1.1 Algorithms</li><li>Some exposure to assembly or the TIS-100/EXAPUNKS games</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.1 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 1::1.3.1 Description of MIX
TAOCP §1.3.1: how should you work through it?	Install a MIX simulator first (GNU MDK is the common choice). Keep the instruction summary chart open. For every instruction family, write a two-line program and run it to see the registers change. Field specifications like (0:5) and (1:3) confuse everyone at first; spend time on them.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.1 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 1::1.3.1 Description of MIX
TAOCP §1.3.2 The MIX Assembly Language: what does it cover?	MIXAL, the assembly language for MIX: symbols, local labels, pseudo-operations, and worked programs including finding a maximum and printing a table of primes. It also shows how Knuth annotates programs with execution counts.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.2 cracked.guide::kind::about	cracked.guide::TAOCP Vol 1::1.3.2 The MIX Assembly Language
TAOCP §1.3.2: why does it matter?	This is where you go from reading machine instructions to writing real programs. The execution-count annotations are how Knuth turns code into exact running-time formulas.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.2 cracked.guide::kind::why	cracked.guide::TAOCP Vol 1::1.3.2 The MIX Assembly Language
MIXAL: what is it?	MIXAL (MIX Assembly Language) is the symbolic assembly language Knuth defines for writing programs for the MIX computer.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.2 cracked.guide::kind::definition	cracked.guide::TAOCP Vol 1::1.3.2 The MIX Assembly Language
MIXAL: Is MIXAL the same as MIX?	No. MIX is the machine; MIXAL is the assembly language you write MIX programs in. An assembler turns MIXAL into MIX words.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.2 cracked.guide::kind::definition	cracked.guide::TAOCP Vol 1::1.3.2 The MIX Assembly Language
MIXAL: Can I run MIXAL online?	Yes. cracked.guide/mix assembles and runs MIXAL in the browser, and grades a set of exercises from TAOCP §1.3 when you are signed in.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.2 cracked.guide::kind::definition	cracked.guide::TAOCP Vol 1::1.3.2 The MIX Assembly Language
TAOCP §1.3.2: what traps should you watch for?	<ul><li>Local symbols like 2H, 2F and 2B trip people up; F means the next one forward, B the previous one backward.</li><li>Simulator syntax can differ slightly from the book; check your simulator's manual for column and format rules.</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.2 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 1::1.3.2 The MIX Assembly Language
TAOCP §1.3.2, exercise 2 (rated 10, recommended): what is it asking?	Why the self-jump at the end of the max subroutine is not an infinite loop.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.3.2 The MIX Assembly Language
TAOCP §1.3.2, exercise 4 (rated 25, recommended): what is it asking?	Assemble the primes program by hand into numeric words. Takes less time than you fear and demystifies the assembler.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.3.2 The MIX Assembly Language
TAOCP §1.3.2, exercise 8 (rated 24, recommended): what is it asking?	Decode a short mystery program by hand without running it.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.3.2 The MIX Assembly Language
TAOCP §1.3.2, exercise 9 (rated 25, recommended): what is it asking?	Validate an instruction word with a table-driven multiway branch instead of a chain of tests.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.3.2 The MIX Assembly Language
TAOCP §1.3.2, exercise 10 (rated 31, recommended): what is it asking?	Find a saddle point in a matrix with two index registers. Graded on this site as the saddle exercise.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.3.2 The MIX Assembly Language
TAOCP §1.3.2, exercise 14 (rated 31, recommended): what is it asking?	Print a table of Easter dates, with integer arithmetic and a sneaky negative remainder. Graded as easter.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.3.2 The MIX Assembly Language
TAOCP §1.3.2, exercise 18 (rated 25): what is it asking?	Generate a Farey series with a two-term recurrence, no gcd needed. Graded as farey.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.3.2 The MIX Assembly Language
TAOCP §1.3.2, exercise 22 (rated 31): what is it asking?	Work out the Josephus elimination order with a table of links. Graded as josephus.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.3.2 The MIX Assembly Language
TAOCP §1.3.2: how many exercises, and how are they rated?	23 exercises, rated 00 to M47.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.2 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 1::1.3.2 The MIX Assembly Language
TAOCP §1.3.2: what should you be comfortable with first?	<ul><li>1.3.1 Description of MIX</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.2 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 1::1.3.2 The MIX Assembly Language
TAOCP §1.3.2: how should you work through it?	Type in the example programs and run them in the simulator, not just read them. Then change something (print a different number of primes, find the minimum) and get it working. Add the frequency counts yourself and check them against the simulator's instruction counts.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.2 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 1::1.3.2 The MIX Assembly Language
TAOCP §1.3.3 Applications to Permutations: what does it cover?	Permutations written in cycle notation, how to multiply them (two algorithms and MIX programs), and how to invert a permutation in place in memory. It closes with counting: how many cycles a random permutation has, fixed points, and inclusion and exclusion. It mixes the math from 1.2 with the programming from 1.3.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.3 cracked.guide::kind::about	cracked.guide::TAOCP Vol 1::1.3.3 Applications to Permutations
TAOCP §1.3.3: why does it matter?	In-place permutation and cycle-following are real techniques: think in-place array rotation, transposing matrices, and shuffling. The analysis also introduces counting cycles in random permutations.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.3 cracked.guide::kind::why	cracked.guide::TAOCP Vol 1::1.3.3 Applications to Permutations
TAOCP §1.3.3, a common trap: “Multiplying permutations in the wrong order.” What's the catch?	Knuth composes left to right; many textbooks do the opposite.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.3 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 1::1.3.3 Applications to Permutations
TAOCP §1.3.3: what traps should you watch for?	<ul><li>Forgetting to mark visited elements when following cycles in place.</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.3 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 1::1.3.3 Applications to Permutations
TAOCP §1.3.3, exercise 1 (rated 02): what is it asking?	Show that doubling mod 7 permutes 0 to 6 and write its cycles.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.3.3 Applications to Permutations
TAOCP §1.3.3, exercise 4 (rated 10): what is it asking?	Multiply out a product of cycles into disjoint cycles by hand.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.3.3 Applications to Permutations
TAOCP §1.3.3, exercise 5 (rated M10, recommended): what is it asking?	Count the ways to write one permutation in cycle form.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.3.3 Applications to Permutations
TAOCP §1.3.3, exercise 8 (rated 23, recommended): what is it asking?	Decide whether the right-to-left multiplication algorithm could run left to right.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.3.3 Applications to Permutations
TAOCP §1.3.3, exercise 11 (rated 15): what is it asking?	Find the rule for inverting a permutation given in cycle form.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.3.3 Applications to Permutations
TAOCP §1.3.3, exercise 13 (rated M24, recommended): what is it asking?	Prove the second in-place inversion algorithm correct.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.3.3 Applications to Permutations
TAOCP §1.3.3, exercise 34 (rated M25, recommended): what is it asking?	Swap two adjacent blocks of an array in place. The rotation trick behind many library routines.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.3.3 Applications to Permutations
TAOCP §1.3.3, exercise 12 (rated M27): what is it asking?	Transpose a non-square matrix in place by following cycles. The stretch, and genuinely useful.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.3.3 Applications to Permutations
TAOCP §1.3.3: how many exercises, and how are they rated?	36 exercises, rated 02 to HM42.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.3 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 1::1.3.3 Applications to Permutations
TAOCP §1.3.3: what should you be comfortable with first?	<ul><li>1.3.2 The MIX Assembly Language</li><li>1.2.5 Permutations and Factorials</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.3 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 1::1.3.3 Applications to Permutations
TAOCP §1.3.3: how should you work through it?	Do several cycle-notation multiplications by hand until you can do them fast. Then implement in-place inversion of a permutation array in C or Python before reading the MIX version. Compare approaches.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.3 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 1::1.3.3 Applications to Permutations
TAOCP §1.4.1 Subroutines: what does it cover?	How to package code as a subroutine in MIX: linkage, passing parameters, returning, and the trade-offs between in-line code and calls. MIX has no stack or call instruction in the modern sense, so you see the mechanics explicitly.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.1 cracked.guide::kind::about	cracked.guide::TAOCP Vol 1::1.4.1 Subroutines
TAOCP §1.4.1: why does it matter?	Calling conventions are still the glue of every compiled program. Seeing them built by hand makes stack frames, return addresses and ABIs make sense, and connects back to the call frames you built in clox.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.1 cracked.guide::kind::why	cracked.guide::TAOCP Vol 1::1.4.1 Subroutines
TAOCP §1.4.1, a common trap: “Self-modifying return jumps are normal in MIX.” What's the catch?	Do not let that surprise you; it is a product of the era.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.1 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 1::1.4.1 Subroutines
TAOCP §1.4.1, exercise 1 (rated 10): what is it asking?	Write out the interface description for one of the text's subroutines.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.4.1 Subroutines
TAOCP §1.4.1, exercise 2 (rated 10): what is it asking?	Replace a JSJ-based calling sequence with ordinary jumps.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.4.1 Subroutines
TAOCP §1.4.1, exercise 4 (rated 21, recommended): what is it asking?	Generalize the max subroutine to a strided range with extra parameters.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.4.1 Subroutines
TAOCP §1.4.1, exercise 5 (rated 21): what is it asking?	Invent subroutine linkage for a MIX without rJ.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.4.1 Subroutines
TAOCP §1.4.1, exercise 6 (rated 26, recommended): what is it asking?	Write a subroutine that mimics the MOVE instruction, with its parameters stored right after the call.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.4.1 Subroutines
TAOCP §1.4.1, exercise 7 (rated 20, recommended): what is it asking?	Explain why self-modifying code fell out of favor.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.4.1 Subroutines
TAOCP §1.4.1: how many exercises, and how are they rated?	7 exercises, rated 10 to 26.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.1 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 1::1.4.1 Subroutines
TAOCP §1.4.1: what should you be comfortable with first?	<ul><li>1.3.2 The MIX Assembly Language</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.1 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 1::1.4.1 Subroutines
TAOCP §1.4.1: how should you work through it?	Write a MIX subroutine and call it from two places. Then compare the linkage mechanism to how clox pushes CallFrames.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.1 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 1::1.4.1 Subroutines
TAOCP §1.4.2 Coroutines: what does it cover?	Coroutines: routines that call each other as equals, each resuming where it left off. Knuth shows a pipeline example where one coroutine produces characters and another consumes and transforms them.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.2 cracked.guide::kind::about	cracked.guide::TAOCP Vol 1::1.4.2 Coroutines
TAOCP §1.4.2: why does it matter?	Generators, async/await, Go's goroutines and Lua coroutines all descend from this idea. Seeing it in assembly makes the &quot;where does my state live&quot; question concrete.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.2 cracked.guide::kind::why	cracked.guide::TAOCP Vol 1::1.4.2 Coroutines
TAOCP §1.4.2, a common trap: “Thinking coroutines need threads.” What's the catch?	They do not; they are just saved resume points.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.2 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 1::1.4.2 Coroutines
TAOCP §1.4.2, exercise 2 (rated 20, recommended): what is it asking?	Predict what happens if the other coroutine runs first.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.4.2 Coroutines
TAOCP §1.4.2, exercise 3 (rated 20): what is it asking?	A true-or-false about the example's comparisons that rewards careful reading.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.4.2 Coroutines
TAOCP §1.4.2, exercise 4 (rated 20): what is it asking?	Show coroutine linkage on a real machine or language you know.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.4.2 Coroutines
TAOCP §1.4.2, exercise 5 (rated 15): what is it asking?	Make the coroutine switch preserve a register across jumps.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.4.2 Coroutines
TAOCP §1.4.2, exercise 6 (rated 22, recommended): what is it asking?	Extend coroutine linkage to three coroutines.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.4.2 Coroutines
TAOCP §1.4.2, exercise 7 (rated 30, recommended): what is it asking?	Write the reverse translator from the text's example as a MIX program. The stretch.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.4.2 Coroutines
TAOCP §1.4.2: how many exercises, and how are they rated?	7 exercises, rated 10 to 30.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.2 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 1::1.4.2 Coroutines
TAOCP §1.4.2: what should you be comfortable with first?	<ul><li>1.4.1 Subroutines</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.2 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 1::1.4.2 Coroutines
TAOCP §1.4.2: how should you work through it?	Trace the example with two columns on paper, one per coroutine, marking where control jumps. Then rewrite the example with Python generators or JavaScript generators and see how much simpler it gets.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.2 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 1::1.4.2 Coroutines
TAOCP §1.4.3 Interpretive Routines: what does it cover?	Interpreters written in MIX, culminating in a MIX simulator written in MIX itself and a trace routine that watches a program run. It covers decoding, dispatch, and the cost of interpretation.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.3 cracked.guide::kind::about	cracked.guide::TAOCP Vol 1::1.4.3 Interpretive Routines
TAOCP §1.4.3: why does it matter?	You built two interpreters with Crafting Interpreters. This section is the same idea at the machine level, and the trace routine is the ancestor of every debugger.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.3 cracked.guide::kind::why	cracked.guide::TAOCP Vol 1::1.4.3 Interpretive Routines
TAOCP §1.4.3, a common trap: “Trying to understand every line of the simulator in one sitting.” What's the catch?	Go routine by routine.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.3 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 1::1.4.3 Interpretive Routines
TAOCP §1.4.3, exercise 2 of §1.4.3.1 (rated 20): what is it asking?	Write the missing shift routine for the simulator.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.4.3 Interpretive Routines
TAOCP §1.4.3, exercise 3 of §1.4.3.1 (rated 22, recommended): what is it asking?	Write the missing MOVE routine for the simulator.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.4.3 Interpretive Routines
TAOCP §1.4.3, exercise 5 of §1.4.3.1 (rated 24, recommended): what is it asking?	Measure the slowdown of simulating two instructions against running them directly.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.4.3 Interpretive Routines
TAOCP §1.4.3, exercise 8 of §1.4.3.1 (rated 20): what is it asking?	True or false about an index register in the simulator's main loop. Practice reading someone else's code closely.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.4.3 Interpretive Routines
TAOCP §1.4.3, exercise 1 of §1.4.3.2 (rated 22): what is it asking?	Make the trace routine restore rJ when it leaves.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.4.3 Interpretive Routines
TAOCP §1.4.3, exercise 4 of §1.4.3.2 (rated 25, recommended): what is it asking?	Reason about what happens when the trace routine traces itself.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.4.3 Interpretive Routines
TAOCP §1.4.3, exercise 7 of §1.4.3.2 (rated 25, recommended): what is it asking?	Design a jump trace that records only control transfers.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.4.3 Interpretive Routines
TAOCP §1.4.3, exercise 7 of §1.4.3.1 (rated 32, recommended): what is it asking?	Make simulated I/O take simulated time instead of finishing instantly. The stretch.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.4.3 Interpretive Routines
TAOCP §1.4.3: how many exercises, and how are they rated?	15 exercises, rated 10 to 40.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.3 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 1::1.4.3 Interpretive Routines
TAOCP §1.4.3: what should you be comfortable with first?	<ul><li>1.4.1 Subroutines</li><li>Crafting Interpreters (clox dispatch loop)</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.3 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 1::1.4.3 Interpretive Routines
TAOCP §1.4.3: how should you work through it?	Map each part of Knuth's simulator to the matching part of your clox run() loop: fetch, decode, dispatch, execute. Read the simulator code slowly; it is long. The trace routine section is worth reading closely for how it intercepts each instruction.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.3 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 1::1.4.3 Interpretive Routines
TAOCP §1.4.4 Input and Output: what does it cover?	How MIX overlaps computation with slow I/O using buffers, including double buffering and buffer swapping, and the bookkeeping needed to do that safely.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.4 cracked.guide::kind::about	cracked.guide::TAOCP Vol 1::1.4.4 Input and Output
TAOCP §1.4.4: why does it matter?	Buffering is still how fast I/O works, from disk reads to network sockets to audio. The ring-buffer patterns here are the same ones you will see in kernel and driver code.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.4 cracked.guide::kind::why	cracked.guide::TAOCP Vol 1::1.4.4 Input and Output
TAOCP §1.4.4, a common trap: “Getting lost in tape and card-reader specifics.” What's the catch?	The ideas, not the devices, are the point.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.4 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 1::1.4.4 Input and Output
TAOCP §1.4.4, exercise 1 (rated 05): what is it asking?	Check whether reordering the moves and the busy wait breaks buffered input.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.4.4 Input and Output
TAOCP §1.4.4, exercise 3 (rated 22, recommended): what is it asking?	Write the buffer-swapping output routine, the mirror image of the input one.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.4.4 Input and Output
TAOCP §1.4.4, exercise 6 (rated 12): what is it asking?	Set up the input routine so it gets off to the right start. Initialization is where buffering code breaks.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.4.4 Input and Output
TAOCP §1.4.4, exercise 9 (rated 21, recommended): what is it asking?	Simulate a buffer timeline from a list of compute and I/O times.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.4.4 Input and Output
TAOCP §1.4.4, exercise 14 (rated 20, recommended): what is it asking?	What happens when a program grabs two buffers before releasing either.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.4.4 Input and Output
TAOCP §1.4.4, exercise 15 (rated 22, recommended): what is it asking?	Write a complete tape copy program with three buffers, as fast as possible.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.4.4 Input and Output
TAOCP §1.4.4, exercise 5 (rated M21, recommended): what is it asking?	Bound how much buffering can speed up a program that uses several devices.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.4.4 Input and Output
TAOCP §1.4.4, exercise 18 (rated 30, recommended): what is it asking?	Rework the buffering algorithms for a MIX with interrupts. The stretch.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::1.4.4 Input and Output
TAOCP §1.4.4: how many exercises, and how are they rated?	19 exercises, rated 05 to 40.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.4 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 1::1.4.4 Input and Output
TAOCP §1.4.4: what should you be comfortable with first?	<ul><li>1.4.1 Subroutines</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.4 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 1::1.4.4 Input and Output
TAOCP §1.4.4: how should you work through it?	Draw the buffers as boxes and simulate a few steps of producer and consumer by hand. Do not get hung up on MIX device details.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.4 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 1::1.4.4 Input and Output
TAOCP §1.4.5 History and Bibliography: what does it cover?	A short history of subroutines, coroutines, interpreters and related ideas, with pointers to the original papers.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.5 cracked.guide::kind::about	cracked.guide::TAOCP Vol 1::1.4.5 History and Bibliography
TAOCP §1.4.5: why does it matter?	Knowing where ideas came from helps you see that today's &quot;new&quot; patterns are often old. It is also a breather after a heavy chapter.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.5 cracked.guide::kind::why	cracked.guide::TAOCP Vol 1::1.4.5 History and Bibliography
TAOCP §1.4.5: what should you be comfortable with first?	<ul><li>1.4.1 to 1.4.4</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.5 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 1::1.4.5 History and Bibliography
TAOCP §1.4.5: how should you work through it?	Read it with a coffee. Then spend your remaining time on chapter 1 exercises you skipped.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.5 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 1::1.4.5 History and Bibliography
TAOCP §2.1 Introduction: what does it cover?	Chapter 2 opens by defining how Knuth represents data in memory: nodes made of fields, links (pointers), and the notation he uses for them. It walks through a small example with a pile of playing cards.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.1 cracked.guide::kind::about	cracked.guide::TAOCP Vol 1::2.1 Introduction
TAOCP §2.1: why does it matter?	This notation is used for the rest of the series. It also forces you to think about data as concrete memory layout, which is exactly what C taught you in clox.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.1 cracked.guide::kind::why	cracked.guide::TAOCP Vol 1::2.1 Introduction
TAOCP §2.1: what traps should you watch for?	<ul><li>Mixing up a link and the node it points to in Knuth's notation.</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.1 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 1::2.1 Introduction
TAOCP §2.1, exercise 1 (rated 04): what is it asking?	Follow links in the card-pile example to read off field values.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.1 Introduction
TAOCP §2.1, exercise 2 (rated 10): what is it asking?	Work out when taking an address and then dereferencing gets you back where you started.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.1 Introduction
TAOCP §2.1, exercise 3 (rated 11): what is it asking?	Pop the top card. The inverse of the text's push.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.1 Introduction
TAOCP §2.1, exercise 4 (rated 18): what is it asking?	Insert a card at the bottom of the pile, empty pile included.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.1 Introduction
TAOCP §2.1, exercise 5 (rated 21, recommended): what is it asking?	Remove the bottom card, which means walking to the node before it.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.1 Introduction
TAOCP §2.1, exercise 8 (rated 18): what is it asking?	Turn one of the text's card-pile algorithms into MIX.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.1 Introduction
TAOCP §2.1, exercise 9 (rated 23): what is it asking?	Print the pile from MIX, one card per line, with face-down cards marked.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.1 Introduction
TAOCP §2.1: how many exercises, and how are they rated?	9 exercises, rated 04 to 23.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.1 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 1::2.1 Introduction
TAOCP §2.1: what should you be comfortable with first?	<ul><li>1.3 MIX</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.1 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 1::2.1 Introduction
TAOCP §2.1: how should you work through it?	Short and important. Learn the node and field notation until you can read it without thinking. Relate it to C structs and pointers.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.1 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 1::2.1 Introduction
TAOCP §2.2.1 Stacks, Queues, and Deques: what does it cover?	The three classic linear structures defined by where you insert and delete. Knuth uses railway-switching pictures to explore which output orders a stack or deque can produce from a given input order.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.1 cracked.guide::kind::about	cracked.guide::TAOCP Vol 1::2.2.1 Stacks, Queues, and Deques
TAOCP §2.2.1: why does it matter?	Stacks and queues are the backbone of parsers, schedulers and graph search. The question of which permutations a stack can produce is a classic interview-style puzzle with a beautiful answer.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.1 cracked.guide::kind::why	cracked.guide::TAOCP Vol 1::2.2.1 Stacks, Queues, and Deques
TAOCP §2.2.1: what traps should you watch for?	<ul><li>Confusing an input-restricted deque with an output-restricted one.</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.1 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 1::2.2.1 Stacks, Queues, and Deques
TAOCP §2.2.1, exercise 1 (rated 06): what is it asking?	Check what input- and output-restricted deques can each imitate.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.2.1 Stacks, Queues, and Deques
TAOCP §2.2.1, exercise 2 (rated 15, recommended): what is it asking?	Push railroad cars through a stack by hand and see which orders you can make.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.2.1 Stacks, Queues, and Deques
TAOCP §2.2.1, exercise 3 (rated 25): what is it asking?	Characterize the push and pop strings a stack can actually carry out.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.2.1 Stacks, Queues, and Deques
TAOCP §2.2.1, exercise 6 (rated 00): what is it asking?	What a queue can do to the order. A sanity check.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.2.1 Stacks, Queues, and Deques
TAOCP §2.2.1, exercise 7 (rated 25, recommended): what is it asking?	Find permutations that separate the two kinds of restricted deque.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.2.1 Stacks, Queues, and Deques
TAOCP §2.2.1, exercise 14 (rated 26, recommended): what is it asking?	Build an efficient queue out of two stacks. The interview classic, from the source.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.2.1 Stacks, Queues, and Deques
TAOCP §2.2.1, exercise 5 (rated M28, recommended): what is it asking?	Prove the forbidden-pattern test for which permutations a stack can produce. The stretch.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.2.1 Stacks, Queues, and Deques
TAOCP §2.2.1: how many exercises, and how are they rated?	14 exercises, rated 00 to M48.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.1 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 1::2.2.1 Stacks, Queues, and Deques
TAOCP §2.2.1: what should you be comfortable with first?	<ul><li>2.1 Introduction</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.1 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 1::2.2.1 Stacks, Queues, and Deques
TAOCP §2.2.1: how should you work through it?	Draw the railway diagrams and push cars through them by hand. Then write a quick program that lists all permutations of 1..4 a stack can produce and count them. Compare with the Catalan numbers.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.1 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 1::2.2.1 Stacks, Queues, and Deques
TAOCP §2.2.2 Sequential Allocation: what does it cover?	Storing stacks and queues in contiguous memory, handling overflow, circular queues, and keeping several stacks in one shared region with a method for repacking memory when one stack runs out of room (Garwick's approach).	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.2 cracked.guide::kind::about	cracked.guide::TAOCP Vol 1::2.2.2 Sequential Allocation
TAOCP §2.2.2: why does it matter?	Arrays beat linked structures for cache performance, so contiguous allocation and growth strategies are still very relevant. Think dynamic arrays, ring buffers and arena allocators.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.2 cracked.guide::kind::why	cracked.guide::TAOCP Vol 1::2.2.2 Sequential Allocation
TAOCP §2.2.2: what traps should you watch for?	<ul><li>The classic circular-queue bug: not being able to tell full from empty.</li><li>Off-by-one on the boundary when two stacks meet.</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.2 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 1::2.2.2 Sequential Allocation
TAOCP §2.2.2, exercise 1 (rated 15, recommended): what is it asking?	Count how many items the circular queue holds before it reports overflow.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.2.2 Sequential Allocation
TAOCP §2.2.2, exercise 2 (rated 22, recommended): what is it asking?	Extend the circular queue to a full deque.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.2.2 Sequential Allocation
TAOCP §2.2.2, exercise 6 (rated 10): what is it asking?	Trace a sequence of operations on two stacks sharing memory and spot overflow.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.2.2 Sequential Allocation
TAOCP §2.2.2, exercise 7 (rated 12): what is it asking?	Can the repacking algorithm ever divide by zero.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.2.2 Sequential Allocation
TAOCP §2.2.2, exercise 16 (rated 20): what is it asking?	Can two queues, or a queue and a stack, share memory the way two stacks do.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.2.2 Sequential Allocation
TAOCP §2.2.2, exercise 19 (rated 16, recommended): what is it asking?	Rewrite the stack and queue formulas with 0-based indexing and see what gets simpler.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.2.2 Sequential Allocation
TAOCP §2.2.2, exercise 8 (rated 26, recommended): what is it asking?	Adapt the multi-stack repacking to tables that are circular queues.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.2.2 Sequential Allocation
TAOCP §2.2.2, exercise 18 (rated M30, recommended): what is it asking?	Bound the total running time of the repacking scheme. The stretch.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.2.2 Sequential Allocation
TAOCP §2.2.2: how many exercises, and how are they rated?	19 exercises, rated 10 to HM43.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.2 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 1::2.2.2 Sequential Allocation
TAOCP §2.2.2: what should you be comfortable with first?	<ul><li>2.2.1 Stacks, Queues, and Deques</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.2 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 1::2.2.2 Sequential Allocation
TAOCP §2.2.2: how should you work through it?	Implement a circular queue with an explicit full and empty test. Then implement two stacks growing toward each other in one array. The multi-stack repacking algorithm is worth tracing by hand once; the analysis can be read lightly.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.2 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 1::2.2.2 Sequential Allocation
TAOCP §2.2.3 Linked Allocation: what does it cover?	Linked lists, the available-space (free) list, and how to implement stacks and queues with links. The highlight is topological sorting: putting items in an order consistent with a set of &quot;must come before&quot; relations.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.3 cracked.guide::kind::about	cracked.guide::TAOCP Vol 1::2.2.3 Linked Allocation
TAOCP §2.2.3: why does it matter?	Topological sort runs your build system, package manager and task scheduler. Free lists are the simplest memory allocator and still used in game engines and kernels.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.3 cracked.guide::kind::why	cracked.guide::TAOCP Vol 1::2.2.3 Linked Allocation
Topological sort: what is it?	A topological sort arranges the items of a partial order (or the vertices of a directed acyclic graph) in a sequence where every item comes after all the items that must precede it.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.3 cracked.guide::kind::definition	cracked.guide::TAOCP Vol 1::2.2.3 Linked Allocation
Topological sort: Is the topological order unique?	Only when the relations force a single chain. Usually many orders are valid, and which one you get depends on how ties are broken.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.3 cracked.guide::kind::definition	cracked.guide::TAOCP Vol 1::2.2.3 Linked Allocation
TAOCP §2.2.3: what traps should you watch for?	<ul><li>Losing nodes when you forget to return them to the free list.</li><li>Topological sort with a cycle in the input: decide what your code should do.</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.3 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 1::2.2.3 Linked Allocation
TAOCP §2.2.3, exercise 1 (rated 10, recommended): what is it asking?	Why the linked push never mentions overflow in the text's notation.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.2.3 Linked Allocation
TAOCP §2.2.3, exercise 7 (rated 23): what is it asking?	Reverse a singly linked list in place. The classic.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.2.3 Linked Allocation
TAOCP §2.2.3, exercise 2 (rated 22): what is it asking?	Write a general MIX insertion subroutine with the book's calling conventions.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.2.3 Linked Allocation
TAOCP §2.2.3, exercise 11 (rated 24, recommended): what is it asking?	List every valid topological order for a small example.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.2.3 Linked Allocation
TAOCP §2.2.3, exercise 17 (rated 21, recommended): what is it asking?	Run the topological sort by hand on the text's input.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.2.3 Linked Allocation
TAOCP §2.2.3, exercise 20 (rated 24, recommended): what is it asking?	Swap the queue inside topological sort for a stack and compare the results.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.2.3 Linked Allocation
TAOCP §2.2.3, exercise 29 (rated 21, recommended): what is it asking?	Return a whole list to the free list as fast as possible.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.2.3 Linked Allocation
TAOCP §2.2.3, exercise 23 (rated 27, recommended): what is it asking?	Make topological sort print an actual cycle when it gets stuck. The stretch, and a feature every build tool needs.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.2.3 Linked Allocation
TAOCP §2.2.3: how many exercises, and how are they rated?	30 exercises, rated 10 to M48.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.3 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 1::2.2.3 Linked Allocation
TAOCP §2.2.3: what should you be comfortable with first?	<ul><li>2.2.2 Sequential Allocation</li><li>C pointers (clox)</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.3 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 1::2.2.3 Linked Allocation
TAOCP §2.2.3: how should you work through it?	This is a long and very rewarding section. Implement the free-list allocator in C. Then implement Knuth's topological sort algorithm from the text, run it on a small dependency graph from a real project, and check the output order.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.3 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 1::2.2.3 Linked Allocation
TAOCP §2.2.4 Circular Lists: what does it cover?	Lists whose last node points back to the first, which makes some operations simpler. The main example is adding and multiplying polynomials stored as circular lists of terms.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.4 cracked.guide::kind::about	cracked.guide::TAOCP Vol 1::2.2.4 Circular Lists
TAOCP §2.2.4: why does it matter?	Circular lists are used in schedulers, LRU caches and buffer rings. The polynomial example is a great exercise in pointer surgery.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.4 cracked.guide::kind::why	cracked.guide::TAOCP Vol 1::2.2.4 Circular Lists
TAOCP §2.2.4: what traps should you watch for?	<ul><li>Infinite loops when traversing a circular list without a sentinel or stop condition.</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.4 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 1::2.2.4 Circular Lists
TAOCP §2.2.4, exercise 3 (rated 20, recommended): what is it asking?	Work out what concatenation does when both pointers are in the same circular list.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.2.4 Circular Lists
TAOCP §2.2.4, exercise 5 (rated 21, recommended): what is it asking?	Reverse the links of a circular list.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.2.4 Circular Lists
TAOCP §2.2.4, exercise 8 (rated 10, recommended): what is it asking?	Why the polynomial addition loop keeps a trailing pointer.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.2.4 Circular Lists
TAOCP §2.2.4, exercise 9 (rated 23, recommended): what is it asking?	Check whether polynomial add and multiply survive aliased arguments. Aliasing bugs, early.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.2.4 Circular Lists
TAOCP §2.2.4, exercise 13 (rated 20): what is it asking?	Write a MIX subroutine that returns a whole polynomial to the free list.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.2.4 Circular Lists
TAOCP §2.2.4, exercise 17 (rated 22, recommended): what is it asking?	Argue why circular lists beat null-terminated ones for polynomials.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.2.4 Circular Lists
TAOCP §2.2.4, exercise 15 (rated 24): what is it asking?	Write polynomial multiplication as a MIX subroutine.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.2.4 Circular Lists
TAOCP §2.2.4, exercise 18 (rated 25, recommended): what is it asking?	Traverse a list in both directions with only one link field per node. The stretch.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.2.4 Circular Lists
TAOCP §2.2.4: how many exercises, and how are they rated?	18 exercises, rated 10 to M28.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.4 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 1::2.2.4 Circular Lists
TAOCP §2.2.4: what should you be comfortable with first?	<ul><li>2.2.3 Linked Allocation</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.4 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 1::2.2.4 Circular Lists
TAOCP §2.2.4: how should you work through it?	Implement polynomial addition with circular linked lists in C, following the algorithm in the text. Test with polynomials that cancel terms.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.4 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 1::2.2.4 Circular Lists
TAOCP §2.2.5 Doubly Linked Lists: what does it cover?	Lists with links in both directions, making deletion and insertion anywhere cheap. Knuth illustrates them with a detailed discrete-event simulation of an elevator system.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.5 cracked.guide::kind::about	cracked.guide::TAOCP Vol 1::2.2.5 Doubly Linked Lists
TAOCP §2.2.5: why does it matter?	Doubly linked lists underpin LRU caches and editor buffers, and the elevator simulation is a crash course in discrete-event simulation, a technique still used for modeling systems.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.5 cracked.guide::kind::why	cracked.guide::TAOCP Vol 1::2.2.5 Doubly Linked Lists
TAOCP §2.2.5, a common trap: “Updating only one of the two links on insert or delete.” What's the catch?	Write the four pointer updates down before coding them.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.5 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 1::2.2.5 Doubly Linked Lists
TAOCP §2.2.5, exercise 1 (rated 21): what is it asking?	Spell out insertion and deletion at the left end of a doubly linked list.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.2.5 Doubly Linked Lists
TAOCP §2.2.5, exercise 2 (rated 22, recommended): what is it asking?	Explain why a singly linked list cannot be an efficient general deque.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.2.5 Doubly Linked Lists
TAOCP §2.2.5, exercise 3 (rated 22, recommended): what is it asking?	Design a button-pressing experiment that proves the elevator really keeps three separate call flags per floor.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.2.5 Doubly Linked Lists
TAOCP §2.2.5, exercise 5 (rated 20): what is it asking?	Trace how one change to the arrival table changes the elevator's moves.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.2.5 Doubly Linked Lists
TAOCP §2.2.5, exercise 8 (rated 21): what is it asking?	Write the elevator step the text left out, in MIX.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.2.5 Doubly Linked Lists
TAOCP §2.2.5, exercise 11 (rated 21, recommended): what is it asking?	Simulate simultaneous updates of many variables cheaply when only a few change per step.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.2.5 Doubly Linked Lists
TAOCP §2.2.5, exercise 12 (rated 22, recommended): what is it asking?	Explain why the simulation uses doubly linked lists.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.2.5 Doubly Linked Lists
TAOCP §2.2.5: how many exercises, and how are they rated?	12 exercises, rated 20 to 40.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.5 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 1::2.2.5 Doubly Linked Lists
TAOCP §2.2.5: what should you be comfortable with first?	<ul><li>2.2.4 Circular Lists</li><li>1.4.2 Coroutines</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.5 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 1::2.2.5 Doubly Linked Lists
TAOCP §2.2.5: how should you work through it?	Implement a doubly linked list with a header node and test insert and delete at all positions. The elevator simulation is long: read it for structure, focus on how the event list works, and do not try to trace every MIX line.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.5 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 1::2.2.5 Doubly Linked Lists
TAOCP §2.2.6 Arrays and Orthogonal Lists: what does it cover?	Storing multidimensional arrays in memory, including triangular arrays, then sparse matrices stored as lists linked across both rows and columns, with a pivot step from matrix computation as the example.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.6 cracked.guide::kind::about	cracked.guide::TAOCP Vol 1::2.2.6 Arrays and Orthogonal Lists
TAOCP §2.2.6: why does it matter?	Row-major versus column-major layout decides cache behavior in numeric code. Sparse matrix storage is how graph algorithms and scientific computing handle huge, mostly empty data.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.6 cracked.guide::kind::why	cracked.guide::TAOCP Vol 1::2.2.6 Arrays and Orthogonal Lists
TAOCP §2.2.6, a common trap: “Index arithmetic errors with triangular arrays.” What's the catch?	Test on a 4x4 case.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.6 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 1::2.2.6 Arrays and Orthogonal Lists
TAOCP §2.2.6, exercise 1 (rated 17): what is it asking?	Address formula for a two-dimensional array whose nodes are two words long.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.2.6 Arrays and Orthogonal Lists
TAOCP §2.2.6, exercise 2 (rated 21, recommended): what is it asking?	Generalize the array address formula to arbitrary index bounds.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.2.6 Arrays and Orthogonal Lists
TAOCP §2.2.6, exercise 4 (rated 22): what is it asking?	Derive the address formula for an upper triangular array.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.2.6 Arrays and Orthogonal Lists
TAOCP §2.2.6, exercise 11 (rated 11): what is it asking?	Storage cost of a sparse matrix in the orthogonal list form.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.2.6 Arrays and Orthogonal Lists
TAOCP §2.2.6, exercise 12 (rated 20, recommended): what is it asking?	Track the values the pivot algorithm holds at one step.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.2.6 Arrays and Orthogonal Lists
TAOCP §2.2.6, exercise 13 (rated 22, recommended): what is it asking?	Why the sparse matrix uses circular lists, and whether it has to.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.2.6 Arrays and Orthogonal Lists
TAOCP §2.2.6, exercise 24 (rated 25, recommended): what is it asking?	Get zero-on-first-read array behavior without clearing memory. The sparse array trick.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.2.6 Arrays and Orthogonal Lists
TAOCP §2.2.6, exercise 15 (rated 29, recommended): what is it asking?	Write the sparse pivot algorithm in MIXAL with floating point. The stretch.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.2.6 Arrays and Orthogonal Lists
TAOCP §2.2.6: how many exercises, and how are they rated?	24 exercises, rated 11 to 33.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.6 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 1::2.2.6 Arrays and Orthogonal Lists
TAOCP §2.2.6: what should you be comfortable with first?	<ul><li>2.2.5 Doubly Linked Lists</li><li>Basic matrices</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.6 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 1::2.2.6 Arrays and Orthogonal Lists
TAOCP §2.2.6: how should you work through it?	Derive the address formula for row-major storage yourself. Then implement the orthogonal list representation for a tiny sparse matrix and check it by printing rows and columns.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.2.6 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 1::2.2.6 Arrays and Orthogonal Lists
TAOCP §2.3.1 Traversing Binary Trees: what does it cover?	Binary trees, the three traversal orders (preorder, inorder, postorder), traversal with an explicit stack instead of recursion, and threaded trees where spare null links point to inorder successors.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.1 cracked.guide::kind::about	cracked.guide::TAOCP Vol 1::2.3.1 Traversing Binary Trees
TAOCP §2.3.1: why does it matter?	Tree traversal is everywhere: ASTs in your interpreters, DOM trees, file systems. Converting recursion to an explicit stack is a practical skill when recursion depth is a risk.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.1 cracked.guide::kind::why	cracked.guide::TAOCP Vol 1::2.3.1 Traversing Binary Trees
TAOCP §2.3.1, a common trap: “Threads and real links look identical without the tag bit.” What's the catch?	Keep the tag.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.1 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 1::2.3.1 Traversing Binary Trees
TAOCP §2.3.1: what traps should you watch for?	<ul><li>Confusing the order in which you push left and right children.</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.1 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 1::2.3.1 Traversing Binary Trees
TAOCP §2.3.1, exercise 21 of §2.3 (rated M22): what is it asking?	From the 2.3 opener: count leaves from the numbers of nodes of each degree.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.3.1 Traversing Binary Trees
TAOCP §2.3.1, exercise 2 (rated 11): what is it asking?	List a small tree's nodes in all three orders.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.3.1 Traversing Binary Trees
TAOCP §2.3.1, exercise 4 (rated 20, recommended): what is it asking?	Look at a mirror-image traversal order and relate it to the standard ones.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.3.1 Traversing Binary Trees
TAOCP §2.3.1, exercise 7 (rated 22): what is it asking?	Rebuild a binary tree from its preorder and inorder. The interview favorite, from the source.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.3.1 Traversing Binary Trees
TAOCP §2.3.1, exercise 13 (rated 24): what is it asking?	Write a stack-based postorder traversal. The tricky one.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.3.1 Traversing Binary Trees
TAOCP §2.3.1, exercise 17 (rated 22, recommended): what is it asking?	Find the preorder successor in a threaded tree.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.3.1 Traversing Binary Trees
TAOCP §2.3.1, exercise 30 (rated 22, recommended): what is it asking?	Thread an unthreaded tree.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.3.1 Traversing Binary Trees
TAOCP §2.3.1, exercise 21 (rated 33, recommended): what is it asking?	Traverse in inorder with no stack by temporarily rewiring links. The stretch.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.3.1 Traversing Binary Trees
TAOCP §2.3.1: how many exercises, and how are they rated?	37 exercises, rated 00 to HM41.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.1 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 1::2.3.1 Traversing Binary Trees
TAOCP §2.3.1: what should you be comfortable with first?	<ul><li>2.2.3 Linked Allocation</li><li>Recursion</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.1 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 1::2.3.1 Traversing Binary Trees
TAOCP §2.3.1: how should you work through it?	Read the opening pages of 2.3 (Trees) first: the definitions, the drawing conventions, Dewey notation, forests and Lists. The curriculum has no separate week for them and 2.3.1 assumes them. Then implement inorder traversal with an explicit stack and confirm it matches the recursive version on random trees. Build a threaded tree and walk it without any stack. Compare to the AST visitors from jlox.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.1 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 1::2.3.1 Traversing Binary Trees
TAOCP §2.3.2 Binary Tree Representation of Trees: what does it cover?	Any general tree or forest can be stored as a binary tree using the &quot;first child, next sibling&quot; trick. Knuth applies it to symbolic differentiation of algebraic formulas stored as trees.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.2 cracked.guide::kind::about	cracked.guide::TAOCP Vol 1::2.3.2 Binary Tree Representation of Trees
TAOCP §2.3.2: why does it matter?	The child-sibling representation is how many compilers and file systems store variable-arity trees. Symbolic differentiation is a mini compiler pass, so it should feel familiar after Crafting Interpreters.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.2 cracked.guide::kind::why	cracked.guide::TAOCP Vol 1::2.3.2 Binary Tree Representation of Trees
TAOCP §2.3.2, a common trap: “Forgetting that preorder of the forest equals preorder of the binary tree, but postorder of the forest corresponds to inorder of the binary tree.” What's the catch?	Check it on an example.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.2 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 1::2.3.2 Binary Tree Representation of Trees
TAOCP §2.3.2, exercise 1 (rated 20, recommended): what is it asking?	Define the reverse mapping, from a binary tree back to a forest.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.3.2 Binary Tree Representation of Trees
TAOCP §2.3.2, exercise 2 (rated 20, recommended): what is it asking?	Relate Dewey numbers in a forest to those in its binary tree.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.3.2 Binary Tree Representation of Trees
TAOCP §2.3.2, exercise 4 (rated 19): what is it asking?	True or false on leaf positions in preorder and postorder.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.3.2 Binary Tree Representation of Trees
TAOCP §2.3.2, exercise 11 (rated 15): what is it asking?	Draw the trees the differentiator would store for a small formula.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.3.2 Binary Tree Representation of Trees
TAOCP §2.3.2, exercise 18 (rated 25, recommended): what is it asking?	Turn a parent table into a preorder doubly linked list efficiently.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.3.2 Binary Tree Representation of Trees
TAOCP §2.3.2, exercise 20 (rated M22, recommended): what is it asking?	Prove the ancestor test using preorder and postorder positions. A trick real tree queries use.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.3.2 Binary Tree Representation of Trees
TAOCP §2.3.2, exercise 13 (rated 26, recommended): what is it asking?	Write the tree copy subroutine in MIX for the differentiator.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.3.2 Binary Tree Representation of Trees
TAOCP §2.3.2, exercise 22 (rated M26, recommended): what is it asking?	Tree embedding, a partial order on trees. The stretch.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.3.2 Binary Tree Representation of Trees
TAOCP §2.3.2: how many exercises, and how are they rated?	22 exercises, rated 15 to M40.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.2 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 1::2.3.2 Binary Tree Representation of Trees
TAOCP §2.3.2: what should you be comfortable with first?	<ul><li>2.3.1 Traversing Binary Trees</li><li>Basic derivatives</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.2 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 1::2.3.2 Binary Tree Representation of Trees
TAOCP §2.3.2: how should you work through it?	Convert a few small forests to binary trees by hand. Then implement a tiny symbolic differentiator over an expression tree in any language. It is a fun weekend project.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.2 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 1::2.3.2 Binary Tree Representation of Trees
TAOCP §2.3.3 Other Representations of Trees: what does it cover?	Alternative ways to store trees: sequential layouts in preorder or level order with tags or degrees, parent links only, and triply linked trees. It covers evaluating a function bottom-up over a tree, the algorithm for processing equivalence relations by keeping trees with parent pointers (the ancestor of union-find), and adding polynomials stored as trees.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.3 cracked.guide::kind::about	cracked.guide::TAOCP Vol 1::2.3.3 Other Representations of Trees
TAOCP §2.3.3: why does it matter?	Union-find is a workhorse (Kruskal's algorithm, connected components, type inference). Compact tree encodings matter for serialization and succinct data structures.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.3 cracked.guide::kind::why	cracked.guide::TAOCP Vol 1::2.3.3 Other Representations of Trees
TAOCP §2.3.3: what traps should you watch for?	<ul><li>Forgetting to find the roots before linking two trees.</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.3 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 1::2.3.3 Other Representations of Trees
TAOCP §2.3.3, exercise 1 (rated 20, recommended): what is it asking?	Decide whether the left links can be rebuilt from a level-order layout with tags only.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.3.3 Other Representations of Trees
TAOCP §2.3.3, exercise 4 (rated 18): what is it asking?	Count the wasted null links and compare representations.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.3.3 Other Representations of Trees
TAOCP §2.3.3, exercise 6 (rated 24, recommended): what is it asking?	Fill in child and sibling links when only parent links exist.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.3.3 Other Representations of Trees
TAOCP §2.3.3, exercise 8 (rated 15): what is it asking?	Use the equivalence forest to answer whether two items are equivalent.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.3.3 Other Representations of Trees
TAOCP §2.3.3, exercise 9 (rated 20): what is it asking?	Trace the equivalence algorithm on the text's input.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.3.3 Other Representations of Trees
TAOCP §2.3.3, exercise 11 (rated 24, recommended): what is it asking?	Handle Fortran-style EQUIVALENCE declarations with the tree method.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.3.3 Other Representations of Trees
TAOCP §2.3.3, exercise 17 (rated 25, recommended): what is it asking?	Evaluate a top-down attribute over a tree stored sequentially.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.3.3 Other Representations of Trees
TAOCP §2.3.3, exercise 10 (rated 28): what is it asking?	Fix the equivalence algorithm's quadratic worst case. The stretch: you will reinvent part of union-find.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.3.3 Other Representations of Trees
TAOCP §2.3.3: how many exercises, and how are they rated?	19 exercises, rated 15 to 40.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.3 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 1::2.3.3 Other Representations of Trees
TAOCP §2.3.3: what should you be comfortable with first?	<ul><li>2.3.2 Binary Tree Representation of Trees</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.3 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 1::2.3.3 Other Representations of Trees
TAOCP §2.3.3: how should you work through it?	Implement the equivalence algorithm with parent pointers, then add path compression and union by size yourself and measure the speedup. The sequential representations are quick reads.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.3 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 1::2.3.3 Other Representations of Trees
TAOCP §2.3.4 Basic Mathematical Properties of Trees (part 1): what does it cover?	Part 1 covers the first three subsections: free trees (connected graphs without cycles) and spanning trees, including using Kirchhoff's law to count how often each part of a flowchart runs; oriented trees and directed graphs, including Euler circuits; and the infinity lemma about infinite trees with finite branching.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.4 cracked.guide::kind::about	cracked.guide::TAOCP Vol 1::2.3.4 Basic Mathematical Properties of Trees (part 1)
TAOCP §2.3.4 (part 1): why does it matter?	This is the bridge between data-structure trees and graph theory. Spanning trees show up in networking, clustering and circuit design.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.4 cracked.guide::kind::why	cracked.guide::TAOCP Vol 1::2.3.4 Basic Mathematical Properties of Trees (part 1)
TAOCP §2.3.4 (part 1): what traps should you watch for?	<ul><li>Mixing up free trees (no root) and oriented trees (with a root and direction).</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.4 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 1::2.3.4 Basic Mathematical Properties of Trees (part 1)
TAOCP §2.3.4 (part 1), exercise 2 of §2.3.4.1 (rated M20): what is it asking?	Show any path can be trimmed down to a simple path.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.3.4 Basic Mathematical Properties of Trees (part 1)
TAOCP §2.3.4 (part 1), exercise 10 of §2.3.4.1 (rated 16): what is it asking?	Connect n terminals with as few wires as possible, and see why a spanning tree is the answer.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.3.4 Basic Mathematical Properties of Trees (part 1)
TAOCP §2.3.4 (part 1), exercise 6 of §2.3.4.1 (rated M27, recommended): what is it asking?	Pick a spanning tree out of an edge list efficiently, or report there is none.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.3.4 Basic Mathematical Properties of Trees (part 1)
TAOCP §2.3.4 (part 1), exercise 4 of §2.3.4.2 (rated M20, recommended): what is it asking?	Show a directed graph can be topologically sorted exactly when it has no oriented cycles.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.3.4 Basic Mathematical Properties of Trees (part 1)
TAOCP §2.3.4 (part 1), exercise 7 of §2.3.4.2 (rated M22, recommended): what is it asking?	Decide whether a condition in the definition of an oriented tree can be dropped.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.3.4 Basic Mathematical Properties of Trees (part 1)
TAOCP §2.3.4 (part 1), exercise 10 of §2.3.4.2 (rated 22): what is it asking?	Re-root a tree stored as a parent table.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.3.4 Basic Mathematical Properties of Trees (part 1)
TAOCP §2.3.4 (part 1), exercise 3 of §2.3.4.3 (rated M23, recommended): what is it asking?	Quadrant tiling versus plane tiling. An infinity lemma workout.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.3.4 Basic Mathematical Properties of Trees (part 1)
TAOCP §2.3.4 (part 1), exercise 12 of §2.3.4.1 (rated 29, recommended): what is it asking?	Turn a minimum spanning tree method into an implementable algorithm with real data structures. The stretch.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.3.4 Basic Mathematical Properties of Trees (part 1)
TAOCP §2.3.4 (part 1): how many exercises, and how are they rated?	49 exercises, rated M10 to HM40.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.4 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 1::2.3.4 Basic Mathematical Properties of Trees (part 1)
TAOCP §2.3.4 (part 1): what should you be comfortable with first?	<ul><li>2.3.1 to 2.3.3</li><li>1.2.1 Mathematical Induction</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.4 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 1::2.3.4 Basic Mathematical Properties of Trees (part 1)
TAOCP §2.3.4 (part 1): how should you work through it?	Draw lots of small graphs. Prove to yourself that a tree on n vertices has n - 1 edges. Read 2.3.4.1 to 2.3.4.3 carefully; the infinity lemma is short but subtle.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.4 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 1::2.3.4 Basic Mathematical Properties of Trees (part 1)
TAOCP §2.3.4 Basic Mathematical Properties of Trees (part 2): what does it cover?	Part 2 covers counting trees (binary trees, oriented and free trees, labeled trees), path length and its role in measuring tree cost, Huffman's method for building optimal weighted trees, and the section's history, which comes with a few exercises on polygon dissections.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.4 cracked.guide::kind::about	cracked.guide::TAOCP Vol 1::2.3.4 Basic Mathematical Properties of Trees (part 2)
TAOCP §2.3.4 (part 2): why does it matter?	Counting trees gives you Catalan numbers, which pop up everywhere. Huffman coding is used inside gzip, PNG and JPEG.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.4 cracked.guide::kind::why	cracked.guide::TAOCP Vol 1::2.3.4 Basic Mathematical Properties of Trees (part 2)
TAOCP §2.3.4 (part 2), a common trap: “Confusing internal and external path length.” What's the catch?	Write out both for a small tree.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.4 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 1::2.3.4 Basic Mathematical Properties of Trees (part 2)
TAOCP §2.3.4 (part 2), exercise 8 of §2.3.4.4 (rated 20): what is it asking?	Draw all free trees on six vertices and mark their centroids.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.3.4 Basic Mathematical Properties of Trees (part 2)
TAOCP §2.3.4 (part 2), exercise 13 of §2.3.4.4 (rated 15): what is it asking?	Decode an oriented tree from its canonical sequence.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.3.4 Basic Mathematical Properties of Trees (part 2)
TAOCP §2.3.4 (part 2), exercise 16 of §2.3.4.4 (rated 25): what is it asking?	Convert that canonical sequence to parent links efficiently.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.3.4 Basic Mathematical Properties of Trees (part 2)
TAOCP §2.3.4 (part 2), exercise 22 of §2.3.4.4 (rated M20): what is it asking?	Count the labeled free trees on n vertices.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.3.4 Basic Mathematical Properties of Trees (part 2)
TAOCP §2.3.4 (part 2), exercise 2 of §2.3.4.5 (rated 17): what is it asking?	Build a minimum weighted path length tree by hand with Huffman's method.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.3.4 Basic Mathematical Properties of Trees (part 2)
TAOCP §2.3.4 (part 2), exercise 13 of §2.3.4.5 (rated 22): what is it asking?	Implement Huffman's method on sorted weights with fewer than 2m comparisons.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.3.4 Basic Mathematical Properties of Trees (part 2)
TAOCP §2.3.4 (part 2), exercise 1 of §2.3.4.6 (rated 21, recommended): what is it asking?	Match binary trees with triangulations of a polygon.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.3.4 Basic Mathematical Properties of Trees (part 2)
TAOCP §2.3.4 (part 2), exercise 11 of §2.3.4.4 (rated M28, recommended): what is it asking?	Count t-ary trees by generalizing the binary tree count. The stretch.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.3.4 Basic Mathematical Properties of Trees (part 2)
TAOCP §2.3.4 (part 2): how many exercises, and how are they rated?	54 exercises, rated 10 to HM40.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.4 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 1::2.3.4 Basic Mathematical Properties of Trees (part 2)
TAOCP §2.3.4 (part 2): what should you be comfortable with first?	<ul><li>2.3.4 part 1</li><li>1.2.9 Generating Functions</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.4 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 1::2.3.4 Basic Mathematical Properties of Trees (part 2)
TAOCP §2.3.4 (part 2): how should you work through it?	Derive the count of binary trees with n nodes using a generating function before reading Knuth's derivation. Implement Huffman coding with a priority queue and compress a text file.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.4 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 1::2.3.4 Basic Mathematical Properties of Trees (part 2)
TAOCP §2.3.5 Lists and Garbage Collection: what does it cover?	General lists that can share sublists and even contain themselves, reference counting, and garbage collection by marking reachable nodes. It includes the famous trick of marking without an auxiliary stack by temporarily reversing links (Schorr-Waite).	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.5 cracked.guide::kind::about	cracked.guide::TAOCP Vol 1::2.3.5 Lists and Garbage Collection
TAOCP §2.3.5: why does it matter?	You wrote a mark-sweep collector for clox in chapter 26 of Crafting Interpreters. This section shows the same problem with tight memory, and link reversal is a classic example of clever pointer manipulation.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.5 cracked.guide::kind::why	cracked.guide::TAOCP Vol 1::2.3.5 Lists and Garbage Collection
TAOCP §2.3.5, a common trap: “Reference counting cannot reclaim cycles.” What's the catch?	Knuth explains why; make sure you can too.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.5 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 1::2.3.5 Lists and Garbage Collection
TAOCP §2.3.5: what traps should you watch for?	<ul><li>In link reversal, forgetting to restore a link on the way back up.</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.5 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 1::2.3.5 Lists and Garbage Collection
TAOCP §2.3.5, exercise 1 (rated M21, recommended): what is it asking?	Describe List structures as directed graphs.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.3.5 Lists and Garbage Collection
TAOCP §2.3.5, exercise 6 (rated 00): what is it asking?	Where the cost term proportional to total memory comes from in garbage collection.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.3.5 Lists and Garbage Collection
TAOCP §2.3.5, exercise 5 (rated 25): what is it asking?	Combine a small fixed stack with link reversal for marking. Close to what real collectors do.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.3.5 Lists and Garbage Collection
TAOCP §2.3.5, exercise 7 (rated 24): what is it asking?	Marking without a stack when nodes have fewer spare fields.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.3.5 Lists and Garbage Collection
TAOCP §2.3.5, exercise 8 (rated 27, recommended): what is it asking?	Link-reversal marking for nodes of variable size.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.3.5 Lists and Garbage Collection
TAOCP §2.3.5, exercise 9 (rated 28, recommended): what is it asking?	Compact live nodes to one end of memory and fix up the links.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.3.5 Lists and Garbage Collection
TAOCP §2.3.5, exercise 10 (rated 28, recommended): what is it asking?	Copy a List structure that shares and even contains itself.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.3.5 Lists and Garbage Collection
TAOCP §2.3.5, exercise 12 (rated 30): what is it asking?	Make garbage collection safe for real-time use. The stretch: incremental collection before it had a name.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.3.5 Lists and Garbage Collection
TAOCP §2.3.5: how many exercises, and how are they rated?	12 exercises, rated 00 to M30.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.5 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 1::2.3.5 Lists and Garbage Collection
TAOCP §2.3.5: what should you be comfortable with first?	<ul><li>2.3.1 Traversing Binary Trees</li><li>Crafting Interpreters ch 26 (Garbage Collection)</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.5 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 1::2.3.5 Lists and Garbage Collection
TAOCP §2.3.5: how should you work through it?	Compare Knuth's marking algorithms to your clox gray stack. Trace the link-reversal marking algorithm on a small graph on paper; it is tricky and worth drawing every step.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.3.5 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 1::2.3.5 Lists and Garbage Collection
TAOCP §2.4 Multilinked Structures: what does it cover?	Nodes that belong to several lists at once, illustrated by how a compiler for a COBOL-like language stores nested data declarations and implements a &quot;move corresponding fields&quot; operation.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.4 cracked.guide::kind::about	cracked.guide::TAOCP Vol 1::2.4 Multilinked Structures
TAOCP §2.4: why does it matter?	Symbol tables, ORMs and many in-memory databases use multilinked nodes. It is also a peek at real compiler engineering from the 1960s.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.4 cracked.guide::kind::why	cracked.guide::TAOCP Vol 1::2.4 Multilinked Structures
TAOCP §2.4, a common trap: “Getting lost in COBOL semantics.” What's the catch?	Focus on the data structure.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.4 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 1::2.4 Multilinked Structures
TAOCP §2.4, exercise 1 (rated 00): what is it asking?	Which traversal order the level-numbered declarations follow.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.4 Multilinked Structures
TAOCP §2.4, exercise 7 (rated 15): what is it asking?	Work out what one move-corresponding statement does on the text's data.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.4 Multilinked Structures
TAOCP §2.4, exercise 8 (rated 10): what is it asking?	When moving corresponding fields is the same as a plain move.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.4 Multilinked Structures
TAOCP §2.4, exercise 3 (rated 22): what is it asking?	Handle arbitrary level-number sequences in the table builder.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.4 Multilinked Structures
TAOCP §2.4, exercise 4 (rated 26, recommended): what is it asking?	Make the table builder reject one class of malformed declarations.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.4 Multilinked Structures
TAOCP §2.4, exercise 11 (rated 23, recommended): what is it asking?	Find extra links or strategy changes that speed up the lookups.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.4 Multilinked Structures
TAOCP §2.4, exercise 13 (rated 24, recommended): what is it asking?	Rewrite the table builder for a compact sequential format.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.4 Multilinked Structures
TAOCP §2.4, exercise 14 (rated 28, recommended): what is it asking?	Rewrite the corresponding-fields search for that format. The stretch.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.4 Multilinked Structures
TAOCP §2.4: how many exercises, and how are they rated?	15 exercises, rated 00 to 28.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.4 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 1::2.4 Multilinked Structures
TAOCP §2.4: what should you be comfortable with first?	<ul><li>2.3 Trees</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.4 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 1::2.4 Multilinked Structures
TAOCP §2.4: how should you work through it?	Read the problem statement carefully and sketch the data layout yourself before reading Knuth's design. The details of COBOL are not important; the structure design is.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.4 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 1::2.4 Multilinked Structures
TAOCP §2.5 Dynamic Storage Allocation: what does it cover?	How malloc-style allocators work: first-fit versus best-fit, splitting and merging free blocks, boundary tags for fast coalescing, the buddy system, and simulation results on fragmentation, including Knuth's fifty-percent rule about how many free blocks to expect.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.5 cracked.guide::kind::about	cracked.guide::TAOCP Vol 1::2.5 Dynamic Storage Allocation
TAOCP §2.5: why does it matter?	Every malloc, every arena and every slab allocator uses these ideas. Understanding fragmentation helps you debug memory blowups in long-running services.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.5 cracked.guide::kind::why	cracked.guide::TAOCP Vol 1::2.5 Dynamic Storage Allocation
TAOCP §2.5, a common trap: “Alignment.” What's the catch?	Real allocators must return aligned addresses; Knuth's model ignores this.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.5 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 1::2.5 Dynamic Storage Allocation
TAOCP §2.5, a common trap: “Assuming best-fit always beats first-fit.” What's the catch?	The simulations in the text say otherwise.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.5 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 1::2.5 Dynamic Storage Allocation
TAOCP §2.5: what traps should you watch for?	<ul><li>Forgetting to merge with both neighbors on free.</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.5 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 1::2.5 Dynamic Storage Allocation
TAOCP §2.5, exercise 7 (rated 10): what is it asking?	Construct a case where best-fit beats first-fit.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.5 Dynamic Storage Allocation
TAOCP §2.5, exercise 5 (rated 18, recommended): what is it asking?	Judge a proposed threshold for splitting blocks in first-fit.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.5 Dynamic Storage Allocation
TAOCP §2.5, exercise 6 (rated 23, recommended): what is it asking?	Next fit: start each search where the last one stopped.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.5 Dynamic Storage Allocation
TAOCP §2.5, exercise 12 (rated 20, recommended): what is it asking?	Combine boundary tags, the split threshold and next fit in one allocator.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.5 Dynamic Storage Allocation
TAOCP §2.5, exercise 23 (rated 05): what is it asking?	Compute buddy addresses by flipping one bit.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.5 Dynamic Storage Allocation
TAOCP §2.5, exercise 26 (rated 21, recommended): what is it asking?	Make the buddy system work when memory is not a power of two.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.5 Dynamic Storage Allocation
TAOCP §2.5, exercise 36 (rated 20, recommended): what is it asking?	Prove a seating strategy never fails at a lunch counter. A fragmentation puzzle in disguise.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.5 Dynamic Storage Allocation
TAOCP §2.5, exercise 33 (rated 28, recommended): what is it asking?	Garbage collection with compaction for variable-size nodes. The stretch.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::2.5 Dynamic Storage Allocation
TAOCP §2.5: how many exercises, and how are they rated?	44 exercises, rated 00 to HM50.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.5 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 1::2.5 Dynamic Storage Allocation
TAOCP §2.5: what should you be comfortable with first?	<ul><li>2.2.3 Linked Allocation</li><li>C malloc/free (clox)</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.5 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 1::2.5 Dynamic Storage Allocation
TAOCP §2.5: how should you work through it?	Implement a tiny first-fit allocator with boundary tags over a static byte array in C, then a buddy allocator. Write a test that does random allocate/free and checks no block overlaps.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.5 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 1::2.5 Dynamic Storage Allocation
TAOCP §2.6 History and Bibliography: what does it cover?	The history of lists, trees and storage allocation, with references to the original work.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.6 cracked.guide::kind::about	cracked.guide::TAOCP Vol 1::2.6 History and Bibliography
TAOCP §2.6: why does it matter?	A quick look at how these structures were invented, and a breather before the Vol 1 review.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.6 cracked.guide::kind::why	cracked.guide::TAOCP Vol 1::2.6 History and Bibliography
TAOCP §2.6: what should you be comfortable with first?	<ul><li>Chapter 2</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.6 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 1::2.6 History and Bibliography
TAOCP §2.6: how should you work through it?	Read it in one sitting.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::2.6 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 1::2.6 History and Bibliography
TAOCP Vol 1 review: what does it cover?	A review week for all of Volume 1: the mathematical preliminaries, MIX, and information structures.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::vol_1_review cracked.guide::kind::about	cracked.guide::TAOCP Vol 1::Vol 1 review
TAOCP: Vol 1 review: why does it matter?	Volume 2 leans on the math from 1.2 hard. Patching gaps now saves pain later.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::vol_1_review cracked.guide::kind::why	cracked.guide::TAOCP Vol 1::Vol 1 review
TAOCP: Vol 1 review, a common trap: “Skipping review because you are behind.” What's the catch?	Review is where the material sticks.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::vol_1_review cracked.guide::kind::trap	cracked.guide::TAOCP Vol 1::Vol 1 review
TAOCP: Vol 1 review, exercise 34 of §1.2.4 (rated M21, recommended): what is it asking?	When the floor of a log equals the log of a floor. Mixes floors and logs.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::vol_1_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::Vol 1 review
TAOCP: Vol 1 review, exercise 62 of §1.2.6 (rated M23, recommended): what is it asking?	A sum of three binomials with a short proof once you see the trick. Tests the toolbox.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::vol_1_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::Vol 1 review
TAOCP: Vol 1 review, exercise 25 of §1.2.9 (rated M23, recommended): what is it asking?	Evaluate a binomial sum by recasting it with coefficient extraction.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::vol_1_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::Vol 1 review
TAOCP: Vol 1 review, exercise 36 of §1.3.3 (rated 27): what is it asking?	Write a MIX subroutine for rotating three blocks of an array and time it. Programming review.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::vol_1_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::Vol 1 review
TAOCP: Vol 1 review, exercise 10 of §2.2.4 (rated 20, recommended): what is it asking?	Adapt polynomial add and multiply to one variable with much bigger exponents. Data layout review.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::vol_1_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::Vol 1 review
TAOCP: Vol 1 review, exercise 37 of §2.3.1 (rated 24, recommended): what is it asking?	Store a binary tree in fewer words by dropping one link. Representation review.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::vol_1_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::Vol 1 review
TAOCP: Vol 1 review, exercise 22 of §2.5 (rated 21, recommended): what is it asking?	Explain why you cannot just carve an odd-sized request out of a buddy block and free the leftovers. Allocator review.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::vol_1_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::Vol 1 review
TAOCP: Vol 1 review, exercise 25 of §2.5 (rated 22, recommended): what is it asking?	Criticize a plausible shortcut in the buddy system.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::vol_1_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 1::Vol 1 review
TAOCP: Vol 1 review: how many exercises, and how are they rated?	932 exercises, rated 00 to HM50.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::vol_1_review cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 1::Vol 1 review
TAOCP: Vol 1 review: what should you be comfortable with first?	<ul><li>All of Vol 1</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::vol_1_review cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 1::Vol 1 review
TAOCP: Vol 1 review: how should you work through it?	Make a one-page summary per chapter: key identities from 1.2, key MIX idioms, and key structures from chapter 2. Re-attempt two exercises you gave up on. Check the Vol 1 errata for anything you got confused by.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::vol_1_review cracked.guide::kind::approach	cracked.guide::TAOCP Vol 1::Vol 1 review
TAOCP Vol 2: Seminumerical Algorithms: what is the phase about?	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.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::About this phase
TAOCP Vol 2: what should you be able to do by the end?	<ul><li>Pick, use and test a random number generator, and avoid the classic biased-shuffle and modulo-bias bugs.</li><li>Explain floating-point error and write numerically careful code.</li><li>Implement arbitrary-precision arithmetic, including long division and a faster-than-schoolbook multiply.</li><li>Implement gcd, modular inverses, primality testing and Pollard rho factoring.</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::kind::outcomes	cracked.guide::TAOCP Vol 2::About this phase
TAOCP Vol 2: what do you need before you start?	<ul><li>Vol 1 math, especially 1.2.4 (number theory) and 1.2.9 (generating functions).</li><li>Basic probability and statistics: mean, variance, distributions.</li><li>C or another language with 64-bit integers for the bignum work.</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::kind::need	cracked.guide::TAOCP Vol 2::About this phase
TAOCP Vol 2: how do you get the book?	Vol 2, 3rd edition is about $64 new from InformIT, less used. Borrow before you buy: many public and university libraries give you free access to O'Reilly Learning, which carries TAOCP; Libby/OverDrive and interlibrary loan (search WorldCat) work too. Older used editions are fine for Vols 1 to 3; section numbers barely changed. If you buy the eBook, get the PDF from InformIT. Knuth himself warns that the Kindle and ePUB versions mangle the math.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::kind::book	cracked.guide::TAOCP Vol 2::About this phase
TAOCP Vol 2: tips for getting through it?	<ul><li>3.3.3 and parts of 3.5, 4.5.3 and 4.6.2 are heavy math. It is fine to read for ideas and move on.</li><li>Turn the bignum work into a small library with tests; you will reuse it.</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::kind::tips	cracked.guide::TAOCP Vol 2::About this phase
TAOCP §3.1 Introduction: what does it cover?	What &quot;random numbers&quot; means for a computer, why truly random sources are awkward, and a tour of early attempts at generating pseudorandom numbers, including the middle-square method and why many ad hoc generators fail badly.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.1 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::3.1 Introduction
TAOCP §3.1: why does it matter?	Simulations, games, load testing, hashing and cryptography all depend on random numbers. This section is a warning against inventing your own generator.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.1 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::3.1 Introduction
TAOCP §3.1, a common trap: “Believing that complicated means random.” What's the catch?	The section's whole point is that it does not.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.1 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 2::3.1 Introduction
TAOCP §3.1, exercise 1 (rated 20, recommended): what is it asking?	Judge several physical ways of getting a random digit. Sharpens what you actually mean by random.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.1 Introduction
TAOCP §3.1, exercise 3 (rated 10): what is it asking?	One step of the middle-square method by hand.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.1 Introduction
TAOCP §3.1, exercise 5 (rated 15): what is it asking?	Argue why any generator of this kind must eventually repeat, before computing anything.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.1 Introduction
TAOCP §3.1, exercise 6 (rated M21): what is it asking?	Show that a sequence X(n+1) = f(X(n)) is eventually periodic, and find its cycle using almost no memory. This is Floyd's tortoise-and-hare; implement it.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.1 Introduction
TAOCP §3.1, exercise 7 (rated M21, recommended): what is it asking?	Brent's cycle detection with powers of two. Implement it next to exercise 6 and compare function evaluations.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.1 Introduction
TAOCP §3.1, exercise 8 (rated 23): what is it asking?	Exhaustively analyze two-digit middle-square. A small program makes the fate of every seed visible.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.1 Introduction
TAOCP §3.1, exercise 11 (rated M26, recommended): what is it asking?	Probability that a random mapping with a random seed has no repeats for a while. Birthday-paradox thinking.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.1 Introduction
TAOCP §3.1, exercise 12 (rated M31, recommended): what is it asking?	Average cycle length and tail length for a random mapping. The stretch; ties into rho-style factoring later in 4.5.4.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.1 Introduction
TAOCP §3.1: how many exercises, and how are they rated?	23 exercises, rated 10 to M48.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.1 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::3.1 Introduction
TAOCP §3.1: what should you be comfortable with first?	<ul><li>Vol 1 chapter 1 math</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.1 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::3.1 Introduction
TAOCP §3.1: how should you work through it?	Implement the middle-square method and watch it fall into a short cycle. That one experiment teaches the whole section. Read Knuth's story of his own &quot;super-random&quot; generator failing; it is a great lesson in humility.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.1 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::3.1 Introduction
TAOCP §3.2.1 The Linear Congruential Method: what does it cover?	The classic generator X_{n+1} = (aX_n + c) mod m. Knuth covers how to choose the modulus, the exact conditions on a and c for the longest possible period, and the notion of potency that rules out multipliers that are technically fine but bad in practice.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.1 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::3.2.1 The Linear Congruential Method
TAOCP §3.2.1: why does it matter?	LCGs are still inside many standard libraries and games, and knowing their weaknesses (low bits with short periods, patterns in higher dimensions) saves you from subtle simulation bugs.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.1 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::3.2.1 The Linear Congruential Method
Linear congruential generator: what is it?	A linear congruential generator produces pseudorandom numbers by the recurrence X(n+1) = (a X(n) + c) mod m for a fixed multiplier a, increment c and modulus m.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.1 cracked.guide::kind::definition	cracked.guide::TAOCP Vol 2::3.2.1 The Linear Congruential Method
Linear congruential generator: Should I use an LCG today?	For reproducible simulations or games it can be fine with well-tested parameters. Never for anything security related, and modern generators are usually a better default.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.1 cracked.guide::kind::definition	cracked.guide::TAOCP Vol 2::3.2.1 The Linear Congruential Method
TAOCP §3.2.1, a common trap: “Using the low bits of a power-of-two LCG.” What's the catch?	They have tiny periods.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.1 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 2::3.2.1 The Linear Congruential Method
TAOCP §3.2.1, a common trap: “Assuming full period means good quality.” What's the catch?	It does not; the spectral test (3.3.4) is about that.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.1 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 2::3.2.1 The Linear Congruential Method
TAOCP §3.2.1, exercise 2 of §3.2.1 (rated M20, recommended): what is it asking?	If a and m are coprime the seed always comes back. A first taste of why multipliers must be units.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.2.1 The Linear Congruential Method
TAOCP §3.2.1, exercise 6 of §3.2.1.1 (rated 20, recommended): what is it asking?	Swap addition for subtraction in the recurrence and decide whether anything really changes.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.2.1 The Linear Congruential Method
TAOCP §3.2.1, exercise 9 of §3.2.1.1 (rated M25, recommended): what is it asking?	Compute a*x mod m in a language without double-length products, without overflow. The trick behind most portable LCG code.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.2.1 The Linear Congruential Method
TAOCP §3.2.1, exercise 11 of §3.2.1.1 (rated M30): what is it asking?	Push exercise 9 further: evaluate a*x mod m for any multiplier using only small safe operations. The stretch.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.2.1 The Linear Congruential Method
TAOCP §3.2.1, exercise 3 of §3.2.1.2 (rated 13): what is it asking?	Full-period condition for a power-of-ten modulus, specialized from the main theorem. Quick check that you can apply it.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.2.1 The Linear Congruential Method
TAOCP §3.2.1, exercise 6 of §3.2.1.2 (rated 20, recommended): what is it asking?	Find every full-period multiplier for one specific modulus by factoring it.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.2.1 The Linear Congruential Method
TAOCP §3.2.1, exercise 7 of §3.2.1.2 (rated M23, recommended): what is it asking?	Pin down the tail length and period of an arbitrary congruential sequence, not just the full-period case.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.2.1 The Linear Congruential Method
TAOCP §3.2.1, exercise 8 of §3.2.1.3 (rated M26, recommended): what is it asking?	Explain why a generator with low potency fails a simple triples test. The same failure that sank famous real-world generators.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.2.1 The Linear Congruential Method
TAOCP §3.2.1: how many exercises, and how are they rated?	49 exercises, rated 10 to 40.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.1 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::3.2.1 The Linear Congruential Method
TAOCP §3.2.1: what should you be comfortable with first?	<ul><li>1.2.4 Integer Functions and Elementary Number Theory</li><li>3.1 Introduction</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.1 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::3.2.1 The Linear Congruential Method
TAOCP §3.2.1: how should you work through it?	Read 3.2.1.1 (modulus), 3.2.1.2 (multiplier) and 3.2.1.3 (potency). Write an LCG with a small modulus like 16 or 64 and print the full sequence to see the period theorem in action. Then print the lowest bit of a power-of-two-modulus LCG and watch it alternate.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.1 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::3.2.1 The Linear Congruential Method
TAOCP §3.2.2 Other Methods: what does it cover?	Generators beyond the basic LCG: quadratic and higher-order congruences, additive (lagged Fibonacci) generators, combining generators, and shuffling the output of one generator using another to break up patterns.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.2 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::3.2.2 Other Methods
TAOCP §3.2.2: why does it matter?	Modern generators like xorshift, PCG and Mersenne Twister descend from these ideas. Knowing the families helps you judge a library's choice.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.2 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::3.2.2 Other Methods
TAOCP §3.2.2, a common trap: “Thinking combining two weak generators always gives a strong one.” What's the catch?	Sometimes it does, sometimes it does not.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.2 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 2::3.2.2 Other Methods
TAOCP §3.2.2, exercise 1 (rated 12, recommended): what is it asking?	Why generating fractions directly with a floating-point recurrence is a bad idea.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.2.2 Other Methods
TAOCP §3.2.2, exercise 2 (rated M20, recommended): what is it asking?	Show that the plain Fibonacci generator never produces one of the six relative orderings of three consecutive values. A crisp proof of non-randomness.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.2.2 Other Methods
TAOCP §3.2.2, exercise 3 (rated 23): what is it asking?	Run the shuffling algorithms on tiny generators by hand to see what they actually do.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.2.2 Other Methods
TAOCP §3.2.2, exercise 5 (rated 20, recommended): what is it asking?	Use one generator to shuffle itself and compare with Algorithm B.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.2.2 Other Methods
TAOCP §3.2.2, exercise 13 (rated M20): what is it asking?	Adding two generators with coprime periods multiplies the periods. Quick and useful.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.2.2 Other Methods
TAOCP §3.2.2, exercise 23 (rated 20, recommended): what is it asking?	Weigh the subtractive lagged Fibonacci variant against the additive one.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.2.2 Other Methods
TAOCP §3.2.2, exercise 33 (rated M23, recommended): what is it asking?	Jump ahead in a lagged Fibonacci sequence with a polynomial trick. The idea behind seeding parallel streams.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.2.2 Other Methods
TAOCP §3.2.2, exercise 12 (rated M28, recommended): what is it asking?	Find the longest period possible for a second-order recurrence mod a power of two. The stretch.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.2.2 Other Methods
TAOCP §3.2.2: how many exercises, and how are they rated?	37 exercises, rated 00 to M40.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.2 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::3.2.2 Other Methods
TAOCP §3.2.2: what should you be comfortable with first?	<ul><li>3.2.1 The Linear Congruential Method</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.2 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::3.2.2 Other Methods
TAOCP §3.2.2: how should you work through it?	Implement an additive lagged-Fibonacci generator and a shuffling combiner. Do not try to absorb every proof; aim to know what each family is and its main trade-off.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.2 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::3.2.2 Other Methods
TAOCP §3.3.1 General Test Procedures: what does it cover?	The statistical machinery for testing a generator: the chi-square test for counts in categories, and the Kolmogorov-Smirnov test for continuous distributions, plus how to read their results without fooling yourself.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.1 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::3.3.1 General Test Procedures
TAOCP §3.3.1: why does it matter?	These tests are how you check any claim of &quot;uniform&quot; or &quot;random&quot;, whether it is a PRNG, a load balancer, or an A/B test bucketing scheme.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.1 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::3.3.1 General Test Procedures
TAOCP §3.3.1: what traps should you watch for?	<ul><li>Treating one failed test as proof of a bad generator, or one pass as proof of a good one.</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.1 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 2::3.3.1 General Test Procedures
TAOCP §3.3.1, exercise 1 (rated 00): what is it asking?	Which row of the chi-square table applies. Make sure degrees of freedom are second nature.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.1 General Test Procedures
TAOCP §3.3.1, exercise 3 (rated 23, recommended): what is it asking?	Run a chi-square test on real loaded-dice data and interpret the outcome.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.1 General Test Procedures
TAOCP §3.3.1, exercise 5 (rated 22): what is it asking?	Compute both KS statistics for a small sample by hand, then check with code.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.1 General Test Procedures
TAOCP §3.3.1, exercise 7 (rated M15): what is it asking?	Basic bounds on the KS statistics. Quick sanity facts.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.1 General Test Procedures
TAOCP §3.3.1, exercise 9 (rated 20, recommended): what is it asking?	What extra information the other one-sided KS statistic would have given in the text's experiment.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.1 General Test Procedures
TAOCP §3.3.1, exercise 10 (rated 20, recommended): what is it asking?	What happens to chi-square if you sneakily count the same data twice. A lesson about inflating sample size.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.1 General Test Procedures
TAOCP §3.3.1, exercise 23 (rated M22): what is it asking?	Compute the KS statistic in linear time without sorting. A neat algorithm to implement.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.1 General Test Procedures
TAOCP §3.3.1, exercise 14 (rated HM26, recommended): what is it asking?	Derive the chi-square approximation from Stirling's formula. The stretch.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.1 General Test Procedures
TAOCP §3.3.1: how many exercises, and how are they rated?	25 exercises, rated 00 to HM48.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.1 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::3.3.1 General Test Procedures
TAOCP §3.3.1: what should you be comfortable with first?	<ul><li>Basic probability and statistics</li><li>3.2 Generating Uniform Random Numbers</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.1 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::3.3.1 General Test Procedures
TAOCP §3.3.1: how should you work through it?	Implement chi-square on dice rolls from a good and a bad generator. Implement KS on uniform floats. Run each test many times and see that even a perfect generator &quot;fails&quot; sometimes; that is the point of p-values.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.1 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::3.3.1 General Test Procedures
TAOCP §3.3.2 Empirical Tests: what does it cover?	A battery of concrete tests for random sequences: equidistribution, serial pairs, gaps, poker hands, coupon collecting, permutations, runs up and down, maximum of t values, and collision tests.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.2 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::3.3.2 Empirical Tests
TAOCP §3.3.2: why does it matter?	These are the ancestors of modern test suites like TestU01 and PractRand. Writing a few yourself gives you a feel for how generators fail.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.2 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::3.3.2 Empirical Tests
TAOCP §3.3.2, a common trap: “The runs test has correlated statistics; Knuth explains why a plain chi-square is wrong there.” What's the catch?	Read that part carefully.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.2 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 2::3.3.2 Empirical Tests
TAOCP §3.3.2, exercise 7 (rated 08): what is it asking?	Run the coupon collector's test by hand on a short ternary sequence.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.2 Empirical Tests
TAOCP §3.3.2, exercise 12 (rated 20): what is it asking?	Write the run-length counter for the runs test. Programming warm-up.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.2 Empirical Tests
TAOCP §3.3.2, exercise 3 (rated M20, recommended): what is it asking?	Expected length of input consumed by the gap test, with its spread.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.2 Empirical Tests
TAOCP §3.3.2, exercise 8 (rated M22, recommended): what is it asking?	Same question for the coupon collector's test. Uses the harmonic numbers from Vol 1.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.2 Empirical Tests
TAOCP §3.3.2, exercise 14 (rated M15, recommended): what is it asking?	Discarding one element after each run makes run lengths independent, so a plain chi-square works.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.2 Empirical Tests
TAOCP §3.3.2, exercise 16 (rated 15, recommended): what is it asking?	Spot the flaw in a clever-looking shortcut for the maximum-of-t test.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.2 Empirical Tests
TAOCP §3.3.2, exercise 31 (rated M21, recommended): what is it asking?	Show that the low bits of a lagged Fibonacci generator fail a simple test. Generators can be bad in specific bits.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.2 Empirical Tests
TAOCP §3.3.2, exercise 27 (rated HM26, recommended): what is it asking?	Iterated spacings of uniform samples keep the same distribution. The stretch.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.2 Empirical Tests
TAOCP §3.3.2: how many exercises, and how are they rated?	35 exercises, rated 00 to M46.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.2 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::3.3.2 Empirical Tests
TAOCP §3.3.2: what should you be comfortable with first?	<ul><li>3.3.1 General Test Procedures</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.2 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::3.3.2 Empirical Tests
TAOCP §3.3.2: how should you work through it?	Pick three tests (gap, poker, runs are good choices) and implement them against both a decent generator and a bad LCG. You do not need to implement all of them.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.2 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::3.3.2 Empirical Tests
TAOCP §3.3.3 Theoretical Tests: what does it cover?	Instead of running a generator, analyze it mathematically: for example, compute the serial correlation of an LCG exactly from its parameters. This brings in some heavy number theory, including Dedekind sums.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.3 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::3.3.3 Theoretical Tests
TAOCP §3.3.3: why does it matter?	Honestly, this is one of the more specialized sections for a working programmer. The takeaway is that you can sometimes prove a generator is bad without running it.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.3 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::3.3.3 Theoretical Tests
TAOCP §3.3.3, a common trap: “Burning out here.” What's the catch?	It is fine to skim.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.3 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 2::3.3.3 Theoretical Tests
TAOCP §3.3.3, exercise 1 (rated M10): what is it asking?	Write x mod y with the sawtooth function. Warms up the notation.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.3 Theoretical Tests
TAOCP §3.3.3, exercise 2 (rated M20): what is it asking?	Prove the replicative law for the sawtooth function.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.3 Theoretical Tests
TAOCP §3.3.3, exercise 4 (rated M19, recommended): what is it asking?	How large the key quantity of the serial-correlation theorem can be for a given potency.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.3 Theoretical Tests
TAOCP §3.3.3, exercise 14 (rated M20, recommended): what is it asking?	Explain an observed high serial correlation from the generator's parameters. Theory predicting a real failure.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.3 Theoretical Tests
TAOCP §3.3.3, exercise 17 (rated M22): what is it asking?	Evaluate generalized Dedekind sums with integer-only arithmetic. An algorithm worth coding.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.3 Theoretical Tests
TAOCP §3.3.3, exercise 22 (rated M22, recommended): what is it asking?	Real-number version of the up-down probability theorem. Shows where the answer comes from without number theory.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.3 Theoretical Tests
TAOCP §3.3.3, exercise 19 (rated M23, recommended): what is it asking?	Analyze the serial test over the full period with generalized Dedekind sums.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.3 Theoretical Tests
TAOCP §3.3.3, exercise 24 (rated M29): what is it asking?	Probability of a descending run of length t in the real-number model. The stretch.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.3 Theoretical Tests
TAOCP §3.3.3: how many exercises, and how are they rated?	28 exercises, rated M10 to M40.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.3 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::3.3.3 Theoretical Tests
TAOCP §3.3.3: what should you be comfortable with first?	<ul><li>3.3.2 Empirical Tests</li><li>1.2.4 Number theory</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.3 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::3.3.3 Theoretical Tests
TAOCP §3.3.3: how should you work through it?	Read for the main results and the intuition. It is fine to skim the Dedekind sum derivations. Spend the time you save on finishing 3.3.2 implementations.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.3 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::3.3.3 Theoretical Tests
TAOCP §3.3.4 The Spectral Test: what does it cover?	The most important test for LCGs: in t dimensions, successive tuples from an LCG lie on a set of parallel hyperplanes, and the spectral test measures how far apart those planes are. Knuth gives an algorithm to compute it and tables of good and bad multipliers.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.4 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::3.3.4 The Spectral Test
TAOCP §3.3.4: why does it matter?	This explains disasters like IBM's RANDU, whose triples fall on just 15 planes. It is the reason you should not trust a generator just because its 1D histogram looks flat.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.4 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::3.3.4 The Spectral Test
TAOCP §3.3.4, a common trap: “Getting lost in lattice-reduction details.” What's the catch?	The picture is what matters.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.4 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 2::3.3.4 The Spectral Test
TAOCP §3.3.4, exercise 1 (rated M10): what is it asking?	What the spectral test means in one dimension. Checks the definition.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.4 The Spectral Test
TAOCP §3.3.4, exercise 8 (rated M16): what is it asking?	How bad two-dimensional accuracy can be while three-dimensional accuracy stays fine.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.4 The Spectral Test
TAOCP §3.3.4, exercise 4 (rated M23, recommended): what is it asking?	The two-dimensional lattice basis behind the test. The geometry in miniature.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.4 The Spectral Test
TAOCP §3.3.4, exercise 14 (rated 24): what is it asking?	Run Algorithm S by hand on a tiny generator. Do this before coding it.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.4 The Spectral Test
TAOCP §3.3.4, exercise 15 (rated M20, recommended): what is it asking?	Count how many parallel hyperplanes cut the unit cube. Connects the abstract number to the picture.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.4 The Spectral Test
TAOCP §3.3.4, exercise 21 (rated M20): what is it asking?	Analyze the lattice when an application throws away some outputs.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.4 The Spectral Test
TAOCP §3.3.4, exercise 32 (rated M21, recommended): what is it asking?	Show that a well-known combined generator is close to one big linear congruential generator, so the spectral test applies to it.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.4 The Spectral Test
TAOCP §3.3.4, exercise 24 (rated M28, recommended): what is it asking?	Extend the spectral test to second-order recurrences. The stretch.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.4 The Spectral Test
TAOCP §3.3.4: how many exercises, and how are they rated?	32 exercises, rated M10 to HM47.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.4 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::3.3.4 The Spectral Test
TAOCP §3.3.4: what should you be comfortable with first?	<ul><li>3.2.1 The Linear Congruential Method</li><li>Basic linear algebra (vectors, dot products)</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.4 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::3.3.4 The Spectral Test
TAOCP §3.3.4: how should you work through it?	Before reading, plot (X_n, X_{n+1}) for a small LCG and see the lines. Plot RANDU triples in 3D. Then read the spectral test algorithm for the ideas. Following every step of the algorithm is optional.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.4 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::3.3.4 The Spectral Test
TAOCP §3.4.1 Numerical Distributions: what does it cover?	Turning uniform random numbers into other distributions: random integers in a range, general discrete distributions (including the alias method), the normal distribution via the polar method and others, and exponential, gamma, binomial and Poisson distributions.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.1 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::3.4.1 Numerical Distributions
TAOCP §3.4.1: why does it matter?	Every simulation, game loot table and load generator needs non-uniform randomness. The modulo-bias trap for random integers is one of the most common bugs in real code.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.1 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::3.4.1 Numerical Distributions
TAOCP §3.4.1: what traps should you watch for?	<ul><li>Using rand() % k, which is biased when the generator range is not a multiple of k.</li><li>Taking the low bits of a weak generator for small ranges.</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.1 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 2::3.4.1 Numerical Distributions
TAOCP §3.4.1, exercise 1 (rated 10): what is it asking?	Uniform on an arbitrary interval. Quick.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.4.1 Numerical Distributions
TAOCP §3.4.1, exercise 2 (rated M16): what is it asking?	Exact bias of turning a random fraction into an integer in [0, k). Quantifies the rand() % k problem.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.4.1 Numerical Distributions
TAOCP §3.4.1, exercise 3 (rated 14, recommended): what is it asking?	Dividing versus multiplying to get a random integer, and which bits each one uses.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.4.1 Numerical Distributions
TAOCP §3.4.1, exercise 5 (rated 21, recommended): what is it asking?	Sample from a mixture of simple distributions efficiently.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.4.1 Numerical Distributions
TAOCP §3.4.1, exercise 7 (rated 20, recommended): what is it asking?	The cubes-in-boxes construction behind Walker's alias method. Implement it.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.4.1 Numerical Distributions
TAOCP §3.4.1, exercise 17 (rated M24, recommended): what is it asking?	Distribution, generating function, mean and spread of the geometric distribution.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.4.1 Numerical Distributions
TAOCP §3.4.1, exercise 29 (rated M20): what is it asking?	Generate n sorted uniforms in linear time without sorting.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.4.1 Numerical Distributions
TAOCP §3.4.1, exercise 11 (rated HM27, recommended): what is it asking?	Prove that the tail steps of the normal generator produce the correct distribution. The stretch.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.4.1 Numerical Distributions
TAOCP §3.4.1: how many exercises, and how are they rated?	33 exercises, rated 10 to HM40.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.1 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::3.4.1 Numerical Distributions
TAOCP §3.4.1: what should you be comfortable with first?	<ul><li>3.2 Generating Uniform Random Numbers</li><li>Basic probability distributions</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.1 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::3.4.1 Numerical Distributions
TAOCP §3.4.1: how should you work through it?	Implement: unbiased random integer in [0, k), the alias method for a weighted die, and the polar method for normals. Histogram each to check. Skim the more exotic distributions.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.1 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::3.4.1 Numerical Distributions
TAOCP §3.4.2 Random Sampling and Shuffling: what does it cover?	Picking n records at random from N, both when N is known (selection sampling) and when it is not known in advance (reservoir sampling), and shuffling an array uniformly.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.2 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::3.4.2 Random Sampling and Shuffling
TAOCP §3.4.2: why does it matter?	Reservoir sampling and the Fisher-Yates shuffle are must-know algorithms. Getting the shuffle subtly wrong is a famous bug in real products.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.2 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::3.4.2 Random Sampling and Shuffling
Fisher-Yates shuffle: what is it?	The Fisher-Yates shuffle produces a uniformly random permutation of an array in one pass by swapping each position with a randomly chosen position at or before it.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.2 cracked.guide::kind::definition	cracked.guide::TAOCP Vol 2::3.4.2 Random Sampling and Shuffling
Fisher-Yates shuffle: Why is it called the Knuth shuffle?	Fisher and Yates published a pencil-and-paper version in 1938; Durstenfeld gave the computer version in 1964; Knuth popularized it in TAOCP.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.2 cracked.guide::kind::definition	cracked.guide::TAOCP Vol 2::3.4.2 Random Sampling and Shuffling
TAOCP §3.4.2, a common trap: “Swapping with a random index from the whole array instead of the remaining part.” What's the catch?	That gives a biased shuffle.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.2 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 2::3.4.2 Random Sampling and Shuffling
TAOCP §3.4.2: what traps should you watch for?	<ul><li>Off-by-one on the range of the random index.</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.2 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 2::3.4.2 Random Sampling and Shuffling
TAOCP §3.4.2, exercise 3 (rated 22, recommended): what is it asking?	Resolve the apparent paradox that the selection probability changes but the sample is still fair.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.4.2 Random Sampling and Shuffling
TAOCP §3.4.2, exercise 9 (rated 12): what is it asking?	Run reservoir sampling by hand with given random numbers.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.4.2 Random Sampling and Shuffling
TAOCP §3.4.2, exercise 10 (rated 15): what is it asking?	Reservoir sampling without the reservoir file when the sample fits in memory. The version most people use.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.4.2 Random Sampling and Shuffling
TAOCP §3.4.2, exercise 7 (rated M25): what is it asking?	Prove that every subset is equally likely under selection sampling.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.4.2 Random Sampling and Shuffling
TAOCP §3.4.2, exercise 16 (rated M25, recommended): what is it asking?	Sample with hashing in O(n) space and time and output it sorted.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.4.2 Random Sampling and Shuffling
TAOCP §3.4.2, exercise 17 (rated M22): what is it asking?	Prove Floyd's elegant sampling algorithm correct.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.4.2 Random Sampling and Shuffling
TAOCP §3.4.2, exercise 15 (rated 30, recommended): what is it asking?	Get a random permutation of a random combination cheaply by stopping the shuffle early.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.4.2 Random Sampling and Shuffling
TAOCP §3.4.2, exercise 8 (rated M39, recommended): what is it asking?	Vitter's method of skipping records instead of testing each one. The stretch.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.4.2 Random Sampling and Shuffling
TAOCP §3.4.2: how many exercises, and how are they rated?	17 exercises, rated M12 to M39.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.2 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::3.4.2 Random Sampling and Shuffling
TAOCP §3.4.2: what should you be comfortable with first?	<ul><li>3.4.1 Numerical Distributions</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.2 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::3.4.2 Random Sampling and Shuffling
TAOCP §3.4.2: how should you work through it?	Implement the shuffle and verify by running it a million times on a 3-element array and counting all 6 outcomes. Then implement the &quot;naive&quot; swap-with-any-position shuffle and see its bias. Implement reservoir sampling over a stream read from stdin.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.2 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::3.4.2 Random Sampling and Shuffling
TAOCP §3.5 What Is a Random Sequence?: what does it cover?	A philosophical and mathematical attempt to define randomness for infinite and finite sequences, building up through stronger and stronger definitions and touching on what later became algorithmic (Kolmogorov) complexity.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.5 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::3.5 What Is a Random Sequence?
TAOCP §3.5: why does it matter?	Mostly for intellectual depth, but it sharpens your intuition about why &quot;passes some tests&quot; can never fully define random, and connects to compression and cryptography.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.5 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::3.5 What Is a Random Sequence?
TAOCP §3.5, a common trap: “Expecting a practical takeaway on every page.” What's the catch?	This one is about understanding.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.5 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 2::3.5 What Is a Random Sequence?
TAOCP §3.5, exercise 1 (rated 10): what is it asking?	Can a periodic sequence be equidistributed? Quick test of the definition.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.5 What Is a Random Sequence?
TAOCP §3.5, exercise 2 (rated 10): what is it asking?	Check k-distribution of a simple periodic bit pattern for small k.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.5 What Is a Random Sequence?
TAOCP §3.5, exercise 3 (rated M22): what is it asking?	Build a periodic ternary sequence that is 3-distributed. De Bruijn sequences in disguise.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.5 What Is a Random Sequence?
TAOCP §3.5, exercise 5 (rated HM22, recommended): what is it asking?	A sequence whose limiting frequency does not exist. Shows why the definitions need care.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.5 What Is a Random Sequence?
TAOCP §3.5, exercise 11 (rated M10): what is it asking?	Every other element of an infinitely distributed sequence is again infinitely distributed.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.5 What Is a Random Sequence?
TAOCP §3.5, exercise 44 (rated 16, recommended): what is it asking?	Can a valid table of random digits contain exactly one misprint? A fun puzzle with a real point.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.5 What Is a Random Sequence?
TAOCP §3.5, exercise 42 (rated M28, recommended): what is it asking?	Pairwise independence and Chebyshev's inequality. Useful well beyond this section.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.5 What Is a Random Sequence?
TAOCP §3.5, exercise 22 (rated HM30, recommended): what is it asking?	Weyl's criterion for k-distribution via exponential sums. The stretch.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.5 What Is a Random Sequence?
TAOCP §3.5: how many exercises, and how are they rated?	44 exercises, rated 10 to HM50.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.5 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::3.5 What Is a Random Sequence?
TAOCP §3.5: what should you be comfortable with first?	<ul><li>3.3 Statistical Tests</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.5 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::3.5 What Is a Random Sequence?
TAOCP §3.5: how should you work through it?	Read for ideas. Follow the sequence of definitions and why each one is too weak. The heavy proofs can be skimmed on a first pass.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.5 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::3.5 What Is a Random Sequence?
TAOCP §3.6 Summary: what does it cover?	Knuth's practical summary of chapter 3: concrete advice on what kind of generator to use, how to use it, and what to avoid.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.6 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::3.6 Summary
TAOCP §3.6: why does it matter?	The most directly practical few pages in the chapter.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.6 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::3.6 Summary
TAOCP §3.6, a common trap: “Using this advice for cryptography.” What's the catch?	Crypto needs a CSPRNG, a different problem.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.6 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 2::3.6 Summary
TAOCP §3.6, exercise 2 (rated 15, recommended): what is it asking?	A light philosophical question about whether computers can do anything new.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.6 Summary
TAOCP §3.6, exercise 8 (rated M15): what is it asking?	How to check that an LCG implementation is correct. Practical test design.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.6 Summary
TAOCP §3.6, exercise 12 (rated M21, recommended): what is it asking?	Choose a generator for a machine with 16-bit integers only.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.6 Summary
TAOCP §3.6, exercise 3 (rated 32): what is it asking?	Simulate the dice game craps and estimate the odds. A full small simulation project.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.6 Summary
TAOCP §3.6, exercise 15 (rated 25, recommended): what is it asking?	Wrap the recommended generator so it discards most of each batch as advised.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.6 Summary
TAOCP §3.6, exercise 11 (rated M25, recommended): what is it asking?	Port the recommended generator to floating-point arithmetic with exactly the same output.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.6 Summary
TAOCP §3.6, exercise 7 (rated M40, recommended): what is it asking?	Break a file cipher built on an LCG with unknown parameters. The stretch, and a lesson for crypto.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.6 Summary
TAOCP §3.6: how many exercises, and how are they rated?	15 exercises, rated 15 to 46.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.6 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::3.6 Summary
TAOCP §3.6: what should you be comfortable with first?	<ul><li>Chapter 3</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.6 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::3.6 Summary
TAOCP §3.6: how should you work through it?	Read it and compare with what your language's standard library uses. Write down which generator your main language uses and whether it would pass Knuth's advice.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.6 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::3.6 Summary
TAOCP §4.1 Positional Number Systems: what does it cover?	Number representations: binary, octal, hex, and exotic systems like negative bases, balanced ternary, and mixed radix. Knuth also covers a little history of how positional notation developed.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.1 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::4.1 Positional Number Systems
TAOCP §4.1: why does it matter?	Bit manipulation, encodings and serialization formats all depend on fluent radix thinking. Mixed radix is how you convert time units and index multi-dimensional arrays.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.1 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::4.1 Positional Number Systems
TAOCP §4.1, a common trap: “Rushing through the negative-base examples.” What's the catch?	They are fun and they check your understanding.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.1 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 2::4.1 Positional Number Systems
TAOCP §4.1, exercise 1 (rated 15): what is it asking?	Write small integers in base -2. Drill.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.1 Positional Number Systems
TAOCP §4.1, exercise 9 (rated 15, recommended): what is it asking?	Octal to hexadecimal by regrouping bits.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.1 Positional Number Systems
TAOCP §4.1, exercise 2 (rated 24, recommended): what is it asking?	Express a few numbers in four unusual systems. Shows the tradeoffs side by side.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.1 Positional Number Systems
TAOCP §4.1, exercise 11 (rated 22): what is it asking?	Design negabinary addition.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.1 Positional Number Systems
TAOCP §4.1, exercise 13 (rated M21, recommended): what is it asking?	Whether expansions in base -10 can be ambiguous, like 0.999... in decimal.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.1 Positional Number Systems
TAOCP §4.1, exercise 19 (rated 23, recommended): what is it asking?	Which digit sets let every integer be written in a given base.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.1 Positional Number Systems
TAOCP §4.1, exercise 34 (rated 22, recommended): what is it asking?	Write an integer with digits -1, 0, 1 using the fewest nonzero digits. Used in fast exponentiation and hardware multipliers.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.1 Positional Number Systems
TAOCP §4.1, exercise 31 (rated M35, recommended): what is it asking?	2-adic numbers as infinite two's complement. The stretch.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.1 Positional Number Systems
TAOCP §4.1: how many exercises, and how are they rated?	34 exercises, rated 00 to M40.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.1 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::4.1 Positional Number Systems
TAOCP §4.1: what should you be comfortable with first?	<ul><li>1.2.4 Integer Functions</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.1 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::4.1 Positional Number Systems
TAOCP §4.1: how should you work through it?	Convert a few numbers to base -2 and balanced ternary by hand. Write a function that converts to any mixed radix.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.1 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::4.1 Positional Number Systems
TAOCP §4.2.1 Single-Precision Calculations: what does it cover?	How floating-point numbers are stored (sign, exponent, fraction) and the algorithms for add, subtract, multiply and divide, including normalization and rounding. Knuth uses his own floating format on MIX, not IEEE 754.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.1 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::4.2.1 Single-Precision Calculations
TAOCP §4.2.1: why does it matter?	Floats are in almost every program and most programmers have only a vague model of them. Implementing float addition yourself is the fastest way to understand why 0.1 + 0.2 is not 0.3.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.1 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::4.2.1 Single-Precision Calculations
TAOCP §4.2.1, a common trap: “Assuming Knuth's format matches IEEE 754.” What's the catch?	The ideas transfer, the bit layouts do not.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.1 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 2::4.2.1 Single-Precision Calculations
TAOCP §4.2.1, exercise 1 (rated 10): what is it asking?	Encode two physical constants in a toy floating-point format.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.1 Single-Precision Calculations
TAOCP §4.2.1, exercise 3 (rated 11): what is it asking?	The hidden leading bit trick. IEEE 754 uses it.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.1 Single-Precision Calculations
TAOCP §4.2.1, exercise 4 (rated 16): what is it asking?	Trace floating addition on concrete inputs, including a catastrophic one.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.1 Single-Precision Calculations
TAOCP §4.2.1, exercise 10 (rated 12): what is it asking?	Find a case where rounding pushes the fraction past 1 during addition.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.1 Single-Precision Calculations
TAOCP §4.2.1, exercise 16 (rated HM21): what is it asking?	Divide complex numbers without overflow. Smith's algorithm is still used today.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.1 Single-Precision Calculations
TAOCP §4.2.1, exercise 15 (rated 28, recommended): what is it asking?	Write the fractional-part routine and handle tiny and huge inputs carefully.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.1 Single-Precision Calculations
TAOCP §4.2.1, exercise 13 (rated 30): what is it asking?	Directed rounding for interval arithmetic.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.1 Single-Precision Calculations
TAOCP §4.2.1, exercise 12 (rated M25): what is it asking?	Prove that rounding overflow cannot happen when normalizing a quotient. The stretch.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.1 Single-Precision Calculations
TAOCP §4.2.1: how many exercises, and how are they rated?	19 exercises, rated 10 to 40.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.1 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::4.2.1 Single-Precision Calculations
TAOCP §4.2.1: what should you be comfortable with first?	<ul><li>4.1 Positional Number Systems</li><li>Basic MIX</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.1 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::4.2.1 Single-Precision Calculations
TAOCP §4.2.1: how should you work through it?	Read alongside the IEEE 754 Wikipedia page so you can map Knuth's concepts to real hardware. Implement float addition on a toy format (say 8-bit exponent and 16-bit fraction) in C using integers.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.1 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::4.2.1 Single-Precision Calculations
TAOCP §4.2.2 Accuracy of Floating Point Arithmetic: what does it cover?	Error analysis for floating point: which algebraic laws survive (commutativity does), which break (associativity, distributivity), and how to reason about the error of a sequence of operations.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.2 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::4.2.2 Accuracy of Floating Point Arithmetic
TAOCP §4.2.2: why does it matter?	This is the section that teaches you why summing an array in a different order changes the answer, and how to write numeric code that does not drift.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.2 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::4.2.2 Accuracy of Floating Point Arithmetic
TAOCP §4.2.2: what traps should you watch for?	<ul><li>Comparing floats with == in tests.</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.2 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 2::4.2.2 Accuracy of Floating Point Arithmetic
TAOCP §4.2.2, exercise 4 (rated 10): what is it asking?	Can regrouping a product change whether it overflows?	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.2 Accuracy of Floating Point Arithmetic
TAOCP §4.2.2, exercise 3 (rated M20): what is it asking?	Find concrete numbers where floating multiplication is not associative.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.2 Accuracy of Floating Point Arithmetic
TAOCP §4.2.2, exercise 8 (rated 20, recommended): what is it asking?	Apply the approximate-equality relations to concrete pairs. Builds intuition for tolerance comparisons.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.2 Accuracy of Floating Point Arithmetic
TAOCP §4.2.2, exercise 25 (rated 15, recommended): what is it asking?	Why blaming cancellation is usually blaming the wrong step.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.2 Accuracy of Floating Point Arithmetic
TAOCP §4.2.2, exercise 15 (rated M24, recommended): what is it asking?	Does the computed midpoint of an interval always lie inside it? Classic binary-search trap.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.2 Accuracy of Floating Point Arithmetic
TAOCP §4.2.2, exercise 13 (rated M25, recommended): what is it asking?	Doing exact integer arithmetic on top of floating point and when it stays exact.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.2 Accuracy of Floating Point Arithmetic
TAOCP §4.2.2, exercise 23 (rated M26, recommended): what is it asking?	Check an identity about rounding down that looks obviously true.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.2 Accuracy of Floating Point Arithmetic
TAOCP §4.2.2, exercise 19 (rated M30, recommended): what is it asking?	Error analysis of Kahan's compensated summation. The stretch, and worth implementing.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.2 Accuracy of Floating Point Arithmetic
TAOCP §4.2.2: how many exercises, and how are they rated?	31 exercises, rated 10 to M40.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.2 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::4.2.2 Accuracy of Floating Point Arithmetic
TAOCP §4.2.2: what should you be comfortable with first?	<ul><li>4.2.1 Single-Precision Calculations</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.2 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::4.2.2 Accuracy of Floating Point Arithmetic
TAOCP §4.2.2: how should you work through it?	Write programs that demonstrate non-associativity and catastrophic cancellation. Implement Kahan compensated summation (widely documented) and compare to naive summation.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.2 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::4.2.2 Accuracy of Floating Point Arithmetic
TAOCP §4.2.3 Double-Precision Calculations: what does it cover?	Building higher-precision floating arithmetic out of single-precision operations, with care for carries and rounding.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.3 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::4.2.3 Double-Precision Calculations
TAOCP §4.2.3: why does it matter?	The same idea powers double-double and quad-double libraries used when 64-bit floats are not enough.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.3 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::4.2.3 Double-Precision Calculations
TAOCP §4.2.3, exercise 1 (rated 16): what is it asking?	Run the double-precision division idea by hand on small decimal numbers.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.3 Double-Precision Calculations
TAOCP §4.2.3, exercise 2 (rated 20): what is it asking?	Whether clearing a register would actually improve accuracy.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.3 Double-Precision Calculations
TAOCP §4.2.3, exercise 3 (rated M20): what is it asking?	Why one of the routines can never overflow.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.3 Double-Precision Calculations
TAOCP §4.2.3, exercise 6 (rated 23): what is it asking?	Convert between single and double precision formats.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.3 Double-Precision Calculations
TAOCP §4.2.3, exercise 7 (rated M30, recommended): what is it asking?	Bound the relative error of the double-precision routines. The stretch.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.3 Double-Precision Calculations
TAOCP §4.2.3: how many exercises, and how are they rated?	9 exercises, rated 16 to M42.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.3 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::4.2.3 Double-Precision Calculations
TAOCP §4.2.3: what should you be comfortable with first?	<ul><li>4.2.2 Accuracy of Floating Point Arithmetic</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.3 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::4.2.3 Double-Precision Calculations
TAOCP §4.2.3: how should you work through it?	Read for the method. Skim MIX-heavy details. If you are curious, look up the two-sum trick, which is the modern building block.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.3 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::4.2.3 Double-Precision Calculations
TAOCP §4.2.4 Distribution of Floating Point Numbers: what does it cover?	Why leading digits of real-world numbers are not uniformly distributed but follow a logarithmic law (smaller leading digits are more common), and what that means for floating-point error.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.4 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::4.2.4 Distribution of Floating Point Numbers
TAOCP §4.2.4: why does it matter?	Benford's law is a famous, surprising result that has real uses, including fraud detection. It also explains why some rounding error estimates are pessimistic.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.4 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::4.2.4 Distribution of Floating Point Numbers
TAOCP §4.2.4, exercise 1 (rated 13): what is it asking?	Estimate how often addition needs a normalizing shift, from the tables.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.4 Distribution of Floating Point Numbers
TAOCP §4.2.4, exercise 3 (rated 15): what is it asking?	Probability of given leading digits under the logarithmic law.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.4 Distribution of Floating Point Numbers
TAOCP §4.2.4, exercise 5 (rated M20, recommended): what is it asking?	Leading digits of a uniform random number. A contrast with the log law.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.4 Distribution of Floating Point Numbers
TAOCP §4.2.4, exercise 11 (rated M15): what is it asking?	The reciprocal of a log-law number follows the same law.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.4 Distribution of Floating Point Numbers
TAOCP §4.2.4, exercise 13 (rated M20, recommended): what is it asking?	How often the floating multiply needs its extra shift.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.4 Distribution of Floating Point Numbers
TAOCP §4.2.4, exercise 19 (rated HM25): what is it asking?	Leading digits of Fibonacci numbers obey the log law. Try it in code first.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.4 Distribution of Floating Point Numbers
TAOCP §4.2.4, exercise 14 (rated HM30, recommended): what is it asking?	Distribution of the result of adding two log-law numbers. The stretch.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.4 Distribution of Floating Point Numbers
TAOCP §4.2.4: how many exercises, and how are they rated?	20 exercises, rated 13 to 42.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.4 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::4.2.4 Distribution of Floating Point Numbers
TAOCP §4.2.4: what should you be comfortable with first?	<ul><li>4.2.2 Accuracy of Floating Point Arithmetic</li><li>1.2.2 Logarithms</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.4 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::4.2.4 Distribution of Floating Point Numbers
TAOCP §4.2.4: how should you work through it?	Download any numeric dataset (populations, file sizes) and check the leading-digit distribution. Then read the explanation.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.4 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::4.2.4 Distribution of Floating Point Numbers
TAOCP §4.3.1 The Classical Algorithms: what does it cover?	Grade-school arithmetic on arbitrarily long integers: addition, subtraction, multiplication and especially long division, where Knuth gives a careful algorithm for estimating each quotient digit and proves it is almost always right.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.1 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::4.3.1 The Classical Algorithms
TAOCP §4.3.1: why does it matter?	Every bignum library (Python ints, Java BigInteger, crypto libraries) is built on these. The long division algorithm is notoriously easy to get subtly wrong.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.1 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::4.3.1 The Classical Algorithms
TAOCP §4.3.1: what traps should you watch for?	<ul><li>Forgetting to normalize the divisor before division.</li><li>Overflow in the quotient-digit estimate.</li><li>Edge cases: divisor with one digit, leading zero digits, dividend smaller than divisor.</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.1 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 2::4.3.1 The Classical Algorithms
TAOCP §4.3.1, exercise 6 (rated 22, recommended): what is it asking?	Add left to right without ever revising a digit you have already written.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.3.1 The Classical Algorithms
TAOCP §4.3.1, exercise 16 (rated 20, recommended): what is it asking?	Short division by a single digit. You will use it constantly.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.3.1 The Classical Algorithms
TAOCP §4.3.1, exercise 19 (rated M21, recommended): what is it asking?	The refinement that makes the trial quotient digit almost always correct.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.3.1 The Classical Algorithms
TAOCP §4.3.1, exercise 22 (rated 24, recommended): what is it asking?	Find a case where the rare add-back step is needed. Use it as a test case.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.3.1 The Classical Algorithms
TAOCP §4.3.1, exercise 37 (rated 20, recommended): what is it asking?	Skip normalization when the scale factor is a power of two.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.3.1 The Classical Algorithms
TAOCP §4.3.1, exercise 41 (rated M26, recommended): what is it asking?	Montgomery multiplication for repeated work modulo a fixed number. The basis of fast modular exponentiation.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.3.1 The Classical Algorithms
TAOCP §4.3.1, exercise 43 (rated 22, recommended): what is it asking?	Exact rounded scaling of 8-bit color values without division. A real graphics trick.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.3.1 The Classical Algorithms
TAOCP §4.3.1, exercise 28 (rated M30): what is it asking?	Svoboda's idea for making the divisor easy to divide by. The stretch.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.3.1 The Classical Algorithms
TAOCP §4.3.1: how many exercises, and how are they rated?	43 exercises, rated 10 to 42.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.1 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::4.3.1 The Classical Algorithms
TAOCP §4.3.1: what should you be comfortable with first?	<ul><li>4.1 Positional Number Systems</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.1 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::4.3.1 The Classical Algorithms
TAOCP §4.3.1: how should you work through it?	Implement all four operations for numbers stored as arrays of 32-bit digits in C, with 64-bit intermediates. Test against Python's integers on random inputs. Spend most of the time on division and its normalization step.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.1 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::4.3.1 The Classical Algorithms
TAOCP §4.3.2 Modular Arithmetic: what does it cover?	Representing big numbers by their remainders modulo several coprime moduli, so that addition and multiplication become independent small operations, then reconstructing the answer with the Chinese remainder theorem.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.2 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::4.3.2 Modular Arithmetic
TAOCP §4.3.2: why does it matter?	Residue number systems are used in cryptography and in fast polynomial and integer arithmetic. CRT also shows up in competitive programming and hashing.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.2 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::4.3.2 Modular Arithmetic
TAOCP §4.3.2: what traps should you watch for?	<ul><li>Moduli that are not pairwise coprime break the reconstruction.</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.2 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 2::4.3.2 Modular Arithmetic
TAOCP §4.3.2, exercise 1 (rated 20): what is it asking?	Solve a small Chinese remainder problem by hand.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.3.2 Modular Arithmetic
TAOCP §4.3.2, exercise 4 (rated 20): what is it asking?	Keep choosing moduli greedily as the text does.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.3.2 Modular Arithmetic
TAOCP §4.3.2, exercise 3 (rated M26, recommended): what is it asking?	The Chinese remainder theorem when moduli share factors.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.3.2 Modular Arithmetic
TAOCP §4.3.2, exercise 5 (rated M23, recommended): what is it asking?	Does the greedy choice of moduli give the best product?	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.3.2 Modular Arithmetic
TAOCP §4.3.2, exercise 7 (rated M21, recommended): what is it asking?	Rearrange the mixed-radix reconstruction to save work.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.3.2 Modular Arithmetic
TAOCP §4.3.2, exercise 12 (rated M10): what is it asking?	Detecting overflow in modular addition is a comparison problem.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.3.2 Modular Arithmetic
TAOCP §4.3.2, exercise 13 (rated M25, recommended): what is it asking?	Find all decimal automorphs like 9376. A fun application of the theorem.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.3.2 Modular Arithmetic
TAOCP §4.3.2, exercise 14 (rated M30, recommended): what is it asking?	Cyclic convolution and multiplication modulo a Mersenne-style number. The stretch, and a bridge to 4.3.3.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.3.2 Modular Arithmetic
TAOCP §4.3.2: how many exercises, and how are they rated?	14 exercises, rated M10 to M30.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.2 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::4.3.2 Modular Arithmetic
TAOCP §4.3.2: what should you be comfortable with first?	<ul><li>4.3.1 The Classical Algorithms</li><li>1.2.4 Number theory</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.2 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::4.3.2 Modular Arithmetic
TAOCP §4.3.2: how should you work through it?	Implement CRT reconstruction for three small moduli and test it. Make sure you can compute a modular inverse with extended Euclid.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.2 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::4.3.2 Modular Arithmetic
TAOCP §4.3.3 How Fast Can We Multiply?: what does it cover?	Faster-than-schoolbook multiplication: splitting numbers in halves to trade a multiplication for additions (Karatsuba-style), Toom-Cook generalizations, and the Fourier transform approach that leads to Schonhage-Strassen.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.3 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::4.3.3 How Fast Can We Multiply?
TAOCP §4.3.3: why does it matter?	These ideas are behind every fast bignum library and are a beautiful example of divide and conquer and of how the FFT connects to arithmetic.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.3 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::4.3.3 How Fast Can We Multiply?
TAOCP §4.3.3, a common trap: “Recursing all the way down to single digits.” What's the catch?	Switch to schoolbook below a threshold.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.3 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 2::4.3.3 How Fast Can We Multiply?
TAOCP §4.3.3, exercise 1 (rated 22): what is it asking?	Karatsuba in decimal, by hand, on four-digit numbers.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.3.3 How Fast Can We Multiply?
TAOCP §4.3.3, exercise 8 (rated M20): what is it asking?	Can you skip the bit reversal in the FFT? A common shortcut question.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.3.3 How Fast Can We Multiply?
TAOCP §4.3.3, exercise 9 (rated M15): what is it asking?	Replacing the root of unity by a power of it. Checks you understand the transform.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.3.3 How Fast Can We Multiply?
TAOCP §4.3.3, exercise 17 (rated M26): what is it asking?	Count exactly how many small products Karatsuba does.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.3.3 How Fast Can We Multiply?
TAOCP §4.3.3, exercise 4 (rated 28, recommended): what is it asking?	Evaluate at symmetric points to speed up Toom-Cook.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.3.3 How Fast Can We Multiply?
TAOCP §4.3.3, exercise 16 (rated 25, recommended): what is it asking?	A discrete Fourier transform of any length in n log n operations.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.3.3 How Fast Can We Multiply?
TAOCP §4.3.3, exercise 19 (rated M23, recommended): what is it asking?	Compute u*v mod m with a bounded number of safe operations.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.3.3 How Fast Can We Multiply?
TAOCP §4.3.3, exercise 18 (rated M30, recommended): what is it asking?	Schedule memory for recursive Karatsuba. The stretch, and a real implementation issue.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.3.3 How Fast Can We Multiply?
TAOCP §4.3.3: how many exercises, and how are they rated?	19 exercises, rated M15 to M49.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.3 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::4.3.3 How Fast Can We Multiply?
TAOCP §4.3.3: what should you be comfortable with first?	<ul><li>4.3.1 The Classical Algorithms</li><li>Divide and conquer, recursion</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.3 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::4.3.3 How Fast Can We Multiply?
TAOCP §4.3.3: how should you work through it?	Implement the half-splitting method on top of your 4.3.1 bignums and find the crossover size where it beats schoolbook. Read the FFT part for ideas; implementing an FFT multiply is a stretch goal.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.3 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::4.3.3 How Fast Can We Multiply?
TAOCP §4.4 Radix Conversion: what does it cover?	Converting numbers between bases efficiently, for integers and fractions, by multiplication or division, and how to do it correctly with floating point and multiple precision.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.4 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::4.4 Radix Conversion
TAOCP §4.4: why does it matter?	Printing and parsing numbers correctly (especially floats) is surprisingly hard; many languages had bugs here for decades.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.4 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::4.4 Radix Conversion
TAOCP §4.4: what traps should you watch for?	<ul><li>Converting fractions with floats and accumulating rounding error.</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.4 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 2::4.4 Radix Conversion
TAOCP §4.4, exercise 11 (rated 16): what is it asking?	Octal to decimal by hand. Drill.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.4 Radix Conversion
TAOCP §4.4, exercise 12 (rated 22, recommended): what is it asking?	A fast pencil method for ternary to decimal and back.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.4 Radix Conversion
TAOCP §4.4, exercise 1 (rated 25, recommended): what is it asking?	Generalize conversion to mixed-radix systems, such as times and dates.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.4 Radix Conversion
TAOCP §4.4, exercise 3 (rated 25, recommended): what is it asking?	Print a fraction with just enough digits to read it back exactly. The idea behind shortest float printing.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.4 Radix Conversion
TAOCP §4.4, exercise 7 (rated M18): what is it asking?	When multiplying by an approximate reciprocal gives the right quotient.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.4 Radix Conversion
TAOCP §4.4, exercise 10 (rated 22): what is it asking?	Halve a binary-coded decimal number with shifts and masks.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.4 Radix Conversion
TAOCP §4.4, exercise 9 (rated M29, recommended): what is it asking?	Divide by 10 using only shifts, masks and adds. Compilers do exactly this.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.4 Radix Conversion
TAOCP §4.4, exercise 14 (rated M27, recommended): what is it asking?	Fast conversion of huge integers with divide and conquer. The stretch.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.4 Radix Conversion
TAOCP §4.4: how many exercises, and how are they rated?	19 exercises, rated 16 to M47.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.4 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::4.4 Radix Conversion
TAOCP §4.4: what should you be comfortable with first?	<ul><li>4.1 Positional Number Systems</li><li>4.3.1 The Classical Algorithms</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.4 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::4.4 Radix Conversion
TAOCP §4.4: how should you work through it?	Implement integer to decimal string for your bignums. Then read about fraction conversion and think about why printing the shortest float that round-trips is hard.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.4 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::4.4 Radix Conversion
TAOCP §4.5.1 Fractions: what does it cover?	Exact rational arithmetic: keeping fractions in lowest terms with gcds, doing add and multiply so intermediate numbers stay small, and fixed-slash and floating-slash representations that store a fraction in a fixed number of bits.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.1 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::4.5.1 Fractions
TAOCP §4.5.1: why does it matter?	Rationals are used in computer algebra, geometry kernels and anywhere floats are not exact enough.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.1 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::4.5.1 Fractions
TAOCP §4.5.1: what traps should you watch for?	<ul><li>Reducing only at the end and overflowing in the middle.</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.1 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 2::4.5.1 Fractions
TAOCP §4.5.1, exercise 1 (rated 15): what is it asking?	Compare two fractions without overflow.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.1 Fractions
TAOCP §4.5.1, exercise 5 (rated 10): what is it asking?	Add two fractions with the text's method.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.1 Fractions
TAOCP §4.5.1, exercise 2 (rated M15): what is it asking?	Dividing out the gcd leaves coprime parts.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.1 Fractions
TAOCP §4.5.1, exercise 6 (rated M23, recommended): what is it asking?	The gcd fact behind the efficient addition method.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.1 Fractions
TAOCP §4.5.1, exercise 8 (rated 22, recommended): what is it asking?	Use 1/0 and -1/0 as infinities or overflow markers.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.1 Fractions
TAOCP §4.5.1, exercise 7 (rated M22): what is it asking?	How large intermediate values get in fraction addition. The stretch.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.1 Fractions
TAOCP §4.5.1: how many exercises, and how are they rated?	16 exercises, rated 10 to 42.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.1 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::4.5.1 Fractions
TAOCP §4.5.1: what should you be comfortable with first?	<ul><li>4.5.2 GCD idea from 1.1</li><li>4.3.1 Classical Algorithms</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.1 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::4.5.1 Fractions
TAOCP §4.5.1: how should you work through it?	Implement a Rational type with add and multiply that reduces cleverly using gcds of partial terms, as the section suggests, and test it.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.1 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::4.5.1 Fractions
TAOCP §4.5.2 The Greatest Common Divisor: what does it cover?	Euclid again, now in depth: the extended algorithm for finding coefficients, the binary gcd algorithm that uses only shifts and subtraction, and gcd for multiple-precision numbers.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.2 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::4.5.2 The Greatest Common Divisor
TAOCP §4.5.2: why does it matter?	Extended Euclid gives modular inverses, needed in RSA and hashing. Binary gcd is a good example of trading division for cheap operations.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.2 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::4.5.2 The Greatest Common Divisor
TAOCP §4.5.2: what traps should you watch for?	<ul><li>Sign handling in extended Euclid coefficients.</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.2 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 2::4.5.2 The Greatest Common Divisor
TAOCP §4.5.2, exercise 9 (rated 18): what is it asking?	Run the binary gcd and extended Euclid by hand on one pair.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.2 The Greatest Common Divisor
TAOCP §4.5.2, exercise 16 (rated M22, recommended): what is it asking?	Division modulo m with extended Euclid. Modular inverse in practice.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.2 The Greatest Common Divisor
TAOCP §4.5.2, exercise 17 (rated M20, recommended): what is it asking?	Lift an inverse modulo 2^e to modulo 2^(2e). Newton's method for integers.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.2 The Greatest Common Divisor
TAOCP §4.5.2, exercise 41 (rated M22): what is it asking?	Closed form for gcd(10^m - 1, 10^n - 1).	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.2 The Greatest Common Divisor
TAOCP §4.5.2, exercise 5 (rated M26, recommended): what is it asking?	Design a gcd algorithm for balanced ternary.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.2 The Greatest Common Divisor
TAOCP §4.5.2, exercise 39 (rated M28, recommended): what is it asking?	Extend the binary gcd to compute the coefficients too.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.2 The Greatest Common Divisor
TAOCP §4.5.2, exercise 40 (rated M25, recommended): what is it asking?	A hardware-friendly binary gcd that avoids comparisons.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.2 The Greatest Common Divisor
TAOCP §4.5.2, exercise 10 (rated HM24, recommended): what is it asking?	Prove that two random integers are coprime with probability 6/pi^2. The stretch.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.2 The Greatest Common Divisor
TAOCP §4.5.2: how many exercises, and how are they rated?	42 exercises, rated 18 to HM49.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.2 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::4.5.2 The Greatest Common Divisor
TAOCP §4.5.2: what should you be comfortable with first?	<ul><li>1.1 Algorithms</li><li>4.5.1 Fractions</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.2 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::4.5.2 The Greatest Common Divisor
TAOCP §4.5.2: how should you work through it?	Implement Euclid, binary gcd and extended Euclid. Benchmark the first two on 64-bit numbers. Use extended Euclid to compute modular inverses and check them.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.2 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::4.5.2 The Greatest Common Divisor
TAOCP §4.5.3 Analysis of Euclid's Algorithm: what does it cover?	How many steps Euclid takes: the worst case involves consecutive Fibonacci numbers (Lame's theorem), and the average case connects to continued fractions and a famous distribution of partial quotients.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.3 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::4.5.3 Analysis of Euclid's Algorithm
TAOCP §4.5.3: why does it matter?	A beautiful example of algorithm analysis meeting deep math. The worst-case result alone (logarithmic steps) is worth knowing cold.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.3 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::4.5.3 Analysis of Euclid's Algorithm
TAOCP §4.5.3, a common trap: “Getting lost in the HM material.” What's the catch?	The first part is the essential part.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.3 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 2::4.5.3 Analysis of Euclid's Algorithm
TAOCP §4.5.3, exercise 1 (rated 20): what is it asking?	Speed up Euclid when the quotient is often 1.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.3 Analysis of Euclid's Algorithm
TAOCP §4.5.3, exercise 32 (rated 20): what is it asking?	Continuants and Morse code. A pleasant combinatorial view.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.3 Analysis of Euclid's Algorithm
TAOCP §4.5.3, exercise 4 (rated M20): what is it asking?	Prove a basic continuant identity.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.3 Analysis of Euclid's Algorithm
TAOCP §4.5.3, exercise 24 (rated M22): what is it asking?	Average size of a partial quotient. The answer is surprising.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.3 Analysis of Euclid's Algorithm
TAOCP §4.5.3, exercise 39 (rated M25, recommended): what is it asking?	Smallest number of at-bats giving a batting average of .334. Best rational approximation in action.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.3 Analysis of Euclid's Algorithm
TAOCP §4.5.3, exercise 40 (rated M28, recommended): what is it asking?	The Stern-Brocot tree and how it lists every fraction once.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.3 Analysis of Euclid's Algorithm
TAOCP §4.5.3, exercise 51 (rated M30, recommended): what is it asking?	Rational reconstruction: recover a small fraction from its residue. Used in computer algebra.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.3 Analysis of Euclid's Algorithm
TAOCP §4.5.3, exercise 30 (rated HM32, recommended): what is it asking?	Analyze the nearest-remainder variant of Euclid. The stretch.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.3 Analysis of Euclid's Algorithm
TAOCP §4.5.3: how many exercises, and how are they rated?	51 exercises, rated 20 to HM46.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.3 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::4.5.3 Analysis of Euclid's Algorithm
TAOCP §4.5.3: what should you be comfortable with first?	<ul><li>4.5.2 The Greatest Common Divisor</li><li>1.2.8 Fibonacci Numbers</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.3 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::4.5.3 Analysis of Euclid's Algorithm
TAOCP §4.5.3: how should you work through it?	Prove the Fibonacci worst case yourself first. Then empirically count steps on random inputs and compare to the average formula. The heavy continued-fraction analysis can be read for ideas.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.3 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::4.5.3 Analysis of Euclid's Algorithm
TAOCP §4.5.4 Factoring into Primes: what does it cover?	Methods for factoring integers and testing primality: trial division, Fermat's method, Pollard's rho, probabilistic primality testing, and the connection to public-key cryptography (RSA), plus a look at more advanced sieving methods.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.4 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::4.5.4 Factoring into Primes
TAOCP §4.5.4: why does it matter?	Primality testing and the hardness of factoring are the foundation of RSA. Pollard rho is also a neat use of cycle detection.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.4 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::4.5.4 Factoring into Primes
TAOCP §4.5.4, a common trap: “Overflow in modular multiplication.” What's the catch?	Use 128-bit intermediates or bignums.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.4 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 2::4.5.4 Factoring into Primes
TAOCP §4.5.4: what traps should you watch for?	<ul><li>Treating a probabilistic test as deterministic.</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.4 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 2::4.5.4 Factoring into Primes
TAOCP §4.5.4, exercise 1 (rated 10): what is it asking?	Why composite trial divisors never show up in the output.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.4 Factoring into Primes
TAOCP §4.5.4, exercise 5 (rated 21): what is it asking?	Fermat's method by hand on a five-digit number.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.4 Factoring into Primes
TAOCP §4.5.4, exercise 8 (rated 23, recommended): what is it asking?	The sieve of Eratosthenes and how to do it well. Implement it.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.4 Factoring into Primes
TAOCP §4.5.4, exercise 10 (rated M26, recommended): what is it asking?	Selfridge's test for proving primality from the factors of n - 1.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.4 Factoring into Primes
TAOCP §4.5.4, exercise 19 (rated M25, recommended): what is it asking?	Pollard's p - 1 idea. Another factoring method to implement.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.4 Factoring into Primes
TAOCP §4.5.4, exercise 26 (rated M25, recommended): what is it asking?	Pocklington's primality certificate.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.4 Factoring into Primes
TAOCP §4.5.4, exercise 38 (rated 25): what is it asking?	Find the largest 50-digit primes made mostly of one digit. A fun programming exercise with Miller-Rabin.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.4 Factoring into Primes
TAOCP §4.5.4, exercise 22 (rated M30, recommended): what is it asking?	Bound the error rate of the probabilistic primality test. The stretch.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.4 Factoring into Primes
TAOCP §4.5.4: how many exercises, and how are they rated?	47 exercises, rated 10 to M50.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.4 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::4.5.4 Factoring into Primes
TAOCP §4.5.4: what should you be comfortable with first?	<ul><li>4.5.2 The Greatest Common Divisor</li><li>4.3.2 Modular Arithmetic</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.4 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::4.5.4 Factoring into Primes
TAOCP §4.5.4: how should you work through it?	Implement trial division, Pollard rho (with Floyd's cycle detection) and a Miller-Rabin primality test. Factor some 20-digit numbers. Read the advanced methods for the ideas only.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.4 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::4.5.4 Factoring into Primes
TAOCP §4.6.1 Division of Polynomials: what does it cover?	Polynomial arithmetic, especially division with remainder, and computing greatest common divisors of polynomials, including variants that avoid fractions when coefficients are integers.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.1 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::4.6.1 Division of Polynomials
TAOCP §4.6.1: why does it matter?	Polynomials over finite fields power error-correcting codes, CRCs and cryptography. Polynomial gcd is a building block in computer algebra.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.1 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::4.6.1 Division of Polynomials
TAOCP §4.6.1, a common trap: “Coefficient blow-up when working over the integers.” What's the catch?	That is exactly what the fraction-free methods address.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.1 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 2::4.6.1 Division of Polynomials
TAOCP §4.6.1, exercise 1 of §4.6 (rated 10): what is it asking?	Polynomial arithmetic modulo 10. Shows where non-prime moduli cause trouble.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.1 Division of Polynomials
TAOCP §4.6.1, exercise 4 of §4.6 (rated 21, recommended): what is it asking?	Multiply polynomials mod 2 with bitwise word operations.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.1 Division of Polynomials
TAOCP §4.6.1, exercise 5 of §4.6 (rated M21, recommended): what is it asking?	Karatsuba for polynomials mod 2.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.1 Division of Polynomials
TAOCP §4.6.1, exercise 1 of §4.6.1 (rated 10): what is it asking?	Pseudo-division by hand on integer polynomials.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.1 Division of Polynomials
TAOCP §4.6.1, exercise 2 of §4.6.1 (rated 15): what is it asking?	A polynomial gcd modulo 7.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.1 Division of Polynomials
TAOCP §4.6.1, exercise 3 of §4.6.1 (rated M25): what is it asking?	Extended Euclid for polynomials and the degrees of the coefficients.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.1 Division of Polynomials
TAOCP §4.6.1, exercise 16 of §4.6.1 (rated M22, recommended): what is it asking?	A nonzero polynomial cannot vanish on too many grid points. The basis of randomized identity testing.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.1 Division of Polynomials
TAOCP §4.6.1, exercise 26 of §4.6.1 (rated M26, recommended): what is it asking?	Best rational-function approximations from the polynomial Euclid algorithm. The stretch.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.1 Division of Polynomials
TAOCP §4.6.1: how many exercises, and how are they rated?	31 exercises, rated 10 to M40.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.1 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::4.6.1 Division of Polynomials
TAOCP §4.6.1: what should you be comfortable with first?	<ul><li>4.5.2 The Greatest Common Divisor</li><li>4.3.1 Classical Algorithms</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.1 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::4.6.1 Division of Polynomials
TAOCP §4.6.1: how should you work through it?	Implement polynomial division over integers mod a prime. Then compute a CRC by hand as polynomial division over GF(2) to see a real use.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.1 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::4.6.1 Division of Polynomials
TAOCP §4.6.2 Factorization of Polynomials: what does it cover?	Factoring polynomials modulo a prime (Berlekamp's algorithm and distinct-degree factorization) and then lifting to factor polynomials over the integers.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.2 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::4.6.2 Factorization of Polynomials
TAOCP §4.6.2: why does it matter?	One of the more specialized sections. It matters for computer algebra and coding theory; for most programmers the takeaway is that factoring polynomials is surprisingly tractable while factoring integers is not.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.2 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::4.6.2 Factorization of Polynomials
TAOCP §4.6.2, a common trap: “Feeling you must master this.” What's the catch?	It is fine to come back later.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.2 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 2::4.6.2 Factorization of Polynomials
TAOCP §4.6.2, exercise 9 (rated 20): what is it asking?	Build a table of inverses mod 101 from a primitive root.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.2 Factorization of Polynomials
TAOCP §4.6.2, exercise 10 (rated 21, recommended): what is it asking?	Factor the text's example mod 2 with Berlekamp.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.2 Factorization of Polynomials
TAOCP §4.6.2, exercise 11 (rated 22): what is it asking?	Same polynomial mod 5.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.2 Factorization of Polynomials
TAOCP §4.6.2, exercise 12 (rated M22, recommended): what is it asking?	How x^4 + 1 factors modulo every prime.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.2 Factorization of Polynomials
TAOCP §4.6.2, exercise 19 (rated M20): what is it asking?	Eisenstein's irreducibility criterion.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.2 Factorization of Polynomials
TAOCP §4.6.2, exercise 15 (rated M27, recommended): what is it asking?	Square roots modulo a prime. Needed all over number theory and crypto.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.2 Factorization of Polynomials
TAOCP §4.6.2, exercise 34 (rated M25, recommended): what is it asking?	Squarefree factorization using derivatives and gcds.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.2 Factorization of Polynomials
TAOCP §4.6.2, exercise 22 (rated M24, recommended): what is it asking?	Hensel lifting of a factorization mod p to mod p^e. The stretch.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.2 Factorization of Polynomials
TAOCP §4.6.2: how many exercises, and how are they rated?	41 exercises, rated 20 to M47.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.2 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::4.6.2 Factorization of Polynomials
TAOCP §4.6.2: what should you be comfortable with first?	<ul><li>4.6.1 Division of Polynomials</li><li>Basic linear algebra mod p</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.2 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::4.6.2 Factorization of Polynomials
TAOCP §4.6.2: how should you work through it?	Read the overview and follow one small worked example of Berlekamp's algorithm. Skim the rest. Spend extra time catching up if you are behind.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.2 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::4.6.2 Factorization of Polynomials
TAOCP §4.6.3 Evaluation of Powers: what does it cover?	Computing x^n with as few multiplications as possible: the binary (square-and-multiply) method, and the deep theory of addition chains, which ask for the shortest sequence of additions reaching n.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.3 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::4.6.3 Evaluation of Powers
TAOCP §4.6.3: why does it matter?	Fast exponentiation is used everywhere from modular crypto to matrix powers for linear recurrences. Addition chains are a famous open-problem area that is easy to state.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.3 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::4.6.3 Evaluation of Powers
TAOCP §4.6.3, a common trap: “Assuming the binary method is optimal.” What's the catch?	Knuth shows small n where it is not.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.3 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 2::4.6.3 Evaluation of Powers
TAOCP §4.6.3, exercise 1 (rated 15): what is it asking?	State the final value in the right-to-left binary method.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.3 Evaluation of Powers
TAOCP §4.6.3, exercise 3 (rated 22, recommended): what is it asking?	Compute one power by several methods and compare their costs.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.3 Evaluation of Powers
TAOCP §4.6.3, exercise 4 (rated M20): what is it asking?	A case where the octal method beats binary by a lot.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.3 Evaluation of Powers
TAOCP §4.6.3, exercise 5 (rated 24, recommended): what is it asking?	Build the power tree. Implement it.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.3 Evaluation of Powers
TAOCP §4.6.3, exercise 9 (rated 25, recommended): what is it asking?	Exponentiation with a window of e bits.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.3 Evaluation of Powers
TAOCP §4.6.3, exercise 26 (rated M25, recommended): what is it asking?	Large Fibonacci numbers modulo m quickly.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.3 Evaluation of Powers
TAOCP §4.6.3, exercise 30 (rated 20): what is it asking?	Allowing subtraction (division) in chains.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.3 Evaluation of Powers
TAOCP §4.6.3, exercise 11 (rated M26, recommended): what is it asking?	Find all optimal chains for two specific exponents. The stretch.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.3 Evaluation of Powers
TAOCP §4.6.3: how many exercises, and how are they rated?	42 exercises, rated 10 to M50.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.3 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::4.6.3 Evaluation of Powers
TAOCP §4.6.3: what should you be comfortable with first?	<ul><li>4.1 Positional Number Systems</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.3 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::4.6.3 Evaluation of Powers
TAOCP §4.6.3: how should you work through it?	Implement right-to-left and left-to-right binary exponentiation and count multiplications. Then find the shortest addition chain for small n by brute force and compare to the binary method.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.3 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::4.6.3 Evaluation of Powers
TAOCP §4.6.4 Evaluation of Polynomials: what does it cover?	Evaluating polynomials efficiently: Horner's rule, evaluating at many points, preprocessing coefficients to save multiplications, and the related cost of matrix and polynomial operations, including the Fourier transform.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.4 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::4.6.4 Evaluation of Polynomials
TAOCP §4.6.4: why does it matter?	Horner's rule is used in every math library and in hashing (polynomial rolling hashes). The FFT view connects to signal processing and fast multiplication.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.4 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::4.6.4 Evaluation of Polynomials
TAOCP §4.6.4: what traps should you watch for?	<ul><li>Numerical instability when evaluating with floats at large x.</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.4 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 2::4.6.4 Evaluation of Polynomials
TAOCP §4.6.4, exercise 1 (rated 15): what is it asking?	Evaluate an odd polynomial efficiently.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.4 Evaluation of Polynomials
TAOCP §4.6.4, exercise 2 (rated M20, recommended): what is it asking?	Shift a polynomial's origin with Horner-like steps or fast multiplication.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.4 Evaluation of Polynomials
TAOCP §4.6.4, exercise 3 (rated 20): what is it asking?	Horner's rule for two variables, with operation counts.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.4 Evaluation of Polynomials
TAOCP §4.6.4, exercise 41 (rated 22): what is it asking?	Complex multiplication with three real multiplications.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.4 Evaluation of Polynomials
TAOCP §4.6.4, exercise 57 (rated M20): what is it asking?	Multiply polynomials with the FFT in n log n time. Implement it.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.4 Evaluation of Polynomials
TAOCP §4.6.4, exercise 19 (rated M24, recommended): what is it asking?	Adapt coefficients ahead of time to save multiplications.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.4 Evaluation of Polynomials
TAOCP §4.6.4, exercise 14 (rated HM28, recommended): what is it asking?	Derive the fast Fourier transform from the text's general scheme.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.4 Evaluation of Polynomials
TAOCP §4.6.4, exercise 51 (rated M24, recommended): what is it asking?	Winograd's small cyclic convolutions. The stretch.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.4 Evaluation of Polynomials
TAOCP §4.6.4: how many exercises, and how are they rated?	74 exercises, rated 15 to M50.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.4 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::4.6.4 Evaluation of Polynomials
TAOCP §4.6.4: what should you be comfortable with first?	<ul><li>4.6.1 Division of Polynomials</li><li>4.3.3 How Fast Can We Multiply?</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.4 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::4.6.4 Evaluation of Polynomials
TAOCP §4.6.4: how should you work through it?	Implement Horner's rule and a rolling hash using it. Read the coefficient-preprocessing ideas lightly. Spend real time on the discrete Fourier transform discussion if FFT is new to you.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.4 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::4.6.4 Evaluation of Polynomials
TAOCP §4.7 Manipulation of Power Series: what does it cover?	Algorithms for working with power series as data: multiplying, dividing, raising to powers, composing and reversing them, including Lagrange inversion.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.7 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::4.7 Manipulation of Power Series
TAOCP §4.7: why does it matter?	This is computer algebra territory, and it is the algorithmic side of the generating functions from 1.2.9. Useful if you ever do combinatorics by computer.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.7 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::4.7 Manipulation of Power Series
TAOCP §4.7: what traps should you watch for?	<ul><li>Forgetting to truncate, which makes costs explode.</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.7 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 2::4.7 Manipulation of Power Series
TAOCP §4.7, exercise 1 (rated M10): what is it asking?	Division when the leading coefficient is zero.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.7 Manipulation of Power Series
TAOCP §4.7, exercise 2 (rated 20): what is it asking?	Keep integer coefficients integral during division.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.7 Manipulation of Power Series
TAOCP §4.7, exercise 5 (rated M00): what is it asking?	What reverting twice gives you.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.7 Manipulation of Power Series
TAOCP §4.7, exercise 4 (rated HM23, recommended): what is it asking?	Exponential and logarithm of a power series with small changes to the power recurrence.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.7 Manipulation of Power Series
TAOCP §4.7, exercise 6 (rated M21, recommended): what is it asking?	Newton's method for the reciprocal of a power series. The key to fast series division.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.7 Manipulation of Power Series
TAOCP §4.7, exercise 11 (rated M25, recommended): what is it asking?	Compose two power series.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.7 Manipulation of Power Series
TAOCP §4.7, exercise 8 (rated M25, recommended): what is it asking?	Lagrange's inversion formula in its general form.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.7 Manipulation of Power Series
TAOCP §4.7, exercise 14 (rated HM30, recommended): what is it asking?	Fractional iteration of a power series. The stretch.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.7 Manipulation of Power Series
TAOCP §4.7: how many exercises, and how are they rated?	28 exercises, rated M00 to HM35.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.7 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::4.7 Manipulation of Power Series
TAOCP §4.7: what should you be comfortable with first?	<ul><li>1.2.9 Generating Functions</li><li>4.6 Polynomial Arithmetic</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.7 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::4.7 Manipulation of Power Series
TAOCP §4.7: how should you work through it?	Implement power-series multiplication and reciprocal on truncated series. Use them to compute the Catalan numbers from their generating function.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.7 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::4.7 Manipulation of Power Series
TAOCP Vol 2 review: what does it cover?	A review week for Volume 2: random numbers and arithmetic.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::vol_2_review cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::Vol 2 review
TAOCP: Vol 2 review: why does it matter?	Vol 3 leans on probability (from chapter 3) and on the analysis style you practiced. A quick review makes the switch smoother.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::vol_2_review cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::Vol 2 review
TAOCP: Vol 2 review, a common trap: “Skipping review.” What's the catch?	This is the halfway point of the whole path.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::vol_2_review cracked.guide::kind::trap	cracked.guide::TAOCP Vol 2::Vol 2 review
TAOCP: Vol 2 review, exercise 23 of §3.1 (rated M26, recommended): what is it asking?	Encode every mapping as a sequence with a bijection. Combinatorial review.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::vol_2_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::Vol 2 review
TAOCP: Vol 2 review, exercise 16 of §3.2.2 (rated M28, recommended): what is it asking?	Show that the shift-register method produces a linear recurrence mod 2.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::vol_2_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::Vol 2 review
TAOCP: Vol 2 review, exercise 16 of §3.4.1 (rated HM22, recommended): what is it asking?	Design a rejection sampler for gamma deviates of small order.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::vol_2_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::Vol 2 review
TAOCP: Vol 2 review, exercise 30 of §4.2.2 (rated M30, recommended): what is it asking?	Explain wildly wrong calculator results on a harmless-looking function. Floating-point review.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::vol_2_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::Vol 2 review
TAOCP: Vol 2 review, exercise 21 of §4.3.1 (rated M23, recommended): what is it asking?	How rarely the corrected trial quotient is still wrong.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::vol_2_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::Vol 2 review
TAOCP: Vol 2 review, exercise 38 of §4.5.2 (rated M32, recommended): what is it asking?	Make the binary gcd fast for big numbers, Lehmer-style.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::vol_2_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::Vol 2 review
TAOCP: Vol 2 review, exercise 41 of §4.5.4 (rated M28, recommended): what is it asking?	Count primes faster than finding them all.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::vol_2_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::Vol 2 review
TAOCP: Vol 2 review, exercise 38 of §4.6.4 (rated HM32, recommended): what is it asking?	Prove that Horner's rule is optimal when coefficients are not preprocessed.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::vol_2_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::Vol 2 review
TAOCP: Vol 2 review: how many exercises, and how are they rated?	918 exercises, rated 00 to HM50.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::vol_2_review cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::Vol 2 review
TAOCP: Vol 2 review: what should you be comfortable with first?	<ul><li>All of Vol 2</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::vol_2_review cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::Vol 2 review
TAOCP: Vol 2 review: how should you work through it?	Tidy up the code you wrote: PRNGs, tests, bignums, gcd, factoring. Put it in one repo with tests. Write a one-page summary of what to use in practice for random numbers and for big arithmetic.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::vol_2_review cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::Vol 2 review
TAOCP Vol 3: Sorting and Searching: what is the phase about?	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](https://www.youtube.com/watch?v=TxCB-GBpmIQ) that helped inspire this path: &quot;If you actually go through [Volume 3] for real, you will know way more data structures than anyone with a CS degree.&quot; For real means the exercises too.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::About this phase
TAOCP Vol 3: what should you be able to do by the end?	<ul><li>Implement and analyze quicksort, heapsort, merge sort, radix sort and Shellsort.</li><li>Explain why comparison sorting needs about n lg n comparisons.</li><li>Build AVL trees, B-trees, tries and hash tables, and predict their performance.</li><li>Design an external sort for data that does not fit in memory.</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::kind::outcomes	cracked.guide::TAOCP Vol 3::About this phase
TAOCP Vol 3: what do you need before you start?	<ul><li>Vols 1 and 2, especially 1.2 math and 2.3 trees.</li><li>Your clox hash table (chapter 20) as a reference point for 6.4.</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::kind::need	cracked.guide::TAOCP Vol 3::About this phase
TAOCP Vol 3: how do you get the book?	Vol 3, 2nd edition is about $64 new from InformIT. The 1st edition (1973) is fine and often very cheap used. Borrow before you buy: many public and university libraries give you free access to O'Reilly Learning, which carries TAOCP; Libby/OverDrive and interlibrary loan (search WorldCat) work too. Older used editions are fine for Vols 1 to 3; section numbers barely changed. If you buy the eBook, get the PDF from InformIT. Knuth himself warns that the Kindle and ePUB versions mangle the math.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::kind::book	cracked.guide::TAOCP Vol 3::About this phase
TAOCP Vol 3: tips for getting through it?	<ul><li>The tape-sorting sections (5.4.2 to 5.4.8) are mostly historical; skim them and spend the time on 5.4.1 and 5.4.9.</li><li>Build one shared benchmark harness for all your sorts.</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::kind::tips	cracked.guide::TAOCP Vol 3::About this phase
TAOCP §5.1.1 Inversions: what does it cover?	An inversion is a pair of elements that are out of order. Knuth studies the inversion table of a permutation, which encodes it uniquely, and counts how many permutations have a given number of inversions, with generating functions.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.1 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::5.1.1 Inversions
TAOCP §5.1.1: why does it matter?	The number of inversions is exactly how much work insertion sort and bubble sort do, and counting inversions is a classic merge-sort interview problem.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.1 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::5.1.1 Inversions
TAOCP §5.1.1, fill in the blank:<br>Then count inversions in <span class="cg-blank">&nbsp;</span> with a modified merge sort.	Then count inversions in <b>O(n log n)</b> with a modified merge sort.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.1 cracked.guide::kind::complexity	cracked.guide::TAOCP Vol 3::5.1.1 Inversions
TAOCP §5.1.1, a common trap: “There are several conventions for inversion tables.” What's the catch?	Stick to Knuth's within this volume.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.1 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 3::5.1.1 Inversions
TAOCP §5.1.1, exercise 1 (rated 10): what is it asking?	Convert a permutation to its inversion table and back by hand. Five minutes, and it fixes the convention for the whole chapter.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.1 Inversions
TAOCP §5.1.1, exercise 4 (rated 20, recommended): what is it asking?	Rebuild a permutation from its inversion table with a linked list. Implement it; you will use it to test exercise 6.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.1 Inversions
TAOCP §5.1.1, exercise 6 (rated 26, recommended): what is it asking?	Compute the inversion table in n log n time. The same divide-and-conquer idea as counting inversions with merge sort.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.1 Inversions
TAOCP §5.1.1, exercise 9 (rated M21, recommended): what is it asking?	A neat characterization of involutions using two of the alternative inversion tables from exercise 7. Read 7 first.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.1 Inversions
TAOCP §5.1.1, exercise 13 (rated M23): what is it asking?	Show that inversion counts are evenly spread modulo m once n is at least m. Generalizes the even/odd split of permutations.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.1 Inversions
TAOCP §5.1.1, exercise 21 (rated M25, recommended): what is it asking?	Which permutations a stack can produce, described with an inversion-table condition. Ties back to the railway problems in Vol 1.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.1 Inversions
TAOCP §5.1.1, exercise 28 (rated 25, recommended): what is it asking?	Bound the total distance elements sit from home in terms of the inversion count. Useful intuition for why insertion sort is quadratic.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.1 Inversions
TAOCP §5.1.1, exercise 25 (rated M30, recommended): what is it asking?	Build the Foata bijection that trades the index of a permutation for its inversion count. The stretch; give it a fixed time box.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.1 Inversions
TAOCP §5.1.1: how many exercises, and how are they rated?	29 exercises, rated 10 to M43.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.1 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::5.1.1 Inversions
TAOCP §5.1.1: what should you be comfortable with first?	<ul><li>1.2.5 Permutations</li><li>1.2.9 Generating Functions</li><li>1.3.3 Applications to Permutations</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.1 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::5.1.1 Inversions
TAOCP §5.1.1: how should you work through it?	Compute inversion tables for several permutations of 1..5 by hand and convert back. Write code for both directions. Then count inversions in O(n log n) with a modified merge sort.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.1 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::5.1.1 Inversions
TAOCP §5.1.2 Permutations of a Multiset: what does it cover?	Permutations where elements can repeat, and an algebraic product on them (the intercalation product) that lets Knuth prove facts about factoring permutations into cycles in a unified way.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.2 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::5.1.2 Permutations of a Multiset
TAOCP §5.1.2: why does it matter?	Sorting with duplicate keys is the normal case in practice. This section is fairly abstract, though; the practical payoff is mostly the mental model.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.2 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::5.1.2 Permutations of a Multiset
TAOCP §5.1.2, a common trap: “Trying to rush through the abstract algebra.” What's the catch?	It only clicks with examples.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.2 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 3::5.1.2 Permutations of a Multiset
TAOCP §5.1.2, exercise 2 (rated 10): what is it asking?	Compute an intercalation product with the factors swapped. Shows directly that the product does not commute.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.2 Permutations of a Multiset
TAOCP §5.1.2, exercise 6 (rated M15): what is it asking?	Count two-letter strings by how often a b sits right before an a. A warm-up in counting multiset permutations.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.2 Permutations of a Multiset
TAOCP §5.1.2, exercise 8 (rated 20, recommended): what is it asking?	List every way to split the running example into two factors. Hand practice with the product's definition.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.2 Permutations of a Multiset
TAOCP §5.1.2, exercise 15 (rated M25, recommended): what is it asking?	Decide when a multiset permutation is a single cycle by looking at a small directed graph.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.2 Permutations of a Multiset
TAOCP §5.1.2, exercise 17 (rated M24): what is it asking?	Mean and spread of the inversion count for a random multiset permutation. Uses the generating function from 16, so read that statement first.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.2 Permutations of a Multiset
TAOCP §5.1.2, exercise 11 (rated M26, recommended): what is it asking?	Show that counting prime factorizations is the same as counting topological sorts. Links this section to Vol 1's 2.2.3.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.2 Permutations of a Multiset
TAOCP §5.1.2, exercise 10 (rated M30, recommended): what is it asking?	True or false: an ordering on the primes can make factorization unique. The stretch; the answer is subtle.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.2 Permutations of a Multiset
TAOCP §5.1.2: how many exercises, and how are they rated?	24 exercises, rated M05 to M35.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.2 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::5.1.2 Permutations of a Multiset
TAOCP §5.1.2: what should you be comfortable with first?	<ul><li>5.1.1 Inversions</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.2 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::5.1.2 Permutations of a Multiset
TAOCP §5.1.2: how should you work through it?	Read the definitions with lots of small examples. The intercalation product is unusual; work several products by hand before reading the theorems. Accept a slower pace here.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.2 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::5.1.2 Permutations of a Multiset
TAOCP §5.1.3 Runs: what does it cover?	Ascending runs in a permutation, the Eulerian numbers that count permutations by number of runs, and the distribution of run lengths in random data.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.3 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::5.1.3 Runs
TAOCP §5.1.3: why does it matter?	Natural merge sort and Timsort exploit runs in real data. Knowing how long runs are in random input tells you when that pays off.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.3 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::5.1.3 Runs
TAOCP §5.1.3, a common trap: “Confusing runs up with alternating runs (up-down sequences).” What's the catch?	They are different statistics.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.3 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 3::5.1.3 Runs
TAOCP §5.1.3, exercise 13 (rated 05): what is it asking?	Average number of piles in a card-game version of runs. A quick check that you can use the main formula.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.3 Runs
TAOCP §5.1.3, exercise 6 (rated M21, recommended): what is it asking?	Find the flaw in a bogus derivation that n! equals zero. Good practice spotting an illegal swap of sums.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.3 Runs
TAOCP §5.1.3, exercise 2 (rated M22, recommended): what is it asking?	Prove a generalization of the identity that expresses powers through Eulerian numbers.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.3 Runs
TAOCP §5.1.3, exercise 15 (rated M21, recommended): what is it asking?	Alternating up-and-down runs, the older notion of a run. Set up the counting and compare with ordinary runs.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.3 Runs
TAOCP §5.1.3, exercise 20 (rated M21, recommended): what is it asking?	Connect runs to the number of left-to-right passes needed to read a permutation in order.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.3 Runs
TAOCP §5.1.3, exercise 27 (rated M21, recommended): what is it asking?	Show that Eulerian numbers also count increasing forests by their leaves. A clean bijection.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.3 Runs
TAOCP §5.1.3, exercise 19 (rated M26, recommended): what is it asking?	Count rook placements on a chessboard by how many fall below the diagonal. Eulerian numbers show up unexpectedly.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.3 Runs
TAOCP §5.1.3, exercise 29 (rated M30, recommended): what is it asking?	Count permutations by peaks and relate them to alternating runs. The stretch.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.3 Runs
TAOCP §5.1.3: how many exercises, and how are they rated?	29 exercises, rated 05 to HM42.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.3 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::5.1.3 Runs
TAOCP §5.1.3: what should you be comfortable with first?	<ul><li>5.1.1 Inversions</li><li>1.2.6 Binomial Coefficients</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.3 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::5.1.3 Runs
TAOCP §5.1.3: how should you work through it?	Generate random permutations and histogram the run lengths, then compare with the formulas. Build a small table of Eulerian numbers by recurrence.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.3 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::5.1.3 Runs
TAOCP §5.1.4 Tableaux and Involutions: what does it cover?	Young tableaux, a correspondence between permutations and pairs of tableaux (Robinson-Schensted), the hook length formula for counting tableaux, and involutions (permutations that are their own inverse).	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.4 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::5.1.4 Tableaux and Involutions
TAOCP §5.1.4: why does it matter?	The correspondence gives a slick way to find the longest increasing subsequence, a common interview and diff-algorithm topic. It is also one of the most beautiful bijections in combinatorics.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.4 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::5.1.4 Tableaux and Involutions
TAOCP §5.1.4, a common trap: “Bumping into the wrong row during insertion.” What's the catch?	Trace carefully with pencil.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.4 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 3::5.1.4 Tableaux and Involutions
TAOCP §5.1.4, exercise 1 (rated 16): what is it asking?	Run the tableau correspondence forward and backward on a small example. Essential before anything else here.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.4 Tableaux and Involutions
TAOCP §5.1.4, exercise 8 (rated M18): what is it asking?	The classic result that a long enough sequence must contain a long monotone subsequence. Follows quickly from 7.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.4 Tableaux and Involutions
TAOCP §5.1.4, exercise 7 (rated M20): what is it asking?	Show that the tableau's shape gives the longest increasing and decreasing subsequences. The practical heart of the section.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.4 Tableaux and Involutions
TAOCP §5.1.4, exercise 3 (rated M24, recommended): what is it asking?	An alternative table-based way to carry out the correspondence. Easier to implement than the bumping description.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.4 Tableaux and Involutions
TAOCP §5.1.4, exercise 20 (rated M24, recommended): what is it asking?	Count increasing labelings of a tree with a hook-length style product. A gentle cousin of the hook formula.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.4 Tableaux and Involutions
TAOCP §5.1.4, exercise 42 (rated 30, recommended): what is it asking?	Sort genes with reversal flips and show one example needs five. An applied puzzle from genome comparison.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.4 Tableaux and Involutions
TAOCP §5.1.4, exercise 5 (rated M22, recommended): what is it asking?	Show that reversing a permutation transposes its tableau. Uses the result of exercise 4.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.4 Tableaux and Involutions
TAOCP §5.1.4, exercise 4 (rated M30, recommended): what is it asking?	Characterize which adjacent swaps leave the tableau unchanged. The stretch, and it unlocks exercise 5.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.1.4 Tableaux and Involutions
TAOCP §5.1.4: how many exercises, and how are they rated?	44 exercises, rated M08 to HM43.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.4 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::5.1.4 Tableaux and Involutions
TAOCP §5.1.4: what should you be comfortable with first?	<ul><li>5.1.1 Inversions</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.4 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::5.1.4 Tableaux and Involutions
TAOCP §5.1.4: how should you work through it?	Implement the insertion procedure that builds the tableau from a permutation, and check that the length of the first row equals the longest increasing subsequence length. Verify the hook length formula on small shapes.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.4 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::5.1.4 Tableaux and Involutions
TAOCP §5.2.1 Sorting by Insertion: what does it cover?	Straight insertion, binary insertion, Shellsort with diminishing increments, list insertion, and address-calculation sorting, each with careful analysis.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.1 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::5.2.1 Sorting by Insertion
TAOCP §5.2.1: why does it matter?	Insertion sort is what fast library sorts use for small subarrays. Shellsort is still a practical choice in embedded code with no recursion.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.1 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::5.2.1 Sorting by Insertion
TAOCP §5.2.1, fill in the blank:<br>Using binary insertion and expecting big wins on arrays: moves still cost <span class="cg-blank">&nbsp;</span>.	Using binary insertion and expecting big wins on arrays: moves still cost <b>O(n^2)</b>.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.1 cracked.guide::kind::complexity	cracked.guide::TAOCP Vol 3::5.2.1 Sorting by Insertion
TAOCP §5.2.1, a common trap: “Shellsort performance depends hugely on the increment sequence.” What's the catch?	Do not use powers of two.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.1 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 3::5.2.1 Sorting by Insertion
TAOCP §5.2.1: what traps should you watch for?	<ul><li>Using binary insertion and expecting big wins on arrays: moves still cost O(n^2).</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.1 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 3::5.2.1 Sorting by Insertion
TAOCP §5.2.1, exercise 1 (rated 10): what is it asking?	Is straight insertion stable? One-line answer, but say why.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.1 Sorting by Insertion
TAOCP §5.2.1, exercise 4 (rated M20, recommended): what is it asking?	Best and worst running time of the MIX straight insertion program. Ties the code to the inversion count.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.1 Sorting by Insertion
TAOCP §5.2.1, exercise 13 (rated M16, recommended): what is it asking?	Put the inversion-counting weights on the other edges of the lattice path. Quick, and it makes the picture click.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.1 Sorting by Insertion
TAOCP §5.2.1, exercise 10 (rated 22, recommended): what is it asking?	Skip shellsort's wasted work when an element is already in place, and judge whether it pays off.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.1 Sorting by Insertion
TAOCP §5.2.1, exercise 25 (rated M22, recommended): what is it asking?	Count permutations that are both 2-ordered and 3-ordered. The fact behind fast shellsort increment sequences.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.1 Sorting by Insertion
TAOCP §5.2.1, exercise 33 (rated 25, recommended): what is it asking?	Speed up list insertion with a sentinel so the inner loop does less work. A classic micro-optimization.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.1 Sorting by Insertion
TAOCP §5.2.1, exercise 31 (rated 25, recommended): what is it asking?	Write Pratt's shellsort (increments of the form 2^p 3^q) in MIX and express its running time.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.1 Sorting by Insertion
TAOCP §5.2.1, exercise 5 (rated M27, recommended): what is it asking?	Full probability distribution of straight insertion's running time. The stretch.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.1 Sorting by Insertion
TAOCP §5.2.1: how many exercises, and how are they rated?	44 exercises, rated 10 to HM43.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.1 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::5.2.1 Sorting by Insertion
TAOCP §5.2.1: what should you be comfortable with first?	<ul><li>5.1.1 Inversions</li><li>1.2.10 Analysis of an Algorithm</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.1 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::5.2.1 Sorting by Insertion
TAOCP §5.2.1: how should you work through it?	Implement straight insertion and Shellsort with a few increment sequences. Count comparisons and moves on random data and compare with Knuth's formulas and tables.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.1 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::5.2.1 Sorting by Insertion
TAOCP §5.2.2 Sorting by Exchanging: what does it cover?	Bubble sort and its analysis, Batcher's parallel merge exchange, quicksort with careful analysis of its average case, and radix exchange sort, which partitions on bits.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.2 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::5.2.2 Sorting by Exchanging
TAOCP §5.2.2: why does it matter?	Quicksort is the most used sorting algorithm in the world. Knuth's analysis shows exactly why choosing the pivot and handling small subarrays matter.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.2 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::5.2.2 Sorting by Exchanging
TAOCP §5.2.2: what traps should you watch for?	<ul><li>Quadratic behavior on sorted input with a naive pivot.</li><li>Partitioning bugs with equal keys, the most common real-world quicksort failure.</li><li>Unbounded recursion depth: recurse on the smaller side first.</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.2 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 3::5.2.2 Sorting by Exchanging
TAOCP §5.2.2, exercise 3 (rated 10): what is it asking?	Is bubble sort stable? Quick check of the definition.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.2 Sorting by Exchanging
TAOCP §5.2.2, exercise 33 (rated 15, recommended): what is it asking?	Move all negative numbers ahead of the others with the fewest swaps. Partitioning in its simplest form.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.2 Sorting by Exchanging
TAOCP §5.2.2, exercise 18 (rated 20, recommended): what is it asking?	What quicksort does when every key is equal, and what breaks if you loosen the comparisons. The bug that bites real implementations.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.2 Sorting by Exchanging
TAOCP §5.2.2, exercise 31 (rated 20, recommended): what is it asking?	Turn quicksort into a selection algorithm for the m-th smallest. This is quickselect.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.2 Sorting by Exchanging
TAOCP §5.2.2, exercise 55 (rated 22, recommended): what is it asking?	Add median-of-three pivot choice to the MIX quicksort.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.2 Sorting by Exchanging
TAOCP §5.2.2, exercise 26 (rated M24, recommended): what is it asking?	Build an input that makes the MIX quicksort run as slowly as possible. Teaches what the worst case really looks like.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.2 Sorting by Exchanging
TAOCP §5.2.2, exercise 41 (rated 30, recommended): what is it asking?	Three-way partitioning into less, equal and greater blocks. The fix for inputs with many duplicate keys.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.2 Sorting by Exchanging
TAOCP §5.2.2, exercise 38 (rated M30, recommended): what is it asking?	Average-case quantities for radix exchange on a second input model. The stretch, and it needs exercise 36.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.2 Sorting by Exchanging
TAOCP §5.2.2: how many exercises, and how are they rated?	56 exercises, rated 10 to M48.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.2 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::5.2.2 Sorting by Exchanging
TAOCP §5.2.2: what should you be comfortable with first?	<ul><li>5.2.1 Sorting by Insertion</li><li>1.2.7 Harmonic Numbers</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.2 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::5.2.2 Sorting by Exchanging
TAOCP §5.2.2: how should you work through it?	Implement quicksort carefully with Knuth's partitioning scheme, a cutoff to insertion sort, and median-of-three. Test on sorted input, reverse-sorted input and all-equal keys. Read the bubble sort analysis for technique; bubble sort itself is not worth using.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.2 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::5.2.2 Sorting by Exchanging
TAOCP §5.2.3 Sorting by Selection: what does it cover?	Straight selection, tree selection (tournaments), and heapsort with the heap data structure, plus analysis and the use of heaps as priority queues.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.3 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::5.2.3 Sorting by Selection
TAOCP §5.2.3: why does it matter?	Heaps are the standard priority queue, used in Dijkstra, schedulers and top-k queries. Heapsort is the in-place O(n log n) worst-case fallback in introsort.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.3 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::5.2.3 Sorting by Selection
TAOCP §5.2.3, fill in the blank:<br>Heapsort is the in-place <span class="cg-blank">&nbsp;</span> worst-case fallback in introsort.	Heapsort is the in-place <b>O(n log n)</b> worst-case fallback in introsort.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.3 cracked.guide::kind::complexity	cracked.guide::TAOCP Vol 3::5.2.3 Sorting by Selection
TAOCP §5.2.3: what traps should you watch for?	<ul><li>Off-by-one in parent and child index formulas, especially 0-based versus Knuth's 1-based arrays.</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.3 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 3::5.2.3 Sorting by Selection
TAOCP §5.2.3, exercise 1 (rated 10): what is it asking?	Is straight selection stable? Think about what a long-distance swap does to equal keys.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.3 Sorting by Selection
TAOCP §5.2.3, exercise 16 (rated 20): what is it asking?	Insert a key into a heap: the sift-up half of every priority queue.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.3 Sorting by Selection
TAOCP §5.2.3, exercise 22 (rated 20, recommended): what is it asking?	Work backward to find which inputs heapify into a given heap. Tests that you really understand sift-down.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.3 Sorting by Selection
TAOCP §5.2.3, exercise 18 (rated 21, recommended): what is it asking?	Floyd's improvement: sift the hole to the bottom first, then back up. Nearly halves the comparisons.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.3 Sorting by Selection
TAOCP §5.2.3, exercise 8 (rated 24, recommended): what is it asking?	Make straight selection remember what it learned on the previous scan, and write it in MIX.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.3 Sorting by Selection
TAOCP §5.2.3, exercise 15 (rated M22, recommended): what is it asking?	Generate primes with a priority queue instead of division. A surprising use of heaps.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.3 Sorting by Selection
TAOCP §5.2.3, exercise 33 (rated 21): what is it asking?	Merge two leftist-tree priority queues. A mergeable heap in a few lines.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.3 Sorting by Selection
TAOCP §5.2.3, exercise 4 (rated M25, recommended): what is it asking?	Is testing for a no-op swap worth it in straight selection? Average-case analysis with a practical answer.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.3 Sorting by Selection
TAOCP §5.2.3: how many exercises, and how are they rated?	38 exercises, rated 10 to M41.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.3 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::5.2.3 Sorting by Selection
TAOCP §5.2.3: what should you be comfortable with first?	<ul><li>5.2.2 Sorting by Exchanging</li><li>2.3 Trees</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.3 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::5.2.3 Sorting by Selection
TAOCP §5.2.3: how should you work through it?	Implement heapsort from scratch with an array-based heap. Then implement a priority queue with insert and delete-min and use it for something real like merging k sorted files.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.3 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::5.2.3 Sorting by Selection
TAOCP §5.2.4 Sorting by Merging: what does it cover?	Merging two sorted lists, two-way merge sort on arrays (natural and straight versions), and list merge sort that works on linked records without moving data.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.4 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::5.2.4 Sorting by Merging
TAOCP §5.2.4: why does it matter?	Merge sort is stable and the basis for Timsort (Python, Java objects) and for external sorting. List merge sort is the right way to sort linked lists.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.4 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::5.2.4 Sorting by Merging
TAOCP §5.2.4: what traps should you watch for?	<ul><li>Knuth's array merge sorts are bottom-up and alternate between two memory areas; losing track of which area holds the current runs is the usual bug.</li><li>Breaking stability by taking from the right run on ties.</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.4 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 3::5.2.4 Sorting by Merging
TAOCP §5.2.4, exercise 1 (rated 21): what is it asking?	Generalize two-way merging to k-way. The building block of external sorting later in the chapter.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.4 Sorting by Merging
TAOCP §5.2.4, exercise 3 (rated 20, recommended): what is it asking?	Merge an update file into a master file, letting new records replace old ones. Classic batch-processing pattern.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.4 Sorting by Merging
TAOCP §5.2.4, exercise 5 (rated 21, recommended): what is it asking?	Show that two pointers in the natural merge can never meet in certain steps, so a test can be dropped.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.4 Sorting by Merging
TAOCP §5.2.4, exercise 11 (rated 21): what is it asking?	Is list merge sort stable? Check the tie-breaking rule.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.4 Sorting by Merging
TAOCP §5.2.4, exercise 12 (rated 22, recommended): what is it asking?	Make list merge sort exploit runs already in the input, so sorted input finishes in one pass.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.4 Sorting by Merging
TAOCP §5.2.4, exercise 21 (rated 23): what is it asking?	Count inversions as a side effect of list merge sort. The standard interview problem, from the source.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.4 Sorting by Merging
TAOCP §5.2.4, exercise 13 (rated M34, recommended): what is it asking?	Average-case analysis of the list merge sort program. The stretch.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.4 Sorting by Merging
TAOCP §5.2.4: how many exercises, and how are they rated?	23 exercises, rated 16 to 47.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.4 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::5.2.4 Sorting by Merging
TAOCP §5.2.4: what should you be comfortable with first?	<ul><li>5.2.1 to 5.2.3</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.4 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::5.2.4 Sorting by Merging
TAOCP §5.2.4: how should you work through it?	Implement top-down and bottom-up merge sort on arrays and list merge sort on a linked list. Check stability with records that have equal keys.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.4 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::5.2.4 Sorting by Merging
TAOCP §5.2.5 Sorting by Distribution: what does it cover?	Radix sorting: distributing records into piles by digit, least significant digit first, using linked lists to avoid moving data, with analysis of when it beats comparison sorts.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.5 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::5.2.5 Sorting by Distribution
TAOCP §5.2.5: why does it matter?	Radix sort is how you sort integers, strings and fixed-size keys fast. It shows up in GPU sorting and database engines.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.5 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::5.2.5 Sorting by Distribution
TAOCP §5.2.5: what traps should you watch for?	<ul><li>Non-stable distribution passes break LSD radix sort.</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.5 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 3::5.2.5 Sorting by Distribution
TAOCP §5.2.5, exercise 2 (rated 13): what is it asking?	Is radix sort stable? It has to be, and the reason is the whole trick.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.5 Sorting by Distribution
TAOCP §5.2.5, exercise 1 (rated 20, recommended): what is it asking?	Would in-place distribution counting beat the linked radix sort? Compare the costs.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.5 Sorting by Distribution
TAOCP §5.2.5, exercise 8 (rated 20, recommended): what is it asking?	Adapt radix sorting to two's complement and ones' complement keys.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.5 Sorting by Distribution
TAOCP §5.2.5, exercise 14 (rated 22): what is it asking?	A card-dealing puzzle: sort a hand with two piles in two passes. Radix sort in disguise.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.5 Sorting by Distribution
TAOCP §5.2.5, exercise 4 (rated 23, recommended): what is it asking?	Link the piles as stacks instead of queues and find an order that still sorts.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.5 Sorting by Distribution
TAOCP §5.2.5, exercise 16 (rated 25, recommended): what is it asking?	Sort strings of mixed lengths in time linear in their total length. The basis of practical string sorting.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.5 Sorting by Distribution
TAOCP §5.2.5, exercise 6 (rated M24): what is it asking?	Expected number of empty piles after one distribution pass. The math stretch.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.2.5 Sorting by Distribution
TAOCP §5.2.5: how many exercises, and how are they rated?	18 exercises, rated 13 to 40.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.5 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::5.2.5 Sorting by Distribution
TAOCP §5.2.5: what should you be comfortable with first?	<ul><li>5.2.4 Sorting by Merging</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.5 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::5.2.5 Sorting by Distribution
TAOCP §5.2.5: how should you work through it?	Implement LSD radix sort on 32-bit integers with byte-sized digits and counting sort per pass. Benchmark it against your quicksort.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.2.5 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::5.2.5 Sorting by Distribution
TAOCP §5.3.1 Minimum-Comparison Sorting: what does it cover?	How few comparisons can sort n items? The information-theoretic lower bound of about lg n!, and merge insertion (Ford-Johnson), which comes remarkably close for small n.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.1 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::5.3.1 Minimum-Comparison Sorting
TAOCP §5.3.1: why does it matter?	The lower bound is the reason no comparison sort beats O(n log n). This section also teaches how to think about decision trees, a general lower-bound tool.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.1 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::5.3.1 Minimum-Comparison Sorting
TAOCP §5.3.1, fill in the blank:<br>The lower bound is the reason no comparison sort beats <span class="cg-blank">&nbsp;</span>.	The lower bound is the reason no comparison sort beats <b>O(n log n)</b>.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.1 cracked.guide::kind::complexity	cracked.guide::TAOCP Vol 3::5.3.1 Minimum-Comparison Sorting
TAOCP §5.3.1: what traps should you watch for?	<ul><li>Confusing worst-case comparisons with average-case.</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.1 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 3::5.3.1 Minimum-Comparison Sorting
TAOCP §5.3.1, exercise 23 (rated 10): what is it asking?	Why does an average-linear sort not beat the n lg n lower bound? Find the hidden assumption.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.1 Minimum-Comparison Sorting
TAOCP §5.3.1, exercise 5 (rated 16): what is it asking?	Draw a ternary comparison tree when keys can be equal.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.1 Minimum-Comparison Sorting
TAOCP §5.3.1, exercise 1 (rated 20): what is it asking?	Comparison trees for binary insertion and merging on four elements, with their path lengths.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.1 Minimum-Comparison Sorting
TAOCP §5.3.1, exercise 27 (rated 20, recommended): what is it asking?	Find the comparison tree that is fastest on average for a skewed input distribution.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.1 Minimum-Comparison Sorting
TAOCP §5.3.1, exercise 6 (rated M22, recommended): what is it asking?	Show that allowing three-way comparisons does not reduce the comparisons needed to sort.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.1 Minimum-Comparison Sorting
TAOCP §5.3.1, exercise 10 (rated M25, recommended): what is it asking?	Minimum average comparisons when every key is 0 or 1.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.1 Minimum-Comparison Sorting
TAOCP §5.3.1, exercise 12 (rated M25, recommended): what is it asking?	Sorting with ties where you only need some valid order: what counts as sorting strongly.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.1 Minimum-Comparison Sorting
TAOCP §5.3.1, exercise 20 (rated M26, recommended): what is it asking?	Prove that minimum external path length means leaves sit on at most two levels. The stretch, and used again in 6.2.1.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.1 Minimum-Comparison Sorting
TAOCP §5.3.1: how many exercises, and how are they rated?	36 exercises, rated 10 to M50.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.1 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::5.3.1 Minimum-Comparison Sorting
TAOCP §5.3.1: what should you be comfortable with first?	<ul><li>1.2.5 Factorials</li><li>5.2 Internal Sorting</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.1 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::5.3.1 Minimum-Comparison Sorting
TAOCP §5.3.1: how should you work through it?	Draw the decision tree for sorting 3 elements. Try to find a 7-comparison sort for 5 elements on your own before reading how. Read merge insertion with pencil.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.1 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::5.3.1 Minimum-Comparison Sorting
TAOCP §5.3.2 Minimum-Comparison Merging: what does it cover?	The fewest comparisons needed to merge two sorted lists of given sizes, with adversary arguments and a binary merging algorithm for unequal sizes (Hwang-Lin).	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.2 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::5.3.2 Minimum-Comparison Merging
TAOCP §5.3.2: why does it matter?	Merging very unequal lists efficiently is useful for set intersection in search engines and databases. Adversary arguments are a powerful proof tool.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.2 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::5.3.2 Minimum-Comparison Merging
TAOCP §5.3.2, exercise 15 (rated 12): what is it asking?	Compute a floor of a log ratio without division. A small practical trick used by binary merging.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.2 Minimum-Comparison Merging
TAOCP §5.3.2, exercise 1 (rated 15): what is it asking?	Relate the merging function to the sorting function from 5.3.1.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.2 Minimum-Comparison Merging
TAOCP §5.3.2, exercise 2 (rated 22, recommended): what is it asking?	Show every binary tree with n + 1 leaves is a merging algorithm for one element.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.2 Minimum-Comparison Merging
TAOCP §5.3.2, exercise 8 (rated 24, recommended): what is it asking?	Merge two elements into eight with only six comparisons.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.2 Minimum-Comparison Merging
TAOCP §5.3.2, exercise 19 (rated 23, recommended): what is it asking?	Prove a recurrence inequality for the merging function.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.2 Minimum-Comparison Merging
TAOCP §5.3.2, exercise 25 (rated 25, recommended): what is it asking?	Searching a sorted matrix is exactly as hard as merging. A neat equivalence with interview flavor.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.2 Minimum-Comparison Merging
TAOCP §5.3.2, exercise 3 (rated M24): what is it asking?	Prove the adversary lower bound is exact when one list has a single element. The math stretch.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.2 Minimum-Comparison Merging
TAOCP §5.3.2: how many exercises, and how are they rated?	25 exercises, rated 12 to M47.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.2 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::5.3.2 Minimum-Comparison Merging
TAOCP §5.3.2: what should you be comfortable with first?	<ul><li>5.3.1 Minimum-Comparison Sorting</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.2 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::5.3.2 Minimum-Comparison Merging
TAOCP §5.3.2: how should you work through it?	Focus on the adversary argument idea and on the binary merge algorithm. Implement binary merging and compare against linear merge when one list is tiny.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.2 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::5.3.2 Minimum-Comparison Merging
TAOCP §5.3.3 Minimum-Comparison Selection: what does it cover?	Finding the k-th smallest element with as few comparisons as possible, including finding the second largest and the linear-time worst-case selection result.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.3 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::5.3.3 Minimum-Comparison Selection
TAOCP §5.3.3: why does it matter?	Selection (median, percentiles, top-k) is a common real need. The linear-time median-of-medians idea is a classic.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.3 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::5.3.3 Minimum-Comparison Selection
TAOCP §5.3.3: what traps should you watch for?	<ul><li>Median of medians is linear but has a big constant; quickselect usually wins in practice.</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.3 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 3::5.3.3 Minimum-Comparison Selection
TAOCP §5.3.3, exercise 5 (rated 10): what is it asking?	A one-line bound comparing two selection measures.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.3 Minimum-Comparison Selection
TAOCP §5.3.3, exercise 1 (rated 15): what is it asking?	Why a player who won a round still got knocked out of Lewis Carroll's tournament. Sets up the second-largest problem.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.3 Minimum-Comparison Selection
TAOCP §5.3.3, exercise 9 (rated 20, recommended): what is it asking?	Draw a comparison tree that finds the median of five in six comparisons.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.3 Minimum-Comparison Selection
TAOCP §5.3.3, exercise 14 (rated 20, recommended): what is it asking?	Find the top two of five elements, unordered, with five comparisons.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.3 Minimum-Comparison Selection
TAOCP §5.3.3, exercise 16 (rated 25, recommended): what is it asking?	Find both maximum and minimum with about 3n/2 comparisons, and prove you cannot do better.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.3 Minimum-Comparison Selection
TAOCP §5.3.3, exercise 2 (rated M25, recommended): what is it asking?	Show that finding the t-th largest also tells you which elements are above and below it.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.3 Minimum-Comparison Selection
TAOCP §5.3.3, exercise 6 (rated M26, recommended): what is it asking?	Floyd's analysis of the second-largest problem with partial information.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.3 Minimum-Comparison Selection
TAOCP §5.3.3, exercise 13 (rated HM28, recommended): what is it asking?	Find a median with about 1.5n comparisons on average by sampling first. The stretch.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.3 Minimum-Comparison Selection
TAOCP §5.3.3: how many exercises, and how are they rated?	27 exercises, rated 10 to M49.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.3 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::5.3.3 Minimum-Comparison Selection
TAOCP §5.3.3: what should you be comfortable with first?	<ul><li>5.3.1 Minimum-Comparison Sorting</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.3 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::5.3.3 Minimum-Comparison Selection
TAOCP §5.3.3: how should you work through it?	Work out why finding the second largest takes about n + lg n comparisons using a tournament. Implement quickselect and median of medians and compare their speed.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.3 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::5.3.3 Minimum-Comparison Selection
TAOCP §5.3.4 Networks for Sorting: what does it cover?	Sorting networks: fixed sequences of compare-exchange operations that do not depend on the data. Knuth covers the zero-one principle, Batcher's networks, optimal small networks, and related merging and selection networks.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.4 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::5.3.4 Networks for Sorting
TAOCP §5.3.4: why does it matter?	Sorting networks are used in GPUs, SIMD code and hardware because they are branch-free and parallel. The zero-one principle is a great proof trick.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.4 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::5.3.4 Networks for Sorting
TAOCP §5.3.4, a common trap: “Verifying a network on random inputs only.” What's the catch?	Use the zero-one principle to test exhaustively.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.4 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 3::5.3.4 Networks for Sorting
TAOCP §5.3.4, exercise 1 (rated 20): what is it asking?	Draw Batcher's odd-even merge network for 3 and 5 inputs.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.4 Networks for Sorting
TAOCP §5.3.4, exercise 15 (rated 20): what is it asking?	Find a nonstandard four-element sorting network with five comparators.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.4 Networks for Sorting
TAOCP §5.3.4, exercise 28 (rated M20, recommended): what is it asking?	Write down what each line of a network computes as a formula of mins and maxes.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.4 Networks for Sorting
TAOCP §5.3.4, exercise 36 (rated 22, recommended): what is it asking?	Networks that compare only neighbors need about n^2/2 comparators. Bubble sort as a network.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.4 Networks for Sorting
TAOCP §5.3.4, exercise 4 (rated M23, recommended): what is it asking?	Prove the minimum delay for sorting six elements.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.4 Networks for Sorting
TAOCP §5.3.4, exercise 13 (rated 24, recommended): what is it asking?	Build a sorting network from perfect shuffles. The pattern behind several parallel machines.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.4 Networks for Sorting
TAOCP §5.3.4, exercise 42 (rated 25, recommended): what is it asking?	A lower bound on comparators that grows by about lg n per added element.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.4 Networks for Sorting
TAOCP §5.3.4, exercise 14 (rated M27, recommended): what is it asking?	Alekseev's transformation of networks and what it preserves. The stretch.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.3.4 Networks for Sorting
TAOCP §5.3.4: how many exercises, and how are they rated?	68 exercises, rated M16 to 50.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.4 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::5.3.4 Networks for Sorting
TAOCP §5.3.4: what should you be comfortable with first?	<ul><li>5.3.1 Minimum-Comparison Sorting</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.4 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::5.3.4 Networks for Sorting
TAOCP §5.3.4: how should you work through it?	Draw a few networks for 4 and 5 elements. Write a program that verifies a network by testing all 0-1 inputs. Implement Batcher's bitonic or odd-even merge network.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.3.4 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::5.3.4 Networks for Sorting
TAOCP §5.4.1 Multiway Merging and Replacement Selection: what does it cover?	Merging many sorted runs at once using a tree of losers, and replacement selection, which produces initial sorted runs about twice the size of memory on random data (the snowplow argument).	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.1 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::5.4.1 Multiway Merging and Replacement Selection
TAOCP §5.4.1: why does it matter?	This is still exactly how external sorts and database sort operators work when data does not fit in RAM. Probably the most practical section of 5.4.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.1 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::5.4.1 Multiway Merging and Replacement Selection
TAOCP §5.4.1: what traps should you watch for?	<ul><li>Forgetting to mark records that belong to the next run in replacement selection.</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.1 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 3::5.4.1 Multiway Merging and Replacement Selection
TAOCP §5.4.1, exercise 13 (rated 13): what is it asking?	Why is the second run from replacement selection usually longer than the first?	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.1 Multiway Merging and Replacement Selection
TAOCP §5.4.1, exercise 3 (rated 16): what is it asking?	Run four-way replacement selection by hand on a famous sentence.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.1 Multiway Merging and Replacement Selection
TAOCP §5.4.1, exercise 18 (rated 22, recommended): what is it asking?	What happens if you run replacement selection on its own output?	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.1 Multiway Merging and Replacement Selection
TAOCP §5.4.1, exercise 9 (rated 23, recommended): what is it asking?	Make replacement selection produce some runs ascending and others descending, as later tape methods need.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.1 Multiway Merging and Replacement Selection
TAOCP §5.4.1, exercise 19 (rated HM22): what is it asking?	Use the snowplow argument to show the first run is about (e - 1) times memory.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.1 Multiway Merging and Replacement Selection
TAOCP §5.4.1, exercise 14 (rated HM25, recommended): what is it asking?	Estimate the length of the last two runs using the snowplow picture.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.1 Multiway Merging and Replacement Selection
TAOCP §5.4.1, exercise 21 (rated HM23, recommended): what is it asking?	Run lengths for natural selection with a small reservoir.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.1 Multiway Merging and Replacement Selection
TAOCP §5.4.1, exercise 27 (rated HM30, recommended): what is it asking?	Analyze a refinement of natural selection that keeps filling the queue. The stretch.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.1 Multiway Merging and Replacement Selection
TAOCP §5.4.1: how many exercises, and how are they rated?	30 exercises, rated 00 to M46.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.1 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::5.4.1 Multiway Merging and Replacement Selection
TAOCP §5.4.1: what should you be comfortable with first?	<ul><li>5.2.3 Sorting by Selection (heaps)</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.1 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::5.4.1 Multiway Merging and Replacement Selection
TAOCP §5.4.1: how should you work through it?	Implement replacement selection with a heap and measure run lengths on random data; you should see about 2P. Implement a k-way merge with a heap. Read the snowplow analogy carefully; it is a lovely argument.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.1 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::5.4.1 Multiway Merging and Replacement Selection
TAOCP §5.4.2 The Polyphase Merge: what does it cover?	A way to merge runs using a limited number of tapes without wasting passes, where the ideal initial run distribution follows generalized Fibonacci numbers.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.2 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::5.4.2 The Polyphase Merge
TAOCP §5.4.2: why does it matter?	Honest note: the tape-merging sections describe hardware nobody uses anymore. Knuth himself says much of 5.4 is historical. The ideas (run generation, merge patterns, minimizing passes over slow storage) still apply to external sorting on disks and SSDs, database sort operators and big-data shuffles, so read for those ideas and skim the tape mechanics.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.2 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::5.4.2 The Polyphase Merge
TAOCP §5.4.2: what traps should you watch for?	<ul><li>Spending a lot of time on tape rewind details.</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.2 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 3::5.4.2 The Polyphase Merge
TAOCP §5.4.2, exercise 1 (rated 16): what is it asking?	Find the order in which the early runs go to the tapes. Checks that you can follow Algorithm D.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.2 The Polyphase Merge
TAOCP §5.4.2, exercise 2 (rated 21, recommended): what is it asking?	True or false: all dummy runs are gone after two merge phases.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.2 The Polyphase Merge
TAOCP §5.4.2, exercise 3 (rated 22, recommended): what is it asking?	Prove an ordering invariant on the dummy-run counts and explain why the algorithm depends on it.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.2 The Polyphase Merge
TAOCP §5.4.2, exercise 12 (rated M18, recommended): what is it asking?	Connect powers of a small matrix to the perfect polyphase distributions.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.2 The Polyphase Merge
TAOCP §5.4.2, exercise 8 (rated M20): what is it asking?	Ordered sums of 1 to p are counted by generalized Fibonacci numbers.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.2 The Polyphase Merge
TAOCP §5.4.2, exercise 13 (rated 22, recommended): what is it asking?	A parity property of perfect Fibonacci distributions.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.2 The Polyphase Merge
TAOCP §5.4.2, exercise 10 (rated M27): what is it asking?	Every integer has a unique representation in generalized Fibonacci numbers. The math stretch.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.2 The Polyphase Merge
TAOCP §5.4.2, exercise 23 (rated 29, recommended): what is it asking?	Rework the tape-splitting recurrences with a different merge rule.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.2 The Polyphase Merge
TAOCP §5.4.2: how many exercises, and how are they rated?	31 exercises, rated 11 to M47.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.2 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::5.4.2 The Polyphase Merge
TAOCP §5.4.2: what should you be comfortable with first?	<ul><li>5.4.1 Multiway Merging</li><li>1.2.8 Fibonacci Numbers</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.2 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::5.4.2 The Polyphase Merge
TAOCP §5.4.2: how should you work through it?	Simulate a 3-tape polyphase merge by hand to see the Fibonacci pattern. Skim the detailed tape-handling algorithms.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.2 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::5.4.2 The Polyphase Merge
TAOCP §5.4.3 The Cascade Merge: what does it cover?	Another tape-merge pattern that cascades merges of decreasing order, and how it compares to polyphase.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.3 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::5.4.3 The Cascade Merge
TAOCP §5.4.3: why does it matter?	Honest note: the tape-merging sections describe hardware nobody uses anymore. Knuth himself says much of 5.4 is historical. The ideas (run generation, merge patterns, minimizing passes over slow storage) still apply to external sorting on disks and SSDs, database sort operators and big-data shuffles, so read for those ideas and skim the tape mechanics.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.3 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::5.4.3 The Cascade Merge
TAOCP §5.4.3, exercise 1 (rated 10): what is it asking?	Use the table to decide whether cascade or tape-splitting polyphase wins.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.3 The Cascade Merge
TAOCP §5.4.3, exercise 5 (rated 20, recommended): what is it asking?	Prove an identity for cascade numbers by counting runs output on each pass.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.3 The Cascade Merge
TAOCP §5.4.3, exercise 6 (rated M20): what is it asking?	Find a matrix whose powers generate the six-tape cascade numbers.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.3 The Cascade Merge
TAOCP §5.4.3, exercise 2 (rated 22, recommended): what is it asking?	Compare three-tape cascade with three-tape polyphase.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.3 The Cascade Merge
TAOCP §5.4.3, exercise 3 (rated 23): what is it asking?	Tabulate a full cascade sort of 100 runs on six tapes.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.3 The Cascade Merge
TAOCP §5.4.3, exercise 10 (rated M28, recommended): what is it asking?	Express the cascade generating functions through a family of polynomials. The stretch.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.3 The Cascade Merge
TAOCP §5.4.3: how many exercises, and how are they rated?	13 exercises, rated 10 to M40.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.3 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::5.4.3 The Cascade Merge
TAOCP §5.4.3: what should you be comfortable with first?	<ul><li>5.4.2 The Polyphase Merge</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.3 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::5.4.3 The Cascade Merge
TAOCP §5.4.3: how should you work through it?	Skim. Note how it compares to polyphase and move on.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.3 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::5.4.3 The Cascade Merge
TAOCP §5.4.4 Reading Tape Backwards: what does it cover?	Merge patterns that avoid rewinding by reading tapes backward, which flips the order of runs and changes the bookkeeping.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.4 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::5.4.4 Reading Tape Backwards
TAOCP §5.4.4: why does it matter?	Honest note: the tape-merging sections describe hardware nobody uses anymore. Knuth himself says much of 5.4 is historical. The ideas (run generation, merge patterns, minimizing passes over slow storage) still apply to external sorting on disks and SSDs, database sort operators and big-data shuffles, so read for those ideas and skim the tape mechanics.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.4 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::5.4.4 Reading Tape Backwards
TAOCP §5.4.4, exercise 6 (rated 07): what is it asking?	Convert a merge pattern from tree form to vector form.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.4 Reading Tape Backwards
TAOCP §5.4.4, exercise 1 (rated 17): what is it asking?	How to adapt end-of-run sentinels when reading tapes backward.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.4 Reading Tape Backwards
TAOCP §5.4.4, exercise 3 (rated 20, recommended): what is it asking?	Show read-backward polyphase ends with an ascending run on the right tape.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.4 Reading Tape Backwards
TAOCP §5.4.4, exercise 11 (rated 20, recommended): what is it asking?	True or false: backward-reading merges must alternate ascending and descending runs.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.4 Reading Tape Backwards
TAOCP §5.4.4, exercise 19 (rated 22, recommended): what is it asking?	Find a binary tree that is not 3-fifo. Gets you into Karp's model.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.4 Reading Tape Backwards
TAOCP §5.4.4, exercise 20 (rated 22, recommended): what is it asking?	State the strongly-fifo condition as a rule about tape labels.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.4 Reading Tape Backwards
TAOCP §5.4.4, exercise 5 (rated 23, recommended): what is it asking?	Redo the polyphase merge-number formulas for reading backward.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.4 Reading Tape Backwards
TAOCP §5.4.4, exercise 17 (rated 28, recommended): what is it asking?	Design an initial distribution for read-backward cascade that ends in ascending order. The stretch.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.4 Reading Tape Backwards
TAOCP §5.4.4: how many exercises, and how are they rated?	26 exercises, rated 07 to M46.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.4 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::5.4.4 Reading Tape Backwards
TAOCP §5.4.4: what should you be comfortable with first?	<ul><li>5.4.2 The Polyphase Merge</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.4 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::5.4.4 Reading Tape Backwards
TAOCP §5.4.4: how should you work through it?	Skim for the idea. Use the spare time on 5.4.1 or on earlier Vol 3 exercises.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.4 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::5.4.4 Reading Tape Backwards
TAOCP §5.4.5 The Oscillating Sort: what does it cover?	A tape sorting scheme that interleaves run creation and merging so the sort oscillates between phases, reducing tape movement.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.5 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::5.4.5 The Oscillating Sort
TAOCP §5.4.5: why does it matter?	Honest note: the tape-merging sections describe hardware nobody uses anymore. Knuth himself says much of 5.4 is historical. The ideas (run generation, merge patterns, minimizing passes over slow storage) still apply to external sorting on disks and SSDs, database sort operators and big-data shuffles, so read for those ideas and skim the tape mechanics.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.5 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::5.4.5 The Oscillating Sort
TAOCP §5.4.5, exercise 4 (rated 21): what is it asking?	Show one of two table updates in Algorithm B is never read.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.5 The Oscillating Sort
TAOCP §5.4.5, exercise 1 (rated 22): what is it asking?	Specify Sobel's original oscillating sort precisely for any number of tapes.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.5 The Oscillating Sort
TAOCP §5.4.5, exercise 5 (rated M25): what is it asking?	Which run counts let Algorithm B avoid rewinding? The math one.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.5 The Oscillating Sort
TAOCP §5.4.5, exercise 3 (rated 29, recommended): what is it asking?	Chart Algorithm B on three tapes and nine runs, spot the inefficiency and fix it.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.5 The Oscillating Sort
TAOCP §5.4.5: how many exercises, and how are they rated?	5 exercises, rated 21 to 29.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.5 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::5.4.5 The Oscillating Sort
TAOCP §5.4.5: what should you be comfortable with first?	<ul><li>5.4.4 Reading Tape Backwards</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.5 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::5.4.5 The Oscillating Sort
TAOCP §5.4.5: how should you work through it?	Skim.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.5 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::5.4.5 The Oscillating Sort
TAOCP §5.4.6 Practical Considerations for Tape Merging: what does it cover?	Real-world engineering of tape sorts: buffering, overlapping I/O with computation, block sizes and timing estimates.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.6 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::5.4.6 Practical Considerations for Tape Merging
TAOCP §5.4.6: why does it matter?	The buffering and overlap ideas transfer directly to disk and network I/O. Honest note: the tape-merging sections describe hardware nobody uses anymore. Knuth himself says much of 5.4 is historical. The ideas (run generation, merge patterns, minimizing passes over slow storage) still apply to external sorting on disks and SSDs, database sort operators and big-data shuffles, so read for those ideas and skim the tape mechanics.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.6 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::5.4.6 Practical Considerations for Tape Merging
TAOCP §5.4.6, exercise 2 (rated 15): what is it asking?	Why one buffer in the timing diagram starts out empty.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.6 Practical Considerations for Tape Merging
TAOCP §5.4.6, exercise 3 (rated 20): what is it asking?	Does forecasting still work with one fewer input buffer? Prove it or break it.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.6 Practical Considerations for Tape Merging
TAOCP §5.4.6, exercise 4 (rated 20): what is it asking?	Make Algorithm F work for a one-way merge.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.6 Practical Considerations for Tape Merging
TAOCP §5.4.6, exercise 5 (rated 21, recommended): what is it asking?	Handle equal keys across files when forecasting, so buffers never run dry.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.6 Practical Considerations for Tape Merging
TAOCP §5.4.6, exercise 9 (rated 22, recommended): what is it asking?	Estimate the gain from using the input tape as a work tape.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.6 Practical Considerations for Tape Merging
TAOCP §5.4.6, exercise 10 (rated M23): what is it asking?	Show rewinds in six-tape polyphase or cascade rarely cover more than about half the file.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.6 Practical Considerations for Tape Merging
TAOCP §5.4.6, exercise 7 (rated 26, recommended): what is it asking?	Fill out an imperfect run distribution with dummies in the best way. The stretch.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.6 Practical Considerations for Tape Merging
TAOCP §5.4.6: how many exercises, and how are they rated?	16 exercises, rated 13 to 41.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.6 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::5.4.6 Practical Considerations for Tape Merging
TAOCP §5.4.6: what should you be comfortable with first?	<ul><li>1.4.4 Input and Output</li><li>5.4.1 Multiway Merging</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.6 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::5.4.6 Practical Considerations for Tape Merging
TAOCP §5.4.6: how should you work through it?	Read the buffering and overlap parts carefully, since they map to modern I/O. Skim device timing details.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.6 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::5.4.6 Practical Considerations for Tape Merging
TAOCP §5.4.7 External Radix Sorting: what does it cover?	Doing radix sort on data that lives on external storage, distributing into files by digit.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.7 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::5.4.7 External Radix Sorting
TAOCP §5.4.7: why does it matter?	Distribution-based external sorts are how many big-data systems partition data (think MapReduce shuffles).	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.7 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::5.4.7 External Radix Sorting
TAOCP §5.4.7, exercise 5 (rated 15): what is it asking?	Draw the merge tree that corresponds to Mauchly's backward radix sort.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.7 External Radix Sorting
TAOCP §5.4.7, exercise 1 (rated 20): what is it asking?	Show balanced merging is a radix sort in a mixed-radix number system.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.7 External Radix Sorting
TAOCP §5.4.7, exercise 6 (rated 20, recommended): what is it asking?	Run Mauchly's tape radix sort twice and predict the final order.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.7 External Radix Sorting
TAOCP §5.4.7, exercise 7 (rated 21): what is it asking?	Does the merge/radix duality carry over to multireel files?	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.7 External Radix Sorting
TAOCP §5.4.7, exercise 4 (rated M23): what is it asking?	Prove Ashenhurst's pattern is optimal for ten keys on four tapes. The math one.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.7 External Radix Sorting
TAOCP §5.4.7: how many exercises, and how are they rated?	7 exercises, rated 15 to M35.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.7 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::5.4.7 External Radix Sorting
TAOCP §5.4.7: what should you be comfortable with first?	<ul><li>5.2.5 Sorting by Distribution</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.7 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::5.4.7 External Radix Sorting
TAOCP §5.4.7: how should you work through it?	Skim and connect it to the shuffle phase of MapReduce or Spark.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.7 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::5.4.7 External Radix Sorting
TAOCP §5.4.8 Two-Tape Sorting: what does it cover?	What you can do with only two tapes, and why it is so much harder than with three or more.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.8 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::5.4.8 Two-Tape Sorting
TAOCP §5.4.8: why does it matter?	Mostly of theoretical and historical interest. Honest note: the tape-merging sections describe hardware nobody uses anymore. Knuth himself says much of 5.4 is historical. The ideas (run generation, merge patterns, minimizing passes over slow storage) still apply to external sorting on disks and SSDs, database sort operators and big-data shuffles, so read for those ideas and skim the tape mechanics.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.8 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::5.4.8 Two-Tape Sorting
TAOCP §5.4.8, exercise 1 (rated 20): what is it asking?	Can two-tape bubble sorting gain from reading backward?	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.8 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.8 Two-Tape Sorting
TAOCP §5.4.8, exercise 10 (rated 20): what is it asking?	How would you sort several reels of data with just two tapes?	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.8 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.8 Two-Tape Sorting
TAOCP §5.4.8, exercise 4 (rated M23): what is it asking?	Build an elevator schedule when some floors need no stops.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.8 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.8 Two-Tape Sorting
TAOCP §5.4.8, exercise 5 (rated M23, recommended): what is it asking?	True or false: a claim about passengers' destinations after the first step of the elevator algorithm.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.8 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.8 Two-Tape Sorting
TAOCP §5.4.8, exercise 9 (rated M25, recommended): what is it asking?	Connect cocktail-shaker sort to the elevator problem's counts.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.8 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.8 Two-Tape Sorting
TAOCP §5.4.8, exercise 2 (rated M26): what is it asking?	Closed forms for the two-tape pass counts. The math stretch.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.8 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.8 Two-Tape Sorting
TAOCP §5.4.8: how many exercises, and how are they rated?	10 exercises, rated 20 to M40.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.8 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::5.4.8 Two-Tape Sorting
TAOCP §5.4.8: what should you be comfortable with first?	<ul><li>5.4.1 Multiway Merging</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.8 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::5.4.8 Two-Tape Sorting
TAOCP §5.4.8: how should you work through it?	Skim.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.8 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::5.4.8 Two-Tape Sorting
TAOCP §5.4.9 Disks and Drums: what does it cover?	External sorting on random-access devices. Knuth shows how seek and latency costs turn the choice of merge pattern into an optimal-tree problem, how to size buffers, and how to spread files over several disks with striping, including randomized striping that keeps all disks busy during a merge.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.9 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::5.4.9 Disks and Drums
TAOCP §5.4.9: why does it matter?	Much more relevant than the tape sections: disk-based thinking (minimize seeks, read large sequential blocks) still matters for databases, even on SSDs.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.9 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::5.4.9 Disks and Drums
TAOCP §5.4.9: what traps should you watch for?	<ul><li>Taking 1970s timing numbers literally.</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.9 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 3::5.4.9 Disks and Drums
TAOCP §5.4.9, exercise 21 (rated M15, recommended): what is it asking?	How many blocks of a striped file land on each disk.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.9 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.9 Disks and Drums
TAOCP §5.4.9, exercise 23 (rated 20, recommended): what is it asking?	Buffer space needed for continuous two-way merging under two striping schemes.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.9 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.9 Disks and Drums
TAOCP §5.4.9, exercise 19 (rated 25, recommended): what is it asking?	A keysorting scheme that sorts keys first and moves records later. Still how big sorts avoid moving data twice.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.9 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.9 Disks and Drums
TAOCP §5.4.9, exercise 20 (rated 25, recommended): what is it asking?	What virtual memory does and does not buy you for sorting. Ages well.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.9 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.9 Disks and Drums
TAOCP §5.4.9, exercise 4 (rated M21, recommended): what is it asking?	Buffer sizing when all input buffers are equal and only the output buffer varies.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.9 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.9 Disks and Drums
TAOCP §5.4.9, exercise 6 (rated 22, recommended): what is it asking?	Find an optimal merge tree for 23 runs; a short program helps.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.9 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.9 Disks and Drums
TAOCP §5.4.9, exercise 7 (rated M24, recommended): what is it asking?	Optimal merge patterns when runs have different lengths.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.9 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.9 Disks and Drums
TAOCP §5.4.9, exercise 29 (rated M30, recommended): what is it asking?	Bound the average input time of randomized striping. The stretch.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.9 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.4.9 Disks and Drums
TAOCP §5.4.9: how many exercises, and how are they rated?	31 exercises, rated M15 to 49.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.9 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::5.4.9 Disks and Drums
TAOCP §5.4.9: what should you be comfortable with first?	<ul><li>5.4.1 Multiway Merging</li><li>5.4.6 Practical Considerations</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.9 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::5.4.9 Disks and Drums
TAOCP §5.4.9: how should you work through it?	Read with modern storage in mind. Ask at each point: what changes for an SSD? What stays the same?	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.4.9 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::5.4.9 Disks and Drums
TAOCP §5.5 Summary, History, and Bibliography: what does it cover?	Knuth's summary of chapter 5: a comparison of sorting methods with guidance on choosing one, plus the history of sorting.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.5 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::5.5 Summary, History, and Bibliography
TAOCP §5.5: why does it matter?	The comparison table and advice are practical gold, and the history is fun.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.5 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::5.5 Summary, History, and Bibliography
TAOCP §5.5, exercise 1 (rated 05): what is it asking?	Sum up the chapter in one generalized theorem.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.5 Summary, History, and Bibliography
TAOCP §5.5, exercise 2 (rated 20): what is it asking?	Pick the best list-sorting method for six-digit keys from the summary table.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.5 Summary, History, and Bibliography
TAOCP §5.5, exercise 4 (rated 28, recommended): what is it asking?	Which methods never make a comparison whose result they could already infer?	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::5.5 Summary, History, and Bibliography
TAOCP §5.5: how many exercises, and how are they rated?	5 exercises, rated 05 to 46.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.5 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::5.5 Summary, History, and Bibliography
TAOCP §5.5: what should you be comfortable with first?	<ul><li>Chapter 5</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.5 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::5.5 Summary, History, and Bibliography
TAOCP §5.5: how should you work through it?	Read the comparison of methods closely and compare with what your language's standard sort actually does (introsort, Timsort, pdqsort).	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.5 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::5.5 Summary, History, and Bibliography
TAOCP §6.1 Sequential Searching: what does it cover?	Searching a list one item at a time, with tricks like sentinels to speed up the loop, and self-organizing lists that move frequently accessed items toward the front.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.1 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::6.1 Sequential Searching
TAOCP §6.1: why does it matter?	For small arrays, linear search beats fancier structures. The sentinel trick and move-to-front heuristic are still used in real code.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.1 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::6.1 Sequential Searching
TAOCP §6.1: what traps should you watch for?	<ul><li>Forgetting to restore the sentinel slot.</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.1 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 3::6.1 Sequential Searching
TAOCP §6.1, exercise 2 (rated 15): what is it asking?	Restate sequential search for a linked list.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.1 Sequential Searching
TAOCP §6.1, exercise 4 (rated 17, recommended): what is it asking?	Does the sentinel trick work on a linked list?	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.1 Sequential Searching
TAOCP §6.1, exercise 5 (rated 20): what is it asking?	When can the unrolled sentinel search be slower than the simple one?	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.1 Sequential Searching
TAOCP §6.1, exercise 6 (rated 20, recommended): what is it asking?	Shave the inner loop further with three more MIX instructions.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.1 Sequential Searching
TAOCP §6.1, exercise 22 (rated 20, recommended): what is it asking?	Find the 1000 nearest records in one scan: which data structure? A heap of the best so far.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.1 Sequential Searching
TAOCP §6.1, exercise 10 (rated M20): what is it asking?	The worst ordering of a table, and how it relates to the best.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.1 Sequential Searching
TAOCP §6.1, exercise 15 (rated M22, recommended): what is it asking?	Arrange a subroutine library on tape when several routines are needed at once.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.1 Sequential Searching
TAOCP §6.1, exercise 11 (rated M30): what is it asking?	Limiting behavior of the move-to-front list. The stretch.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.1 Sequential Searching
TAOCP §6.1: how many exercises, and how are they rated?	22 exercises, rated 15 to M30.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.1 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::6.1 Sequential Searching
TAOCP §6.1: what should you be comfortable with first?	<ul><li>Chapter 5 basics</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.1 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::6.1 Sequential Searching
TAOCP §6.1: how should you work through it?	Implement linear search with and without a sentinel and benchmark. Implement move-to-front on a Zipf-distributed access pattern and measure the average search length.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.1 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::6.1 Sequential Searching
TAOCP §6.2.1 Searching an Ordered Table: what does it cover?	Binary search and its variants: uniform binary search, Fibonacci search, and interpolation search, with analysis and a careful look at how easy it is to get binary search wrong.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.1 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::6.2.1 Searching an Ordered Table
TAOCP §6.2.1: why does it matter?	Binary search is famously hard to write correctly. Knowing the variants also helps with things like branch-free search and searching on sorted disk pages.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.1 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::6.2.1 Searching an Ordered Table
TAOCP §6.2.1: what traps should you watch for?	<ul><li>Off-by-one in bounds and infinite loops when lo and hi are adjacent.</li><li>Midpoint overflow on very large arrays.</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.1 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 3::6.2.1 Searching an Ordered Table
TAOCP §6.2.1, exercise 3 (rated 15): what is it asking?	Identify the search method behind a given tree and compute its average costs.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.1 Searching an Ordered Table
TAOCP §6.2.1, exercise 1 (rated 21, recommended): what is it asking?	Prove what the bounds mean when binary search fails. This is the loop invariant.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.1 Searching an Ordered Table
TAOCP §6.2.1, exercise 2 (rated 22, recommended): what is it asking?	Do two tempting shortcuts in the bound updates still work?	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.1 Searching an Ordered Table
TAOCP §6.2.1, exercise 24 (rated 23, recommended): what is it asking?	Binary search on the heap-ordered layout, using doubling instead of halving. Cache-friendly search.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.1 Searching an Ordered Table
TAOCP §6.2.1, exercise 29 (rated 22, recommended): what is it asking?	Search keys that are only sorted up to a fixed involution.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.1 Searching an Ordered Table
TAOCP §6.2.1, exercise 7 (rated M22, recommended): what is it asking?	Do small changes to the start of uniform binary search break it?	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.1 Searching an Ordered Table
TAOCP §6.2.1, exercise 23 (rated 25, recommended): what is it asking?	Bottenbruch's variant that tests for equality only at the end. The form most libraries use.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.1 Searching an Ordered Table
TAOCP §6.2.1, exercise 25 (rated M25, recommended): what is it asking?	Relate internal and external node counts per level by generating functions. The math stretch.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.1 Searching an Ordered Table
TAOCP §6.2.1: how many exercises, and how are they rated?	30 exercises, rated 15 to M42.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.1 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::6.2.1 Searching an Ordered Table
TAOCP §6.2.1: what should you be comfortable with first?	<ul><li>6.1 Sequential Searching</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.1 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::6.2.1 Searching an Ordered Table
TAOCP §6.2.1: how should you work through it?	Write binary search from memory, then test it exhaustively on all arrays up to size 10 and all targets. Implement interpolation search and test it on uniform and skewed data.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.1 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::6.2.1 Searching an Ordered Table
TAOCP §6.2.2 Binary Tree Searching: what does it cover?	Binary search trees: insertion, deletion, the average cost of random BSTs, and optimal BSTs built with dynamic programming when access frequencies are known.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.2 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::6.2.2 Binary Tree Searching
TAOCP §6.2.2: why does it matter?	BSTs are the basis of ordered maps. The optimal BST algorithm is a classic dynamic programming example.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.2 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::6.2.2 Binary Tree Searching
TAOCP §6.2.2: what traps should you watch for?	<ul><li>Deletion of a node with two children is the classic bug spot.</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.2 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 3::6.2.2 Binary Tree Searching
TAOCP §6.2.2, exercise 1 (rated 15): what is it asking?	Make tree insertion handle the empty tree.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.2 Binary Tree Searching
TAOCP §6.2.2, exercise 3 (rated 20, recommended): what is it asking?	Can a sentinel speed up tree search the way it sped up sequential search?	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.2 Binary Tree Searching
TAOCP §6.2.2, exercise 10 (rated 22, recommended): what is it asking?	Keep a search tree efficient on nonrandom input by making it look random.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.2 Binary Tree Searching
TAOCP §6.2.2, exercise 14 (rated 22, recommended): what is it asking?	Show the extra deletion step never lengthens paths, and find a case where it helps.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.2 Binary Tree Searching
TAOCP §6.2.2, exercise 16 (rated 25, recommended): what is it asking?	Is deletion commutative? Experiment first, then prove.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.2 Binary Tree Searching
TAOCP §6.2.2, exercise 13 (rated M23, recommended): what is it asking?	Does deleting the root keep a random tree random?	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.2 Binary Tree Searching
TAOCP §6.2.2, exercise 23 (rated M23, recommended): what is it asking?	Find an optimum search tree for a skewed weight set without a computer.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.2 Binary Tree Searching
TAOCP §6.2.2, exercise 45 (rated 30, recommended): what is it asking?	Make the Garsia-Wachs algorithm run in n log n time. The stretch.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.2 Binary Tree Searching
TAOCP §6.2.2: how many exercises, and how are they rated?	49 exercises, rated 15 to M47.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.2 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::6.2.2 Binary Tree Searching
TAOCP §6.2.2: what should you be comfortable with first?	<ul><li>2.3 Trees</li><li>6.2.1 Searching an Ordered Table</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.2 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::6.2.2 Binary Tree Searching
TAOCP §6.2.2: how should you work through it?	Implement BST insert, search and delete with tests. Then implement the optimal BST dynamic program and check it on a small set of words with frequencies.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.2 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::6.2.2 Binary Tree Searching
TAOCP §6.2.3 Balanced Trees: what does it cover?	AVL trees: keeping a BST balanced with rotations so height stays logarithmic, plus discussion of other balancing schemes and list operations on balanced trees.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.3 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::6.2.3 Balanced Trees
TAOCP §6.2.3: why does it matter?	Self-balancing trees power ordered maps in most standard libraries and many databases. Rotations are a core skill.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.3 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::6.2.3 Balanced Trees
TAOCP §6.2.3: what traps should you watch for?	<ul><li>Updating balance factors incorrectly after a double rotation.</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.3 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 3::6.2.3 Balanced Trees
TAOCP §6.2.3, exercise 1 (rated 01): what is it asking?	Why a simpler-looking fix for the double-rotation case does not work.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.3 Balanced Trees
TAOCP §6.2.3, exercise 2 (rated 16): what is it asking?	Why the tree grew taller in a particular insertion case.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.3 Balanced Trees
TAOCP §6.2.3, exercise 16 (rated 20, recommended): what is it asking?	Delete two nodes from an AVL tree by hand.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.3 Balanced Trees
TAOCP §6.2.3, exercise 17 (rated 21, recommended): what is it asking?	Concatenate two balanced trees by hand.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.3 Balanced Trees
TAOCP §6.2.3, exercise 12 (rated 24, recommended): what is it asking?	Best and worst cost of one specific insertion in the MIX program.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.3 Balanced Trees
TAOCP §6.2.3, exercise 27 (rated M23, recommended): what is it asking?	Worst-case comparisons for searching a 2-3 tree.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.3 Balanced Trees
TAOCP §6.2.3, exercise 10 (rated 27, recommended): what is it asking?	The shape of an AVL tree is determined by its balance factors in order.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.3 Balanced Trees
TAOCP §6.2.3, exercise 3 (rated M25, recommended): what is it asking?	At most about 62 percent of AVL nodes can be unbalanced. The math stretch.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.3 Balanced Trees
TAOCP §6.2.3: how many exercises, and how are they rated?	33 exercises, rated 01 to M47.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.3 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::6.2.3 Balanced Trees
TAOCP §6.2.3: what should you be comfortable with first?	<ul><li>6.2.2 Binary Tree Searching</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.3 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::6.2.3 Balanced Trees
TAOCP §6.2.3: how should you work through it?	Implement AVL insertion with single and double rotations. Write a checker that verifies balance factors after every insert, and run it on a million random inserts. Deletion is a stretch goal.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.3 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::6.2.3 Balanced Trees
TAOCP §6.2.4 Multiway Trees: what does it cover?	B-trees and their variants: nodes with many keys sized to a disk page, insertion by splitting, and analysis of their height and space usage.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.4 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::6.2.4 Multiway Trees
TAOCP §6.2.4: why does it matter?	B-trees are the index structure inside nearly every database and filesystem (SQLite, Postgres, NTFS, APFS).	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.4 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::6.2.4 Multiway Trees
TAOCP §6.2.4: what traps should you watch for?	<ul><li>Off-by-one on the minimum and maximum keys per node when splitting.</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.4 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 3::6.2.4 Multiway Trees
TAOCP §6.2.4, exercise 1 (rated 10): what is it asking?	Insert a key into a B-tree of order 7 by hand.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.4 Multiway Trees
TAOCP §6.2.4, exercise 2 (rated 15): what is it asking?	Same insertion with overflow and three-way splitting.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.4 Multiway Trees
TAOCP §6.2.4, exercise 5 (rated 21, recommended): what is it asking?	Worst-case fill after a split with variable-length keys.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.4 Multiway Trees
TAOCP §6.2.4, exercise 9 (rated 22): what is it asking?	Use a B-tree to index a list by position instead of by key.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.4 Multiway Trees
TAOCP §6.2.4, exercise 3 (rated 23, recommended): what is it asking?	When do sequential inserts first push the leaves to level 4, under three splitting policies?	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.4 Multiway Trees
TAOCP §6.2.4, exercise 6 (rated 23): what is it asking?	Design B-tree deletion. The algorithm the text leaves to you.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.4 Multiway Trees
TAOCP §6.2.4, exercise 10 (rated 35, recommended): what is it asking?	Concurrent access to a shared B-tree. An open-ended design question that leads to database locking.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.2.4 Multiway Trees
TAOCP §6.2.4: how many exercises, and how are they rated?	10 exercises, rated 10 to HM37.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.4 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::6.2.4 Multiway Trees
TAOCP §6.2.4: what should you be comfortable with first?	<ul><li>6.2.3 Balanced Trees</li><li>5.4.9 Disks and Drums</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.4 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::6.2.4 Multiway Trees
TAOCP §6.2.4: how should you work through it?	Implement an in-memory B-tree with insertion and search. Then read how SQLite lays out its B-tree pages to connect it to the real world.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.2.4 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::6.2.4 Multiway Trees
TAOCP §6.3 Digital Searching: what does it cover?	Searching by looking at keys digit by digit or bit by bit instead of comparing whole keys: tries, digital search trees, and Patricia, a compact trie for long keys.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.3 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::6.3 Digital Searching
TAOCP §6.3: why does it matter?	Tries and radix trees power autocomplete, IP routing tables, and in-memory indexes in many databases.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.3 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::6.3 Digital Searching
TAOCP §6.3: what traps should you watch for?	<ul><li>Memory blow-up from fixed-size child arrays in each trie node.</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.3 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 3::6.3 Digital Searching
TAOCP §6.3, exercise 1 (rated 00): what is it asking?	A one-word joke about trie terminology.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.3 Digital Searching
TAOCP §6.3, exercise 6 (rated 15): what is it asking?	Build a digital search tree from 15 keys inserted in order.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.3 Digital Searching
TAOCP §6.3, exercise 4 (rated 21, recommended): what is it asking?	Pack a sparse trie table by overlapping entries. The idea behind double-array tries.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.3 Digital Searching
TAOCP §6.3, exercise 35 (rated M20, recommended): what is it asking?	Probability that Patricia builds a given small tree.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.3 Digital Searching
TAOCP §6.3, exercise 14 (rated 25, recommended): what is it asking?	Find every occurrence of a key in the text after Patricia finds one.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.3 Digital Searching
TAOCP §6.3, exercise 7 (rated M26, recommended): what is it asking?	Which insertion order gives the worst digital search tree?	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.3 Digital Searching
TAOCP §6.3, exercise 44 (rated 30, recommended): what is it asking?	Explore ternary search tries. A practical structure for string keys.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.3 Digital Searching
TAOCP §6.3, exercise 20 (rated M30, recommended): what is it asking?	Analyze tries that switch to sequential search for small subfiles. The stretch.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.3 Digital Searching
TAOCP §6.3: how many exercises, and how are they rated?	45 exercises, rated 00 to M43.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.3 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::6.3 Digital Searching
TAOCP §6.3: what should you be comfortable with first?	<ul><li>6.2 Searching by Comparison of Keys</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.3 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::6.3 Digital Searching
TAOCP §6.3: how should you work through it?	Implement a simple trie for words, then a compressed radix tree. Compare memory and speed with a hash set on a dictionary file.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.3 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::6.3 Digital Searching
TAOCP §6.4 Hashing (part 1): what does it cover?	Part 1 covers the first part of the section (pages 513 to 533): choosing hash functions (division, multiplicative and Fibonacci hashing, and the idea of universal families), collision resolution by chaining, including coalesced chaining in a single table, and open addressing with linear probing and double hashing, ending with Brent's variation.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 1)
TAOCP §6.4 (part 1): why does it matter?	Hash tables are the most used data structure in practice. Knowing why a bad hash function wrecks performance will save you in production.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 1)
TAOCP §6.4 (part 1): what traps should you watch for?	<ul><li>Using a power-of-two table size with a weak hash: only low bits get used.</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 1)
TAOCP §6.4 (part 1), exercise 6 (rated 15): what is it asking?	Judge a shortcut at the start of the division hashing code.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 1)
TAOCP §6.4 (part 1), exercise 15 (rated 16): what is it asking?	Why open addressing should report overflow one slot early.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 1)
TAOCP §6.4 (part 1), exercise 12 (rated 21, recommended): what is it asking?	Tighten the chained hashing inner loop to one conditional jump.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 1)
TAOCP §6.4 (part 1), exercise 18 (rated 21, recommended): what is it asking?	Compare two ways of computing the double hashing step.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 1)
TAOCP §6.4 (part 1), exercise 13 (rated 24, recommended): what is it asking?	Store only part of each key in a chained table, since the bucket implies the rest.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 1)
TAOCP §6.4 (part 1), exercise 66 (rated 25, recommended): what is it asking?	Keep keys ordered within probe sequences so failed searches stop early.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 1)
TAOCP §6.4 (part 1), exercise 76 (rated M21, recommended): what is it asking?	Extend a universal hash family to variable-length keys.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 1)
TAOCP §6.4 (part 1), exercise 72 (rated M28, recommended): what is it asking?	Universal hashing: why a randomly chosen function from a good family keeps chains short. The stretch.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 1)
TAOCP §6.4 (part 1): how many exercises, and how are they rated?	78 exercises, rated 10 to M49.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 1)
TAOCP §6.4 (part 1): what should you be comfortable with first?	<ul><li>6.1 to 6.3</li><li>1.2.4 Number theory</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 1)
TAOCP §6.4 (part 1): how should you work through it?	Implement multiplicative hashing and test it against keys with patterns (all multiples of 64, sequential IDs). Implement a chained hash table and measure chain lengths against the theoretical averages.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 1)
TAOCP §6.4 Hashing (part 2): what does it cover?	Part 2 covers the rest of the section (pages 533 to 549): deleting from open-addressed tables without breaking later searches, the starred analysis of expected probe counts for chaining, linear probing and double hashing as the table fills, hashing on external storage with buckets, a comparison of all the methods, and history.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 2)
TAOCP §6.4 (part 2): why does it matter?	Open addressing with linear probing is what many modern high-performance hash tables use. Knuth's linear probing analysis is historically the start of the field of algorithm analysis.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 2)
TAOCP §6.4 (part 2), a common trap: “Deleting by just clearing a slot breaks later searches.” What's the catch?	Tombstones or Knuth's deletion algorithm fix this.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 2)
TAOCP §6.4 (part 2): what traps should you watch for?	<ul><li>Letting the load factor get close to 1 with linear probing.</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 2)
TAOCP §6.4 (part 2), exercise 21 (rated 20, recommended): what is it asking?	After marking a record deleted, should the item count go down?	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 2)
TAOCP §6.4 (part 2), exercise 65 (rated 20, recommended): what is it asking?	How to store variable-length keys in a hash table.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 2)
TAOCP §6.4 (part 2), exercise 42 (rated M20, recommended): what is it asking?	Probability that chained hashing finds a free slot immediately.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 2)
TAOCP §6.4 (part 2), exercise 29 (rated M21): what is it asking?	The parking problem: linear probing told as a story about cars.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 2)
TAOCP §6.4 (part 2), exercise 33 (rated M23, recommended): what is it asking?	Why the classic linear probing estimate is only an approximation.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 2)
TAOCP §6.4 (part 2), exercise 34 (rated M23, recommended): what is it asking?	List-length distribution and probe counts for separate chaining.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 2)
TAOCP §6.4 (part 2), exercise 23 (rated 33, recommended): what is it asking?	Design deletion for coalesced chaining, analogous to linear-probing deletion.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 2)
TAOCP §6.4 (part 2), exercise 37 (rated M29, recommended): what is it asking?	Variance of successful search cost under separate chaining. The stretch.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 2)
TAOCP §6.4 (part 2): how many exercises, and how are they rated?	78 exercises, rated 10 to M49.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 2)
TAOCP §6.4 (part 2): what should you be comfortable with first?	<ul><li>6.4 Hashing (part 1)</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 2)
TAOCP §6.4 (part 2): how should you work through it?	Compare this with your clox hash table from chapter 20: tombstones, load factor, linear probing. Measure probe counts at load factors 0.5, 0.75 and 0.9 and compare to Knuth's formulas.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.4 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::6.4 Hashing (part 2)
TAOCP §6.5 Retrieval on Secondary Keys: what does it cover?	Searching on attributes other than the primary key: inverted files, multi-attribute queries, range and partial-match queries, and superimposed coding (the idea behind Bloom filters).	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.5 cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::6.5 Retrieval on Secondary Keys
TAOCP §6.5: why does it matter?	Inverted indexes power every search engine, and Bloom filters are everywhere from databases to network caches.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.5 cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::6.5 Retrieval on Secondary Keys
TAOCP §6.5: what traps should you watch for?	<ul><li>Picking the number of Bloom filter hash functions without doing the math.</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.5 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 3::6.5 Retrieval on Secondary Keys
TAOCP §6.5, exercise 3 (rated 19): what is it asking?	Which queries produce particular false drops in the recipe example.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.5 Retrieval on Secondary Keys
TAOCP §6.5, exercise 9 (rated M20): what is it asking?	Verify a construction of Steiner triple systems.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.5 Retrieval on Secondary Keys
TAOCP §6.5, exercise 6 (rated M20, recommended): what is it asking?	Average locations per query for composed combinatorial hash functions.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.5 Retrieval on Secondary Keys
TAOCP §6.5, exercise 16 (rated 25, recommended): what is it asking?	Build superimposed codes from a triple system so no codeword is covered by two others.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.5 Retrieval on Secondary Keys
TAOCP §6.5, exercise 14 (rated 28): what is it asking?	Deletion in quadtrees and k-d trees. A real design problem.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.5 Retrieval on Secondary Keys
TAOCP §6.5, exercise 1 (rated M27, recommended): what is it asking?	Construct permutations that put every small subset first somewhere.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.5 Retrieval on Secondary Keys
TAOCP §6.5, exercise 17 (rated M30, recommended): what is it asking?	Analyze a bit-interleaving scheme for partial-match buckets. The stretch.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::6.5 Retrieval on Secondary Keys
TAOCP §6.5: how many exercises, and how are they rated?	20 exercises, rated 19 to M47.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.5 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::6.5 Retrieval on Secondary Keys
TAOCP §6.5: what should you be comfortable with first?	<ul><li>6.4 Hashing</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.5 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::6.5 Retrieval on Secondary Keys
TAOCP §6.5: how should you work through it?	Build a tiny inverted index for a folder of text files and answer AND queries. Implement a Bloom filter and measure its false positive rate.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::6.5 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::6.5 Retrieval on Secondary Keys
TAOCP Vol 3 review: what does it cover?	A review week for Volume 3: sorting and searching.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::vol_3_review cracked.guide::kind::about	cracked.guide::TAOCP Vol 3::Vol 3 review
TAOCP: Vol 3 review: why does it matter?	This is the most directly practical volume. Consolidating it gives you a reference you will use for the rest of your career.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::vol_3_review cracked.guide::kind::why	cracked.guide::TAOCP Vol 3::Vol 3 review
TAOCP: Vol 3 review, exercise 20 of §5 (rated 25, recommended): what is it asking?	Find all pairs of words that differ in at most two bits. Sorting as a tool for a search problem.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::vol_3_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::Vol 3 review
TAOCP: Vol 3 review, exercise 13 of §5.2 (rated 27, recommended): what is it asking?	Do distribution counting in place, with no second array of records.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::vol_3_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::Vol 3 review
TAOCP: Vol 3 review, exercise 43 of §5.2.1 (rated 25, recommended): what is it asking?	Remove the bounds test from shellsort's inner loop without a sentinel.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::vol_3_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::Vol 3 review
TAOCP: Vol 3 review, exercise 30 of §5.2.2 (rated 25, recommended): what is it asking?	Keep quicksort fast on multiword keys as the file nears sorted order.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::vol_3_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::Vol 3 review
TAOCP: Vol 3 review, exercise 56 of §5.3.4 (rated 25, recommended): what is it asking?	For any unsorted 0-1 vector, build a network that fails only on it. Why the zero-one test must be exhaustive.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::vol_3_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::Vol 3 review
TAOCP: Vol 3 review, exercise 44 of §6.2.2 (rated 25, recommended): what is it asking?	Rebuild a binary tree from the depths of its leaves in order.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::vol_3_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::Vol 3 review
TAOCP: Vol 3 review, exercise 21 of §6.2.3 (rated 30, recommended): what is it asking?	Build perfectly balanced trees online in linear time.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::vol_3_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::Vol 3 review
TAOCP: Vol 3 review, exercise 78 of §6.4 (rated M26, recommended): what is it asking?	Prove a multiply-and-shift family is universal. The hash function many fast libraries use.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::vol_3_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 3::Vol 3 review
TAOCP: Vol 3 review: how many exercises, and how are they rated?	964 exercises, rated 00 to M50.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::vol_3_review cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 3::Vol 3 review
TAOCP: Vol 3 review: what should you be comfortable with first?	<ul><li>All of Vol 3</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::vol_3_review cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 3::Vol 3 review
TAOCP: Vol 3 review: how should you work through it?	Gather your implementations (quicksort, heapsort, merge sort, radix sort, BST, AVL, B-tree, hash tables) in one repo with a shared benchmark harness. Write a short decision guide: which sort or search structure when.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::vol_3_review cracked.guide::kind::approach	cracked.guide::TAOCP Vol 3::Vol 3 review
TAOCP Vol 4A: Combinatorial Algorithms, Part 1: what is the phase about?	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.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::kind::about	cracked.guide::TAOCP Vol 4A::About this phase
TAOCP Vol 4A: what should you be able to do by the end?	<ul><li>Use bitwise and broadword tricks fluently in C.</li><li>Build and use BDDs and ZDDs.</li><li>Generate combinatorial objects in Gray-code orders and test code exhaustively with them.</li><li>Solve 2SAT and Horn satisfiability in linear time.</li></ul>	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::kind::outcomes	cracked.guide::TAOCP Vol 4A::About this phase
TAOCP Vol 4A: what do you need before you start?	<ul><li>Vols 1 to 3.</li><li>MMIX basics from Vol 1 Fascicle 1 or Knuth's MMIX page, mainly for 7.1.3.</li></ul>	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::kind::need	cracked.guide::TAOCP Vol 4A::About this phase
TAOCP Vol 4A: how do you get the book?	Vol 4A is about $64 new from InformIT. It is too new to be dirt cheap used. The paperback Fascicles 0 to 4 contain earlier drafts of the same material and sometimes turn up cheap used. Borrow before you buy: many public and university libraries give you free access to O'Reilly Learning, which carries TAOCP; Libby/OverDrive and interlibrary loan (search WorldCat) work too. Older used editions are fine for Vols 1 to 3; section numbers barely changed. If you buy the eBook, get the PDF from InformIT. Knuth himself warns that the Kindle and ePUB versions mangle the math.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::kind::book	cracked.guide::TAOCP Vol 4A::About this phase
TAOCP Vol 4A: tips for getting through it?	<ul><li>Vol 4A is huge; you are reading selected sections, not all of it.</li><li>The exercises are full of puzzles. Pick the ones that make you curious.</li></ul>	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::kind::tips	cracked.guide::TAOCP Vol 4A::About this phase
TAOCP §7 Combinatorial Searching intro (part 1): what does it cover?	Part 1 covers the first 17 pages of chapter 7: Langford pairs, orthogonal latin squares and the Tompkins approach of splitting a search into phases, a warning about puzzles versus real problems, the Stanford GraphBase list of 5757 five-letter English words, and then the start of the graph primer: graphs built from words, paths and cycles, and coloring (with the theorem that a graph is bipartite exactly when it has no odd cycle).	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7 cracked.guide::kind::about	cracked.guide::TAOCP Vol 4A::7 Combinatorial Searching intro (part 1)
TAOCP §7 (part 1): why does it matter?	Combinatorial search is behind schedulers, compilers' register allocators, puzzle solvers and test generators. This intro sets the mindset for the last 26 weeks.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7 cracked.guide::kind::why	cracked.guide::TAOCP Vol 4A::7 Combinatorial Searching intro (part 1)
TAOCP §7 (part 1), a common trap: “Being intimidated by the size of Vol 4A.” What's the catch?	You are reading selected sections, not all 900 pages.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 4A::7 Combinatorial Searching intro (part 1)
TAOCP §7 (part 1), a common trap: “Treating exercises rated 48 or 50 as homework.” What's the catch?	Those mark research problems (15 asks for three mutually orthogonal 10 x 10 latin squares, still open); read them and move on.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 4A::7 Combinatorial Searching intro (part 1)
TAOCP §7 (part 1), exercise 2 (rated 20): what is it asking?	Find exactly which n admit a Langford arrangement. A parity argument does all the work; worth writing out before you code a search.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7 Combinatorial Searching intro (part 1)
TAOCP §7 (part 1), exercise 5 (rated HM22, recommended): what is it asking?	Use a probability estimate to guess how fast the number of Langford pairings grows. A classic back-of-envelope sanity check for search sizes.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7 Combinatorial Searching intro (part 1)
TAOCP §7 (part 1), exercise 12 (rated M21, recommended): what is it asking?	Show the addition table mod n has an orthogonal mate exactly when n is odd. Short, and it explains why Euler got stuck on even orders.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7 Combinatorial Searching intro (part 1)
TAOCP §7 (part 1), exercise 22 (rated M22, recommended): what is it asking?	Connect orthogonal arrays with geometric nets, and decide whether the link runs both ways.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7 Combinatorial Searching intro (part 1)
TAOCP §7 (part 1), exercise 26 (rated 25, recommended): what is it asking?	Write a sensible English sentence using only five-letter words. Fun, and it gets you poking around the SGB word list.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7 Combinatorial Searching intro (part 1)
TAOCP §7 (part 1), exercise 30 (rated 20, recommended): what is it asking?	Search the word list for words whose letters are in alphabetical order. A first warm-up for filtering the data set with code.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7 Combinatorial Searching intro (part 1)
TAOCP §7 (part 1), exercise 54 (rated 21, recommended): what is it asking?	Build graphs and a digraph from US postal codes and find their components and strong components. Ties the new vocabulary to Section 2.3.4.2.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7 Combinatorial Searching intro (part 1)
TAOCP §7 (part 1), exercise 6 (rated M28, recommended): what is it asking?	Count Langford pairings with an algebraic sum you can evaluate in exponential but small time, then speed it up with symmetries. The stretch, and a taste of counting without generating.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7 Combinatorial Searching intro (part 1)
TAOCP §7 (part 1): how many exercises, and how are they rated?	145 exercises, rated M00 to 50.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 4A::7 Combinatorial Searching intro (part 1)
TAOCP §7 (part 1): what should you be comfortable with first?	<ul><li>Vol 1 to 3</li><li>Basic graph vocabulary</li></ul>	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 4A::7 Combinatorial Searching intro (part 1)
TAOCP §7 (part 1): how should you work through it?	Read slowly and play with the puzzles. Write a brute-force Langford pair finder for small n before reading Knuth's smarter ideas. Vol 4 uses MMIX (Knuth's 64-bit RISC machine) instead of MIX where it shows machine code, and much of it is written in plain algorithm steps. You will want MMIX basics (from Vol 1 Fascicle 1 or the MMIX page) for 7.1.3 especially.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 4A::7 Combinatorial Searching intro (part 1)
TAOCP §7 Combinatorial Searching intro (part 2): what does it cover?	Part 2 is the rest of the chapter 7 introduction (book pages 18 to 35): directed graphs and tournaments, how the Stanford GraphBase represents graphs in memory, a simple 2-coloring algorithm (Algorithm B), the SGB graph generators, graph algebra (complements, sums, joins and five kinds of graph products), graphical degree sequences and Algorithm H for realizing them, hypergraphs and incidence matrices, and covering, independence, cliques and coloring.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7 cracked.guide::kind::about	cracked.guide::TAOCP Vol 4A::7 Combinatorial Searching intro (part 2)
TAOCP §7 (part 2): why does it matter?	Graphs are the most common model for real problems (networks, dependencies, maps). Getting the vocabulary precise makes everything after this easier.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7 cracked.guide::kind::why	cracked.guide::TAOCP Vol 4A::7 Combinatorial Searching intro (part 2)
TAOCP §7 (part 2): what is Algorithm B about?	A simple 2-coloring algorithm.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7 cracked.guide::kind::algorithm	cracked.guide::TAOCP Vol 4A::7 Combinatorial Searching intro (part 2)
TAOCP §7 (part 2), a common trap: “Getting lost in notation.” What's the catch?	Keep a glossary of the graph products and their symbols; they come back in 7.1.4 and 7.2.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 4A::7 Combinatorial Searching intro (part 2)
TAOCP §7 (part 2), a common trap: “Assuming the five graph products are interchangeable.” What's the catch?	Draw each for two small graphs (exercise 91) until you can tell them apart.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 4A::7 Combinatorial Searching intro (part 2)
TAOCP §7 (part 2), exercise 59 (rated M23, recommended): what is it asking?	Show every tournament has a directed path through all its vertices. A neat induction that also gives an insertion-sort style algorithm.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7 Combinatorial Searching intro (part 2)
TAOCP §7 (part 2), exercise 60 (rated M22, recommended): what is it asking?	Prove the player with the most wins can reach everyone else in at most two steps. Short and satisfying.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7 Combinatorial Searching intro (part 2)
TAOCP §7 (part 2), exercise 69 (rated 20, recommended): what is it asking?	Compute in-degrees and out-degrees for a graph stored in SGB format. Makes sure you can actually walk the data structure.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7 Combinatorial Searching intro (part 2)
TAOCP §7 (part 2), exercise 70 (rated M20, recommended): what is it asking?	Count how often each step of the 2-coloring algorithm runs. Classic Knuth-style analysis on a graph algorithm.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7 Combinatorial Searching intro (part 2)
TAOCP §7 (part 2), exercise 108 (rated M23, recommended): what is it asking?	Adapt the degree-sequence construction to digraphs with given in-degrees and out-degrees.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7 Combinatorial Searching intro (part 2)
TAOCP §7 (part 2), exercise 143 (rated M25, recommended): what is it asking?	Show you can always delete a column from a matrix with distinct rows and keep the rows distinct. Useful for thinking about minimal keys in data.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7 Combinatorial Searching intro (part 2)
TAOCP §7 (part 2), exercise 145 (rated 25, recommended): what is it asking?	Find a majority element with fewer than n comparisons. The Boyer-Moore voting idea, which shows up in interviews and streaming code.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7 Combinatorial Searching intro (part 2)
TAOCP §7 (part 2), exercise 65 (rated HM31, recommended): what is it asking?	Use eigenvalues to pin down which degrees allow girth-5 graphs of the smallest possible size. The stretch; it is the Hoffman-Singleton theorem, and the one open case is exercise 67.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7 Combinatorial Searching intro (part 2)
TAOCP §7 (part 2): how many exercises, and how are they rated?	145 exercises, rated M00 to 50.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 4A::7 Combinatorial Searching intro (part 2)
TAOCP §7 (part 2): what should you be comfortable with first?	<ul><li>7 intro part 1</li><li>2.3.4 Mathematical properties of trees</li></ul>	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 4A::7 Combinatorial Searching intro (part 2)
TAOCP §7 (part 2): how should you work through it?	Make a glossary as you read. Draw every named graph family for small sizes. Do not try to memorize every operation on graphs; aim to recognize them later.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 4A::7 Combinatorial Searching intro (part 2)
TAOCP §7.1.1 Boolean Basics (part 1): what does it cover?	Part 1 covers the first half of 7.1.1 (book pages 47 to 62): the sixteen binary Boolean operations and their names, basic identities, functions of n variables and their representations (truth tables, multilinear polynomials), disjunctive and conjunctive normal forms with implicants and prime implicants, satisfiability, and the two easy special cases: Horn clauses (solved by unit propagation) and Krom clauses, that is 2SAT (solved with strong components).	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.1 cracked.guide::kind::about	cracked.guide::TAOCP Vol 4A::7.1.1 Boolean Basics (part 1)
TAOCP §7.1.1 (part 1): why does it matter?	Boolean logic is the foundation of hardware, query engines, feature-flag logic and SAT solving (which you will meet at the end of the path).	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.1 cracked.guide::kind::why	cracked.guide::TAOCP Vol 4A::7.1.1 Boolean Basics (part 1)
TAOCP §7.1.1 (part 1), fill in the blank:<br>Horn and 2SAT are solvable in <span class="cg-blank">&nbsp;</span>, and both live in this half of the section, not the next one.	Horn and 2SAT are solvable in <b>linear time</b>, and both live in this half of the section, not the next one.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.1 cracked.guide::kind::complexity	cracked.guide::TAOCP Vol 4A::7.1.1 Boolean Basics (part 1)
TAOCP §7.1.1 (part 1), a common trap: “Confusing CNF and DNF.” What's the catch?	Write a mnemonic.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.1 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 4A::7.1.1 Boolean Basics (part 1)
TAOCP §7.1.1 (part 1), a common trap: “Thinking all SAT is hard.” What's the catch?	Horn and 2SAT are solvable in linear time, and both live in this half of the section, not the next one.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.1 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 4A::7.1.1 Boolean Basics (part 1)
TAOCP §7.1.1 (part 1), exercise 3 (rated 13, recommended): what is it asking?	Redo the operation table with -1 and +1 instead of 0 and 1. Shows which operations are really min, max, negation and product in disguise.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.1 Boolean Basics (part 1)
TAOCP §7.1.1 (part 1), exercise 13 (rated 20, recommended): what is it asking?	Model a system of working or failing parts as a Boolean function and get its reliability polynomial. A practical reason to care about representations.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.1 Boolean Basics (part 1)
TAOCP §7.1.1 (part 1), exercise 18 (rated 20, recommended): what is it asking?	Show any implicant of a DNF and any clause of a CNF for the same function must share a literal. One line once you see it, and it fixes the duality in your head.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.1 Boolean Basics (part 1)
TAOCP §7.1.1 (part 1), exercise 30 (rated 27, recommended): what is it asking?	Compute all prime implicants by treating them as subcubes encoded with two bit masks. Real code, and bit tricks you will meet again in 7.1.3.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.1 Boolean Basics (part 1)
TAOCP §7.1.1 (part 1), exercise 48 (rated 21, recommended): what is it asking?	Test Horn clauses for satisfiability efficiently. Write it as unit propagation with counters; it is the core of many rule engines.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.1 Boolean Basics (part 1)
TAOCP §7.1.1 (part 1), exercise 56 (rated 20, recommended): what is it asking?	Restate satisfiability as a quantified formula. Short setup for the next pick.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.1 Boolean Basics (part 1)
TAOCP §7.1.1 (part 1), exercise 57 (rated 30, recommended): what is it asking?	Decide fully quantified 2CNF formulas in linear time, extending the strong-components algorithm for 2SAT. The main algorithmic payoff of the week.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.1 Boolean Basics (part 1)
TAOCP §7.1.1 (part 1), exercise 37 (rated M31, recommended): what is it asking?	Build a shellable DNF for a simple function and prove no orthogonal DNF is shorter. The stretch.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.1 Boolean Basics (part 1)
TAOCP §7.1.1 (part 1): how many exercises, and how are they rated?	133 exercises, rated 05 to M48.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.1 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 4A::7.1.1 Boolean Basics (part 1)
TAOCP §7.1.1 (part 1): what should you be comfortable with first?	<ul><li>7 intro</li></ul>	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.1 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 4A::7.1.1 Boolean Basics (part 1)
TAOCP §7.1.1 (part 1): how should you work through it?	Make your own table of all 16 binary operations and their names. Convert a few small functions between truth table, DNF and CNF by hand. Then implement Horn clause satisfiability with unit propagation and the linear-time 2SAT algorithm with strongly connected components; both are in this half.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.1 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 4A::7.1.1 Boolean Basics (part 1)
TAOCP §7.1.1 Boolean Basics (part 2): what does it cover?	Part 2 finishes 7.1.1 (book pages 62 to 78): the median (majority) operation and monotone self-dual functions, median algebras and median graphs with their labels, median sets, threshold functions, symmetric Boolean functions, canalizing functions, and a closing table comparing how many functions of n variables fall into each class.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.1 cracked.guide::kind::about	cracked.guide::TAOCP Vol 4A::7.1.1 Boolean Basics (part 2)
TAOCP §7.1.1 (part 2): why does it matter?	Horn clauses are the basis of Prolog and Datalog, and 2SAT is one of the few satisfiability problems solvable in linear time, a classic competitive programming trick.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.1 cracked.guide::kind::why	cracked.guide::TAOCP Vol 4A::7.1.1 Boolean Basics (part 2)
TAOCP §7.1.1 (part 2), fill in the blank:<br>Horn clauses are the basis of Prolog and Datalog, and 2SAT is one of the few satisfiability problems solvable in <span class="cg-blank">&nbsp;</span>, a classic competitive programming trick.	Horn clauses are the basis of Prolog and Datalog, and 2SAT is one of the few satisfiability problems solvable in <b>linear time</b>, a classic competitive programming trick.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.1 cracked.guide::kind::complexity	cracked.guide::TAOCP Vol 4A::7.1.1 Boolean Basics (part 2)
TAOCP §7.1.1 (part 2), a common trap: “Expecting Horn clauses and 2SAT here.” What's the catch?	They are in part 1; this half is about medians and special classes of functions.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.1 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 4A::7.1.1 Boolean Basics (part 2)
TAOCP §7.1.1 (part 2), a common trap: “Skipping the median material because it looks abstract.” What's the catch?	Median graphs connect 2SAT solutions, hypercube labels and distance problems.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.1 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 4A::7.1.1 Boolean Basics (part 2)
TAOCP §7.1.1 (part 2), exercise 60 (rated 12): what is it asking?	Decide which formulas really compute the median of three. Quick check that you know majority from its look-alikes.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.1 Boolean Basics (part 2)
TAOCP §7.1.1 (part 2), exercise 65 (rated M21, recommended): what is it asking?	Translate families of sets into Boolean functions and see which properties of the family become monotone or self-dual. The set view is used again for ZDDs.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.1 Boolean Basics (part 2)
TAOCP §7.1.1 (part 2), exercise 71 (rated M21, recommended): what is it asking?	Derive the long distributive law of median algebras from the short one. Short axiomatic practice.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.1 Boolean Basics (part 2)
TAOCP §7.1.1 (part 2), exercise 99 (rated 20, recommended): what is it asking?	Prove a median identity that lets you fold repeated inputs. Good warm-up for threshold functions.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.1 Boolean Basics (part 2)
TAOCP §7.1.1 (part 2), exercise 106 (rated M25, recommended): what is it asking?	Compare two binary numbers with a single large median. A threshold function with a hardware flavor.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.1 Boolean Basics (part 2)
TAOCP §7.1.1 (part 2), exercise 128 (rated 20, recommended): what is it asking?	Find a function true at exactly two points that is not canalizing. Checks you understand the definition.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.1 Boolean Basics (part 2)
TAOCP §7.1.1 (part 2), exercise 133 (rated 20, recommended): what is it asking?	Choose coin biases so the probability that a function of the random bits is 1 equals its truth table read as a binary fraction. A cute link between truth tables and probabilities.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.1 Boolean Basics (part 2)
TAOCP §7.1.1 (part 2), exercise 67 (rated M30, recommended): what is it asking?	Express the Y function (from the board game Y) as nested medians on a triangular grid. The stretch.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.1 Boolean Basics (part 2)
TAOCP §7.1.1 (part 2): how many exercises, and how are they rated?	133 exercises, rated 05 to M48.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.1 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 4A::7.1.1 Boolean Basics (part 2)
TAOCP §7.1.1 (part 2): what should you be comfortable with first?	<ul><li>7.1.1 part 1</li></ul>	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.1 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 4A::7.1.1 Boolean Basics (part 2)
TAOCP §7.1.1 (part 2): how should you work through it?	Read the threshold and symmetric function material with pencil in hand: build a few small examples and check them against the definitions before moving on.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.1 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 4A::7.1.1 Boolean Basics (part 2)
TAOCP §7.1.2 Boolean Evaluation: what does it cover?	Computing Boolean functions with few operations. Knuth defines Boolean chains and their cost, length and depth, finds optimum chains for every function of four variables (Algorithm L and the footprint method), looks at evaluation with minimum memory, multiple outputs such as adders and the seven-segment display, asymptotic counts, functions with don't-cares, a tic-tac-toe player built from gates, and functional decomposition.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.2 cracked.guide::kind::about	cracked.guide::TAOCP Vol 4A::7.1.2 Boolean Evaluation
TAOCP §7.1.2: why does it matter?	This is how hardware designers think, and it is the same skill as writing branch-free code. The game Shenzhen I/O touches the same instincts.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.2 cracked.guide::kind::why	cracked.guide::TAOCP Vol 4A::7.1.2 Boolean Evaluation
TAOCP §7.1.2, exercise 1 (rated 24): what is it asking?	Rewrite a cost-4 chain as a depth-3 formula of the same cost. Gets you comfortable with the cost versus depth trade-off.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.2 Boolean Evaluation
TAOCP §7.1.2, exercise 8 (rated 20, recommended): what is it asking?	Explain why a particular bit pattern is the truth table of a variable. You will use these masks constantly in 7.1.3 and 7.1.4.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.2 Boolean Evaluation
TAOCP §7.1.2, exercise 10 (rated 20, recommended): what is it asking?	Change Algorithm L to compute minimum depth instead of formula length. A small edit that shows you understand the dynamic program.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.2 Boolean Evaluation
TAOCP §7.1.2, exercise 27 (rated 23, recommended): what is it asking?	Decide whether a full adder fits in five steps using only three one-bit registers.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.2 Boolean Evaluation
TAOCP §7.1.2, exercise 34 (rated 22, recommended): what is it asking?	Design a priority encoder with linear cost and logarithmic depth. A real hardware building block.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.2 Boolean Evaluation
TAOCP §7.1.2, exercise 44 (rated 26, recommended): what is it asking?	View binary addition as a finite-state transduction and derive a fast parallel adder from it. Carry lookahead from first principles.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.2 Boolean Evaluation
TAOCP §7.1.2, exercise 56 (rated 16, recommended): what is it asking?	Explain why functions with many don't-cares cost nothing. Quick reading check on partial functions.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.2 Boolean Evaluation
TAOCP §7.1.2, exercise 36 (rated M28, recommended): what is it asking?	Find chains for all prefix ANDs that have optimum depth and linear cost (Ladner and Fischer). The stretch; this is the parallel prefix idea behind fast adders and GPU scans.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.2 Boolean Evaluation
TAOCP §7.1.2: how many exercises, and how are they rated?	88 exercises, rated 15 to 47.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.2 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 4A::7.1.2 Boolean Evaluation
TAOCP §7.1.2: what should you be comfortable with first?	<ul><li>7.1.1 Boolean Basics</li></ul>	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.2 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 4A::7.1.2 Boolean Evaluation
TAOCP §7.1.2: how should you work through it?	Design a full adder with the fewest gates you can, then compare to Knuth. Write a brute-force search for the cheapest chain computing a 3-variable function.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.2 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 4A::7.1.2 Boolean Evaluation
TAOCP §7.1.3 Bitwise Tricks and Techniques (part 1): what does it cover?	Part 1 covers the first 20 pages of 7.1.3 (book pages 133 to 153): bitwise operations on 2-adic integers and their algebra (with a detour into nim and Conway's nim field), packing and unpacking fields, big-endian versus little-endian, isolating and counting the rightmost and leftmost bits (the ruler function and binary logarithm), sideways addition (popcount), bit reversal and swapping, general bit permutations and the permutation networks behind them, scattered bit fields, and operating on several bytes at once in one word.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.3 cracked.guide::kind::about	cracked.guide::TAOCP Vol 4A::7.1.3 Bitwise Tricks and Techniques (part 1)
TAOCP §7.1.3 (part 1): why does it matter?	This is the most directly useful part of Vol 4 for systems programmers: bitboards, compact sets, hashing, compression and fast parsers all rely on these tricks.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.3 cracked.guide::kind::why	cracked.guide::TAOCP Vol 4A::7.1.3 Bitwise Tricks and Techniques (part 1)
MMIX: what is it?	MMIX is a 64-bit RISC computer designed by Donald Knuth to replace MIX in The Art of Computer Programming.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.3 cracked.guide::kind::definition	cracked.guide::TAOCP Vol 4A::7.1.3 Bitwise Tricks and Techniques (part 1)
MMIX: Should I learn MIX or MMIX first?	For Volumes 1 to 3 as printed today, MIX, because that is what the programs use. Pick up MMIX when you reach Volume 4A.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.3 cracked.guide::kind::definition	cracked.guide::TAOCP Vol 4A::7.1.3 Bitwise Tricks and Techniques (part 1)
MMIX: Is there an MMIX simulator?	Yes. Knuth's own MMIXware package includes an assembler and simulator, and there are browser-based ones made by others.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.3 cracked.guide::kind::definition	cracked.guide::TAOCP Vol 4A::7.1.3 Bitwise Tricks and Techniques (part 1)
SWAR (broadword computing): what is it?	SWAR, SIMD within a register, is the technique of using ordinary integer instructions on a full machine word to operate on many small packed fields at once; Knuth calls it broadword computing.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.3 cracked.guide::kind::definition	cracked.guide::TAOCP Vol 4A::7.1.3 Bitwise Tricks and Techniques (part 1)
SWAR (broadword computing): Is SWAR still useful with real SIMD instructions?	Yes. It needs no special instructions, works in any language with 64-bit integers, and the same ideas apply inside SIMD lanes.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.3 cracked.guide::kind::definition	cracked.guide::TAOCP Vol 4A::7.1.3 Bitwise Tricks and Techniques (part 1)
TAOCP §7.1.3 (part 1), a common trap: “Forgetting that Knuth's identities are stated for infinite-precision 2-adic integers.” What's the catch?	Check each one at your actual word size before trusting it.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.3 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 4A::7.1.3 Bitwise Tricks and Techniques (part 1)
TAOCP §7.1.3 (part 1): what traps should you watch for?	<ul><li>Undefined behavior in C when shifting by 64 or shifting signed negative values.</li></ul>	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.3 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 4A::7.1.3 Bitwise Tricks and Techniques (part 1)
TAOCP §7.1.3 (part 1), exercise 1 (rated 15, recommended): what is it asking?	Work out what three XOR and mask steps do. Short, and the core of the classic swap and field-merge tricks.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.3 Bitwise Tricks and Techniques (part 1)
TAOCP §7.1.3 (part 1), exercise 20 (rated 21, recommended): what is it asking?	Explain Gosper's hack for the next number with the same popcount. Lets you loop over all k-subsets of a word.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.3 Bitwise Tricks and Techniques (part 1)
TAOCP §7.1.3 (part 1), exercise 25 (rated 15, recommended): what is it asking?	The bookworm puzzle. A quick lesson in which end of a word is the start.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.3 Bitwise Tricks and Techniques (part 1)
TAOCP §7.1.3 (part 1), exercise 31 (rated 20, recommended): what is it asking?	Find the flaw in a plausible average-case argument for a bit-at-a-time loop.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.3 Bitwise Tricks and Techniques (part 1)
TAOCP §7.1.3 (part 1), exercise 39 (rated 20, recommended): what is it asking?	Remove the leftmost run of 1 bits, the mirror image of a trick from the text. Harder than the rightmost version.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.3 Bitwise Tricks and Techniques (part 1)
TAOCP §7.1.3 (part 1), exercise 44 (rated 23, recommended): what is it asking?	Compute the weighted bit sum (each bit times its position) quickly with masks.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.3 Bitwise Tricks and Techniques (part 1)
TAOCP §7.1.3 (part 1), exercise 87 (rated 20, recommended): what is it asking?	Uppercase all eight ASCII letters in a word with three bitwise operations. A real SWAR trick.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.3 Bitwise Tricks and Techniques (part 1)
TAOCP §7.1.3 (part 1), exercise 35 (rated M26, recommended): what is it asking?	Compute the non-adjacent signed-digit form of an integer with a few bitwise operations. The stretch.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.3 Bitwise Tricks and Techniques (part 1)
TAOCP §7.1.3 (part 1): how many exercises, and how are they rated?	218 exercises, rated 10 to 47.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.3 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 4A::7.1.3 Bitwise Tricks and Techniques (part 1)
TAOCP §7.1.3 (part 1): what should you be comfortable with first?	<ul><li>7.1.1 Boolean Basics</li><li>Two's complement</li></ul>	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.3 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 4A::7.1.3 Bitwise Tricks and Techniques (part 1)
TAOCP §7.1.3 (part 1): how should you work through it?	Keep a file of tricks and test every one in C with 64-bit integers. Compare with what your compiler emits for popcount and count-trailing-zeros. Vol 4 uses MMIX (Knuth's 64-bit RISC machine) instead of MIX where it shows machine code, and much of it is written in plain algorithm steps. You will want MMIX basics (from Vol 1 Fascicle 1 or the MMIX page) for 7.1.3 especially. Code the zero-byte SWAR trick (the one fast strlen uses) this week; it belongs to this half.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.3 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 4A::7.1.3 Bitwise Tricks and Techniques (part 1)
TAOCP §7.1.3 Bitwise Tricks and Techniques (part 2): what does it cover?	Part 2 covers the second 30 pages of 7.1.3 (book pages 153 to 183): broadword computing (Algorithm B, a branch-free binary logarithm) and lower bounds on what broadword chains can do, then a run of applications: reachability in digraphs with bit vectors, ternary and other encodings, data structures built on bits (sideways heaps, nearest common ancestors in constant time, navigation piles), negaFibonacci codes for the hyperbolic plane, bitmap graphics (cellular automata, thinning, connected components, filling, drawing conics), branchless computation, and MMIX's MOR and MXOR instructions for shuffles, transposes and CRCs.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.3 cracked.guide::kind::about	cracked.guide::TAOCP Vol 4A::7.1.3 Bitwise Tricks and Techniques (part 2)
TAOCP §7.1.3 (part 2): why does it matter?	Broadword (SWAR) techniques are the basis of fast string search, SIMD-style parsing and succinct data structures.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.3 cracked.guide::kind::why	cracked.guide::TAOCP Vol 4A::7.1.3 Bitwise Tricks and Techniques (part 2)
TAOCP §7.1.3 (part 2): what is Algorithm B about?	Broadword computing, a branch-free binary logarithm.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.3 cracked.guide::kind::algorithm	cracked.guide::TAOCP Vol 4A::7.1.3 Bitwise Tricks and Techniques (part 2)
TAOCP §7.1.3 (part 2), a common trap: “Reading the lower-bound results as practical advice.” What's the catch?	They show limits of a model; the applications later in the section are where the usable code is.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.3 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 4A::7.1.3 Bitwise Tricks and Techniques (part 2)
TAOCP §7.1.3 (part 2): what traps should you watch for?	<ul><li>Endianness assumptions when packing bytes into words.</li></ul>	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.3 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 4A::7.1.3 Bitwise Tricks and Techniques (part 2)
TAOCP §7.1.3 (part 2), exercise 107 (rated 22, recommended): what is it asking?	Implement the broadword binary logarithm in MMIX for 64-bit words and compare it to the simple method. Translate to C if MMIX is not set up yet.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.3 Bitwise Tricks and Techniques (part 2)
TAOCP §7.1.3 (part 2), exercise 133 (rated 20, recommended): what is it asking?	Reuse the maximal clique algorithm to list maximal independent sets and minimal vertex covers. Complements are cheap with bit vectors.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.3 Bitwise Tricks and Techniques (part 2)
TAOCP §7.1.3 (part 2), exercise 150 (rated 25, recommended): what is it asking?	Show the nearest common ancestor method also solves range minimum queries after linear preprocessing. Standard algorithms material.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.3 Bitwise Tricks and Techniques (part 2)
TAOCP §7.1.3 (part 2), exercise 185 (rated 22, recommended): what is it asking?	Simplify the conic drawing algorithm into a correct line drawer for rational endpoints.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.3 Bitwise Tricks and Techniques (part 2)
TAOCP §7.1.3 (part 2), exercise 198 (rated 21, recommended): what is it asking?	Encode and decode UTF-8 with bitwise operations. Directly useful.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.3 Bitwise Tricks and Techniques (part 2)
TAOCP §7.1.3 (part 2), exercise 199 (rated 23, recommended): what is it asking?	Reject overlong UTF-8 forms, and see why accepting them was a real security hole.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.3 Bitwise Tricks and Techniques (part 2)
TAOCP §7.1.3 (part 2), exercise 215 (rated 21, recommended): what is it asking?	Test whether a 64-bit number is a multiple of 3 in a few instructions, with no division.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.3 Bitwise Tricks and Techniques (part 2)
TAOCP §7.1.3 (part 2), exercise 132 (rated M27, recommended): what is it asking?	Analyze a bitwise algorithm for listing all maximal cliques of a graph. The stretch.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.3 Bitwise Tricks and Techniques (part 2)
TAOCP §7.1.3 (part 2): how many exercises, and how are they rated?	218 exercises, rated 10 to 47.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.3 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 4A::7.1.3 Bitwise Tricks and Techniques (part 2)
TAOCP §7.1.3 (part 2): what should you be comfortable with first?	<ul><li>7.1.3 part 1</li></ul>	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.3 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 4A::7.1.3 Bitwise Tricks and Techniques (part 2)
TAOCP §7.1.3 (part 2): how should you work through it?	Broadword computing builds on last week's tricks. Pick one or two larger applications from the section and code them in C with 64-bit integers, testing against a slow, obvious version.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.3 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 4A::7.1.3 Bitwise Tricks and Techniques (part 2)
TAOCP §7.1.4 Binary Decision Diagrams (part 1): what does it cover?	Part 1 covers the first 31 pages of 7.1.4 (book pages 202 to 233): what a BDD is and why the reduced ordered form is canonical, counting solutions (Algorithm C) and finding maximum-weight solutions (Algorithm B), generating functions and reliability polynomials from a BDD, functions with small BDDs, shared BDDs, reducing an arbitrary decision diagram (Algorithm R), and synthesis: combining BDDs breadth-first (Algorithm S) or recursively in a BDD base with a unique table and memo cache (Algorithm U), plus ternary operations, quantifiers and functional composition.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.4 cracked.guide::kind::about	cracked.guide::TAOCP Vol 4A::7.1.4 Binary Decision Diagrams (part 1)
TAOCP §7.1.4 (part 1): why does it matter?	BDDs are used in hardware verification, model checking, and configuration tools. Knuth has praised them as one of the few truly fundamental data structures to appear in recent decades.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.4 cracked.guide::kind::why	cracked.guide::TAOCP Vol 4A::7.1.4 Binary Decision Diagrams (part 1)
Binary decision diagram (BDD): what is it?	A binary decision diagram is a directed acyclic graph that represents a Boolean function; in its reduced ordered form it is canonical, so equal functions have identical diagrams.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.4 cracked.guide::kind::definition	cracked.guide::TAOCP Vol 4A::7.1.4 Binary Decision Diagrams (part 1)
Binary decision diagram (BDD): BDD or SAT solver?	A BDD describes all solutions at once and answers counting and equivalence questions; a SAT solver finds one solution or proves there is none, and scales to much bigger problems when you only need that.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.4 cracked.guide::kind::definition	cracked.guide::TAOCP Vol 4A::7.1.4 Binary Decision Diagrams (part 1)
TAOCP §7.1.4 (part 1): what is Algorithm C about?	Counting solutions.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.4 cracked.guide::kind::algorithm	cracked.guide::TAOCP Vol 4A::7.1.4 Binary Decision Diagrams (part 1)
TAOCP §7.1.4 (part 1): what is Algorithm B about?	Finding maximum-weight solutions.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.4 cracked.guide::kind::algorithm	cracked.guide::TAOCP Vol 4A::7.1.4 Binary Decision Diagrams (part 1)
TAOCP §7.1.4 (part 1): what is Algorithm R about?	Reducing an arbitrary decision diagram.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.4 cracked.guide::kind::algorithm	cracked.guide::TAOCP Vol 4A::7.1.4 Binary Decision Diagrams (part 1)
TAOCP §7.1.4 (part 1): what is Algorithm S about?	Combining BDDs breadth-first.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.4 cracked.guide::kind::algorithm	cracked.guide::TAOCP Vol 4A::7.1.4 Binary Decision Diagrams (part 1)
TAOCP §7.1.4 (part 1), a common trap: “Forgetting to memoize synthesis, which turns a fast operation into an exponential one.” What's the catch?	Synthesis is in this half of the section, not the next.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.4 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 4A::7.1.4 Binary Decision Diagrams (part 1)
TAOCP §7.1.4 (part 1): what traps should you watch for?	<ul><li>Forgetting the unique table, which is what makes nodes shared and the BDD canonical.</li></ul>	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.4 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 4A::7.1.4 Binary Decision Diagrams (part 1)
TAOCP §7.1.4 (part 1), exercise 1 (rated 20, recommended): what is it asking?	Draw the BDDs for all 16 functions of two variables. Do it before writing any code.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.4 Binary Decision Diagrams (part 1)
TAOCP §7.1.4 (part 1), exercise 10 (rated 21, recommended): what is it asking?	Test two BDDs for equality. Easy once you see why canonical form matters.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.4 Binary Decision Diagrams (part 1)
TAOCP §7.1.4 (part 1), exercise 16 (rated 22, recommended): what is it asking?	Generate all solutions of a function from its BDD. The first useful thing your BDD package should do.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.4 Binary Decision Diagrams (part 1)
TAOCP §7.1.4 (part 1), exercise 23 (rated M20, recommended): what is it asking?	Explain why every path to true in a particular BDD has the same number of solid arcs.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.4 Binary Decision Diagrams (part 1)
TAOCP §7.1.4 (part 1), exercise 53 (rated 23, recommended): what is it asking?	Trace the reduction algorithm on a small diagram by hand.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.4 Binary Decision Diagrams (part 1)
TAOCP §7.1.4 (part 1), exercise 78 (rated 25, recommended): what is it asking?	Use BDDs to count graphs on 12 labeled vertices by maximum degree. A real counting job no brute force could do.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.4 Binary Decision Diagrams (part 1)
TAOCP §7.1.4 (part 1), exercise 81 (rated 20, recommended): what is it asking?	Adapt the recursive AND synthesis to XOR in a BDD base. Small change, good test of understanding.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.4 Binary Decision Diagrams (part 1)
TAOCP §7.1.4 (part 1), exercise 44 (rated M32, recommended): what is it asking?	Find the largest possible BDD for a symmetric function. The stretch.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.4 Binary Decision Diagrams (part 1)
TAOCP §7.1.4 (part 1): how many exercises, and how are they rated?	267 exercises, rated 05 to M47.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.4 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 4A::7.1.4 Binary Decision Diagrams (part 1)
TAOCP §7.1.4 (part 1): what should you be comfortable with first?	<ul><li>7.1.1 Boolean Basics</li><li>2.3 Trees</li></ul>	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.4 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 4A::7.1.4 Binary Decision Diagrams (part 1)
TAOCP §7.1.4 Binary Decision Diagrams (part 2): what does it cover?	Part 2 covers the rest of 7.1.4 (book pages 233 to 258): most functions have large BDDs, why variable ordering can change sizes exponentially, finding a good order, local swaps and dynamic reordering by sifting (Algorithm J), read-once functions, the bad news for multiplication, and zero-suppressed BDDs (ZDDs) with their family algebra, used for exact cover, tilings, word lists, paths in graphs and prime implicants. It ends with a short history and a caveat about when BDDs are the wrong tool.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.4 cracked.guide::kind::about	cracked.guide::TAOCP Vol 4A::7.1.4 Binary Decision Diagrams (part 2)
TAOCP §7.1.4 (part 2): why does it matter?	Variable ordering can make a BDD tiny or exponential, a great lesson in representation choice. ZDDs are excellent for combinatorial families and come back in Vol 4B.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.4 cracked.guide::kind::why	cracked.guide::TAOCP Vol 4A::7.1.4 Binary Decision Diagrams (part 2)
ZDD (zero-suppressed decision diagram): what is it?	A ZDD is a variant of the binary decision diagram, introduced by Shin-ichi Minato, that represents families of sets compactly by removing nodes whose HI branch leads to 0.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.4 cracked.guide::kind::definition	cracked.guide::TAOCP Vol 4A::7.1.4 Binary Decision Diagrams (part 2)
ZDD (zero-suppressed decision diagram): When should I use a ZDD instead of a BDD?	When the objects are sets with few members out of many possible elements. For general Boolean functions, a BDD is usually the better fit.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.4 cracked.guide::kind::definition	cracked.guide::TAOCP Vol 4A::7.1.4 Binary Decision Diagrams (part 2)
TAOCP §7.1.4 (part 2): what is Algorithm J about?	Local swaps and dynamic reordering by sifting.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.4 cracked.guide::kind::algorithm	cracked.guide::TAOCP Vol 4A::7.1.4 Binary Decision Diagrams (part 2)
TAOCP §7.1.4 (part 2), a common trap: “Assuming a good variable order is easy to find.” What's the catch?	Finding the best order is expensive in general; heuristics like sifting are what you use in practice.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.4 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 4A::7.1.4 Binary Decision Diagrams (part 2)
TAOCP §7.1.4 (part 2), a common trap: “Mixing up BDD and ZDD reduction rules.” What's the catch?	ZDDs remove nodes whose HI branch goes to false, not nodes with equal branches.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.4 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 4A::7.1.4 Binary Decision Diagrams (part 2)
TAOCP §7.1.4 (part 2), exercise 147 (rated 27, recommended): what is it asking?	Work out the details of swapping two adjacent variables in place. The building block of every dynamic reordering heuristic.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.4 Binary Decision Diagrams (part 2)
TAOCP §7.1.4 (part 2), exercise 187 (rated 20, recommended): what is it asking?	Draw the ZDDs for all 16 functions of two variables and compare with your BDDs.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.4 Binary Decision Diagrams (part 2)
TAOCP §7.1.4 (part 2), exercise 198 (rated 23, recommended): what is it asking?	Write AND for ZDDs. Shows exactly where the different reduction rule changes the algorithm.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.4 Binary Decision Diagrams (part 2)
TAOCP §7.1.4 (part 2), exercise 208 (rated 16, recommended): what is it asking?	Count solutions from a ZDD by modifying the BDD counting algorithm.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.4 Binary Decision Diagrams (part 2)
TAOCP §7.1.4 (part 2), exercise 212 (rated 25, recommended): what is it asking?	Build a ZDD for an exact cover problem. Connects to the dancing links material in Vol 4B.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.4 Binary Decision Diagrams (part 2)
TAOCP §7.1.4 (part 2), exercise 225 (rated 30, recommended): what is it asking?	Build a ZDD of all simple paths between two vertices. This is the idea behind the Simpath algorithm used to count paths on grids.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.4 Binary Decision Diagrams (part 2)
TAOCP §7.1.4 (part 2), exercise 265 (rated 21, recommended): what is it asking?	Find the m-th smallest solution from a BDD. Ranking and unranking, which 7.2.1 uses throughout.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.4 Binary Decision Diagrams (part 2)
TAOCP §7.1.4 (part 2), exercise 164 (rated M27, recommended): what is it asking?	Find the largest BDD a read-once function can have. The stretch.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.1.4 Binary Decision Diagrams (part 2)
TAOCP §7.1.4 (part 2): how many exercises, and how are they rated?	267 exercises, rated 05 to M47.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.4 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 4A::7.1.4 Binary Decision Diagrams (part 2)
TAOCP §7.1.4 (part 2): what should you be comfortable with first?	<ul><li>7.1.4 part 1</li></ul>	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.4 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 4A::7.1.4 Binary Decision Diagrams (part 2)
TAOCP §7.1.4 (part 2): how should you work through it?	Add AND/OR synthesis with a memo cache to your BDD. Try two variable orders on the same function and watch the size change.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.1.4 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 4A::7.1.4 Binary Decision Diagrams (part 2)
TAOCP §7.2.1.1 Generating All n-Tuples: what does it cover?	Generating all n-tuples: mixed-radix counting (Algorithm M), the binary Gray code and its many properties (including Walsh functions and the Chinese ring puzzle), loopless generation, other Gray codes (balanced, monotonic, mixed radix), a worked example of fast search over five-letter words, and de Bruijn cycles with algorithms that build them, including prime strings and Algorithm F.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.1 cracked.guide::kind::about	cracked.guide::TAOCP Vol 4A::7.2.1.1 Generating All n-Tuples
TAOCP §7.2.1.1: why does it matter?	Gray codes are used in rotary encoders and error minimization; exhaustive generation is a basic tool for testing. Loopless generation teaches tight algorithm design.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.1 cracked.guide::kind::why	cracked.guide::TAOCP Vol 4A::7.2.1.1 Generating All n-Tuples
Gray code: what is it?	A Gray code is an ordering of all n-bit binary strings in which each string differs from the next in exactly one bit.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.1 cracked.guide::kind::definition	cracked.guide::TAOCP Vol 4A::7.2.1.1 Generating All n-Tuples
Gray code: Who is it named after?	Frank Gray of Bell Labs, who patented its use in 1953, though the reflected code was known earlier (it solves the Chinese ring puzzle).	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.1 cracked.guide::kind::definition	cracked.guide::TAOCP Vol 4A::7.2.1.1 Generating All n-Tuples
Gray code: How do I convert Gray code back to binary?	XOR the code with all its right shifts: b = g ^ (g &gt;&gt; 1) ^ (g &gt;&gt; 2) ^ ..., which takes log n steps with doubling shifts.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.1 cracked.guide::kind::definition	cracked.guide::TAOCP Vol 4A::7.2.1.1 Generating All n-Tuples
TAOCP §7.2.1.1: what is Algorithm M about?	Mixed-radix counting.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.1 cracked.guide::kind::algorithm	cracked.guide::TAOCP Vol 4A::7.2.1.1 Generating All n-Tuples
TAOCP §7.2.1.1, exercise 3 (rated M20, recommended): what is it asking?	Count how often the inner step of mixed-radix counting runs. The amortized-constant argument you will reuse all chapter.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.1 Generating All n-Tuples
TAOCP §7.2.1.1, exercise 4 (rated 18, recommended): what is it asking?	Rewrite mixed-radix counting to count down. Easy, and useful on real machines.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.1 Generating All n-Tuples
TAOCP §7.2.1.1, exercise 5 (rated 20, recommended): what is it asking?	Put an FFT's bit-reversed output back in order efficiently.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.1 Generating All n-Tuples
TAOCP §7.2.1.1, exercise 12 (rated 25, recommended): what is it asking?	Generate the compositions of n through the bit strings that encode them.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.1 Generating All n-Tuples
TAOCP §7.2.1.1, exercise 40 (rated 21, recommended): what is it asking?	Check whether a variant of the text's five-letter word search still gives correct answers.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.1 Generating All n-Tuples
TAOCP §7.2.1.1, exercise 58 (rated 21, recommended): what is it asking?	Build an (n+1)-bit Gray cycle from an n-bit one by editing its delta sequence.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.1 Generating All n-Tuples
TAOCP §7.2.1.1, exercise 88 (rated 25, recommended): what is it asking?	Predict what happens if you restart a Gray-code algorithm after it ends.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.1 Generating All n-Tuples
TAOCP §7.2.1.1, exercise 93 (rated M28, recommended): what is it asking?	Prove a de Bruijn cycle construction is correct. The stretch.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.1 Generating All n-Tuples
TAOCP §7.2.1.1: how many exercises, and how are they rated?	112 exercises, rated 10 to HM48.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.1 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 4A::7.2.1.1 Generating All n-Tuples
TAOCP §7.2.1.1: what should you be comfortable with first?	<ul><li>4.1 Positional Number Systems</li><li>7.1.3 Bitwise tricks</li></ul>	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.1 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 4A::7.2.1.1 Generating All n-Tuples
TAOCP §7.2.1.1: how should you work through it?	Implement binary counting, reflected Gray code (n XOR n&gt;&gt;1), and a de Bruijn sequence generator. Verify properties by brute force.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.1 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 4A::7.2.1.1 Generating All n-Tuples
TAOCP §7.2.1.2 Generating All Permutations: what does it cover?	Generating all permutations: lexicographic order (Algorithm L, which also handles multisets), plain changes by adjacent swaps (Algorithm P), Heap's method and other single-swap schemes, Sims tables for permutation groups, alphametics as a search application, generating with early cutoffs (Algorithm X), topological sorts, and timing comparisons of the methods in MMIX.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.2 cracked.guide::kind::about	cracked.guide::TAOCP Vol 4A::7.2.1.2 Generating All Permutations
TAOCP §7.2.1.2: why does it matter?	next_permutation is a standard library function and a classic interview question. Choosing the right generator matters when you brute force.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.2 cracked.guide::kind::why	cracked.guide::TAOCP Vol 4A::7.2.1.2 Generating All Permutations
TAOCP §7.2.1.2: what is Algorithm L about?	Lexicographic order, which also handles multisets.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.2 cracked.guide::kind::algorithm	cracked.guide::TAOCP Vol 4A::7.2.1.2 Generating All Permutations
TAOCP §7.2.1.2: what is Algorithm P about?	Plain changes by adjacent swaps.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.2 cracked.guide::kind::algorithm	cracked.guide::TAOCP Vol 4A::7.2.1.2 Generating All Permutations
TAOCP §7.2.1.2: what is Algorithm X about?	Generating with early cutoffs.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.2 cracked.guide::kind::algorithm	cracked.guide::TAOCP Vol 4A::7.2.1.2 Generating All Permutations
TAOCP §7.2.1.2: what traps should you watch for?	<ul><li>Lexicographic generation with duplicates: handle multisets correctly.</li></ul>	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.2 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 4A::7.2.1.2 Generating All Permutations
TAOCP §7.2.1.2, exercise 1 (rated 20, recommended): what is it asking?	Speed up lexicographic next-permutation for the common case. The kind of tuning that matters in real loops.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.2 Generating All Permutations
TAOCP §7.2.1.2, exercise 3 (rated M21, recommended): what is it asking?	Compute the rank of a permutation in lexicographic order.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.2 Generating All Permutations
TAOCP §7.2.1.2, exercise 12 (rated M23, recommended): what is it asking?	Find the millionth permutation of ten digits under three different algorithms, using mixed-radix arithmetic.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.2 Generating All Permutations
TAOCP §7.2.1.2, exercise 17 (rated 20, recommended): what is it asking?	Keep the inverse permutation updated while running plain changes.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.2 Generating All Permutations
TAOCP §7.2.1.2, exercise 49 (rated 28, recommended): what is it asking?	Rework the alphametic solver to choose digits in a smarter order. Search ordering in practice.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.2 Generating All Permutations
TAOCP §7.2.1.2, exercise 85 (rated 25, recommended): what is it asking?	Rank and unrank permutations in linear time. Standard trick for indexing permutations in tables.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.2 Generating All Permutations
TAOCP §7.2.1.2, exercise 107 (rated 30, recommended): what is it asking?	Topswops, Conway's card game. Explore it with code.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.2 Generating All Permutations
TAOCP §7.2.1.2, exercise 41 (rated M33, recommended): what is it asking?	Generate all r-variations with one swap per step by generalizing Heap's method. The stretch.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.2 Generating All Permutations
TAOCP §7.2.1.2: how many exercises, and how are they rated?	113 exercises, rated M15 to 48.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.2 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 4A::7.2.1.2 Generating All Permutations
TAOCP §7.2.1.2: what should you be comfortable with first?	<ul><li>7.2.1.1 Generating All n-Tuples</li><li>1.3.3 Permutations</li></ul>	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.2 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 4A::7.2.1.2 Generating All Permutations
TAOCP §7.2.1.2: how should you work through it?	Implement lexicographic next-permutation, plain changes, and Heap's method. Count swaps per permutation and benchmark. Look up change ringing; it is permutation generation with church bells, and plain changes are exactly what this section covers.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.2 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 4A::7.2.1.2 Generating All Permutations
TAOCP §7.2.1.3 Generating All Combinations: what does it cover?	Generating all combinations: lexicographic order (Algorithms L and T), the binomial tree, revolving-door Gray codes, combinations with repetition and compositions, Chase's sequence and other near-perfect orders, a general genlex framework, combinations of a multiset, and the Kruskal-Katona theory of shadows, which says how small the shadow of a family of k-sets can be.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.3 cracked.guide::kind::about	cracked.guide::TAOCP Vol 4A::7.2.1.3 Generating All Combinations
TAOCP §7.2.1.3: why does it matter?	Subset enumeration is everywhere in brute-force search and testing. Gray-code orderings let you update a running computation in O(1) per step.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.3 cracked.guide::kind::why	cracked.guide::TAOCP Vol 4A::7.2.1.3 Generating All Combinations
TAOCP §7.2.1.3: what are Algorithms L and T about?	Lexicographic order.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.3 cracked.guide::kind::algorithm	cracked.guide::TAOCP Vol 4A::7.2.1.3 Generating All Combinations
TAOCP §7.2.1.3, fill in the blank:<br>Gray-code orderings let you update a running computation in <span class="cg-blank">&nbsp;</span> per step.	Gray-code orderings let you update a running computation in <b>O(1)</b> per step.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.3 cracked.guide::kind::complexity	cracked.guide::TAOCP Vol 4A::7.2.1.3 Generating All Combinations
TAOCP §7.2.1.3, exercise 5 (rated 20, recommended): what is it asking?	Generate integer solutions to chains of inequalities by mapping them to combinations.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.3 Generating All Combinations
TAOCP §7.2.1.3, exercise 10 (rated 21, recommended): what is it asking?	List all World Series outcomes and index them neatly. Combinations in disguise.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.3 Generating All Combinations
TAOCP §7.2.1.3, exercise 18 (rated 20, recommended): what is it asking?	See which binary tree the binomial tree becomes under child-sibling links.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.3 Generating All Combinations
TAOCP §7.2.1.3, exercise 27 (rated 25, recommended): what is it asking?	Generate all subsets of size at most t with Gray-code-like moves.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.3 Generating All Combinations
TAOCP §7.2.1.3, exercise 57 (rated 22, recommended): what is it asking?	Can a pianist play every chord in an octave moving one finger at a time? A revolving-door question.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.3 Generating All Combinations
TAOCP §7.2.1.3, exercise 69 (rated M22, recommended): what is it asking?	Find the smallest family of k-sets whose shadow is smaller than the family. Gets you into Kruskal-Katona.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.3 Generating All Combinations
TAOCP §7.2.1.3, exercise 110 (rated 26, recommended): what is it asking?	Score all cribbage hands by generating combinations. A real enumeration job.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.3 Generating All Combinations
TAOCP §7.2.1.3, exercise 111 (rated M26, recommended): what is it asking?	Prove the Erdős-Ko-Rado bound using shadows. The stretch.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.3 Generating All Combinations
TAOCP §7.2.1.3: how many exercises, and how are they rated?	111 exercises, rated M01 to M49.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.3 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 4A::7.2.1.3 Generating All Combinations
TAOCP §7.2.1.3: what should you be comfortable with first?	<ul><li>7.2.1.2 Generating All Permutations</li></ul>	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.3 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 4A::7.2.1.3 Generating All Combinations
TAOCP §7.2.1.3: how should you work through it?	Implement lexicographic combinations and a revolving-door order. Use the revolving door to maintain a running sum of selected elements cheaply.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.3 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 4A::7.2.1.3 Generating All Combinations
TAOCP §7.2.1.4 Generating All Partitions: what does it cover?	Generating all partitions of an integer: reverse lexicographic order (Algorithm P), partitions into a fixed number of parts (Algorithm H), Ferrers diagrams and conjugates, generating functions and Euler's pentagonal number theorem, the asymptotic size of p(n), Gray codes for partitions, and Twelvefold Way style counting.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.4 cracked.guide::kind::about	cracked.guide::TAOCP Vol 4A::7.2.1.4 Generating All Partitions
TAOCP §7.2.1.4: why does it matter?	Integer partitions appear in dynamic programming problems (coin change), and the generating function theory is a great application of 1.2.9.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.4 cracked.guide::kind::why	cracked.guide::TAOCP Vol 4A::7.2.1.4 Generating All Partitions
TAOCP §7.2.1.4: what is Algorithm P about?	Reverse lexicographic order.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.4 cracked.guide::kind::algorithm	cracked.guide::TAOCP Vol 4A::7.2.1.4 Generating All Partitions
TAOCP §7.2.1.4: what is Algorithm H about?	Partitions into a fixed number of parts.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.4 cracked.guide::kind::algorithm	cracked.guide::TAOCP Vol 4A::7.2.1.4 Generating All Partitions
TAOCP §7.2.1.4, exercise 1 (rated M21, recommended): what is it asking?	Fill in the Twelvefold Way: counts for every kind of placement of balls in urns. Worth making into a reference card.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.4 Generating All Partitions
TAOCP §7.2.1.4, exercise 2 (rated 20, recommended): what is it asking?	Change one step of Algorithm H to get partitions into at most m parts.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.4 Generating All Partitions
TAOCP §7.2.1.4, exercise 5 (rated 23, recommended): what is it asking?	Generate partitions in part-count form efficiently.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.4 Generating All Partitions
TAOCP §7.2.1.4, exercise 12 (rated M21, recommended): what is it asking?	Prove Euler's theorem that distinct-part and odd-part partitions are equinumerous with generating functions.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.4 Generating All Partitions
TAOCP §7.2.1.4, exercise 20 (rated M21, recommended): what is it asking?	Estimate the cost of tabulating p(n) with Euler's recurrence.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.4 Generating All Partitions
TAOCP §7.2.1.4, exercise 47 (rated HM22, recommended): what is it asking?	Prove a simple random partition generator is uniform.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.4 Generating All Partitions
TAOCP §7.2.1.4, exercise 52 (rated M21, recommended): what is it asking?	Find the millionth partition of 64 generated by Algorithm P.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.4 Generating All Partitions
TAOCP §7.2.1.4, exercise 54 (rated M30, recommended): what is it asking?	Study the majorization (dominance) order on partitions. The stretch.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.4 Generating All Partitions
TAOCP §7.2.1.4: how many exercises, and how are they rated?	73 exercises, rated 15 to 47.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.4 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 4A::7.2.1.4 Generating All Partitions
TAOCP §7.2.1.4: what should you be comfortable with first?	<ul><li>7.2.1.3 Generating All Combinations</li><li>1.2.9 Generating Functions</li></ul>	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.4 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 4A::7.2.1.4 Generating All Partitions
TAOCP §7.2.1.4: how should you work through it?	Implement partition generation in reverse lexicographic order. Compute partition counts with a DP and check against the generator.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.4 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 4A::7.2.1.4 Generating All Partitions
TAOCP §7.2.1.5 Generating All Set Partitions: what does it cover?	Generating all partitions of a set: restricted growth strings and Algorithm H, Gray codes for set partitions, Bell numbers and Peirce's triangle, the asymptotics of Bell numbers, Stirling numbers of the second kind, and partitions of a multiset (Algorithm M), with applications to rhyme schemes and alphametics.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.5 cracked.guide::kind::about	cracked.guide::TAOCP Vol 4A::7.2.1.5 Generating All Set Partitions
TAOCP §7.2.1.5: why does it matter?	Set partitions show up in clustering, test case generation and some scheduling problems.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.5 cracked.guide::kind::why	cracked.guide::TAOCP Vol 4A::7.2.1.5 Generating All Set Partitions
TAOCP §7.2.1.5: what is Algorithm M about?	Partitions of a multiset.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.5 cracked.guide::kind::algorithm	cracked.guide::TAOCP Vol 4A::7.2.1.5 Generating All Set Partitions
TAOCP §7.2.1.5, exercise 2 (rated 22, recommended): what is it asking?	Keep linked lists of each block up to date as Algorithm H runs.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.5 Generating All Set Partitions
TAOCP §7.2.1.5, exercise 4 (rated 21, recommended): what is it asking?	Classify the SGB five-letter words by their letter-repetition pattern. Restricted growth strings in practice.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.5 Generating All Set Partitions
TAOCP §7.2.1.5, exercise 6 (rated 25, recommended): what is it asking?	Generate set partitions with given numbers of blocks of each size.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.5 Generating All Set Partitions
TAOCP §7.2.1.5, exercise 11 (rated 28, recommended): what is it asking?	Count how many set partitions of the digit positions in SEND+MORE=MONEY give pure alphametics.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.5 Generating All Set Partitions
TAOCP §7.2.1.5, exercise 26 (rated M22, recommended): what is it asking?	Interpret Peirce's triangle as counting paths.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.5 Generating All Set Partitions
TAOCP §7.2.1.5, exercise 65 (rated HM22, recommended): what is it asking?	Find the variance of the number of blocks of size k in a random set partition.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.5 Generating All Set Partitions
TAOCP §7.2.1.5, exercise 69 (rated 22, recommended): what is it asking?	Restrict the multiset partition generator to at most r parts.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.5 Generating All Set Partitions
TAOCP §7.2.1.5, exercise 38 (rated M30, recommended): what is it asking?	Study sequences of cyclic shifts whose product is the identity. The stretch.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.5 Generating All Set Partitions
TAOCP §7.2.1.5: how many exercises, and how are they rated?	82 exercises, rated 14 to HM46.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.5 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 4A::7.2.1.5 Generating All Set Partitions
TAOCP §7.2.1.5: what should you be comfortable with first?	<ul><li>7.2.1.4 Generating All Partitions</li></ul>	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.5 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 4A::7.2.1.5 Generating All Set Partitions
TAOCP §7.2.1.5: how should you work through it?	Implement generation via restricted growth strings and verify counts match Bell numbers.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.5 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 4A::7.2.1.5 Generating All Set Partitions
TAOCP §7.2.1.6 Generating All Trees: what does it cover?	Generating all trees: nested parentheses (Algorithm P), binary trees in linked form (Algorithm B), forests and their encodings, the Christmas tree pattern for subsets, oriented trees by parent pointers, and spanning trees of a graph (Algorithm S), including series-parallel graphs and a count of spanning trees via a determinant.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.6 cracked.guide::kind::about	cracked.guide::TAOCP Vol 4A::7.2.1.6 Generating All Trees
TAOCP §7.2.1.6: why does it matter?	Generating all trees is useful for testing tree code exhaustively (a great way to find bugs in an AVL or parser). The Catalan connections tie back to 2.3.4.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.6 cracked.guide::kind::why	cracked.guide::TAOCP Vol 4A::7.2.1.6 Generating All Trees
TAOCP §7.2.1.6: what is Algorithm P about?	Nested parentheses.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.6 cracked.guide::kind::algorithm	cracked.guide::TAOCP Vol 4A::7.2.1.6 Generating All Trees
TAOCP §7.2.1.6: what is Algorithm B about?	Binary trees in linked form.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.6 cracked.guide::kind::algorithm	cracked.guide::TAOCP Vol 4A::7.2.1.6 Generating All Trees
TAOCP §7.2.1.6: what is Algorithm S about?	Spanning trees of a graph.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.6 cracked.guide::kind::algorithm	cracked.guide::TAOCP Vol 4A::7.2.1.6 Generating All Trees
TAOCP §7.2.1.6, exercise 3 (rated 23, recommended): what is it asking?	Prove a short conversion from a tree encoding to its inversion table.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.6 Generating All Trees
TAOCP §7.2.1.6, exercise 6 (rated 20, recommended): what is it asking?	Find which perfect matching corresponds to a given parenthesis string.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.6 Generating All Trees
TAOCP §7.2.1.6, exercise 23 (rated 25, recommended): what is it asking?	Work out the last tree visited by two of the generators.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.6 Generating All Trees
TAOCP §7.2.1.6, exercise 31 (rated M28, recommended): what is it asking?	Count degenerate binary trees and see how the encodings treat them.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.6 Generating All Trees
TAOCP §7.2.1.6, exercise 61 (rated M26, recommended): what is it asking?	Prove Raney's cycle lemma, the cleanest route to Catalan-style counts.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.6 Generating All Trees
TAOCP §7.2.1.6, exercise 70 (rated 20, recommended): what is it asking?	Find a simple mate rule for bit strings that underlies the Christmas tree pattern.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.6 Generating All Trees
TAOCP §7.2.1.6, exercise 96 (rated 28, recommended): what is it asking?	Estimate how fast the spanning tree generator runs on paths and cycles.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.6 Generating All Trees
TAOCP §7.2.1.6, exercise 27 (rated M33, recommended): what is it asking?	Study the Tamari lattice of binary trees. The stretch.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.6 Generating All Trees
TAOCP §7.2.1.6: how many exercises, and how are they rated?	124 exercises, rated 05 to HM46.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.6 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 4A::7.2.1.6 Generating All Trees
TAOCP §7.2.1.6: what should you be comfortable with first?	<ul><li>2.3.4 Mathematical properties of trees</li><li>7.2.1.5</li></ul>	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.6 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 4A::7.2.1.6 Generating All Trees
TAOCP §7.2.1.6: how should you work through it?	Implement nested parentheses generation and convert each string to a binary tree. Use it to exhaustively test one of your tree implementations from Vol 3.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.6 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 4A::7.2.1.6 Generating All Trees
TAOCP §7.2.1.7 History and Further References: what does it cover?	About 25 pages of history of combinatorial generation: the I Ching, early Indian work on poetic meters, Arabic and medieval European lists of permutations and combinations, Ramon Llull, Japanese work including Seki and the genji-ko diagrams for set partitions, and the 17th and 18th century authors (Wallis, de Moivre and others) who first wrote down systematic orders. Many of the exercises ask you to find errors in the old lists.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.7 cracked.guide::kind::about	cracked.guide::TAOCP Vol 4A::7.2.1.7 History and Further References
TAOCP §7.2.1.7: why does it matter?	A genuinely fun read that shows these ideas are old and human.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.7 cracked.guide::kind::why	cracked.guide::TAOCP Vol 4A::7.2.1.7 History and Further References
TAOCP §7.2.1.7, exercise 14 (rated 20, recommended): what is it asking?	Continue a 16th century list of three-letter combinations and spot its order.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.7 History and Further References
TAOCP §7.2.1.7, exercise 16 (rated 20): what is it asking?	Generate compositions with bounded parts, as Narayana did in 1356.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.7 History and Further References
TAOCP §7.2.1.7, exercise 18 (rated 10): what is it asking?	A trick question about the year 1666.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.7 History and Further References
TAOCP §7.2.1.7, exercise 24 (rated 23, recommended): what is it asking?	Figure out Honda's recursive rule for set partitions from its output.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.7 History and Further References
TAOCP §7.2.1.7, exercise 28 (rated 25, recommended): what is it asking?	Find Wallis's ordering of factorizations and judge it.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.7 History and Further References
TAOCP §7.2.1.7, exercise 29 (rated 24, recommended): what is it asking?	Apply Wallis's method to a product of five primes.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.7 History and Further References
TAOCP §7.2.1.7, exercise 8 (rated M27, recommended): what is it asking?	Patch Seki's 17th century permutation procedure so it is correct. The stretch.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::7.2.1.7 History and Further References
TAOCP §7.2.1.7: how many exercises, and how are they rated?	32 exercises, rated 10 to M40.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.7 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 4A::7.2.1.7 History and Further References
TAOCP §7.2.1.7: what should you be comfortable with first?	<ul><li>7.2.1.1 to 7.2.1.6</li></ul>	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.7 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 4A::7.2.1.7 History and Further References
TAOCP §7.2.1.7: how should you work through it?	Read for enjoyment: it is the story of how people generated combinatorial patterns long before computers. Work the exercises the advice points to.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.7 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 4A::7.2.1.7 History and Further References
TAOCP Vol 4A review: what does it cover?	A review week for Volume 4A: Boolean functions, bitwise tricks, BDDs and generating combinatorial objects.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::vol_4a_review cracked.guide::kind::about	cracked.guide::TAOCP Vol 4A::Vol 4A review
TAOCP: Vol 4A review: why does it matter?	Vol 4B builds directly on backtracking over these objects, and bit tricks and BDD ideas return in dancing links and SAT.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::vol_4a_review cracked.guide::kind::why	cracked.guide::TAOCP Vol 4A::Vol 4A review
TAOCP: Vol 4A review, exercise 111 of §7 (rated 25, recommended): what is it asking?	Embed any graph in a regular graph of the same maximum degree with few extra vertices.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::vol_4a_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::Vol 4A review
TAOCP: Vol 4A review, exercise 55 of §7.1.1 (rated 30, recommended): what is it asking?	Recognize Horn functions in disguise by reducing the question to 2SAT.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::vol_4a_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::Vol 4A review
TAOCP: Vol 4A review, exercise 17 of §7.1.2 (rated 25, recommended): what is it asking?	Show any Boolean function can be computed with n+1 one-bit registers.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::vol_4a_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::Vol 4A review
TAOCP: Vol 4A review, exercise 23 of §7.1.3 (rated 27, recommended): what is it asking?	Represent nested parentheses as bit strings and step to the next one with bit tricks. Joins 7.1.3 with 7.2.1.6.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::vol_4a_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::Vol 4A review
TAOCP: Vol 4A review, exercise 218 of §7.1.4 (rated 24, recommended): what is it asking?	Apply BDDs and ZDDs to Langford pairs from the start of the chapter. Brings the volume full circle.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::vol_4a_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::Vol 4A review
TAOCP: Vol 4A review, exercise 111 of §7.2.1.2 (rated M25, recommended): what is it asking?	Study universal cycles of permutations, the permutation analog of de Bruijn cycles.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::vol_4a_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::Vol 4A review
TAOCP: Vol 4A review, exercise 64 of §7.2.1.4 (rated 32, recommended): what is it asking?	Generate partitions into powers of 2 looplessly.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::vol_4a_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::Vol 4A review
TAOCP: Vol 4A review, exercise 25 of §7.2.1.6 (rated 30, recommended): what is it asking?	Generate binary trees so that each step prunes one subtree and grafts it elsewhere.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::vol_4a_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4A::Vol 4A review
TAOCP: Vol 4A review: how many exercises, and how are they rated?	1498 exercises, rated M00 to 50.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::vol_4a_review cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 4A::Vol 4A review
TAOCP: Vol 4A review: what should you be comfortable with first?	<ul><li>All of Vol 4A</li></ul>	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::vol_4a_review cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 4A::Vol 4A review
TAOCP: Vol 4A review: how should you work through it?	Collect your generators and bit-trick tests into one library. Write a short summary of when to use BDDs.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::vol_4a_review cracked.guide::kind::approach	cracked.guide::TAOCP Vol 4A::Vol 4A review
TAOCP Vol 4B: Combinatorial Algorithms, Part 2: what is the phase about?	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.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::kind::about	cracked.guide::TAOCP Vol 4B::About this phase
TAOCP Vol 4B: what should you be able to do by the end?	<ul><li>Write fast backtracking searches and estimate their running time before you run them.</li><li>Implement dancing links and use exact cover to model real puzzles and scheduling problems.</li><li>Encode problems as SAT and understand how modern CDCL solvers work.</li></ul>	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::kind::outcomes	cracked.guide::TAOCP Vol 4B::About this phase
TAOCP Vol 4B: what do you need before you start?	<ul><li>Vol 4A, especially 7.1.1 and 7.2.1.</li><li>Probability basics (the volume opens with a week reviewing them).</li></ul>	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::kind::need	cracked.guide::TAOCP Vol 4B::About this phase
TAOCP Vol 4B: how do you get the book?	Vol 4B (2022) is about $64 new from InformIT; used copies are not much cheaper yet. The paperback Fascicles 5 and 6 cover earlier drafts of the same material. Borrow before you buy: many public and university libraries give you free access to O'Reilly Learning, which carries TAOCP; Libby/OverDrive and interlibrary loan (search WorldCat) work too. Older used editions are fine for Vols 1 to 3; section numbers barely changed. If you buy the eBook, get the PDF from InformIT. Knuth himself warns that the Kindle and ePUB versions mangle the math.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::kind::book	cracked.guide::TAOCP Vol 4B::About this phase
TAOCP Vol 4B: tips for getting through it?	<ul><li>Watch a couple of Knuth's annual Christmas lectures on dancing links; they are free on YouTube.</li><li>Install a real SAT solver early and play with encodings.</li></ul>	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::kind::tips	cracked.guide::TAOCP Vol 4B::About this phase
TAOCP Mathematical Preliminaries Redux: what does it cover?	An unnumbered probability tutorial that opens the volume (cited as MPR). It reviews probability spaces, k-wise independence and conditional probability, then makes conditional expectation E(X|Y) precise as a random variable. Next come inequalities: Markov, Chebyshev, Jensen, the first and second moment principles, Ross's conditional expectation inequality and the FKG inequality. Then martingales (Pólya's urn, optional stopping, Kolmogorov's maximal inequality, the Hoeffding-Azuma tail bound), Doob martingales and the method of bounded differences, applied to a hashing example. It ends with 'almost sure' versus 'quite sure' (superpolynomially unlikely to fail) statements.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::mathematical_preliminaries_redux cracked.guide::kind::about	cracked.guide::TAOCP Vol 4B::Mathematical Preliminaries Redux
TAOCP: Mathematical Preliminaries Redux: why does it matter?	Tail bounds are how you reason about randomized algorithms, load balancing and hashing guarantees. This is advanced but very useful math.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::mathematical_preliminaries_redux cracked.guide::kind::why	cracked.guide::TAOCP Vol 4B::Mathematical Preliminaries Redux
TAOCP: Mathematical Preliminaries Redux, a common trap: “Reading E(X|Y) as a number.” What's the catch?	In MPR it is a random variable, a function of Y; that is what makes E X = E(E(X|Y)) work.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::mathematical_preliminaries_redux cracked.guide::kind::trap	cracked.guide::TAOCP Vol 4B::Mathematical Preliminaries Redux
TAOCP: Mathematical Preliminaries Redux, a common trap: “Treating pairwise independence as full independence.” What's the catch?	Exercise 6 builds a counterexample.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::mathematical_preliminaries_redux cracked.guide::kind::trap	cracked.guide::TAOCP Vol 4B::Mathematical Preliminaries Redux
TAOCP: Mathematical Preliminaries Redux: what traps should you watch for?	<ul><li>Applying an inequality whose conditions (independence, bounded differences) do not hold.</li></ul>	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::mathematical_preliminaries_redux cracked.guide::kind::traps	cracked.guide::TAOCP Vol 4B::Mathematical Preliminaries Redux
TAOCP: Mathematical Preliminaries Redux, exercise 13 (rated 15): what is it asking?	Decide whether 'B makes A likelier, and C makes B likelier' means C makes A likelier. It doesn't always, and that surprises people.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::mathematical_preliminaries_redux cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::Mathematical Preliminaries Redux
TAOCP: Mathematical Preliminaries Redux, exercise 17 (rated 15, recommended): what is it asking?	A conditional probability in the playing-card example. A warm-up for the notation.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::mathematical_preliminaries_redux cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::Mathematical Preliminaries Redux
TAOCP: Mathematical Preliminaries Redux, exercise 6 (rated M22, recommended): what is it asking?	Build random bit vectors that are pairwise independent but not 3-wise independent.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::mathematical_preliminaries_redux cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::Mathematical Preliminaries Redux
TAOCP: Mathematical Preliminaries Redux, exercise 22 (rated M20, recommended): what is it asking?	Derive the union bound from the indicator-variable identity for expectations.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::mathematical_preliminaries_redux cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::Mathematical Preliminaries Redux
TAOCP: Mathematical Preliminaries Redux, exercise 35 (rated M22, recommended): what is it asking?	Two true-or-false identities about nested conditional expectations. Tests whether you understand E(X|Y) as a random variable.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::mathematical_preliminaries_redux cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::Mathematical Preliminaries Redux
TAOCP: Mathematical Preliminaries Redux, exercise 48 (rated M20, recommended): what is it asking?	Show that the second moment principle gives a one-sided bound slightly better than Chebyshev's.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::mathematical_preliminaries_redux cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::Mathematical Preliminaries Redux
TAOCP: Mathematical Preliminaries Redux, exercise 54 (rated M22, recommended): what is it asking?	Bound the probability that a random graph has a triangle, using the first and second moment principles.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::mathematical_preliminaries_redux cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::Mathematical Preliminaries Redux
TAOCP: Mathematical Preliminaries Redux, exercise 66 (rated M22, recommended): what is it asking?	Classify every martingale whose nth value is always plus or minus n.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::mathematical_preliminaries_redux cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::Mathematical Preliminaries Redux
TAOCP: Mathematical Preliminaries Redux: how many exercises, and how are they rated?	147 exercises, rated 10 to HM34.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::mathematical_preliminaries_redux cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 4B::Mathematical Preliminaries Redux
TAOCP: Mathematical Preliminaries Redux: what should you be comfortable with first?	<ul><li>1.2 Mathematical Preliminaries</li><li>Probability: expectation, variance</li></ul>	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::mathematical_preliminaries_redux cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 4B::Mathematical Preliminaries Redux
TAOCP: Mathematical Preliminaries Redux: how should you work through it?	Make a one-page sheet of each inequality with a tiny example. Simulate one in code (e.g. flips of a coin) and compare the actual tail to the bound.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::mathematical_preliminaries_redux cracked.guide::kind::approach	cracked.guide::TAOCP Vol 4B::Mathematical Preliminaries Redux
TAOCP §7.2.2 Backtrack Programming (part 1): what does it cover?	Part 1 covers the first two-thirds of 7.2.2 (pages 30 to 45). It starts with the basic backtrack scheme (Algorithm B) on the n queens problem, then Walker's bitwise version (Algorithm W), Langford pairs with a linked list of unused values (Algorithm L), and word rectangles built column by column with a trie. After that comes a long case study: searching for commafree codes with dynamic ordering of choices, sequential (array-based) lists with cheap deletion and undeletion, and a general memory-stamping scheme for doing and undoing changes (Algorithm C).	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2 cracked.guide::kind::about	cracked.guide::TAOCP Vol 4B::7.2.2 Backtrack Programming (part 1)
TAOCP §7.2.2 (part 1): why does it matter?	Backtracking solves constraint problems from sudoku to scheduling to regex matching. It is also a constant source of LeetCode problems.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2 cracked.guide::kind::why	cracked.guide::TAOCP Vol 4B::7.2.2 Backtrack Programming (part 1)
TAOCP §7.2.2 (part 1): what is Algorithm B about?	The basic backtrack scheme.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2 cracked.guide::kind::algorithm	cracked.guide::TAOCP Vol 4B::7.2.2 Backtrack Programming (part 1)
TAOCP §7.2.2 (part 1): what is Algorithm W about?	Walker's bitwise version.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2 cracked.guide::kind::algorithm	cracked.guide::TAOCP Vol 4B::7.2.2 Backtrack Programming (part 1)
TAOCP §7.2.2 (part 1): what is Algorithm L about?	Langford pairs with a linked list of unused values.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2 cracked.guide::kind::algorithm	cracked.guide::TAOCP Vol 4B::7.2.2 Backtrack Programming (part 1)
TAOCP §7.2.2 (part 1): what is Algorithm C about?	A general memory-stamping scheme for doing and undoing changes.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2 cracked.guide::kind::algorithm	cracked.guide::TAOCP Vol 4B::7.2.2 Backtrack Programming (part 1)
TAOCP §7.2.2 (part 1), a common trap: “Choosing a bad order of variables.” What's the catch?	The commafree search shows how much dynamic ordering (most constrained choice first) helps.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 4B::7.2.2 Backtrack Programming (part 1)
TAOCP §7.2.2 (part 1), a common trap: “Assuming linked lists are always the right undo structure.” What's the catch?	The text's sequential lists, with swap-to-delete, are often faster.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 4B::7.2.2 Backtrack Programming (part 1)
TAOCP §7.2.2 (part 1): what traps should you watch for?	<ul><li>Forgetting to undo state on the way back.</li></ul>	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 4B::7.2.2 Backtrack Programming (part 1)
TAOCP §7.2.2 (part 1), exercise 5 (rated 20, recommended): what is it asking?	Rewrite Algorithm B as a recursive procedure, and think about why the book prefers the iterative form.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2 Backtrack Programming (part 1)
TAOCP §7.2.2 (part 1), exercise 10 (rated 22, recommended): what is it asking?	Adapt Walker's method to n queens with n-bit masks. The classic fast queens counter.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2 Backtrack Programming (part 1)
TAOCP §7.2.2 (part 1), exercise 20 (rated 21, recommended): what is it asking?	Add a forcing rule to the Langford pair search, so values that must go in now are placed at once.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2 Backtrack Programming (part 1)
TAOCP §7.2.2 (part 1), exercise 25 (rated 25, recommended): what is it asking?	Use orthogonal lists to find all words with a given letter in a given position, and speed up the word rectangle search with them.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2 Backtrack Programming (part 1)
TAOCP §7.2.2 (part 1), exercise 35 (rated 22, recommended): what is it asking?	Design an incremental test that accepts a new four-letter word only if the code stays commafree.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2 Backtrack Programming (part 1)
TAOCP §7.2.2 (part 1), exercise 40 (rated 15, recommended): what is it asking?	Think about why these sequential list structures were left out of the Vol 1 section on sequential allocation.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2 Backtrack Programming (part 1)
TAOCP §7.2.2 (part 1), exercise 44 (rated 25, recommended): what is it asking?	Write out the low-level candidate selection step of the commafree search, using the reversible store routine.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2 Backtrack Programming (part 1)
TAOCP §7.2.2 (part 1), exercise 37 (rated M30, recommended): what is it asking?	The stretch: understand and prove Eastman's construction of a maximum commafree code for odd block lengths.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2 Backtrack Programming (part 1)
TAOCP §7.2.2 (part 1): how many exercises, and how are they rated?	48 exercises, rated 10 to HM42.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 4B::7.2.2 Backtrack Programming (part 1)
TAOCP §7.2.2 (part 1): what should you be comfortable with first?	<ul><li>7.2.1 Generating Basic Combinatorial Patterns</li></ul>	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 4B::7.2.2 Backtrack Programming (part 1)
TAOCP §7.2.2 (part 1): how should you work through it?	Implement n queens twice: once as Algorithm B with plain arrays, and once with Walker's bitmask trick. Count solutions up to n = 14 or so. Then do Langford pairs with Algorithm L. Read the commafree case study slowly; the doing/undoing scheme is the idea you will reuse all through 7.2.2.1 and 7.2.2.2.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 4B::7.2.2 Backtrack Programming (part 1)
TAOCP §7.2.2 Backtrack Programming (part 2): what does it cover?	Part 2 covers the rest of 7.2.2 (pages 46 to 54). It shows how to estimate the running time of a backtrack program before running it, by following random paths down the tree (Algorithm E), and why the estimate is unbiased. An optional starred part uses the same idea to estimate the number of solutions, with king paths on a chessboard as the example. Then 'factoring the problem' splits a search into independent pieces, using the Instant Insanity cube puzzle. The section ends with historical notes.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2 cracked.guide::kind::about	cracked.guide::TAOCP Vol 4B::7.2.2 Backtrack Programming (part 2)
TAOCP §7.2.2 (part 2): why does it matter?	Estimating search cost is a superpower: you can tell in seconds whether a search will take a minute or a million years.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2 cracked.guide::kind::why	cracked.guide::TAOCP Vol 4B::7.2.2 Backtrack Programming (part 2)
TAOCP §7.2.2 (part 2): what is Algorithm E about?	Following random paths down the tree.<div class="cg-dim cg-ctx">It shows how to estimate the running time of a backtrack program before running it, by following random paths down the tree (Algorithm E), and why the estimate is unbiased.</div>	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2 cracked.guide::kind::algorithm	cracked.guide::TAOCP Vol 4B::7.2.2 Backtrack Programming (part 2)
TAOCP §7.2.2 (part 2), a common trap: “Trusting a single random estimate.” What's the catch?	The variance is huge; average many probes.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 4B::7.2.2 Backtrack Programming (part 2)
TAOCP §7.2.2 (part 2), a common trap: “Thinking the estimator is biased because single runs are wildly off.” What's the catch?	It is unbiased; it just has high variance.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 4B::7.2.2 Backtrack Programming (part 2)
TAOCP §7.2.2 (part 2), exercise 49 (rated 20): what is it asking?	Trace how the random bits in the figure produced each choice in a sample probe.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2 Backtrack Programming (part 2)
TAOCP §7.2.2 (part 2), exercise 60 (rated 20, recommended): what is it asking?	Try weighting king moves to bias the random walk, and see whether the estimates get better.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2 Backtrack Programming (part 2)
TAOCP §7.2.2 (part 2), exercise 62 (rated 22, recommended): what is it asking?	Estimate how often four randomly colored cubes give an Instant Insanity puzzle with exactly one solution.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2 Backtrack Programming (part 2)
TAOCP §7.2.2 (part 2), exercise 66 (rated 23, recommended): what is it asking?	Show that a rotating-disks puzzle factors into small independent pieces you can solve by hand.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2 Backtrack Programming (part 2)
TAOCP §7.2.2 (part 2), exercise 52 (rated HM25, recommended): what is it asking?	Connect Algorithm E on a simple decreasing-sequence tree to a coin-flipping process.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2 Backtrack Programming (part 2)
TAOCP §7.2.2 (part 2), exercise 56 (rated M25, recommended): what is it asking?	Figure out how to estimate the running time of the commafree search, which does not fit the plain Algorithm E mold.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2 Backtrack Programming (part 2)
TAOCP §7.2.2 (part 2), exercise 75 (rated 30, recommended): what is it asking?	Design a backtrack generator for all connected vertex subsets of a graph that contain a given vertex.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2 Backtrack Programming (part 2)
TAOCP §7.2.2 (part 2), exercise 53 (rated M30, recommended): what is it asking?	The stretch: extend Algorithm B to report the minimum, maximum, mean and variance of the Monte Carlo estimates.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2 Backtrack Programming (part 2)
TAOCP §7.2.2 (part 2): how many exercises, and how are they rated?	31 exercises, rated M15 to 41.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 4B::7.2.2 Backtrack Programming (part 2)
TAOCP §7.2.2 (part 2): what should you be comfortable with first?	<ul><li>7.2.2 part 1</li><li>Mathematical Preliminaries Redux</li></ul>	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 4B::7.2.2 Backtrack Programming (part 2)
TAOCP §7.2.2 (part 2): how should you work through it?	Implement Algorithm E for your n queens program from part 1. Compare the averages of many random probes with the true node counts, and look at how widely single estimates vary. Then solve Instant Insanity by hand using the factoring idea.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 4B::7.2.2 Backtrack Programming (part 2)
TAOCP §7.2.2.1 Dancing Links (part 1): what does it cover?	Part 1 covers pages 65 to 78 of 7.2.2.1. Deleting a node from a doubly linked list and later restoring it from its own stale links is the 'dance'. With it, Algorithm X backtracks over exact cover problems (items and options), using the minimum-remaining-values heuristic to pick an item. The text then adds secondary items (covered at most once), progress reports for long runs, and a long sudoku study: the exact cover model, naked and hidden singles, and variants like jigsaw sudoku.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::about	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 1)
TAOCP §7.2.2.1 (part 1): why does it matter?	Dancing links is one of Knuth's most famous techniques. Exact cover models sudoku, polyomino tiling and many scheduling problems.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::why	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 1)
Dancing links: what is it?	Dancing links is a technique for backtracking in which nodes are removed from doubly linked lists and later restored from their own stale pointers, used by Knuth's Algorithm X to solve exact cover problems.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::definition	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 1)
Dancing links: Who invented dancing links?	The link-removal trick predates Knuth (he credits Hitotumatu and Noshita, 1979), but Knuth named it &quot;dancing links&quot;, popularized it in a 2000 paper and built Algorithm X around it.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::definition	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 1)
Dancing links: Is DLX the fastest sudoku solver?	It solves any sudoku in a blink and is easy to get right, but hand-tuned constraint solvers can be faster. Its strength is that one program handles every exact cover puzzle.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::definition	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 1)
Exact cover: what is it?	An exact cover problem gives a set of items and a collection of options, each a subset of the items, and asks for options that together contain every item exactly once.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::definition	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 1)
Exact cover: Is exact cover NP-complete?	Yes, it is one of Karp's classic NP-complete problems. Good heuristics still solve real puzzle instances quickly.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::definition	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 1)
TAOCP §7.2.2.1 (part 1), a common trap: “Restoring links in the wrong order on backtrack.” What's the catch?	It must be the exact reverse of removal.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 1)
TAOCP §7.2.2.1 (part 1), a common trap: “Making the queens' diagonals primary items.” What's the catch?	They must be secondary, since not every diagonal gets a queen.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 1)
TAOCP §7.2.2.1 (part 1), a common trap: “Skipping the MRV heuristic.” What's the catch?	Without it Algorithm X can be orders of magnitude slower.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 1)
TAOCP §7.2.2.1 (part 1), exercise 9 (rated 18): what is it asking?	Implement the minimum-remaining-values choice of item. You will use it in every later algorithm.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 1)
TAOCP §7.2.2.1 (part 1), exercise 11 (rated 19, recommended): what is it asking?	Run Algorithm X by hand on Table 1 and record the memory contents. The best way to see the dance.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 1)
TAOCP §7.2.2.1 (part 1), exercise 12 (rated 21, recommended): what is it asking?	Print the option that a given node belongs to. A small, useful debugging routine.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 1)
TAOCP §7.2.2.1 (part 1), exercise 14 (rated 20, recommended): what is it asking?	Model the ménage seating problem as exact cover and count solutions.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 1)
TAOCP §7.2.2.1 (part 1), exercise 19 (rated 21, recommended): what is it asking?	Change Algorithm X to work with no primary items at all, with a sensible definition of a solution.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 1)
TAOCP §7.2.2.1 (part 1), exercise 22 (rated 28, recommended): what is it asking?	Use pairwise encoding to cut n queens solutions by symmetry, case by case.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 1)
TAOCP §7.2.2.1 (part 1), exercise 40 (rated 21, recommended): what is it asking?	Count exact cover solutions with bitwise vectors instead of links. A totally different approach.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 1)
TAOCP §7.2.2.1 (part 1), exercise 67 (rated 22, recommended): what is it asking?	Find the hidden extra constraints in hypersudoku and use them to solve puzzles.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 1)
TAOCP §7.2.2.1 (part 1): how many exercises, and how are they rated?	77 exercises, rated M04 to 47.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 1)
TAOCP §7.2.2.1 (part 1): what should you be comfortable with first?	<ul><li>2.2.5 Doubly Linked Lists</li><li>7.2.2 Backtrack Programming</li></ul>	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 1)
TAOCP §7.2.2.1 Dancing Links (part 2): what does it cover?	Part 2 covers the first stretch of pages 79 to 97 of 7.2.2.1: packing polyominoes and polycubes (the pentominoes, the Soma cube), and 'factoring' an exact cover problem into independent parts, which can prove a packing impossible without searching it. Everything here runs on plain Algorithm X from part 1; the rest of those pages (color controls and multiplicities) is part 3.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::about	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 2)
TAOCP §7.2.2.1 (part 2): why does it matter?	Packing puzzles are where exact cover earns its keep: one modeling tool turns a shape and a set of pieces into options, and the solver from part 1 does the rest. Factoring shows how a little math can replace an enormous search.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::why	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 2)
TAOCP §7.2.2.1 (part 2), a common trap: “Double-counting symmetric solutions in polyomino packing.” What's the catch?	Restrict one piece's placements to break symmetry.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 2)
TAOCP §7.2.2.1 (part 2), exercise 266 (rated 25, recommended): what is it asking?	Sketch a tool that turns a shape plus a set of pieces into exact cover options. You need it for every packing puzzle.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 2)
TAOCP §7.2.2.1 (part 2), exercise 268 (rated 21, recommended): what is it asking?	Find all pentomino packings of a 5 by 12 box with Algorithm X, and deal with symmetry.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 2)
TAOCP §7.2.2.1 (part 2), exercise 326 (rated M25, recommended): what is it asking?	Prove by factoring that a certain Soma cube wall cannot be built.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 2)
TAOCP §7.2.2.1 (part 2), exercise 378 (rated M30, recommended): what is it asking?	The stretch: prove that any set of rectangle shapes has a finite subset that builds all the others by concatenation (read 377 first).	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 2)
TAOCP §7.2.2.1 (part 2): what should you be comfortable with first?	<ul><li>7.2.2.1 part 1</li></ul>	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 2)
TAOCP §7.2.2.1 (part 2): how should you work through it?	Write a small tool that turns a board shape and a set of pieces (with their rotations and reflections) into exact cover options, and feed it to your Algorithm X from part 1. Solve the 6 by 10 pentomino problem and check the known count of 2339 (not counting reflections). Then read the factoring argument for the Soma cube slowly; it is short and it is the idea of the week.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 2)
TAOCP §7.2.2.1 Dancing Links (part 3): what does it cover?	Part 3 covers the rest of pages 79 to 97 of 7.2.2.1. It adds color controls: secondary items may be shared by several options if they all give the same color (XCC, Algorithm C), which handles word puzzles, MacMahon tiles and general constraint satisfaction. Then it introduces multiplicity: primary items covered between a lower and upper number of times (MCC), implemented by Algorithm M with a new dance step that tweaks lists instead of removing items.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::about	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 3)
TAOCP §7.2.2.1 (part 3): why does it matter?	These extensions make dancing links a general-purpose constraint solver rather than a sudoku trick.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::why	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 3)
TAOCP §7.2.2.1 (part 3), a common trap: “Expecting colors to be free.” What's the catch?	A colored item is hidden, not covered, so it can still need purification work on every branch.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 3)
TAOCP §7.2.2.1 (part 3), exercise 80 (rated 19): what is it asking?	Run Algorithm C by hand on the small colored example until it finds a solution.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 3)
TAOCP §7.2.2.1 (part 3), exercise 101 (rated 25, recommended): what is it asking?	Formulate the zebra puzzle as an exact cover problem with colors.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 3)
TAOCP §7.2.2.1 (part 3), exercise 117 (rated 24, recommended): what is it asking?	Encode graph coloring as exact cover with secondary items per edge, then improve it using cliques.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 3)
TAOCP §7.2.2.1 (part 3), exercise 169 (rated 22, recommended): what is it asking?	Find all t-element independent sets of a graph as a multiplicity problem.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 3)
TAOCP §7.2.2.1 (part 3): what should you be comfortable with first?	<ul><li>7.2.2.1 part 2</li></ul>	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 3)
TAOCP §7.2.2.1 (part 3): how should you work through it?	Add colors to your solver (Algorithm C): purify instead of cover when an option gives a secondary item a color. Model a word square or the zebra puzzle as XCC and solve it. Read Algorithm M for the ideas; implementing it is optional.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 3)
TAOCP §7.2.2.1 Dancing Links (part 4): what does it cover?	Part 4 covers pages 98 to 123 of 7.2.2.1, mostly starred material. It analyzes Algorithm X's running time (strict exact cover, the extreme problem with Bell-like counts, matching problems), explains why choosing the item to branch on matters (maintaining focus), uses bipairs for local equivalence and symmetry breaking, and preprocesses options to remove useless ones (Algorithm P). Then it finds minimum-cost solutions with cost cutoffs (Algorithms X$ and C$), builds a ZDD of all solutions at once (Algorithm Z), and closes with a summary and historical notes.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::about	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 4)
TAOCP §7.2.2.1 (part 4): why does it matter?	This is where you see how far one data structure trick can go, and how modeling a problem well matters more than raw speed.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::why	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 4)
TAOCP §7.2.2.1 (part 4): what is Algorithm P about?	Preprocesses options to remove useless ones.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::algorithm	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 4)
TAOCP §7.2.2.1 (part 4): what is Algorithm Z about?	Builds a ZDD of all solutions at once.<div class="cg-dim cg-ctx">Then it finds minimum-cost solutions with cost cutoffs (Algorithms X$ and C$), builds a ZDD of all solutions at once (Algorithm Z), and closes with a summary and historical notes.</div>	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::algorithm	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 4)
TAOCP §7.2.2.1 (part 4), a common trap: “Reading every starred section line by line.” What's the catch?	Get the main results, then move on.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 4)
TAOCP §7.2.2.1 (part 4), a common trap: “Using negative or fractional option costs with Algorithm X$.” What's the catch?	Costs must be nonnegative integers, so scale and round first.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 4)
TAOCP §7.2.2.1 (part 4), exercise 184 (rated M22, recommended): what is it asking?	Decide whether a strict exact cover problem with n items can have exactly t solutions, for any t.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 4)
TAOCP §7.2.2.1 (part 4), exercise 195 (rated M22, recommended): what is it asking?	Estimate how many updates Algorithm X makes when listing the perfect matchings of the text's example graph.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 4)
TAOCP §7.2.2.1 (part 4), exercise 218 (rated 20, recommended): what is it asking?	Explain one detail of the forcing rule in option preprocessing.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 4)
TAOCP §7.2.2.1 (part 4), exercise 229 (rated 25, recommended): what is it asking?	Find the lexicographically smallest and largest Langford pairings for n = 16 with the min-cost machinery.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 4)
TAOCP §7.2.2.1 (part 4), exercise 253 (rated 21, recommended): what is it asking?	Extend Algorithm Z to report the number of solutions as well as the ZDD.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 4)
TAOCP §7.2.2.1 (part 4), exercise 390 (rated 21, recommended): what is it asking?	Show two different exact cover encodings of futoshiki: one with pairwise ordering, one with colors.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 4)
TAOCP §7.2.2.1 (part 4), exercise 399 (rated 22, recommended): what is it asking?	Encode kenken for Algorithm C.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 4)
TAOCP §7.2.2.1 (part 4), exercise 200 (rated HM25, recommended): what is it asking?	The stretch: decide 3D matching with polynomial algebra instead of backtracking (Björklund's method).	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 4)
TAOCP §7.2.2.1 (part 4): how many exercises, and how are they rated?	150 exercises, rated 10 to HM46.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 4)
TAOCP §7.2.2.1 (part 4): what should you be comfortable with first?	<ul><li>7.2.2.1 part 3</li></ul>	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 4)
TAOCP §7.2.2.1 (part 4): how should you work through it?	Skim the starred analysis sections for the main results. Spend real time on minimum-cost solutions and on Algorithm Z, since both change what the solver can answer. If you have a working solver, add a cost bound to it and solve one of the text's min-cost queens examples.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.1 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 4B::7.2.2.1 Dancing Links (part 4)
TAOCP §7.2.2.2 Satisfiability (part 1): what does it cover?	Part 1 covers pages 185 to 210 of 7.2.2.2: what SAT is (clauses, literals, 3SAT), then a tour of example applications encoded as clauses. Examples include van der Waerden numbers, exact cover and Langford pairs, graph coloring (McGregor's map) with cardinality constraints (Sinz and Bailleux-Boufkhad encodings), factoring via multiplication circuits and Tseytin encoding, circuit fault testing, learning a Boolean function, sorting networks, Conway's Life, mutual exclusion protocols and bounded model checking, and digital tomography.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::about	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 1)
TAOCP §7.2.2.2 (part 1): why does it matter?	Modern SAT solvers are astonishingly good, and knowing how to encode a problem as SAT lets you solve things that look impossible: package dependency resolution, hardware verification, scheduling.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::why	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 1)
TAOCP §7.2.2.2 (part 1), a common trap: “Naive encodings of 'at most one' or 'at most r' constraints blow up quadratically.” What's the catch?	Learn the Sinz and Bailleux-Boufkhad encodings.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 1)
TAOCP §7.2.2.2 (part 1), a common trap: “Forgetting symmetry.” What's the catch?	Many example problems have obvious symmetries that multiply the search.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 1)
TAOCP §7.2.2.2 (part 1), exercise 2 (rated 20): what is it asking?	A word puzzle about planet Pincus. Turn the statements into clauses and see what follows.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 1)
TAOCP §7.2.2.2 (part 1), exercise 8 (rated 20, recommended): what is it asking?	Define clauses for van der Waerden numbers with more than two colors.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 1)
TAOCP §7.2.2.2 (part 1), exercise 10 (rated 21, recommended): what is it asking?	Turn any clause set into an equivalent monotone one with a simple fixed shape.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 1)
TAOCP §7.2.2.2 (part 1), exercise 26 (rated 22): what is it asking?	Prove that Sinz's sequential-counter clauses really enforce 'at most r'.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 1)
TAOCP §7.2.2.2 (part 1), exercise 28 (rated 20, recommended): what is it asking?	Specialize the cardinality encoding to 'at least one', and see that it turns long clauses into 3SAT.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 1)
TAOCP §7.2.2.2 (part 1), exercise 65 (rated 28, recommended): what is it asking?	Encode Life's transition rule as clauses, with and without auxiliary variables.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 1)
TAOCP §7.2.2.2 (part 1), exercise 94 (rated 21, recommended): what is it asking?	Write the clauses that prove a property is invariant, given that no short counterexample exists.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 1)
TAOCP §7.2.2.2 (part 1), exercise 109 (rated 20, recommended): what is it asking?	Find the lexicographically smallest solution by calling a SAT solver repeatedly.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 1)
TAOCP §7.2.2.2 (part 1): how many exercises, and how are they rated?	118 exercises, rated 01 to M46.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 1)
TAOCP §7.2.2.2 (part 1): what should you be comfortable with first?	<ul><li>7.1.1 Boolean Basics</li><li>7.2.2 Backtrack Programming</li></ul>	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 1)
TAOCP §7.2.2.2 (part 1): how should you work through it?	Install a real solver (MiniSat or CaDiCaL) or Knuth's SAT13. Write DIMACS generators for two or three of the examples, such as waerden(3,3;n), a graph coloring and a small Life search, and solve them. Focus on the encoding tricks, especially the cardinality constraints.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 1)
TAOCP §7.2.2.2 Satisfiability (part 2): what does it cover?	Part 2 covers pages 211 to 244 of 7.2.2.2. It starts with backtracking solvers: Algorithm A (counting literal occurrences), Algorithm B (watched literals), Algorithm D (watched literals plus a cyclic order of variables), then Algorithm L, a lookahead solver with binary implication tables, heuristic scores, autarkies and double lookahead (Algorithms X and Y as subroutines). Next is a mostly mathematical study of random clauses and the satisfiability threshold (random 2SAT, random 3SAT near 4.27 clauses per variable). It ends with resolution proofs: the Davis-Putnam elimination, treelike and regular resolution, the pigeonhole lower bounds and Tseytin's graph parity clauses.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::about	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 2)
TAOCP §7.2.2.2 (part 2): why does it matter?	Watched literals are one of the key engineering ideas that made SAT solvers fast. Implementing them teaches serious data structure design.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::why	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 2)
TAOCP §7.2.2.2 (part 2), a common trap: “Generalizing from random 3SAT.” What's the catch?	Structured industrial instances behave very differently.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 2)
TAOCP §7.2.2.2 (part 2): what traps should you watch for?	<ul><li>Bugs in watched-literal updates when a clause becomes unit or conflicting.</li></ul>	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 2)
TAOCP §7.2.2.2 (part 2), exercise 119 (rated 18): what is it asking?	Find which literal shrinks a small van der Waerden formula the most when set true.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 2)
TAOCP §7.2.2.2 (part 2), exercise 122 (rated 21, recommended): what is it asking?	Change Algorithm A to find all satisfying assignments.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 2)
TAOCP §7.2.2.2 (part 2), exercise 132 (rated 22, recommended): what is it asking?	Look for 2SAT inputs that make Algorithm D take exponential time, even though 2SAT is easy.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 2)
TAOCP §7.2.2.2 (part 2), exercise 135 (rated 16, recommended): what is it asking?	Use the binary implication tables to find the literals that imply a given one.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 2)
TAOCP §7.2.2.2 (part 2), exercise 163 (rated M25, recommended): what is it asking?	Prove a better-than-2^n bound for a simple recursive 3SAT procedure that uses autarkies.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 2)
TAOCP §7.2.2.2 (part 2), exercise 188 (rated HM25, recommended): what is it asking?	Work out the satisfiability threshold for random 1SAT, the easiest case.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 2)
TAOCP §7.2.2.2 (part 2), exercise 219 (rated M20, recommended): what is it asking?	Define resolution for arbitrary pairs of clauses so it is still sound.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 2)
TAOCP §7.2.2.2 (part 2), exercise 237 (rated 28, recommended): what is it asking?	Show that extended resolution refutes the pigeonhole clauses in polynomial time.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 2)
TAOCP §7.2.2.2 (part 2): how many exercises, and how are they rated?	130 exercises, rated 05 to HM49.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 2)
TAOCP §7.2.2.2 (part 2): what should you be comfortable with first?	<ul><li>7.2.2.2 part 1</li></ul>	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 2)
TAOCP §7.2.2.2 (part 2): how should you work through it?	Write a small DPLL solver with watched literals (Algorithm B or D) in C. Measure it on random 3SAT instances near the 4.27 ratio and on waerden problems. Read Algorithm L to see what lookahead buys, and the resolution part for why some problems need exponential time with any such solver.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 2)
TAOCP §7.2.2.2 Satisfiability (part 3): what does it cover?	Part 3 covers pages 244 to 274 of 7.2.2.2. It starts with conflict-driven clause learning: a simple learning solver (Algorithm I), then the full CDCL Algorithm C with a trail, watched literals, conflict analysis that learns a clause and backjumps, variable activity scores, certificates of unsatisfiability, purging learned clauses and restarts. Then come Monte Carlo methods: Papadimitriou's random walk for 2SAT and 3SAT (Algorithm P), WalkSAT (Algorithm W), and Las Vegas restarts with the 'reluctant doubling' sequence. It ends with the Lovász Local Lemma, including Shearer's exact bound, traces and the Moser-Tardos resampling Algorithm M.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::about	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 3)
TAOCP §7.2.2.2 (part 3): why does it matter?	CDCL is why SAT went from theory to industrial tool. It is a beautiful example of an algorithm learning from its own failures.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::why	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 3)
CDCL (conflict-driven clause learning): what is it?	Conflict-driven clause learning is the algorithm behind modern SAT solvers: when a partial assignment leads to a contradiction, the solver analyzes why, adds a new clause that rules the cause out, and jumps back.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::definition	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 3)
CDCL (conflict-driven clause learning): Who invented CDCL?	Clause learning came from the GRASP solver (Marques-Silva and Sakallah, 1996); Chaff (2001) added watched literals and activity-based decisions that made it fast.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::definition	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 3)
WalkSAT: what is it?	WalkSAT is a randomized local search algorithm for satisfiability that repeatedly picks an unsatisfied clause and flips one of its variables, mixing greedy and random choices.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::definition	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 3)
WalkSAT: What does the noise parameter do?	It is the probability of a random flip instead of a greedy one. Too low and the search gets stuck; too high and it wanders aimlessly.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::definition	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 3)
TAOCP §7.2.2.2 (part 3): what is Algorithm I about?	A simple learning solver.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::algorithm	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 3)
TAOCP §7.2.2.2 (part 3): what is Algorithm P about?	Papadimitriou's random walk for 2SAT and 3SAT.<div class="cg-dim cg-ctx">Then come Monte Carlo methods: Papadimitriou's random walk for 2SAT and 3SAT (Algorithm P), WalkSAT (Algorithm W), and Las Vegas restarts with the 'reluctant doubling' sequence.</div>	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::algorithm	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 3)
TAOCP §7.2.2.2 (part 3), a common trap: “Expecting local search (Algorithms P and W) to prove unsatisfiability.” What's the catch?	They can't; they only find solutions.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 3)
TAOCP §7.2.2.2 (part 3), a common trap: “Restarting on a fixed schedule.” What's the catch?	The reluctant doubling sequence is near optimal when you don't know the run-time distribution.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 3)
TAOCP §7.2.2.2 (part 3): what traps should you watch for?	<ul><li>Getting the implication graph wrong when analyzing conflicts.</li></ul>	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 3)
TAOCP §7.2.2.2 (part 3), exercise 254 (rated 16): what is it asking?	Work out the first clause a CDCL solver learns on a tiny binary example.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 3)
TAOCP §7.2.2.2 (part 3), exercise 253 (rated 18, recommended): what is it asking?	Continue the text's conflict example by one decision and find the next learned clauses.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 3)
TAOCP §7.2.2.2 (part 3), exercise 255 (rated 20, recommended): what is it asking?	Build a small ternary formula that makes CDCL learn a chosen clause.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 3)
TAOCP §7.2.2.2 (part 3), exercise 257 (rated 30, recommended): what is it asking?	Implement Sörensson's recursive test for redundant literals, which shortens learned clauses.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 3)
TAOCP §7.2.2.2 (part 3), exercise 271 (rated 25, recommended): what is it asking?	Drop a learned clause right away when the next one subsumes it.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 3)
TAOCP §7.2.2.2 (part 3), exercise 300 (rated 25, recommended): what is it asking?	Run 64 random walks of Algorithm P at once with bitwise operations.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 3)
TAOCP §7.2.2.2 (part 3), exercise 313 (rated 22, recommended): what is it asking?	Show that WalkSAT's free flips reduce unsatisfied clauses but can move away from a solution.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 3)
TAOCP §7.2.2.2 (part 3), exercise 351 (rated 25, recommended): what is it asking?	Apply the Local Lemma to SAT with variables biased individually.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 3)
TAOCP §7.2.2.2 (part 3): how many exercises, and how are they rated?	108 exercises, rated 10 to HM46.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 3)
TAOCP §7.2.2.2 Satisfiability (part 4): what does it cover?	Part 4 covers pages 274 to 316 of 7.2.2.2. It starts with message passing (belief and survey propagation, Algorithm S), then preprocessing clauses before solving (variable elimination with erp rules, subsumption, blocked clauses, inprocessing). Next it covers encoding constraints into clauses (order, log and direct encodings, at-most-one, scheduling), clauses that are 'forcing' under unit propagation, symmetry breaking, and satisfiability-preserving maps (endomorphisms, the mutilated chessboard). It ends with one hundred benchmark problems run through all the solvers, parameter tuning, parallelism and history.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::about	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 4)
TAOCP §7.2.2.2 (part 4): why does it matter?	Local search solves huge satisfiable instances fast, and preprocessing is a big part of real-world solver performance.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::why	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 4)
TAOCP §7.2.2.2 (part 4), a common trap: “Thinking the encoding is a detail.” What's the catch?	The same problem can be easy or hopeless depending on how it is written as clauses.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 4)
TAOCP §7.2.2.2 (part 4), a common trap: “Adding symmetry-breaking clauses that break more than the symmetry.” What's the catch?	Exercise 496 shows how that goes wrong.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 4)
TAOCP §7.2.2.2 (part 4), a common trap: “Forgetting erp rules after eliminating variables.” What's the catch?	Without them you cannot rebuild a full solution.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 4)
TAOCP §7.2.2.2 (part 4), exercise 401 (rated 16): what is it asking?	Simple arithmetic on a unary (order) encoding. A warm-up for the encoding exercises.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 4)
TAOCP §7.2.2.2 (part 4), exercise 357 (rated M20, recommended): what is it asking?	Express survey-propagation quantities for one variable in terms of its three-part field.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 4)
TAOCP §7.2.2.2 (part 4), exercise 367 (rated 20, recommended): what is it asking?	Justify the erp rule that lets you rebuild an eliminated variable's value.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 4)
TAOCP §7.2.2.2 (part 4), exercise 399 (rated 23, recommended): what is it asking?	Compare two ways of encoding a binary constraint between multivalued variables.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 4)
TAOCP §7.2.2.2 (part 4), exercise 408 (rated 25, recommended): what is it asking?	Encode open shop scheduling as SAT and find optimal makespans.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 4)
TAOCP §7.2.2.2 (part 4), exercise 431 (rated 20, recommended): what is it asking?	Build efficient clauses that force a comparison of two sums under unit propagation.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 4)
TAOCP §7.2.2.2 (part 4), exercise 496 (rated M20, recommended): what is it asking?	Find the flaw in a plausible but wrong symmetry-breaking argument for the pigeonhole clauses.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 4)
TAOCP §7.2.2.2 (part 4), exercise 515 (rated 23, recommended): what is it asking?	Write clauses that let a puzzle designer impose shape rules on a hard sudoku.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 4)
TAOCP §7.2.2.2 (part 4): how many exercises, and how are they rated?	170 exercises, rated M10 to M49.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 4)
TAOCP §7.2.2.2 (part 4): what should you be comfortable with first?	<ul><li>7.2.2.2 part 3</li></ul>	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 4)
TAOCP §7.2.2.2 (part 4): how should you work through it?	Read preprocessing and encoding closely; they make the biggest difference in practice. For the 100 test cases, read the discussion and look at the tables without studying every row. As a project, re-encode one earlier problem two ways (order versus direct encoding) and time a real solver on both.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::7.2.2.2 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 4B::7.2.2.2 Satisfiability (part 4)
TAOCP Vol 4B review: what does it cover?	The final review week: Volume 4B and the whole path. Vol 4B is MPR plus 7.2.2 backtracking, 7.2.2.1 dancing links and 7.2.2.2 satisfiability.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::vol_4b_review cracked.guide::kind::about	cracked.guide::TAOCP Vol 4B::Vol 4B review
TAOCP: Vol 4B review: why does it matter?	You made it. This is the week to look back at 125 weeks of work and decide what to go deeper on.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::vol_4b_review cracked.guide::kind::why	cracked.guide::TAOCP Vol 4B::Vol 4B review
TAOCP: Vol 4B review, exercise MPR-61 (rated M28, recommended): what is it asking?	Prove the FKG inequality for random sets with a log-supermodular distribution.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::vol_4b_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::Vol 4B review
TAOCP: Vol 4B review, exercise MPR-128 (rated HM26, recommended): what is it asking?	Analyze a randomized protocol where processors that can't communicate compete for a shared resource.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::vol_4b_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::Vol 4B review
TAOCP: Vol 4B review, exercise 45 of §7.2.2 (rated 28, recommended): what is it asking?	Finish the low-level update step of the commafree search, including the poison list.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::vol_4b_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::Vol 4B review
TAOCP: Vol 4B review, exercise 71 of §7.2.2 (rated M29, recommended): what is it asking?	Maximize the correct answers in a self-referential questionnaire, after first pinning down what that means.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::vol_4b_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::Vol 4B review
TAOCP: Vol 4B review, exercise 156 of §7.2.2.1 (rated 30, recommended): what is it asking?	Solve the partridge puzzle both with a bitwise backtracker and with a general MCC solver, and compare.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::vol_4b_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::Vol 4B review
TAOCP: Vol 4B review, exercise 254 of §7.2.2.1 (rated 28, recommended): what is it asking?	Design the subproblem signature that lets Algorithm Z share ZDD nodes, including colored items.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::vol_4b_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::Vol 4B review
TAOCP: Vol 4B review, exercise 143 of §7.2.2.2 (rated 30, recommended): what is it asking?	Extend the lookahead solver from ternary clauses to clauses of any length.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::vol_4b_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::Vol 4B review
TAOCP: Vol 4B review, exercise 282 of §7.2.2.2 (rated M33, recommended): what is it asking?	Build a linear-size certificate of unsatisfiability for the flower snark clauses.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::vol_4b_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 4B::Vol 4B review
TAOCP: Vol 4B review: how many exercises, and how are they rated?	1202 exercises, rated 01 to HM49.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::vol_4b_review cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 4B::Vol 4B review
TAOCP: Vol 4B review: what should you be comfortable with first?	<ul><li>Everything</li></ul>	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::vol_4b_review cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 4B::Vol 4B review
TAOCP: Vol 4B review: how should you work through it?	Write a short retrospective: what stuck, what did not, and which volume you would reread. Check Knuth's TAOCP page for the newest pre-fascicles of Vol 4C if you want more.	cracked.guide cracked.guide::phase::taocp-4b cracked.guide::section::vol_4b_review cracked.guide::kind::approach	cracked.guide::TAOCP Vol 4B::Vol 4B review
NeetCode 150: two problems a week: what is it?	Every week has two problems from the NeetCode 150, a curated list of LeetCode problems grouped by pattern (arrays and hashing, two pointers, sliding window, stack, binary search, linked lists, trees, tries, heaps, backtracking, graphs, dynamic programming, greedy, intervals, math and bit manipulation). At two a week you will finish the list well before the end of the path and can repeat the ones that gave you trouble. It keeps your interview skills warm while Knuth gives you the deep version of the same ideas.	cracked.guide cracked.guide::phase::side cracked.guide::kind::about	cracked.guide::Side tracks::NeetCode 150
NeetCode problems: how should you work each one?	<ul><li>Give each problem 30 to 45 minutes on your own before looking at anything.</li><li>If stuck, watch the NeetCode video explanation for that problem, then close it and write the solution from scratch.</li><li>Write down the pattern in one line (&quot;monotonic stack&quot;, &quot;two pointers from both ends&quot;) so you can recognize it next time.</li><li>Revisit any problem you needed help with two or three weeks later.</li></ul>	cracked.guide cracked.guide::phase::side cracked.guide::kind::how	cracked.guide::Side tracks::NeetCode 150
The Play track: what is it?	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.<br><br>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.<br><br>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.	cracked.guide cracked.guide::phase::side cracked.guide::kind::about	cracked.guide::Side tracks::Play track
The Play track: how does each game fit into the path?	Each game has two tasks: a start week with a small goal (read the manual, solve the first few puzzles) and a checkpoint about two to three months later with a real milestone. Play an hour or two a week, more for Factorio and Satisfactory. Finishing every puzzle is not required. When you get stuck, step away; the answer often shows up in the shower. Zachtronics closed as a studio in 2022, but its games are still sold and still work.	cracked.guide cracked.guide::phase::side cracked.guide::kind::how	cracked.guide::Side tracks::Play track
