#separator:tab
#html:true
#notetype:Basic
#tags column:3
#deck:cracked.guide::TAOCP Vol 1::1.2.9 Generating Functions
#columns:Front	Back	Tags
TAOCP §1.2.9 Generating Functions: what does it cover?	Treating a whole sequence as the coefficients of a power series, then manipulating the series (adding, shifting, multiplying, differentiating) to solve recurrences and evaluate sums.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.9 cracked.guide::kind::about
TAOCP §1.2.9: why does it matter?	Generating functions are the single most powerful tool in algorithm analysis. Everything from counting binary trees to averaging hashing costs uses them.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.9 cracked.guide::kind::why
Generating function: what is it?	A generating function represents a sequence a0, a1, a2, ... as the coefficients of a power series a0 + a1 z + a2 z^2 + ..., so that operations on the series correspond to operations on the sequence.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.9 cracked.guide::kind::definition
Generating function: Do I need calculus for generating functions?	Mostly algebra. Differentiation shows up for things like averages, but a first course in calculus is plenty.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.9 cracked.guide::kind::definition
TAOCP §1.2.9, a common trap: “Worrying about convergence.” What's the catch?	Knuth mostly treats these as formal power series, so you can manipulate first and ask questions later.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.9 cracked.guide::kind::trap
TAOCP §1.2.9: what traps should you watch for?	<ul><li>Forgetting the convolution rule; it is the one you will use most.</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.9 cracked.guide::kind::traps
TAOCP §1.2.9, exercise 1 (rated M12): what is it asking?	Write down the generating function for a sum of two geometric sequences.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.9 cracked.guide::kind::exercise
TAOCP §1.2.9, exercise 2 (rated M13, recommended): what is it asking?	Prove the product rule for exponential generating functions.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.9 cracked.guide::kind::exercise
TAOCP §1.2.9, exercise 5 (rated M20): what is it asking?	Prove a generating-function expansion involving Stirling numbers by induction.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.9 cracked.guide::kind::exercise
TAOCP §1.2.9, exercise 8 (rated M23): what is it asking?	Find the generating function for the number of partitions of n.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.9 cracked.guide::kind::exercise
TAOCP §1.2.9, exercise 12 (rated M20, recommended): what is it asking?	Encode a doubly indexed sequence in a single generating function.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.9 cracked.guide::kind::exercise
TAOCP §1.2.9, exercise 10 (rated M25, recommended): what is it asking?	Get the generating function for the elementary symmetric functions and relate it to the complete ones.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.9 cracked.guide::kind::exercise
TAOCP §1.2.9, exercise 18 (rated M25, recommended): what is it asking?	Evaluate sums over increasing index tuples in closed form.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.9 cracked.guide::kind::exercise
TAOCP §1.2.9, exercise 15 (rated M28): what is it asking?	Find a closed form for a whole family of generating functions using a second variable. The stretch.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.9 cracked.guide::kind::exercise
TAOCP §1.2.9: how many exercises, and how are they rated?	26 exercises, rated M01 to M40.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.9 cracked.guide::kind::exercises
TAOCP §1.2.9: what should you be comfortable with first?	<ul><li>1.2.8 Fibonacci Numbers</li><li>Basic calculus (derivatives, geometric series)</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.9 cracked.guide::kind::prereqs
TAOCP §1.2.9: how should you work through it?	Make a table of the basic operations (shift, multiply by z, differentiate, convolution) and what each does to the coefficients. For each worked example, close the book and redo it. If it does not click, Concrete Mathematics chapter 7 and Wilf's free book generatingfunctionology are excellent companions.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.9 cracked.guide::kind::approach
