#separator:tab
#html:true
#notetype:Basic
#tags column:3
#deck column:4
#columns:Front	Back	Tags	Deck
TAOCP Vol 2: Seminumerical Algorithms: what is the phase about?	Volume 2 is about numbers as computers see them. Chapter 3 is random numbers: how to generate them, how to test them, and how to turn them into shuffles and samples. Chapter 4 is arithmetic: floating point, bignums, fast multiplication, gcd, factoring and polynomials. Some sections are deep number theory; the guides tell you where to dig in and where to skim.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::About this phase
TAOCP Vol 2: what should you be able to do by the end?	<ul><li>Pick, use and test a random number generator, and avoid the classic biased-shuffle and modulo-bias bugs.</li><li>Explain floating-point error and write numerically careful code.</li><li>Implement arbitrary-precision arithmetic, including long division and a faster-than-schoolbook multiply.</li><li>Implement gcd, modular inverses, primality testing and Pollard rho factoring.</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::kind::outcomes	cracked.guide::TAOCP Vol 2::About this phase
TAOCP Vol 2: what do you need before you start?	<ul><li>Vol 1 math, especially 1.2.4 (number theory) and 1.2.9 (generating functions).</li><li>Basic probability and statistics: mean, variance, distributions.</li><li>C or another language with 64-bit integers for the bignum work.</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::kind::need	cracked.guide::TAOCP Vol 2::About this phase
TAOCP Vol 2: how do you get the book?	Vol 2, 3rd edition is about $64 new from InformIT, less used. Borrow before you buy: many public and university libraries give you free access to O'Reilly Learning, which carries TAOCP; Libby/OverDrive and interlibrary loan (search WorldCat) work too. Older used editions are fine for Vols 1 to 3; section numbers barely changed. If you buy the eBook, get the PDF from InformIT. Knuth himself warns that the Kindle and ePUB versions mangle the math.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::kind::book	cracked.guide::TAOCP Vol 2::About this phase
TAOCP Vol 2: tips for getting through it?	<ul><li>3.3.3 and parts of 3.5, 4.5.3 and 4.6.2 are heavy math. It is fine to read for ideas and move on.</li><li>Turn the bignum work into a small library with tests; you will reuse it.</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::kind::tips	cracked.guide::TAOCP Vol 2::About this phase
TAOCP §3.1 Introduction: what does it cover?	What &quot;random numbers&quot; means for a computer, why truly random sources are awkward, and a tour of early attempts at generating pseudorandom numbers, including the middle-square method and why many ad hoc generators fail badly.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.1 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::3.1 Introduction
TAOCP §3.1: why does it matter?	Simulations, games, load testing, hashing and cryptography all depend on random numbers. This section is a warning against inventing your own generator.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.1 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::3.1 Introduction
TAOCP §3.1, a common trap: “Believing that complicated means random.” What's the catch?	The section's whole point is that it does not.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.1 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 2::3.1 Introduction
TAOCP §3.1, exercise 1 (rated 20, recommended): what is it asking?	Judge several physical ways of getting a random digit. Sharpens what you actually mean by random.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.1 Introduction
TAOCP §3.1, exercise 3 (rated 10): what is it asking?	One step of the middle-square method by hand.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.1 Introduction
TAOCP §3.1, exercise 5 (rated 15): what is it asking?	Argue why any generator of this kind must eventually repeat, before computing anything.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.1 Introduction
TAOCP §3.1, exercise 6 (rated M21): what is it asking?	Show that a sequence X(n+1) = f(X(n)) is eventually periodic, and find its cycle using almost no memory. This is Floyd's tortoise-and-hare; implement it.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.1 Introduction
TAOCP §3.1, exercise 7 (rated M21, recommended): what is it asking?	Brent's cycle detection with powers of two. Implement it next to exercise 6 and compare function evaluations.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.1 Introduction
TAOCP §3.1, exercise 8 (rated 23): what is it asking?	Exhaustively analyze two-digit middle-square. A small program makes the fate of every seed visible.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.1 Introduction
TAOCP §3.1, exercise 11 (rated M26, recommended): what is it asking?	Probability that a random mapping with a random seed has no repeats for a while. Birthday-paradox thinking.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.1 Introduction
TAOCP §3.1, exercise 12 (rated M31, recommended): what is it asking?	Average cycle length and tail length for a random mapping. The stretch; ties into rho-style factoring later in 4.5.4.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.1 Introduction
TAOCP §3.1: how many exercises, and how are they rated?	23 exercises, rated 10 to M48.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.1 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::3.1 Introduction
TAOCP §3.1: what should you be comfortable with first?	<ul><li>Vol 1 chapter 1 math</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.1 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::3.1 Introduction
TAOCP §3.1: how should you work through it?	Implement the middle-square method and watch it fall into a short cycle. That one experiment teaches the whole section. Read Knuth's story of his own &quot;super-random&quot; generator failing; it is a great lesson in humility.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.1 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::3.1 Introduction
TAOCP §3.2.1 The Linear Congruential Method: what does it cover?	The classic generator X_{n+1} = (aX_n + c) mod m. Knuth covers how to choose the modulus, the exact conditions on a and c for the longest possible period, and the notion of potency that rules out multipliers that are technically fine but bad in practice.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.1 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::3.2.1 The Linear Congruential Method
TAOCP §3.2.1: why does it matter?	LCGs are still inside many standard libraries and games, and knowing their weaknesses (low bits with short periods, patterns in higher dimensions) saves you from subtle simulation bugs.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.1 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::3.2.1 The Linear Congruential Method
Linear congruential generator: what is it?	A linear congruential generator produces pseudorandom numbers by the recurrence X(n+1) = (a X(n) + c) mod m for a fixed multiplier a, increment c and modulus m.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.1 cracked.guide::kind::definition	cracked.guide::TAOCP Vol 2::3.2.1 The Linear Congruential Method
Linear congruential generator: Should I use an LCG today?	For reproducible simulations or games it can be fine with well-tested parameters. Never for anything security related, and modern generators are usually a better default.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.1 cracked.guide::kind::definition	cracked.guide::TAOCP Vol 2::3.2.1 The Linear Congruential Method
TAOCP §3.2.1, a common trap: “Using the low bits of a power-of-two LCG.” What's the catch?	They have tiny periods.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.1 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 2::3.2.1 The Linear Congruential Method
TAOCP §3.2.1, a common trap: “Assuming full period means good quality.” What's the catch?	It does not; the spectral test (3.3.4) is about that.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.1 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 2::3.2.1 The Linear Congruential Method
TAOCP §3.2.1, exercise 2 of §3.2.1 (rated M20, recommended): what is it asking?	If a and m are coprime the seed always comes back. A first taste of why multipliers must be units.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.2.1 The Linear Congruential Method
TAOCP §3.2.1, exercise 6 of §3.2.1.1 (rated 20, recommended): what is it asking?	Swap addition for subtraction in the recurrence and decide whether anything really changes.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.2.1 The Linear Congruential Method
TAOCP §3.2.1, exercise 9 of §3.2.1.1 (rated M25, recommended): what is it asking?	Compute a*x mod m in a language without double-length products, without overflow. The trick behind most portable LCG code.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.2.1 The Linear Congruential Method
TAOCP §3.2.1, exercise 11 of §3.2.1.1 (rated M30): what is it asking?	Push exercise 9 further: evaluate a*x mod m for any multiplier using only small safe operations. The stretch.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.2.1 The Linear Congruential Method
TAOCP §3.2.1, exercise 3 of §3.2.1.2 (rated 13): what is it asking?	Full-period condition for a power-of-ten modulus, specialized from the main theorem. Quick check that you can apply it.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.2.1 The Linear Congruential Method
TAOCP §3.2.1, exercise 6 of §3.2.1.2 (rated 20, recommended): what is it asking?	Find every full-period multiplier for one specific modulus by factoring it.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.2.1 The Linear Congruential Method
TAOCP §3.2.1, exercise 7 of §3.2.1.2 (rated M23, recommended): what is it asking?	Pin down the tail length and period of an arbitrary congruential sequence, not just the full-period case.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.2.1 The Linear Congruential Method
TAOCP §3.2.1, exercise 8 of §3.2.1.3 (rated M26, recommended): what is it asking?	Explain why a generator with low potency fails a simple triples test. The same failure that sank famous real-world generators.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.2.1 The Linear Congruential Method
TAOCP §3.2.1: how many exercises, and how are they rated?	49 exercises, rated 10 to 40.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.1 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::3.2.1 The Linear Congruential Method
TAOCP §3.2.1: what should you be comfortable with first?	<ul><li>1.2.4 Integer Functions and Elementary Number Theory</li><li>3.1 Introduction</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.1 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::3.2.1 The Linear Congruential Method
TAOCP §3.2.1: how should you work through it?	Read 3.2.1.1 (modulus), 3.2.1.2 (multiplier) and 3.2.1.3 (potency). Write an LCG with a small modulus like 16 or 64 and print the full sequence to see the period theorem in action. Then print the lowest bit of a power-of-two-modulus LCG and watch it alternate.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.1 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::3.2.1 The Linear Congruential Method
TAOCP §3.2.2 Other Methods: what does it cover?	Generators beyond the basic LCG: quadratic and higher-order congruences, additive (lagged Fibonacci) generators, combining generators, and shuffling the output of one generator using another to break up patterns.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.2 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::3.2.2 Other Methods
TAOCP §3.2.2: why does it matter?	Modern generators like xorshift, PCG and Mersenne Twister descend from these ideas. Knowing the families helps you judge a library's choice.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.2 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::3.2.2 Other Methods
TAOCP §3.2.2, a common trap: “Thinking combining two weak generators always gives a strong one.” What's the catch?	Sometimes it does, sometimes it does not.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.2 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 2::3.2.2 Other Methods
TAOCP §3.2.2, exercise 1 (rated 12, recommended): what is it asking?	Why generating fractions directly with a floating-point recurrence is a bad idea.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.2.2 Other Methods
TAOCP §3.2.2, exercise 2 (rated M20, recommended): what is it asking?	Show that the plain Fibonacci generator never produces one of the six relative orderings of three consecutive values. A crisp proof of non-randomness.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.2.2 Other Methods
TAOCP §3.2.2, exercise 3 (rated 23): what is it asking?	Run the shuffling algorithms on tiny generators by hand to see what they actually do.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.2.2 Other Methods
TAOCP §3.2.2, exercise 5 (rated 20, recommended): what is it asking?	Use one generator to shuffle itself and compare with Algorithm B.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.2.2 Other Methods
TAOCP §3.2.2, exercise 13 (rated M20): what is it asking?	Adding two generators with coprime periods multiplies the periods. Quick and useful.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.2.2 Other Methods
TAOCP §3.2.2, exercise 23 (rated 20, recommended): what is it asking?	Weigh the subtractive lagged Fibonacci variant against the additive one.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.2.2 Other Methods
TAOCP §3.2.2, exercise 33 (rated M23, recommended): what is it asking?	Jump ahead in a lagged Fibonacci sequence with a polynomial trick. The idea behind seeding parallel streams.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.2.2 Other Methods
TAOCP §3.2.2, exercise 12 (rated M28, recommended): what is it asking?	Find the longest period possible for a second-order recurrence mod a power of two. The stretch.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.2.2 Other Methods
TAOCP §3.2.2: how many exercises, and how are they rated?	37 exercises, rated 00 to M40.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.2 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::3.2.2 Other Methods
TAOCP §3.2.2: what should you be comfortable with first?	<ul><li>3.2.1 The Linear Congruential Method</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.2 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::3.2.2 Other Methods
TAOCP §3.2.2: how should you work through it?	Implement an additive lagged-Fibonacci generator and a shuffling combiner. Do not try to absorb every proof; aim to know what each family is and its main trade-off.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.2.2 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::3.2.2 Other Methods
TAOCP §3.3.1 General Test Procedures: what does it cover?	The statistical machinery for testing a generator: the chi-square test for counts in categories, and the Kolmogorov-Smirnov test for continuous distributions, plus how to read their results without fooling yourself.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.1 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::3.3.1 General Test Procedures
TAOCP §3.3.1: why does it matter?	These tests are how you check any claim of &quot;uniform&quot; or &quot;random&quot;, whether it is a PRNG, a load balancer, or an A/B test bucketing scheme.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.1 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::3.3.1 General Test Procedures
TAOCP §3.3.1: what traps should you watch for?	<ul><li>Treating one failed test as proof of a bad generator, or one pass as proof of a good one.</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.1 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 2::3.3.1 General Test Procedures
TAOCP §3.3.1, exercise 1 (rated 00): what is it asking?	Which row of the chi-square table applies. Make sure degrees of freedom are second nature.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.1 General Test Procedures
TAOCP §3.3.1, exercise 3 (rated 23, recommended): what is it asking?	Run a chi-square test on real loaded-dice data and interpret the outcome.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.1 General Test Procedures
TAOCP §3.3.1, exercise 5 (rated 22): what is it asking?	Compute both KS statistics for a small sample by hand, then check with code.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.1 General Test Procedures
TAOCP §3.3.1, exercise 7 (rated M15): what is it asking?	Basic bounds on the KS statistics. Quick sanity facts.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.1 General Test Procedures
TAOCP §3.3.1, exercise 9 (rated 20, recommended): what is it asking?	What extra information the other one-sided KS statistic would have given in the text's experiment.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.1 General Test Procedures
TAOCP §3.3.1, exercise 10 (rated 20, recommended): what is it asking?	What happens to chi-square if you sneakily count the same data twice. A lesson about inflating sample size.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.1 General Test Procedures
TAOCP §3.3.1, exercise 23 (rated M22): what is it asking?	Compute the KS statistic in linear time without sorting. A neat algorithm to implement.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.1 General Test Procedures
TAOCP §3.3.1, exercise 14 (rated HM26, recommended): what is it asking?	Derive the chi-square approximation from Stirling's formula. The stretch.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.1 General Test Procedures
TAOCP §3.3.1: how many exercises, and how are they rated?	25 exercises, rated 00 to HM48.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.1 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::3.3.1 General Test Procedures
TAOCP §3.3.1: what should you be comfortable with first?	<ul><li>Basic probability and statistics</li><li>3.2 Generating Uniform Random Numbers</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.1 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::3.3.1 General Test Procedures
TAOCP §3.3.1: how should you work through it?	Implement chi-square on dice rolls from a good and a bad generator. Implement KS on uniform floats. Run each test many times and see that even a perfect generator &quot;fails&quot; sometimes; that is the point of p-values.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.1 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::3.3.1 General Test Procedures
TAOCP §3.3.2 Empirical Tests: what does it cover?	A battery of concrete tests for random sequences: equidistribution, serial pairs, gaps, poker hands, coupon collecting, permutations, runs up and down, maximum of t values, and collision tests.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.2 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::3.3.2 Empirical Tests
TAOCP §3.3.2: why does it matter?	These are the ancestors of modern test suites like TestU01 and PractRand. Writing a few yourself gives you a feel for how generators fail.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.2 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::3.3.2 Empirical Tests
TAOCP §3.3.2, a common trap: “The runs test has correlated statistics; Knuth explains why a plain chi-square is wrong there.” What's the catch?	Read that part carefully.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.2 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 2::3.3.2 Empirical Tests
TAOCP §3.3.2, exercise 7 (rated 08): what is it asking?	Run the coupon collector's test by hand on a short ternary sequence.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.2 Empirical Tests
TAOCP §3.3.2, exercise 12 (rated 20): what is it asking?	Write the run-length counter for the runs test. Programming warm-up.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.2 Empirical Tests
TAOCP §3.3.2, exercise 3 (rated M20, recommended): what is it asking?	Expected length of input consumed by the gap test, with its spread.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.2 Empirical Tests
TAOCP §3.3.2, exercise 8 (rated M22, recommended): what is it asking?	Same question for the coupon collector's test. Uses the harmonic numbers from Vol 1.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.2 Empirical Tests
TAOCP §3.3.2, exercise 14 (rated M15, recommended): what is it asking?	Discarding one element after each run makes run lengths independent, so a plain chi-square works.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.2 Empirical Tests
TAOCP §3.3.2, exercise 16 (rated 15, recommended): what is it asking?	Spot the flaw in a clever-looking shortcut for the maximum-of-t test.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.2 Empirical Tests
TAOCP §3.3.2, exercise 31 (rated M21, recommended): what is it asking?	Show that the low bits of a lagged Fibonacci generator fail a simple test. Generators can be bad in specific bits.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.2 Empirical Tests
TAOCP §3.3.2, exercise 27 (rated HM26, recommended): what is it asking?	Iterated spacings of uniform samples keep the same distribution. The stretch.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.2 Empirical Tests
TAOCP §3.3.2: how many exercises, and how are they rated?	35 exercises, rated 00 to M46.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.2 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::3.3.2 Empirical Tests
TAOCP §3.3.2: what should you be comfortable with first?	<ul><li>3.3.1 General Test Procedures</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.2 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::3.3.2 Empirical Tests
TAOCP §3.3.2: how should you work through it?	Pick three tests (gap, poker, runs are good choices) and implement them against both a decent generator and a bad LCG. You do not need to implement all of them.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.2 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::3.3.2 Empirical Tests
TAOCP §3.3.3 Theoretical Tests: what does it cover?	Instead of running a generator, analyze it mathematically: for example, compute the serial correlation of an LCG exactly from its parameters. This brings in some heavy number theory, including Dedekind sums.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.3 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::3.3.3 Theoretical Tests
TAOCP §3.3.3: why does it matter?	Honestly, this is one of the more specialized sections for a working programmer. The takeaway is that you can sometimes prove a generator is bad without running it.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.3 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::3.3.3 Theoretical Tests
TAOCP §3.3.3, a common trap: “Burning out here.” What's the catch?	It is fine to skim.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.3 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 2::3.3.3 Theoretical Tests
TAOCP §3.3.3, exercise 1 (rated M10): what is it asking?	Write x mod y with the sawtooth function. Warms up the notation.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.3 Theoretical Tests
TAOCP §3.3.3, exercise 2 (rated M20): what is it asking?	Prove the replicative law for the sawtooth function.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.3 Theoretical Tests
TAOCP §3.3.3, exercise 4 (rated M19, recommended): what is it asking?	How large the key quantity of the serial-correlation theorem can be for a given potency.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.3 Theoretical Tests
TAOCP §3.3.3, exercise 14 (rated M20, recommended): what is it asking?	Explain an observed high serial correlation from the generator's parameters. Theory predicting a real failure.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.3 Theoretical Tests
TAOCP §3.3.3, exercise 17 (rated M22): what is it asking?	Evaluate generalized Dedekind sums with integer-only arithmetic. An algorithm worth coding.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.3 Theoretical Tests
TAOCP §3.3.3, exercise 22 (rated M22, recommended): what is it asking?	Real-number version of the up-down probability theorem. Shows where the answer comes from without number theory.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.3 Theoretical Tests
TAOCP §3.3.3, exercise 19 (rated M23, recommended): what is it asking?	Analyze the serial test over the full period with generalized Dedekind sums.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.3 Theoretical Tests
TAOCP §3.3.3, exercise 24 (rated M29): what is it asking?	Probability of a descending run of length t in the real-number model. The stretch.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.3 Theoretical Tests
TAOCP §3.3.3: how many exercises, and how are they rated?	28 exercises, rated M10 to M40.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.3 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::3.3.3 Theoretical Tests
TAOCP §3.3.3: what should you be comfortable with first?	<ul><li>3.3.2 Empirical Tests</li><li>1.2.4 Number theory</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.3 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::3.3.3 Theoretical Tests
TAOCP §3.3.3: how should you work through it?	Read for the main results and the intuition. It is fine to skim the Dedekind sum derivations. Spend the time you save on finishing 3.3.2 implementations.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.3 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::3.3.3 Theoretical Tests
TAOCP §3.3.4 The Spectral Test: what does it cover?	The most important test for LCGs: in t dimensions, successive tuples from an LCG lie on a set of parallel hyperplanes, and the spectral test measures how far apart those planes are. Knuth gives an algorithm to compute it and tables of good and bad multipliers.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.4 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::3.3.4 The Spectral Test
TAOCP §3.3.4: why does it matter?	This explains disasters like IBM's RANDU, whose triples fall on just 15 planes. It is the reason you should not trust a generator just because its 1D histogram looks flat.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.4 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::3.3.4 The Spectral Test
TAOCP §3.3.4, a common trap: “Getting lost in lattice-reduction details.” What's the catch?	The picture is what matters.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.4 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 2::3.3.4 The Spectral Test
TAOCP §3.3.4, exercise 1 (rated M10): what is it asking?	What the spectral test means in one dimension. Checks the definition.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.4 The Spectral Test
TAOCP §3.3.4, exercise 8 (rated M16): what is it asking?	How bad two-dimensional accuracy can be while three-dimensional accuracy stays fine.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.4 The Spectral Test
TAOCP §3.3.4, exercise 4 (rated M23, recommended): what is it asking?	The two-dimensional lattice basis behind the test. The geometry in miniature.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.4 The Spectral Test
TAOCP §3.3.4, exercise 14 (rated 24): what is it asking?	Run Algorithm S by hand on a tiny generator. Do this before coding it.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.4 The Spectral Test
TAOCP §3.3.4, exercise 15 (rated M20, recommended): what is it asking?	Count how many parallel hyperplanes cut the unit cube. Connects the abstract number to the picture.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.4 The Spectral Test
TAOCP §3.3.4, exercise 21 (rated M20): what is it asking?	Analyze the lattice when an application throws away some outputs.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.4 The Spectral Test
TAOCP §3.3.4, exercise 32 (rated M21, recommended): what is it asking?	Show that a well-known combined generator is close to one big linear congruential generator, so the spectral test applies to it.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.4 The Spectral Test
TAOCP §3.3.4, exercise 24 (rated M28, recommended): what is it asking?	Extend the spectral test to second-order recurrences. The stretch.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.3.4 The Spectral Test
TAOCP §3.3.4: how many exercises, and how are they rated?	32 exercises, rated M10 to HM47.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.4 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::3.3.4 The Spectral Test
TAOCP §3.3.4: what should you be comfortable with first?	<ul><li>3.2.1 The Linear Congruential Method</li><li>Basic linear algebra (vectors, dot products)</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.4 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::3.3.4 The Spectral Test
TAOCP §3.3.4: how should you work through it?	Before reading, plot (X_n, X_{n+1}) for a small LCG and see the lines. Plot RANDU triples in 3D. Then read the spectral test algorithm for the ideas. Following every step of the algorithm is optional.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.3.4 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::3.3.4 The Spectral Test
TAOCP §3.4.1 Numerical Distributions: what does it cover?	Turning uniform random numbers into other distributions: random integers in a range, general discrete distributions (including the alias method), the normal distribution via the polar method and others, and exponential, gamma, binomial and Poisson distributions.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.1 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::3.4.1 Numerical Distributions
TAOCP §3.4.1: why does it matter?	Every simulation, game loot table and load generator needs non-uniform randomness. The modulo-bias trap for random integers is one of the most common bugs in real code.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.1 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::3.4.1 Numerical Distributions
TAOCP §3.4.1: what traps should you watch for?	<ul><li>Using rand() % k, which is biased when the generator range is not a multiple of k.</li><li>Taking the low bits of a weak generator for small ranges.</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.1 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 2::3.4.1 Numerical Distributions
TAOCP §3.4.1, exercise 1 (rated 10): what is it asking?	Uniform on an arbitrary interval. Quick.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.4.1 Numerical Distributions
TAOCP §3.4.1, exercise 2 (rated M16): what is it asking?	Exact bias of turning a random fraction into an integer in [0, k). Quantifies the rand() % k problem.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.4.1 Numerical Distributions
TAOCP §3.4.1, exercise 3 (rated 14, recommended): what is it asking?	Dividing versus multiplying to get a random integer, and which bits each one uses.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.4.1 Numerical Distributions
TAOCP §3.4.1, exercise 5 (rated 21, recommended): what is it asking?	Sample from a mixture of simple distributions efficiently.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.4.1 Numerical Distributions
TAOCP §3.4.1, exercise 7 (rated 20, recommended): what is it asking?	The cubes-in-boxes construction behind Walker's alias method. Implement it.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.4.1 Numerical Distributions
TAOCP §3.4.1, exercise 17 (rated M24, recommended): what is it asking?	Distribution, generating function, mean and spread of the geometric distribution.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.4.1 Numerical Distributions
TAOCP §3.4.1, exercise 29 (rated M20): what is it asking?	Generate n sorted uniforms in linear time without sorting.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.4.1 Numerical Distributions
TAOCP §3.4.1, exercise 11 (rated HM27, recommended): what is it asking?	Prove that the tail steps of the normal generator produce the correct distribution. The stretch.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.4.1 Numerical Distributions
TAOCP §3.4.1: how many exercises, and how are they rated?	33 exercises, rated 10 to HM40.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.1 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::3.4.1 Numerical Distributions
TAOCP §3.4.1: what should you be comfortable with first?	<ul><li>3.2 Generating Uniform Random Numbers</li><li>Basic probability distributions</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.1 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::3.4.1 Numerical Distributions
TAOCP §3.4.1: how should you work through it?	Implement: unbiased random integer in [0, k), the alias method for a weighted die, and the polar method for normals. Histogram each to check. Skim the more exotic distributions.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.1 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::3.4.1 Numerical Distributions
TAOCP §3.4.2 Random Sampling and Shuffling: what does it cover?	Picking n records at random from N, both when N is known (selection sampling) and when it is not known in advance (reservoir sampling), and shuffling an array uniformly.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.2 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::3.4.2 Random Sampling and Shuffling
TAOCP §3.4.2: why does it matter?	Reservoir sampling and the Fisher-Yates shuffle are must-know algorithms. Getting the shuffle subtly wrong is a famous bug in real products.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.2 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::3.4.2 Random Sampling and Shuffling
Fisher-Yates shuffle: what is it?	The Fisher-Yates shuffle produces a uniformly random permutation of an array in one pass by swapping each position with a randomly chosen position at or before it.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.2 cracked.guide::kind::definition	cracked.guide::TAOCP Vol 2::3.4.2 Random Sampling and Shuffling
Fisher-Yates shuffle: Why is it called the Knuth shuffle?	Fisher and Yates published a pencil-and-paper version in 1938; Durstenfeld gave the computer version in 1964; Knuth popularized it in TAOCP.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.2 cracked.guide::kind::definition	cracked.guide::TAOCP Vol 2::3.4.2 Random Sampling and Shuffling
TAOCP §3.4.2, a common trap: “Swapping with a random index from the whole array instead of the remaining part.” What's the catch?	That gives a biased shuffle.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.2 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 2::3.4.2 Random Sampling and Shuffling
TAOCP §3.4.2: what traps should you watch for?	<ul><li>Off-by-one on the range of the random index.</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.2 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 2::3.4.2 Random Sampling and Shuffling
TAOCP §3.4.2, exercise 3 (rated 22, recommended): what is it asking?	Resolve the apparent paradox that the selection probability changes but the sample is still fair.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.4.2 Random Sampling and Shuffling
TAOCP §3.4.2, exercise 9 (rated 12): what is it asking?	Run reservoir sampling by hand with given random numbers.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.4.2 Random Sampling and Shuffling
TAOCP §3.4.2, exercise 10 (rated 15): what is it asking?	Reservoir sampling without the reservoir file when the sample fits in memory. The version most people use.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.4.2 Random Sampling and Shuffling
TAOCP §3.4.2, exercise 7 (rated M25): what is it asking?	Prove that every subset is equally likely under selection sampling.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.4.2 Random Sampling and Shuffling
TAOCP §3.4.2, exercise 16 (rated M25, recommended): what is it asking?	Sample with hashing in O(n) space and time and output it sorted.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.4.2 Random Sampling and Shuffling
TAOCP §3.4.2, exercise 17 (rated M22): what is it asking?	Prove Floyd's elegant sampling algorithm correct.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.4.2 Random Sampling and Shuffling
TAOCP §3.4.2, exercise 15 (rated 30, recommended): what is it asking?	Get a random permutation of a random combination cheaply by stopping the shuffle early.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.4.2 Random Sampling and Shuffling
TAOCP §3.4.2, exercise 8 (rated M39, recommended): what is it asking?	Vitter's method of skipping records instead of testing each one. The stretch.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.4.2 Random Sampling and Shuffling
TAOCP §3.4.2: how many exercises, and how are they rated?	17 exercises, rated M12 to M39.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.2 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::3.4.2 Random Sampling and Shuffling
TAOCP §3.4.2: what should you be comfortable with first?	<ul><li>3.4.1 Numerical Distributions</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.2 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::3.4.2 Random Sampling and Shuffling
TAOCP §3.4.2: how should you work through it?	Implement the shuffle and verify by running it a million times on a 3-element array and counting all 6 outcomes. Then implement the &quot;naive&quot; swap-with-any-position shuffle and see its bias. Implement reservoir sampling over a stream read from stdin.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.4.2 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::3.4.2 Random Sampling and Shuffling
TAOCP §3.5 What Is a Random Sequence?: what does it cover?	A philosophical and mathematical attempt to define randomness for infinite and finite sequences, building up through stronger and stronger definitions and touching on what later became algorithmic (Kolmogorov) complexity.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.5 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::3.5 What Is a Random Sequence?
TAOCP §3.5: why does it matter?	Mostly for intellectual depth, but it sharpens your intuition about why &quot;passes some tests&quot; can never fully define random, and connects to compression and cryptography.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.5 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::3.5 What Is a Random Sequence?
TAOCP §3.5, a common trap: “Expecting a practical takeaway on every page.” What's the catch?	This one is about understanding.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.5 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 2::3.5 What Is a Random Sequence?
TAOCP §3.5, exercise 1 (rated 10): what is it asking?	Can a periodic sequence be equidistributed? Quick test of the definition.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.5 What Is a Random Sequence?
TAOCP §3.5, exercise 2 (rated 10): what is it asking?	Check k-distribution of a simple periodic bit pattern for small k.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.5 What Is a Random Sequence?
TAOCP §3.5, exercise 3 (rated M22): what is it asking?	Build a periodic ternary sequence that is 3-distributed. De Bruijn sequences in disguise.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.5 What Is a Random Sequence?
TAOCP §3.5, exercise 5 (rated HM22, recommended): what is it asking?	A sequence whose limiting frequency does not exist. Shows why the definitions need care.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.5 What Is a Random Sequence?
TAOCP §3.5, exercise 11 (rated M10): what is it asking?	Every other element of an infinitely distributed sequence is again infinitely distributed.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.5 What Is a Random Sequence?
TAOCP §3.5, exercise 44 (rated 16, recommended): what is it asking?	Can a valid table of random digits contain exactly one misprint? A fun puzzle with a real point.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.5 What Is a Random Sequence?
TAOCP §3.5, exercise 42 (rated M28, recommended): what is it asking?	Pairwise independence and Chebyshev's inequality. Useful well beyond this section.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.5 What Is a Random Sequence?
TAOCP §3.5, exercise 22 (rated HM30, recommended): what is it asking?	Weyl's criterion for k-distribution via exponential sums. The stretch.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.5 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.5 What Is a Random Sequence?
TAOCP §3.5: how many exercises, and how are they rated?	44 exercises, rated 10 to HM50.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.5 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::3.5 What Is a Random Sequence?
TAOCP §3.5: what should you be comfortable with first?	<ul><li>3.3 Statistical Tests</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.5 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::3.5 What Is a Random Sequence?
TAOCP §3.5: how should you work through it?	Read for ideas. Follow the sequence of definitions and why each one is too weak. The heavy proofs can be skimmed on a first pass.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.5 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::3.5 What Is a Random Sequence?
TAOCP §3.6 Summary: what does it cover?	Knuth's practical summary of chapter 3: concrete advice on what kind of generator to use, how to use it, and what to avoid.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.6 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::3.6 Summary
TAOCP §3.6: why does it matter?	The most directly practical few pages in the chapter.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.6 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::3.6 Summary
TAOCP §3.6, a common trap: “Using this advice for cryptography.” What's the catch?	Crypto needs a CSPRNG, a different problem.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.6 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 2::3.6 Summary
TAOCP §3.6, exercise 2 (rated 15, recommended): what is it asking?	A light philosophical question about whether computers can do anything new.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.6 Summary
TAOCP §3.6, exercise 8 (rated M15): what is it asking?	How to check that an LCG implementation is correct. Practical test design.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.6 Summary
TAOCP §3.6, exercise 12 (rated M21, recommended): what is it asking?	Choose a generator for a machine with 16-bit integers only.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.6 Summary
TAOCP §3.6, exercise 3 (rated 32): what is it asking?	Simulate the dice game craps and estimate the odds. A full small simulation project.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.6 Summary
TAOCP §3.6, exercise 15 (rated 25, recommended): what is it asking?	Wrap the recommended generator so it discards most of each batch as advised.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.6 Summary
TAOCP §3.6, exercise 11 (rated M25, recommended): what is it asking?	Port the recommended generator to floating-point arithmetic with exactly the same output.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.6 Summary
TAOCP §3.6, exercise 7 (rated M40, recommended): what is it asking?	Break a file cipher built on an LCG with unknown parameters. The stretch, and a lesson for crypto.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.6 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::3.6 Summary
TAOCP §3.6: how many exercises, and how are they rated?	15 exercises, rated 15 to 46.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.6 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::3.6 Summary
TAOCP §3.6: what should you be comfortable with first?	<ul><li>Chapter 3</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.6 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::3.6 Summary
TAOCP §3.6: how should you work through it?	Read it and compare with what your language's standard library uses. Write down which generator your main language uses and whether it would pass Knuth's advice.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::3.6 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::3.6 Summary
TAOCP §4.1 Positional Number Systems: what does it cover?	Number representations: binary, octal, hex, and exotic systems like negative bases, balanced ternary, and mixed radix. Knuth also covers a little history of how positional notation developed.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.1 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::4.1 Positional Number Systems
TAOCP §4.1: why does it matter?	Bit manipulation, encodings and serialization formats all depend on fluent radix thinking. Mixed radix is how you convert time units and index multi-dimensional arrays.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.1 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::4.1 Positional Number Systems
TAOCP §4.1, a common trap: “Rushing through the negative-base examples.” What's the catch?	They are fun and they check your understanding.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.1 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 2::4.1 Positional Number Systems
TAOCP §4.1, exercise 1 (rated 15): what is it asking?	Write small integers in base -2. Drill.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.1 Positional Number Systems
TAOCP §4.1, exercise 9 (rated 15, recommended): what is it asking?	Octal to hexadecimal by regrouping bits.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.1 Positional Number Systems
TAOCP §4.1, exercise 2 (rated 24, recommended): what is it asking?	Express a few numbers in four unusual systems. Shows the tradeoffs side by side.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.1 Positional Number Systems
TAOCP §4.1, exercise 11 (rated 22): what is it asking?	Design negabinary addition.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.1 Positional Number Systems
TAOCP §4.1, exercise 13 (rated M21, recommended): what is it asking?	Whether expansions in base -10 can be ambiguous, like 0.999... in decimal.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.1 Positional Number Systems
TAOCP §4.1, exercise 19 (rated 23, recommended): what is it asking?	Which digit sets let every integer be written in a given base.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.1 Positional Number Systems
TAOCP §4.1, exercise 34 (rated 22, recommended): what is it asking?	Write an integer with digits -1, 0, 1 using the fewest nonzero digits. Used in fast exponentiation and hardware multipliers.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.1 Positional Number Systems
TAOCP §4.1, exercise 31 (rated M35, recommended): what is it asking?	2-adic numbers as infinite two's complement. The stretch.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.1 Positional Number Systems
TAOCP §4.1: how many exercises, and how are they rated?	34 exercises, rated 00 to M40.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.1 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::4.1 Positional Number Systems
TAOCP §4.1: what should you be comfortable with first?	<ul><li>1.2.4 Integer Functions</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.1 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::4.1 Positional Number Systems
TAOCP §4.1: how should you work through it?	Convert a few numbers to base -2 and balanced ternary by hand. Write a function that converts to any mixed radix.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.1 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::4.1 Positional Number Systems
TAOCP §4.2.1 Single-Precision Calculations: what does it cover?	How floating-point numbers are stored (sign, exponent, fraction) and the algorithms for add, subtract, multiply and divide, including normalization and rounding. Knuth uses his own floating format on MIX, not IEEE 754.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.1 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::4.2.1 Single-Precision Calculations
TAOCP §4.2.1: why does it matter?	Floats are in almost every program and most programmers have only a vague model of them. Implementing float addition yourself is the fastest way to understand why 0.1 + 0.2 is not 0.3.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.1 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::4.2.1 Single-Precision Calculations
TAOCP §4.2.1, a common trap: “Assuming Knuth's format matches IEEE 754.” What's the catch?	The ideas transfer, the bit layouts do not.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.1 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 2::4.2.1 Single-Precision Calculations
TAOCP §4.2.1, exercise 1 (rated 10): what is it asking?	Encode two physical constants in a toy floating-point format.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.1 Single-Precision Calculations
TAOCP §4.2.1, exercise 3 (rated 11): what is it asking?	The hidden leading bit trick. IEEE 754 uses it.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.1 Single-Precision Calculations
TAOCP §4.2.1, exercise 4 (rated 16): what is it asking?	Trace floating addition on concrete inputs, including a catastrophic one.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.1 Single-Precision Calculations
TAOCP §4.2.1, exercise 10 (rated 12): what is it asking?	Find a case where rounding pushes the fraction past 1 during addition.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.1 Single-Precision Calculations
TAOCP §4.2.1, exercise 16 (rated HM21): what is it asking?	Divide complex numbers without overflow. Smith's algorithm is still used today.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.1 Single-Precision Calculations
TAOCP §4.2.1, exercise 15 (rated 28, recommended): what is it asking?	Write the fractional-part routine and handle tiny and huge inputs carefully.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.1 Single-Precision Calculations
TAOCP §4.2.1, exercise 13 (rated 30): what is it asking?	Directed rounding for interval arithmetic.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.1 Single-Precision Calculations
TAOCP §4.2.1, exercise 12 (rated M25): what is it asking?	Prove that rounding overflow cannot happen when normalizing a quotient. The stretch.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.1 Single-Precision Calculations
TAOCP §4.2.1: how many exercises, and how are they rated?	19 exercises, rated 10 to 40.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.1 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::4.2.1 Single-Precision Calculations
TAOCP §4.2.1: what should you be comfortable with first?	<ul><li>4.1 Positional Number Systems</li><li>Basic MIX</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.1 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::4.2.1 Single-Precision Calculations
TAOCP §4.2.1: how should you work through it?	Read alongside the IEEE 754 Wikipedia page so you can map Knuth's concepts to real hardware. Implement float addition on a toy format (say 8-bit exponent and 16-bit fraction) in C using integers.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.1 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::4.2.1 Single-Precision Calculations
TAOCP §4.2.2 Accuracy of Floating Point Arithmetic: what does it cover?	Error analysis for floating point: which algebraic laws survive (commutativity does), which break (associativity, distributivity), and how to reason about the error of a sequence of operations.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.2 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::4.2.2 Accuracy of Floating Point Arithmetic
TAOCP §4.2.2: why does it matter?	This is the section that teaches you why summing an array in a different order changes the answer, and how to write numeric code that does not drift.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.2 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::4.2.2 Accuracy of Floating Point Arithmetic
TAOCP §4.2.2: what traps should you watch for?	<ul><li>Comparing floats with == in tests.</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.2 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 2::4.2.2 Accuracy of Floating Point Arithmetic
TAOCP §4.2.2, exercise 4 (rated 10): what is it asking?	Can regrouping a product change whether it overflows?	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.2 Accuracy of Floating Point Arithmetic
TAOCP §4.2.2, exercise 3 (rated M20): what is it asking?	Find concrete numbers where floating multiplication is not associative.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.2 Accuracy of Floating Point Arithmetic
TAOCP §4.2.2, exercise 8 (rated 20, recommended): what is it asking?	Apply the approximate-equality relations to concrete pairs. Builds intuition for tolerance comparisons.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.2 Accuracy of Floating Point Arithmetic
TAOCP §4.2.2, exercise 25 (rated 15, recommended): what is it asking?	Why blaming cancellation is usually blaming the wrong step.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.2 Accuracy of Floating Point Arithmetic
TAOCP §4.2.2, exercise 15 (rated M24, recommended): what is it asking?	Does the computed midpoint of an interval always lie inside it? Classic binary-search trap.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.2 Accuracy of Floating Point Arithmetic
TAOCP §4.2.2, exercise 13 (rated M25, recommended): what is it asking?	Doing exact integer arithmetic on top of floating point and when it stays exact.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.2 Accuracy of Floating Point Arithmetic
TAOCP §4.2.2, exercise 23 (rated M26, recommended): what is it asking?	Check an identity about rounding down that looks obviously true.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.2 Accuracy of Floating Point Arithmetic
TAOCP §4.2.2, exercise 19 (rated M30, recommended): what is it asking?	Error analysis of Kahan's compensated summation. The stretch, and worth implementing.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.2 Accuracy of Floating Point Arithmetic
TAOCP §4.2.2: how many exercises, and how are they rated?	31 exercises, rated 10 to M40.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.2 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::4.2.2 Accuracy of Floating Point Arithmetic
TAOCP §4.2.2: what should you be comfortable with first?	<ul><li>4.2.1 Single-Precision Calculations</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.2 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::4.2.2 Accuracy of Floating Point Arithmetic
TAOCP §4.2.2: how should you work through it?	Write programs that demonstrate non-associativity and catastrophic cancellation. Implement Kahan compensated summation (widely documented) and compare to naive summation.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.2 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::4.2.2 Accuracy of Floating Point Arithmetic
TAOCP §4.2.3 Double-Precision Calculations: what does it cover?	Building higher-precision floating arithmetic out of single-precision operations, with care for carries and rounding.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.3 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::4.2.3 Double-Precision Calculations
TAOCP §4.2.3: why does it matter?	The same idea powers double-double and quad-double libraries used when 64-bit floats are not enough.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.3 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::4.2.3 Double-Precision Calculations
TAOCP §4.2.3, exercise 1 (rated 16): what is it asking?	Run the double-precision division idea by hand on small decimal numbers.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.3 Double-Precision Calculations
TAOCP §4.2.3, exercise 2 (rated 20): what is it asking?	Whether clearing a register would actually improve accuracy.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.3 Double-Precision Calculations
TAOCP §4.2.3, exercise 3 (rated M20): what is it asking?	Why one of the routines can never overflow.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.3 Double-Precision Calculations
TAOCP §4.2.3, exercise 6 (rated 23): what is it asking?	Convert between single and double precision formats.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.3 Double-Precision Calculations
TAOCP §4.2.3, exercise 7 (rated M30, recommended): what is it asking?	Bound the relative error of the double-precision routines. The stretch.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.3 Double-Precision Calculations
TAOCP §4.2.3: how many exercises, and how are they rated?	9 exercises, rated 16 to M42.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.3 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::4.2.3 Double-Precision Calculations
TAOCP §4.2.3: what should you be comfortable with first?	<ul><li>4.2.2 Accuracy of Floating Point Arithmetic</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.3 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::4.2.3 Double-Precision Calculations
TAOCP §4.2.3: how should you work through it?	Read for the method. Skim MIX-heavy details. If you are curious, look up the two-sum trick, which is the modern building block.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.3 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::4.2.3 Double-Precision Calculations
TAOCP §4.2.4 Distribution of Floating Point Numbers: what does it cover?	Why leading digits of real-world numbers are not uniformly distributed but follow a logarithmic law (smaller leading digits are more common), and what that means for floating-point error.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.4 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::4.2.4 Distribution of Floating Point Numbers
TAOCP §4.2.4: why does it matter?	Benford's law is a famous, surprising result that has real uses, including fraud detection. It also explains why some rounding error estimates are pessimistic.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.4 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::4.2.4 Distribution of Floating Point Numbers
TAOCP §4.2.4, exercise 1 (rated 13): what is it asking?	Estimate how often addition needs a normalizing shift, from the tables.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.4 Distribution of Floating Point Numbers
TAOCP §4.2.4, exercise 3 (rated 15): what is it asking?	Probability of given leading digits under the logarithmic law.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.4 Distribution of Floating Point Numbers
TAOCP §4.2.4, exercise 5 (rated M20, recommended): what is it asking?	Leading digits of a uniform random number. A contrast with the log law.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.4 Distribution of Floating Point Numbers
TAOCP §4.2.4, exercise 11 (rated M15): what is it asking?	The reciprocal of a log-law number follows the same law.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.4 Distribution of Floating Point Numbers
TAOCP §4.2.4, exercise 13 (rated M20, recommended): what is it asking?	How often the floating multiply needs its extra shift.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.4 Distribution of Floating Point Numbers
TAOCP §4.2.4, exercise 19 (rated HM25): what is it asking?	Leading digits of Fibonacci numbers obey the log law. Try it in code first.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.4 Distribution of Floating Point Numbers
TAOCP §4.2.4, exercise 14 (rated HM30, recommended): what is it asking?	Distribution of the result of adding two log-law numbers. The stretch.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.2.4 Distribution of Floating Point Numbers
TAOCP §4.2.4: how many exercises, and how are they rated?	20 exercises, rated 13 to 42.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.4 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::4.2.4 Distribution of Floating Point Numbers
TAOCP §4.2.4: what should you be comfortable with first?	<ul><li>4.2.2 Accuracy of Floating Point Arithmetic</li><li>1.2.2 Logarithms</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.4 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::4.2.4 Distribution of Floating Point Numbers
TAOCP §4.2.4: how should you work through it?	Download any numeric dataset (populations, file sizes) and check the leading-digit distribution. Then read the explanation.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.4 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::4.2.4 Distribution of Floating Point Numbers
TAOCP §4.3.1 The Classical Algorithms: what does it cover?	Grade-school arithmetic on arbitrarily long integers: addition, subtraction, multiplication and especially long division, where Knuth gives a careful algorithm for estimating each quotient digit and proves it is almost always right.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.1 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::4.3.1 The Classical Algorithms
TAOCP §4.3.1: why does it matter?	Every bignum library (Python ints, Java BigInteger, crypto libraries) is built on these. The long division algorithm is notoriously easy to get subtly wrong.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.1 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::4.3.1 The Classical Algorithms
TAOCP §4.3.1: what traps should you watch for?	<ul><li>Forgetting to normalize the divisor before division.</li><li>Overflow in the quotient-digit estimate.</li><li>Edge cases: divisor with one digit, leading zero digits, dividend smaller than divisor.</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.1 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 2::4.3.1 The Classical Algorithms
TAOCP §4.3.1, exercise 6 (rated 22, recommended): what is it asking?	Add left to right without ever revising a digit you have already written.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.3.1 The Classical Algorithms
TAOCP §4.3.1, exercise 16 (rated 20, recommended): what is it asking?	Short division by a single digit. You will use it constantly.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.3.1 The Classical Algorithms
TAOCP §4.3.1, exercise 19 (rated M21, recommended): what is it asking?	The refinement that makes the trial quotient digit almost always correct.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.3.1 The Classical Algorithms
TAOCP §4.3.1, exercise 22 (rated 24, recommended): what is it asking?	Find a case where the rare add-back step is needed. Use it as a test case.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.3.1 The Classical Algorithms
TAOCP §4.3.1, exercise 37 (rated 20, recommended): what is it asking?	Skip normalization when the scale factor is a power of two.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.3.1 The Classical Algorithms
TAOCP §4.3.1, exercise 41 (rated M26, recommended): what is it asking?	Montgomery multiplication for repeated work modulo a fixed number. The basis of fast modular exponentiation.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.3.1 The Classical Algorithms
TAOCP §4.3.1, exercise 43 (rated 22, recommended): what is it asking?	Exact rounded scaling of 8-bit color values without division. A real graphics trick.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.3.1 The Classical Algorithms
TAOCP §4.3.1, exercise 28 (rated M30): what is it asking?	Svoboda's idea for making the divisor easy to divide by. The stretch.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.3.1 The Classical Algorithms
TAOCP §4.3.1: how many exercises, and how are they rated?	43 exercises, rated 10 to 42.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.1 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::4.3.1 The Classical Algorithms
TAOCP §4.3.1: what should you be comfortable with first?	<ul><li>4.1 Positional Number Systems</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.1 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::4.3.1 The Classical Algorithms
TAOCP §4.3.1: how should you work through it?	Implement all four operations for numbers stored as arrays of 32-bit digits in C, with 64-bit intermediates. Test against Python's integers on random inputs. Spend most of the time on division and its normalization step.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.1 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::4.3.1 The Classical Algorithms
TAOCP §4.3.2 Modular Arithmetic: what does it cover?	Representing big numbers by their remainders modulo several coprime moduli, so that addition and multiplication become independent small operations, then reconstructing the answer with the Chinese remainder theorem.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.2 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::4.3.2 Modular Arithmetic
TAOCP §4.3.2: why does it matter?	Residue number systems are used in cryptography and in fast polynomial and integer arithmetic. CRT also shows up in competitive programming and hashing.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.2 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::4.3.2 Modular Arithmetic
TAOCP §4.3.2: what traps should you watch for?	<ul><li>Moduli that are not pairwise coprime break the reconstruction.</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.2 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 2::4.3.2 Modular Arithmetic
TAOCP §4.3.2, exercise 1 (rated 20): what is it asking?	Solve a small Chinese remainder problem by hand.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.3.2 Modular Arithmetic
TAOCP §4.3.2, exercise 4 (rated 20): what is it asking?	Keep choosing moduli greedily as the text does.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.3.2 Modular Arithmetic
TAOCP §4.3.2, exercise 3 (rated M26, recommended): what is it asking?	The Chinese remainder theorem when moduli share factors.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.3.2 Modular Arithmetic
TAOCP §4.3.2, exercise 5 (rated M23, recommended): what is it asking?	Does the greedy choice of moduli give the best product?	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.3.2 Modular Arithmetic
TAOCP §4.3.2, exercise 7 (rated M21, recommended): what is it asking?	Rearrange the mixed-radix reconstruction to save work.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.3.2 Modular Arithmetic
TAOCP §4.3.2, exercise 12 (rated M10): what is it asking?	Detecting overflow in modular addition is a comparison problem.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.3.2 Modular Arithmetic
TAOCP §4.3.2, exercise 13 (rated M25, recommended): what is it asking?	Find all decimal automorphs like 9376. A fun application of the theorem.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.3.2 Modular Arithmetic
TAOCP §4.3.2, exercise 14 (rated M30, recommended): what is it asking?	Cyclic convolution and multiplication modulo a Mersenne-style number. The stretch, and a bridge to 4.3.3.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.3.2 Modular Arithmetic
TAOCP §4.3.2: how many exercises, and how are they rated?	14 exercises, rated M10 to M30.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.2 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::4.3.2 Modular Arithmetic
TAOCP §4.3.2: what should you be comfortable with first?	<ul><li>4.3.1 The Classical Algorithms</li><li>1.2.4 Number theory</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.2 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::4.3.2 Modular Arithmetic
TAOCP §4.3.2: how should you work through it?	Implement CRT reconstruction for three small moduli and test it. Make sure you can compute a modular inverse with extended Euclid.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.2 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::4.3.2 Modular Arithmetic
TAOCP §4.3.3 How Fast Can We Multiply?: what does it cover?	Faster-than-schoolbook multiplication: splitting numbers in halves to trade a multiplication for additions (Karatsuba-style), Toom-Cook generalizations, and the Fourier transform approach that leads to Schonhage-Strassen.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.3 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::4.3.3 How Fast Can We Multiply?
TAOCP §4.3.3: why does it matter?	These ideas are behind every fast bignum library and are a beautiful example of divide and conquer and of how the FFT connects to arithmetic.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.3 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::4.3.3 How Fast Can We Multiply?
TAOCP §4.3.3, a common trap: “Recursing all the way down to single digits.” What's the catch?	Switch to schoolbook below a threshold.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.3 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 2::4.3.3 How Fast Can We Multiply?
TAOCP §4.3.3, exercise 1 (rated 22): what is it asking?	Karatsuba in decimal, by hand, on four-digit numbers.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.3.3 How Fast Can We Multiply?
TAOCP §4.3.3, exercise 8 (rated M20): what is it asking?	Can you skip the bit reversal in the FFT? A common shortcut question.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.3.3 How Fast Can We Multiply?
TAOCP §4.3.3, exercise 9 (rated M15): what is it asking?	Replacing the root of unity by a power of it. Checks you understand the transform.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.3.3 How Fast Can We Multiply?
TAOCP §4.3.3, exercise 17 (rated M26): what is it asking?	Count exactly how many small products Karatsuba does.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.3.3 How Fast Can We Multiply?
TAOCP §4.3.3, exercise 4 (rated 28, recommended): what is it asking?	Evaluate at symmetric points to speed up Toom-Cook.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.3.3 How Fast Can We Multiply?
TAOCP §4.3.3, exercise 16 (rated 25, recommended): what is it asking?	A discrete Fourier transform of any length in n log n operations.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.3.3 How Fast Can We Multiply?
TAOCP §4.3.3, exercise 19 (rated M23, recommended): what is it asking?	Compute u*v mod m with a bounded number of safe operations.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.3.3 How Fast Can We Multiply?
TAOCP §4.3.3, exercise 18 (rated M30, recommended): what is it asking?	Schedule memory for recursive Karatsuba. The stretch, and a real implementation issue.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.3.3 How Fast Can We Multiply?
TAOCP §4.3.3: how many exercises, and how are they rated?	19 exercises, rated M15 to M49.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.3 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::4.3.3 How Fast Can We Multiply?
TAOCP §4.3.3: what should you be comfortable with first?	<ul><li>4.3.1 The Classical Algorithms</li><li>Divide and conquer, recursion</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.3 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::4.3.3 How Fast Can We Multiply?
TAOCP §4.3.3: how should you work through it?	Implement the half-splitting method on top of your 4.3.1 bignums and find the crossover size where it beats schoolbook. Read the FFT part for ideas; implementing an FFT multiply is a stretch goal.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.3 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::4.3.3 How Fast Can We Multiply?
TAOCP §4.4 Radix Conversion: what does it cover?	Converting numbers between bases efficiently, for integers and fractions, by multiplication or division, and how to do it correctly with floating point and multiple precision.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.4 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::4.4 Radix Conversion
TAOCP §4.4: why does it matter?	Printing and parsing numbers correctly (especially floats) is surprisingly hard; many languages had bugs here for decades.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.4 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::4.4 Radix Conversion
TAOCP §4.4: what traps should you watch for?	<ul><li>Converting fractions with floats and accumulating rounding error.</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.4 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 2::4.4 Radix Conversion
TAOCP §4.4, exercise 11 (rated 16): what is it asking?	Octal to decimal by hand. Drill.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.4 Radix Conversion
TAOCP §4.4, exercise 12 (rated 22, recommended): what is it asking?	A fast pencil method for ternary to decimal and back.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.4 Radix Conversion
TAOCP §4.4, exercise 1 (rated 25, recommended): what is it asking?	Generalize conversion to mixed-radix systems, such as times and dates.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.4 Radix Conversion
TAOCP §4.4, exercise 3 (rated 25, recommended): what is it asking?	Print a fraction with just enough digits to read it back exactly. The idea behind shortest float printing.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.4 Radix Conversion
TAOCP §4.4, exercise 7 (rated M18): what is it asking?	When multiplying by an approximate reciprocal gives the right quotient.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.4 Radix Conversion
TAOCP §4.4, exercise 10 (rated 22): what is it asking?	Halve a binary-coded decimal number with shifts and masks.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.4 Radix Conversion
TAOCP §4.4, exercise 9 (rated M29, recommended): what is it asking?	Divide by 10 using only shifts, masks and adds. Compilers do exactly this.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.4 Radix Conversion
TAOCP §4.4, exercise 14 (rated M27, recommended): what is it asking?	Fast conversion of huge integers with divide and conquer. The stretch.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.4 Radix Conversion
TAOCP §4.4: how many exercises, and how are they rated?	19 exercises, rated 16 to M47.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.4 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::4.4 Radix Conversion
TAOCP §4.4: what should you be comfortable with first?	<ul><li>4.1 Positional Number Systems</li><li>4.3.1 The Classical Algorithms</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.4 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::4.4 Radix Conversion
TAOCP §4.4: how should you work through it?	Implement integer to decimal string for your bignums. Then read about fraction conversion and think about why printing the shortest float that round-trips is hard.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.4 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::4.4 Radix Conversion
TAOCP §4.5.1 Fractions: what does it cover?	Exact rational arithmetic: keeping fractions in lowest terms with gcds, doing add and multiply so intermediate numbers stay small, and fixed-slash and floating-slash representations that store a fraction in a fixed number of bits.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.1 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::4.5.1 Fractions
TAOCP §4.5.1: why does it matter?	Rationals are used in computer algebra, geometry kernels and anywhere floats are not exact enough.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.1 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::4.5.1 Fractions
TAOCP §4.5.1: what traps should you watch for?	<ul><li>Reducing only at the end and overflowing in the middle.</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.1 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 2::4.5.1 Fractions
TAOCP §4.5.1, exercise 1 (rated 15): what is it asking?	Compare two fractions without overflow.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.1 Fractions
TAOCP §4.5.1, exercise 5 (rated 10): what is it asking?	Add two fractions with the text's method.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.1 Fractions
TAOCP §4.5.1, exercise 2 (rated M15): what is it asking?	Dividing out the gcd leaves coprime parts.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.1 Fractions
TAOCP §4.5.1, exercise 6 (rated M23, recommended): what is it asking?	The gcd fact behind the efficient addition method.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.1 Fractions
TAOCP §4.5.1, exercise 8 (rated 22, recommended): what is it asking?	Use 1/0 and -1/0 as infinities or overflow markers.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.1 Fractions
TAOCP §4.5.1, exercise 7 (rated M22): what is it asking?	How large intermediate values get in fraction addition. The stretch.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.1 Fractions
TAOCP §4.5.1: how many exercises, and how are they rated?	16 exercises, rated 10 to 42.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.1 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::4.5.1 Fractions
TAOCP §4.5.1: what should you be comfortable with first?	<ul><li>4.5.2 GCD idea from 1.1</li><li>4.3.1 Classical Algorithms</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.1 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::4.5.1 Fractions
TAOCP §4.5.1: how should you work through it?	Implement a Rational type with add and multiply that reduces cleverly using gcds of partial terms, as the section suggests, and test it.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.1 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::4.5.1 Fractions
TAOCP §4.5.2 The Greatest Common Divisor: what does it cover?	Euclid again, now in depth: the extended algorithm for finding coefficients, the binary gcd algorithm that uses only shifts and subtraction, and gcd for multiple-precision numbers.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.2 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::4.5.2 The Greatest Common Divisor
TAOCP §4.5.2: why does it matter?	Extended Euclid gives modular inverses, needed in RSA and hashing. Binary gcd is a good example of trading division for cheap operations.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.2 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::4.5.2 The Greatest Common Divisor
TAOCP §4.5.2: what traps should you watch for?	<ul><li>Sign handling in extended Euclid coefficients.</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.2 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 2::4.5.2 The Greatest Common Divisor
TAOCP §4.5.2, exercise 9 (rated 18): what is it asking?	Run the binary gcd and extended Euclid by hand on one pair.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.2 The Greatest Common Divisor
TAOCP §4.5.2, exercise 16 (rated M22, recommended): what is it asking?	Division modulo m with extended Euclid. Modular inverse in practice.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.2 The Greatest Common Divisor
TAOCP §4.5.2, exercise 17 (rated M20, recommended): what is it asking?	Lift an inverse modulo 2^e to modulo 2^(2e). Newton's method for integers.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.2 The Greatest Common Divisor
TAOCP §4.5.2, exercise 41 (rated M22): what is it asking?	Closed form for gcd(10^m - 1, 10^n - 1).	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.2 The Greatest Common Divisor
TAOCP §4.5.2, exercise 5 (rated M26, recommended): what is it asking?	Design a gcd algorithm for balanced ternary.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.2 The Greatest Common Divisor
TAOCP §4.5.2, exercise 39 (rated M28, recommended): what is it asking?	Extend the binary gcd to compute the coefficients too.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.2 The Greatest Common Divisor
TAOCP §4.5.2, exercise 40 (rated M25, recommended): what is it asking?	A hardware-friendly binary gcd that avoids comparisons.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.2 The Greatest Common Divisor
TAOCP §4.5.2, exercise 10 (rated HM24, recommended): what is it asking?	Prove that two random integers are coprime with probability 6/pi^2. The stretch.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.2 The Greatest Common Divisor
TAOCP §4.5.2: how many exercises, and how are they rated?	42 exercises, rated 18 to HM49.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.2 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::4.5.2 The Greatest Common Divisor
TAOCP §4.5.2: what should you be comfortable with first?	<ul><li>1.1 Algorithms</li><li>4.5.1 Fractions</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.2 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::4.5.2 The Greatest Common Divisor
TAOCP §4.5.2: how should you work through it?	Implement Euclid, binary gcd and extended Euclid. Benchmark the first two on 64-bit numbers. Use extended Euclid to compute modular inverses and check them.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.2 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::4.5.2 The Greatest Common Divisor
TAOCP §4.5.3 Analysis of Euclid's Algorithm: what does it cover?	How many steps Euclid takes: the worst case involves consecutive Fibonacci numbers (Lame's theorem), and the average case connects to continued fractions and a famous distribution of partial quotients.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.3 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::4.5.3 Analysis of Euclid's Algorithm
TAOCP §4.5.3: why does it matter?	A beautiful example of algorithm analysis meeting deep math. The worst-case result alone (logarithmic steps) is worth knowing cold.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.3 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::4.5.3 Analysis of Euclid's Algorithm
TAOCP §4.5.3, a common trap: “Getting lost in the HM material.” What's the catch?	The first part is the essential part.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.3 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 2::4.5.3 Analysis of Euclid's Algorithm
TAOCP §4.5.3, exercise 1 (rated 20): what is it asking?	Speed up Euclid when the quotient is often 1.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.3 Analysis of Euclid's Algorithm
TAOCP §4.5.3, exercise 32 (rated 20): what is it asking?	Continuants and Morse code. A pleasant combinatorial view.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.3 Analysis of Euclid's Algorithm
TAOCP §4.5.3, exercise 4 (rated M20): what is it asking?	Prove a basic continuant identity.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.3 Analysis of Euclid's Algorithm
TAOCP §4.5.3, exercise 24 (rated M22): what is it asking?	Average size of a partial quotient. The answer is surprising.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.3 Analysis of Euclid's Algorithm
TAOCP §4.5.3, exercise 39 (rated M25, recommended): what is it asking?	Smallest number of at-bats giving a batting average of .334. Best rational approximation in action.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.3 Analysis of Euclid's Algorithm
TAOCP §4.5.3, exercise 40 (rated M28, recommended): what is it asking?	The Stern-Brocot tree and how it lists every fraction once.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.3 Analysis of Euclid's Algorithm
TAOCP §4.5.3, exercise 51 (rated M30, recommended): what is it asking?	Rational reconstruction: recover a small fraction from its residue. Used in computer algebra.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.3 Analysis of Euclid's Algorithm
TAOCP §4.5.3, exercise 30 (rated HM32, recommended): what is it asking?	Analyze the nearest-remainder variant of Euclid. The stretch.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.3 Analysis of Euclid's Algorithm
TAOCP §4.5.3: how many exercises, and how are they rated?	51 exercises, rated 20 to HM46.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.3 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::4.5.3 Analysis of Euclid's Algorithm
TAOCP §4.5.3: what should you be comfortable with first?	<ul><li>4.5.2 The Greatest Common Divisor</li><li>1.2.8 Fibonacci Numbers</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.3 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::4.5.3 Analysis of Euclid's Algorithm
TAOCP §4.5.3: how should you work through it?	Prove the Fibonacci worst case yourself first. Then empirically count steps on random inputs and compare to the average formula. The heavy continued-fraction analysis can be read for ideas.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.3 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::4.5.3 Analysis of Euclid's Algorithm
TAOCP §4.5.4 Factoring into Primes: what does it cover?	Methods for factoring integers and testing primality: trial division, Fermat's method, Pollard's rho, probabilistic primality testing, and the connection to public-key cryptography (RSA), plus a look at more advanced sieving methods.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.4 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::4.5.4 Factoring into Primes
TAOCP §4.5.4: why does it matter?	Primality testing and the hardness of factoring are the foundation of RSA. Pollard rho is also a neat use of cycle detection.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.4 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::4.5.4 Factoring into Primes
TAOCP §4.5.4, a common trap: “Overflow in modular multiplication.” What's the catch?	Use 128-bit intermediates or bignums.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.4 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 2::4.5.4 Factoring into Primes
TAOCP §4.5.4: what traps should you watch for?	<ul><li>Treating a probabilistic test as deterministic.</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.4 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 2::4.5.4 Factoring into Primes
TAOCP §4.5.4, exercise 1 (rated 10): what is it asking?	Why composite trial divisors never show up in the output.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.4 Factoring into Primes
TAOCP §4.5.4, exercise 5 (rated 21): what is it asking?	Fermat's method by hand on a five-digit number.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.4 Factoring into Primes
TAOCP §4.5.4, exercise 8 (rated 23, recommended): what is it asking?	The sieve of Eratosthenes and how to do it well. Implement it.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.4 Factoring into Primes
TAOCP §4.5.4, exercise 10 (rated M26, recommended): what is it asking?	Selfridge's test for proving primality from the factors of n - 1.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.4 Factoring into Primes
TAOCP §4.5.4, exercise 19 (rated M25, recommended): what is it asking?	Pollard's p - 1 idea. Another factoring method to implement.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.4 Factoring into Primes
TAOCP §4.5.4, exercise 26 (rated M25, recommended): what is it asking?	Pocklington's primality certificate.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.4 Factoring into Primes
TAOCP §4.5.4, exercise 38 (rated 25): what is it asking?	Find the largest 50-digit primes made mostly of one digit. A fun programming exercise with Miller-Rabin.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.4 Factoring into Primes
TAOCP §4.5.4, exercise 22 (rated M30, recommended): what is it asking?	Bound the error rate of the probabilistic primality test. The stretch.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.5.4 Factoring into Primes
TAOCP §4.5.4: how many exercises, and how are they rated?	47 exercises, rated 10 to M50.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.4 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::4.5.4 Factoring into Primes
TAOCP §4.5.4: what should you be comfortable with first?	<ul><li>4.5.2 The Greatest Common Divisor</li><li>4.3.2 Modular Arithmetic</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.4 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::4.5.4 Factoring into Primes
TAOCP §4.5.4: how should you work through it?	Implement trial division, Pollard rho (with Floyd's cycle detection) and a Miller-Rabin primality test. Factor some 20-digit numbers. Read the advanced methods for the ideas only.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.5.4 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::4.5.4 Factoring into Primes
TAOCP §4.6.1 Division of Polynomials: what does it cover?	Polynomial arithmetic, especially division with remainder, and computing greatest common divisors of polynomials, including variants that avoid fractions when coefficients are integers.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.1 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::4.6.1 Division of Polynomials
TAOCP §4.6.1: why does it matter?	Polynomials over finite fields power error-correcting codes, CRCs and cryptography. Polynomial gcd is a building block in computer algebra.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.1 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::4.6.1 Division of Polynomials
TAOCP §4.6.1, a common trap: “Coefficient blow-up when working over the integers.” What's the catch?	That is exactly what the fraction-free methods address.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.1 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 2::4.6.1 Division of Polynomials
TAOCP §4.6.1, exercise 1 of §4.6 (rated 10): what is it asking?	Polynomial arithmetic modulo 10. Shows where non-prime moduli cause trouble.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.1 Division of Polynomials
TAOCP §4.6.1, exercise 4 of §4.6 (rated 21, recommended): what is it asking?	Multiply polynomials mod 2 with bitwise word operations.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.1 Division of Polynomials
TAOCP §4.6.1, exercise 5 of §4.6 (rated M21, recommended): what is it asking?	Karatsuba for polynomials mod 2.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.1 Division of Polynomials
TAOCP §4.6.1, exercise 1 of §4.6.1 (rated 10): what is it asking?	Pseudo-division by hand on integer polynomials.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.1 Division of Polynomials
TAOCP §4.6.1, exercise 2 of §4.6.1 (rated 15): what is it asking?	A polynomial gcd modulo 7.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.1 Division of Polynomials
TAOCP §4.6.1, exercise 3 of §4.6.1 (rated M25): what is it asking?	Extended Euclid for polynomials and the degrees of the coefficients.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.1 Division of Polynomials
TAOCP §4.6.1, exercise 16 of §4.6.1 (rated M22, recommended): what is it asking?	A nonzero polynomial cannot vanish on too many grid points. The basis of randomized identity testing.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.1 Division of Polynomials
TAOCP §4.6.1, exercise 26 of §4.6.1 (rated M26, recommended): what is it asking?	Best rational-function approximations from the polynomial Euclid algorithm. The stretch.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.1 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.1 Division of Polynomials
TAOCP §4.6.1: how many exercises, and how are they rated?	31 exercises, rated 10 to M40.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.1 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::4.6.1 Division of Polynomials
TAOCP §4.6.1: what should you be comfortable with first?	<ul><li>4.5.2 The Greatest Common Divisor</li><li>4.3.1 Classical Algorithms</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.1 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::4.6.1 Division of Polynomials
TAOCP §4.6.1: how should you work through it?	Implement polynomial division over integers mod a prime. Then compute a CRC by hand as polynomial division over GF(2) to see a real use.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.1 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::4.6.1 Division of Polynomials
TAOCP §4.6.2 Factorization of Polynomials: what does it cover?	Factoring polynomials modulo a prime (Berlekamp's algorithm and distinct-degree factorization) and then lifting to factor polynomials over the integers.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.2 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::4.6.2 Factorization of Polynomials
TAOCP §4.6.2: why does it matter?	One of the more specialized sections. It matters for computer algebra and coding theory; for most programmers the takeaway is that factoring polynomials is surprisingly tractable while factoring integers is not.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.2 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::4.6.2 Factorization of Polynomials
TAOCP §4.6.2, a common trap: “Feeling you must master this.” What's the catch?	It is fine to come back later.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.2 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 2::4.6.2 Factorization of Polynomials
TAOCP §4.6.2, exercise 9 (rated 20): what is it asking?	Build a table of inverses mod 101 from a primitive root.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.2 Factorization of Polynomials
TAOCP §4.6.2, exercise 10 (rated 21, recommended): what is it asking?	Factor the text's example mod 2 with Berlekamp.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.2 Factorization of Polynomials
TAOCP §4.6.2, exercise 11 (rated 22): what is it asking?	Same polynomial mod 5.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.2 Factorization of Polynomials
TAOCP §4.6.2, exercise 12 (rated M22, recommended): what is it asking?	How x^4 + 1 factors modulo every prime.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.2 Factorization of Polynomials
TAOCP §4.6.2, exercise 19 (rated M20): what is it asking?	Eisenstein's irreducibility criterion.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.2 Factorization of Polynomials
TAOCP §4.6.2, exercise 15 (rated M27, recommended): what is it asking?	Square roots modulo a prime. Needed all over number theory and crypto.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.2 Factorization of Polynomials
TAOCP §4.6.2, exercise 34 (rated M25, recommended): what is it asking?	Squarefree factorization using derivatives and gcds.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.2 Factorization of Polynomials
TAOCP §4.6.2, exercise 22 (rated M24, recommended): what is it asking?	Hensel lifting of a factorization mod p to mod p^e. The stretch.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.2 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.2 Factorization of Polynomials
TAOCP §4.6.2: how many exercises, and how are they rated?	41 exercises, rated 20 to M47.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.2 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::4.6.2 Factorization of Polynomials
TAOCP §4.6.2: what should you be comfortable with first?	<ul><li>4.6.1 Division of Polynomials</li><li>Basic linear algebra mod p</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.2 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::4.6.2 Factorization of Polynomials
TAOCP §4.6.2: how should you work through it?	Read the overview and follow one small worked example of Berlekamp's algorithm. Skim the rest. Spend extra time catching up if you are behind.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.2 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::4.6.2 Factorization of Polynomials
TAOCP §4.6.3 Evaluation of Powers: what does it cover?	Computing x^n with as few multiplications as possible: the binary (square-and-multiply) method, and the deep theory of addition chains, which ask for the shortest sequence of additions reaching n.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.3 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::4.6.3 Evaluation of Powers
TAOCP §4.6.3: why does it matter?	Fast exponentiation is used everywhere from modular crypto to matrix powers for linear recurrences. Addition chains are a famous open-problem area that is easy to state.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.3 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::4.6.3 Evaluation of Powers
TAOCP §4.6.3, a common trap: “Assuming the binary method is optimal.” What's the catch?	Knuth shows small n where it is not.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.3 cracked.guide::kind::trap	cracked.guide::TAOCP Vol 2::4.6.3 Evaluation of Powers
TAOCP §4.6.3, exercise 1 (rated 15): what is it asking?	State the final value in the right-to-left binary method.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.3 Evaluation of Powers
TAOCP §4.6.3, exercise 3 (rated 22, recommended): what is it asking?	Compute one power by several methods and compare their costs.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.3 Evaluation of Powers
TAOCP §4.6.3, exercise 4 (rated M20): what is it asking?	A case where the octal method beats binary by a lot.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.3 Evaluation of Powers
TAOCP §4.6.3, exercise 5 (rated 24, recommended): what is it asking?	Build the power tree. Implement it.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.3 Evaluation of Powers
TAOCP §4.6.3, exercise 9 (rated 25, recommended): what is it asking?	Exponentiation with a window of e bits.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.3 Evaluation of Powers
TAOCP §4.6.3, exercise 26 (rated M25, recommended): what is it asking?	Large Fibonacci numbers modulo m quickly.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.3 Evaluation of Powers
TAOCP §4.6.3, exercise 30 (rated 20): what is it asking?	Allowing subtraction (division) in chains.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.3 Evaluation of Powers
TAOCP §4.6.3, exercise 11 (rated M26, recommended): what is it asking?	Find all optimal chains for two specific exponents. The stretch.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.3 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.3 Evaluation of Powers
TAOCP §4.6.3: how many exercises, and how are they rated?	42 exercises, rated 10 to M50.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.3 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::4.6.3 Evaluation of Powers
TAOCP §4.6.3: what should you be comfortable with first?	<ul><li>4.1 Positional Number Systems</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.3 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::4.6.3 Evaluation of Powers
TAOCP §4.6.3: how should you work through it?	Implement right-to-left and left-to-right binary exponentiation and count multiplications. Then find the shortest addition chain for small n by brute force and compare to the binary method.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.3 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::4.6.3 Evaluation of Powers
TAOCP §4.6.4 Evaluation of Polynomials: what does it cover?	Evaluating polynomials efficiently: Horner's rule, evaluating at many points, preprocessing coefficients to save multiplications, and the related cost of matrix and polynomial operations, including the Fourier transform.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.4 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::4.6.4 Evaluation of Polynomials
TAOCP §4.6.4: why does it matter?	Horner's rule is used in every math library and in hashing (polynomial rolling hashes). The FFT view connects to signal processing and fast multiplication.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.4 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::4.6.4 Evaluation of Polynomials
TAOCP §4.6.4: what traps should you watch for?	<ul><li>Numerical instability when evaluating with floats at large x.</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.4 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 2::4.6.4 Evaluation of Polynomials
TAOCP §4.6.4, exercise 1 (rated 15): what is it asking?	Evaluate an odd polynomial efficiently.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.4 Evaluation of Polynomials
TAOCP §4.6.4, exercise 2 (rated M20, recommended): what is it asking?	Shift a polynomial's origin with Horner-like steps or fast multiplication.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.4 Evaluation of Polynomials
TAOCP §4.6.4, exercise 3 (rated 20): what is it asking?	Horner's rule for two variables, with operation counts.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.4 Evaluation of Polynomials
TAOCP §4.6.4, exercise 41 (rated 22): what is it asking?	Complex multiplication with three real multiplications.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.4 Evaluation of Polynomials
TAOCP §4.6.4, exercise 57 (rated M20): what is it asking?	Multiply polynomials with the FFT in n log n time. Implement it.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.4 Evaluation of Polynomials
TAOCP §4.6.4, exercise 19 (rated M24, recommended): what is it asking?	Adapt coefficients ahead of time to save multiplications.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.4 Evaluation of Polynomials
TAOCP §4.6.4, exercise 14 (rated HM28, recommended): what is it asking?	Derive the fast Fourier transform from the text's general scheme.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.4 Evaluation of Polynomials
TAOCP §4.6.4, exercise 51 (rated M24, recommended): what is it asking?	Winograd's small cyclic convolutions. The stretch.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.4 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.6.4 Evaluation of Polynomials
TAOCP §4.6.4: how many exercises, and how are they rated?	74 exercises, rated 15 to M50.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.4 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::4.6.4 Evaluation of Polynomials
TAOCP §4.6.4: what should you be comfortable with first?	<ul><li>4.6.1 Division of Polynomials</li><li>4.3.3 How Fast Can We Multiply?</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.4 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::4.6.4 Evaluation of Polynomials
TAOCP §4.6.4: how should you work through it?	Implement Horner's rule and a rolling hash using it. Read the coefficient-preprocessing ideas lightly. Spend real time on the discrete Fourier transform discussion if FFT is new to you.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.6.4 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::4.6.4 Evaluation of Polynomials
TAOCP §4.7 Manipulation of Power Series: what does it cover?	Algorithms for working with power series as data: multiplying, dividing, raising to powers, composing and reversing them, including Lagrange inversion.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.7 cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::4.7 Manipulation of Power Series
TAOCP §4.7: why does it matter?	This is computer algebra territory, and it is the algorithmic side of the generating functions from 1.2.9. Useful if you ever do combinatorics by computer.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.7 cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::4.7 Manipulation of Power Series
TAOCP §4.7: what traps should you watch for?	<ul><li>Forgetting to truncate, which makes costs explode.</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.7 cracked.guide::kind::traps	cracked.guide::TAOCP Vol 2::4.7 Manipulation of Power Series
TAOCP §4.7, exercise 1 (rated M10): what is it asking?	Division when the leading coefficient is zero.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.7 Manipulation of Power Series
TAOCP §4.7, exercise 2 (rated 20): what is it asking?	Keep integer coefficients integral during division.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.7 Manipulation of Power Series
TAOCP §4.7, exercise 5 (rated M00): what is it asking?	What reverting twice gives you.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.7 Manipulation of Power Series
TAOCP §4.7, exercise 4 (rated HM23, recommended): what is it asking?	Exponential and logarithm of a power series with small changes to the power recurrence.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.7 Manipulation of Power Series
TAOCP §4.7, exercise 6 (rated M21, recommended): what is it asking?	Newton's method for the reciprocal of a power series. The key to fast series division.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.7 Manipulation of Power Series
TAOCP §4.7, exercise 11 (rated M25, recommended): what is it asking?	Compose two power series.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.7 Manipulation of Power Series
TAOCP §4.7, exercise 8 (rated M25, recommended): what is it asking?	Lagrange's inversion formula in its general form.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.7 Manipulation of Power Series
TAOCP §4.7, exercise 14 (rated HM30, recommended): what is it asking?	Fractional iteration of a power series. The stretch.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.7 cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::4.7 Manipulation of Power Series
TAOCP §4.7: how many exercises, and how are they rated?	28 exercises, rated M00 to HM35.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.7 cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::4.7 Manipulation of Power Series
TAOCP §4.7: what should you be comfortable with first?	<ul><li>1.2.9 Generating Functions</li><li>4.6 Polynomial Arithmetic</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.7 cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::4.7 Manipulation of Power Series
TAOCP §4.7: how should you work through it?	Implement power-series multiplication and reciprocal on truncated series. Use them to compute the Catalan numbers from their generating function.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.7 cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::4.7 Manipulation of Power Series
TAOCP Vol 2 review: what does it cover?	A review week for Volume 2: random numbers and arithmetic.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::vol_2_review cracked.guide::kind::about	cracked.guide::TAOCP Vol 2::Vol 2 review
TAOCP: Vol 2 review: why does it matter?	Vol 3 leans on probability (from chapter 3) and on the analysis style you practiced. A quick review makes the switch smoother.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::vol_2_review cracked.guide::kind::why	cracked.guide::TAOCP Vol 2::Vol 2 review
TAOCP: Vol 2 review, a common trap: “Skipping review.” What's the catch?	This is the halfway point of the whole path.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::vol_2_review cracked.guide::kind::trap	cracked.guide::TAOCP Vol 2::Vol 2 review
TAOCP: Vol 2 review, exercise 23 of §3.1 (rated M26, recommended): what is it asking?	Encode every mapping as a sequence with a bijection. Combinatorial review.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::vol_2_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::Vol 2 review
TAOCP: Vol 2 review, exercise 16 of §3.2.2 (rated M28, recommended): what is it asking?	Show that the shift-register method produces a linear recurrence mod 2.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::vol_2_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::Vol 2 review
TAOCP: Vol 2 review, exercise 16 of §3.4.1 (rated HM22, recommended): what is it asking?	Design a rejection sampler for gamma deviates of small order.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::vol_2_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::Vol 2 review
TAOCP: Vol 2 review, exercise 30 of §4.2.2 (rated M30, recommended): what is it asking?	Explain wildly wrong calculator results on a harmless-looking function. Floating-point review.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::vol_2_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::Vol 2 review
TAOCP: Vol 2 review, exercise 21 of §4.3.1 (rated M23, recommended): what is it asking?	How rarely the corrected trial quotient is still wrong.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::vol_2_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::Vol 2 review
TAOCP: Vol 2 review, exercise 38 of §4.5.2 (rated M32, recommended): what is it asking?	Make the binary gcd fast for big numbers, Lehmer-style.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::vol_2_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::Vol 2 review
TAOCP: Vol 2 review, exercise 41 of §4.5.4 (rated M28, recommended): what is it asking?	Count primes faster than finding them all.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::vol_2_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::Vol 2 review
TAOCP: Vol 2 review, exercise 38 of §4.6.4 (rated HM32, recommended): what is it asking?	Prove that Horner's rule is optimal when coefficients are not preprocessed.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::vol_2_review cracked.guide::kind::exercise	cracked.guide::TAOCP Vol 2::Vol 2 review
TAOCP: Vol 2 review: how many exercises, and how are they rated?	918 exercises, rated 00 to HM50.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::vol_2_review cracked.guide::kind::exercises	cracked.guide::TAOCP Vol 2::Vol 2 review
TAOCP: Vol 2 review: what should you be comfortable with first?	<ul><li>All of Vol 2</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::vol_2_review cracked.guide::kind::prereqs	cracked.guide::TAOCP Vol 2::Vol 2 review
TAOCP: Vol 2 review: how should you work through it?	Tidy up the code you wrote: PRNGs, tests, bignums, gcd, factoring. Put it in one repo with tests. Write a one-page summary of what to use in practice for random numbers and for big arithmetic.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::vol_2_review cracked.guide::kind::approach	cracked.guide::TAOCP Vol 2::Vol 2 review
