#separator:tab
#html:true
#notetype:Basic
#tags column:3
#deck:cracked.guide::TAOCP Vol 2::4.5.3 Analysis of Euclid's Algorithm
#columns:Front	Back	Tags
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
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
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
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
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
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
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
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
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
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
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
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
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
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
