#separator:tab
#html:true
#notetype:Basic
#tags column:3
#deck:cracked.guide::TAOCP Vol 1::1.2.8 Fibonacci Numbers
#columns:Front	Back	Tags
TAOCP §1.2.8 Fibonacci Numbers: what does it cover?	The Fibonacci sequence, its closed form in terms of the golden ratio, and a pile of identities. Knuth introduces generating functions here as the tool for deriving the closed form, a preview of 1.2.9.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.8 cracked.guide::kind::about
TAOCP §1.2.8: why does it matter?	Fibonacci numbers show up in the worst case of Euclid's algorithm, Fibonacci heaps, AVL tree heights and Fibonacci hashing. It is also the cleanest first example of solving a recurrence.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.8 cracked.guide::kind::why
TAOCP §1.2.8: what traps should you watch for?	<ul><li>Floating-point closed forms break for large n; use integers when you code it.</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.8 cracked.guide::kind::traps
TAOCP §1.2.8, exercise 2 (rated 20, recommended): what is it asking?	Estimate a far-out Fibonacci number from the closed form and logs.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.8 cracked.guide::kind::exercise
TAOCP §1.2.8, exercise 3 (rated 25): what is it asking?	Write a program printing the first thousand Fibonacci numbers exactly. You need your own bignum addition.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.8 cracked.guide::kind::exercise
TAOCP §1.2.8, exercise 4 (rated 14, recommended): what is it asking?	Find all n where F_n equals n.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.8 cracked.guide::kind::exercise
TAOCP §1.2.8, exercise 7 (rated 15, recommended): what is it asking?	Show a composite index gives a composite Fibonacci number, with one exception.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.8 cracked.guide::kind::exercise
TAOCP §1.2.8, exercise 13 (rated M22, recommended): what is it asking?	Solve Fibonacci-like recurrences with added constants by expressing them through F_n.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.8 cracked.guide::kind::exercise
TAOCP §1.2.8, exercise 22 (rated M20, recommended): what is it asking?	Show a binomial-weighted sum of Fibonacci numbers is again a Fibonacci number.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.8 cracked.guide::kind::exercise
TAOCP §1.2.8, exercise 34 (rated M24, recommended): what is it asking?	Prove every positive integer has a unique representation as a sum of non-adjacent Fibonacci numbers.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.8 cracked.guide::kind::exercise
TAOCP §1.2.8, exercise 36 (rated M32, recommended): what is it asking?	Fibonacci strings: words built like the sequence, and their structure. The stretch.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.8 cracked.guide::kind::exercise
TAOCP §1.2.8: how many exercises, and how are they rated?	42 exercises, rated 10 to M38.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.8 cracked.guide::kind::exercises
TAOCP §1.2.8: what should you be comfortable with first?	<ul><li>1.2.1 Mathematical Induction</li><li>1.2.6 Binomial Coefficients</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.8 cracked.guide::kind::prereqs
TAOCP §1.2.8: how should you work through it?	Follow the generating-function derivation of the closed form line by line on paper. Then write a quick program checking several identities numerically for n up to 50.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.8 cracked.guide::kind::approach
