#separator:tab
#html:true
#notetype:Basic
#tags column:3
#deck:cracked.guide::TAOCP Vol 4A::7.2.1.4 Generating All Partitions
#columns:Front	Back	Tags
TAOCP §7.2.1.4 Generating All Partitions: what does it cover?	Generating all partitions of an integer: reverse lexicographic order (Algorithm P), partitions into a fixed number of parts (Algorithm H), Ferrers diagrams and conjugates, generating functions and Euler's pentagonal number theorem, the asymptotic size of p(n), Gray codes for partitions, and Twelvefold Way style counting.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.4 cracked.guide::kind::about
TAOCP §7.2.1.4: why does it matter?	Integer partitions appear in dynamic programming problems (coin change), and the generating function theory is a great application of 1.2.9.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.4 cracked.guide::kind::why
TAOCP §7.2.1.4: what is Algorithm P about?	Reverse lexicographic order.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.4 cracked.guide::kind::algorithm
TAOCP §7.2.1.4: what is Algorithm H about?	Partitions into a fixed number of parts.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.4 cracked.guide::kind::algorithm
TAOCP §7.2.1.4, exercise 1 (rated M21, recommended): what is it asking?	Fill in the Twelvefold Way: counts for every kind of placement of balls in urns. Worth making into a reference card.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.4 cracked.guide::kind::exercise
TAOCP §7.2.1.4, exercise 2 (rated 20, recommended): what is it asking?	Change one step of Algorithm H to get partitions into at most m parts.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.4 cracked.guide::kind::exercise
TAOCP §7.2.1.4, exercise 5 (rated 23, recommended): what is it asking?	Generate partitions in part-count form efficiently.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.4 cracked.guide::kind::exercise
TAOCP §7.2.1.4, exercise 12 (rated M21, recommended): what is it asking?	Prove Euler's theorem that distinct-part and odd-part partitions are equinumerous with generating functions.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.4 cracked.guide::kind::exercise
TAOCP §7.2.1.4, exercise 20 (rated M21, recommended): what is it asking?	Estimate the cost of tabulating p(n) with Euler's recurrence.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.4 cracked.guide::kind::exercise
TAOCP §7.2.1.4, exercise 47 (rated HM22, recommended): what is it asking?	Prove a simple random partition generator is uniform.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.4 cracked.guide::kind::exercise
TAOCP §7.2.1.4, exercise 52 (rated M21, recommended): what is it asking?	Find the millionth partition of 64 generated by Algorithm P.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.4 cracked.guide::kind::exercise
TAOCP §7.2.1.4, exercise 54 (rated M30, recommended): what is it asking?	Study the majorization (dominance) order on partitions. The stretch.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.4 cracked.guide::kind::exercise
TAOCP §7.2.1.4: how many exercises, and how are they rated?	73 exercises, rated 15 to 47.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.4 cracked.guide::kind::exercises
TAOCP §7.2.1.4: what should you be comfortable with first?	<ul><li>7.2.1.3 Generating All Combinations</li><li>1.2.9 Generating Functions</li></ul>	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.4 cracked.guide::kind::prereqs
TAOCP §7.2.1.4: how should you work through it?	Implement partition generation in reverse lexicographic order. Compute partition counts with a DP and check against the generator.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.4 cracked.guide::kind::approach
