#separator:tab
#html:true
#notetype:Basic
#tags column:3
#deck column:4
#columns:Front	Back	Tags	Deck
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
