#separator:tab
#html:true
#notetype:Basic
#tags column:3
#deck:cracked.guide::TAOCP Vol 1::1.2.1 Mathematical Induction
#columns:Front	Back	Tags
TAOCP §1.2.1 Mathematical Induction: what does it cover?	Induction as the main tool for proving things about integers and about programs. Knuth goes further than a typical math class by showing how to prove an algorithm correct by attaching assertions to each step of a flowchart, using an extended version of Euclid's algorithm as the worked example.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.1 cracked.guide::kind::about
TAOCP §1.2.1: why does it matter?	Loop invariants, the thing that makes binary search and in-place algorithms correct, are induction in disguise. Once you can write the invariant, debugging off-by-one errors gets a lot less random.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.1 cracked.guide::kind::why
TAOCP §1.2.1, a common trap: “Reading the assertion proof without actually checking each arrow.” What's the catch?	You will not absorb it passively.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.1 cracked.guide::kind::trap
TAOCP §1.2.1: what traps should you watch for?	<ul><li>Forgetting the base case or proving the step only for large n.</li><li>Strengthening the hypothesis is often the trick: if the induction step will not go through, try proving something stronger.</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.1 cracked.guide::kind::traps
TAOCP §1.2.1, exercise 1 (rated 05): what is it asking?	Adapt induction to start from zero. Checks you know what the base case is actually for.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.1 cracked.guide::kind::exercise
TAOCP §1.2.1, exercise 2 (rated 15): what is it asking?	Find the hole in a bogus induction proof. Great training for code review.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.1 cracked.guide::kind::exercise
TAOCP §1.2.1, exercise 3 (rated 18): what is it asking?	Another plausible proof that fails at a specific n. Subtler than the last one.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.1 cracked.guide::kind::exercise
TAOCP §1.2.1, exercise 5 (rated 21): what is it asking?	Prove every integer above 1 factors into primes, using strong induction.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.1 cracked.guide::kind::exercise
TAOCP §1.2.1, exercise 6 (rated 20): what is it asking?	Check that the extended Euclid invariants survive one step. This is the core technique of the section in miniature.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.1 cracked.guide::kind::exercise
TAOCP §1.2.1, exercise 8 (rated 25, recommended): what is it asking?	Prove a pattern about odd numbers summing to cubes, then use it to get the closed form for the sum of cubes.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.1 cracked.guide::kind::exercise
TAOCP §1.2.1, exercise 13 (rated M23, recommended): what is it asking?	Add a step counter to extended Euclid and prove a bound on it with assertions. Program proofs meet running time.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.1 cracked.guide::kind::exercise
TAOCP §1.2.1, exercise 15 (rated HM28, recommended): what is it asking?	Work out how induction should go for statements about two integers. The stretch, and it leads to well-ordering.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.1 cracked.guide::kind::exercise
TAOCP §1.2.1: how many exercises, and how are they rated?	15 exercises, rated 05 to 50.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.1 cracked.guide::kind::exercises
TAOCP §1.2.1: what should you be comfortable with first?	<ul><li>1.1 Algorithms</li><li>Basic induction proofs (week 0)</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.1 cracked.guide::kind::prereqs
TAOCP §1.2.1: how should you work through it?	Read the basic induction material quickly if you have seen it before. Slow way down for the flowchart-with-assertions proof of the extended Euclid algorithm: copy the flowchart onto paper and check every assertion yourself, step by step. That technique is the payoff of the section.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.2.1 cracked.guide::kind::approach
