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