#separator:tab
#html:true
#notetype:Basic
#tags column:3
#deck:cracked.guide::TAOCP Vol 3::5.1.3 Runs
#columns:Front	Back	Tags
TAOCP §5.1.3 Runs: what does it cover?	Ascending runs in a permutation, the Eulerian numbers that count permutations by number of runs, and the distribution of run lengths in random data.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.3 cracked.guide::kind::about
TAOCP §5.1.3: why does it matter?	Natural merge sort and Timsort exploit runs in real data. Knowing how long runs are in random input tells you when that pays off.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.3 cracked.guide::kind::why
TAOCP §5.1.3, a common trap: “Confusing runs up with alternating runs (up-down sequences).” What's the catch?	They are different statistics.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.3 cracked.guide::kind::trap
TAOCP §5.1.3, exercise 13 (rated 05): what is it asking?	Average number of piles in a card-game version of runs. A quick check that you can use the main formula.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.3 cracked.guide::kind::exercise
TAOCP §5.1.3, exercise 6 (rated M21, recommended): what is it asking?	Find the flaw in a bogus derivation that n! equals zero. Good practice spotting an illegal swap of sums.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.3 cracked.guide::kind::exercise
TAOCP §5.1.3, exercise 2 (rated M22, recommended): what is it asking?	Prove a generalization of the identity that expresses powers through Eulerian numbers.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.3 cracked.guide::kind::exercise
TAOCP §5.1.3, exercise 15 (rated M21, recommended): what is it asking?	Alternating up-and-down runs, the older notion of a run. Set up the counting and compare with ordinary runs.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.3 cracked.guide::kind::exercise
TAOCP §5.1.3, exercise 20 (rated M21, recommended): what is it asking?	Connect runs to the number of left-to-right passes needed to read a permutation in order.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.3 cracked.guide::kind::exercise
TAOCP §5.1.3, exercise 27 (rated M21, recommended): what is it asking?	Show that Eulerian numbers also count increasing forests by their leaves. A clean bijection.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.3 cracked.guide::kind::exercise
TAOCP §5.1.3, exercise 19 (rated M26, recommended): what is it asking?	Count rook placements on a chessboard by how many fall below the diagonal. Eulerian numbers show up unexpectedly.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.3 cracked.guide::kind::exercise
TAOCP §5.1.3, exercise 29 (rated M30, recommended): what is it asking?	Count permutations by peaks and relate them to alternating runs. The stretch.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.3 cracked.guide::kind::exercise
TAOCP §5.1.3: how many exercises, and how are they rated?	29 exercises, rated 05 to HM42.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.3 cracked.guide::kind::exercises
TAOCP §5.1.3: what should you be comfortable with first?	<ul><li>5.1.1 Inversions</li><li>1.2.6 Binomial Coefficients</li></ul>	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.3 cracked.guide::kind::prereqs
TAOCP §5.1.3: how should you work through it?	Generate random permutations and histogram the run lengths, then compare with the formulas. Build a small table of Eulerian numbers by recurrence.	cracked.guide cracked.guide::phase::taocp-3 cracked.guide::section::5.1.3 cracked.guide::kind::approach
