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