#separator:tab
#html:true
#notetype:Basic
#tags column:3
#deck:cracked.guide::TAOCP Vol 4A::7.2.1.5 Generating All Set Partitions
#columns:Front	Back	Tags
TAOCP §7.2.1.5 Generating All Set Partitions: what does it cover?	Generating all partitions of a set: restricted growth strings and Algorithm H, Gray codes for set partitions, Bell numbers and Peirce's triangle, the asymptotics of Bell numbers, Stirling numbers of the second kind, and partitions of a multiset (Algorithm M), with applications to rhyme schemes and alphametics.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.5 cracked.guide::kind::about
TAOCP §7.2.1.5: why does it matter?	Set partitions show up in clustering, test case generation and some scheduling problems.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.5 cracked.guide::kind::why
TAOCP §7.2.1.5: what is Algorithm M about?	Partitions of a multiset.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.5 cracked.guide::kind::algorithm
TAOCP §7.2.1.5, exercise 2 (rated 22, recommended): what is it asking?	Keep linked lists of each block up to date as Algorithm H runs.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.5 cracked.guide::kind::exercise
TAOCP §7.2.1.5, exercise 4 (rated 21, recommended): what is it asking?	Classify the SGB five-letter words by their letter-repetition pattern. Restricted growth strings in practice.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.5 cracked.guide::kind::exercise
TAOCP §7.2.1.5, exercise 6 (rated 25, recommended): what is it asking?	Generate set partitions with given numbers of blocks of each size.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.5 cracked.guide::kind::exercise
TAOCP §7.2.1.5, exercise 11 (rated 28, recommended): what is it asking?	Count how many set partitions of the digit positions in SEND+MORE=MONEY give pure alphametics.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.5 cracked.guide::kind::exercise
TAOCP §7.2.1.5, exercise 26 (rated M22, recommended): what is it asking?	Interpret Peirce's triangle as counting paths.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.5 cracked.guide::kind::exercise
TAOCP §7.2.1.5, exercise 65 (rated HM22, recommended): what is it asking?	Find the variance of the number of blocks of size k in a random set partition.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.5 cracked.guide::kind::exercise
TAOCP §7.2.1.5, exercise 69 (rated 22, recommended): what is it asking?	Restrict the multiset partition generator to at most r parts.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.5 cracked.guide::kind::exercise
TAOCP §7.2.1.5, exercise 38 (rated M30, recommended): what is it asking?	Study sequences of cyclic shifts whose product is the identity. The stretch.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.5 cracked.guide::kind::exercise
TAOCP §7.2.1.5: how many exercises, and how are they rated?	82 exercises, rated 14 to HM46.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.5 cracked.guide::kind::exercises
TAOCP §7.2.1.5: what should you be comfortable with first?	<ul><li>7.2.1.4 Generating All Partitions</li></ul>	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.5 cracked.guide::kind::prereqs
TAOCP §7.2.1.5: how should you work through it?	Implement generation via restricted growth strings and verify counts match Bell numbers.	cracked.guide cracked.guide::phase::taocp-4a cracked.guide::section::7.2.1.5 cracked.guide::kind::approach
