#separator:tab
#html:true
#notetype:Basic
#tags column:3
#deck:cracked.guide::TAOCP Vol 2::3.3.2 Empirical Tests
#columns:Front	Back	Tags
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
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
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
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
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
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
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
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
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
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
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
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
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
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
