#separator:tab
#html:true
#notetype:Basic
#tags column:3
#deck:cracked.guide::TAOCP Vol 2::4.3.2 Modular Arithmetic
#columns:Front	Back	Tags
TAOCP §4.3.2 Modular Arithmetic: what does it cover?	Representing big numbers by their remainders modulo several coprime moduli, so that addition and multiplication become independent small operations, then reconstructing the answer with the Chinese remainder theorem.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.2 cracked.guide::kind::about
TAOCP §4.3.2: why does it matter?	Residue number systems are used in cryptography and in fast polynomial and integer arithmetic. CRT also shows up in competitive programming and hashing.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.2 cracked.guide::kind::why
TAOCP §4.3.2: what traps should you watch for?	<ul><li>Moduli that are not pairwise coprime break the reconstruction.</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.2 cracked.guide::kind::traps
TAOCP §4.3.2, exercise 1 (rated 20): what is it asking?	Solve a small Chinese remainder problem by hand.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.2 cracked.guide::kind::exercise
TAOCP §4.3.2, exercise 4 (rated 20): what is it asking?	Keep choosing moduli greedily as the text does.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.2 cracked.guide::kind::exercise
TAOCP §4.3.2, exercise 3 (rated M26, recommended): what is it asking?	The Chinese remainder theorem when moduli share factors.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.2 cracked.guide::kind::exercise
TAOCP §4.3.2, exercise 5 (rated M23, recommended): what is it asking?	Does the greedy choice of moduli give the best product?	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.2 cracked.guide::kind::exercise
TAOCP §4.3.2, exercise 7 (rated M21, recommended): what is it asking?	Rearrange the mixed-radix reconstruction to save work.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.2 cracked.guide::kind::exercise
TAOCP §4.3.2, exercise 12 (rated M10): what is it asking?	Detecting overflow in modular addition is a comparison problem.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.2 cracked.guide::kind::exercise
TAOCP §4.3.2, exercise 13 (rated M25, recommended): what is it asking?	Find all decimal automorphs like 9376. A fun application of the theorem.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.2 cracked.guide::kind::exercise
TAOCP §4.3.2, exercise 14 (rated M30, recommended): what is it asking?	Cyclic convolution and multiplication modulo a Mersenne-style number. The stretch, and a bridge to 4.3.3.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.2 cracked.guide::kind::exercise
TAOCP §4.3.2: how many exercises, and how are they rated?	14 exercises, rated M10 to M30.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.2 cracked.guide::kind::exercises
TAOCP §4.3.2: what should you be comfortable with first?	<ul><li>4.3.1 The Classical Algorithms</li><li>1.2.4 Number theory</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.2 cracked.guide::kind::prereqs
TAOCP §4.3.2: how should you work through it?	Implement CRT reconstruction for three small moduli and test it. Make sure you can compute a modular inverse with extended Euclid.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.3.2 cracked.guide::kind::approach
