Knuth · Weeks 118 to 133

TAOCP Volume 4A: Combinatorial Algorithms, Part 1

Volume 4A is Knuth at his most playful: puzzles, graphs, Boolean functions, bit tricks, binary decision diagrams, and efficient ways to generate every tuple, permutation, combination, partition and tree. It uses MMIX instead of MIX where it shows machine code, but most of it is plain algorithm steps.

16weeks
17reading guides
1,498exercises
~122hours

Every section, week by week

SectionWeekExercisesPickedTime
7 Combinatorial Searching intro (part 1)118145 (M00 to 50)87 h
7 Combinatorial Searching intro (part 2)119145 (M00 to 50)88 h
7.1.1 Boolean Basics (part 1)120133 (05 to M48)87 h
7.1.1 Boolean Basics (part 2)121133 (05 to M48)88 h
7.1.2 Boolean Evaluation12288 (15 to 47)87 h
7.1.3 Bitwise Tricks and Techniques (part 1)123218 (10 to 47)88 h
7.1.3 Bitwise Tricks and Techniques (part 2)124218 (10 to 47)88 h
7.1.4 Binary Decision Diagrams (part 1)125267 (05 to M47)88 h
7.1.4 Binary Decision Diagrams (part 2)126267 (05 to M47)88 h
7.2.1.1 Generating All n-Tuples127112 (10 to HM48)88 h
7.2.1.2 Generating All Permutations128113 (M15 to 48)88 h
7.2.1.3 Generating All Combinations129111 (M01 to M49)87 h
7.2.1.4 Generating All Partitions13073 (15 to 47)87 h
7.2.1.5 Generating All Set Partitions13182 (14 to HM46)86 h
7.2.1.6 Generating All Trees132124 (05 to HM46)88 h
7.2.1.7 History and Further References13332 (10 to M40)74 h
Vol 4A review1331498 (M00 to 50)85 h

Each section links to its reading guide: what it covers, how to approach it, exercises picked from the book with their ratings, common traps and links. Picked is how many exercises the guide recommends; time is its budget for the week.

What you will be able to do

  • Use bitwise and broadword tricks fluently in C.
  • Build and use BDDs and ZDDs.
  • Generate combinatorial objects in Gray-code orders and test code exhaustively with them.
  • Solve 2SAT and Horn satisfiability in linear time.

Before you start

  • Vols 1 to 3.
  • MMIX basics from Vol 1 Fascicle 1 or Knuth's MMIX page, mainly for 7.1.3.

Getting the book

The current edition is the first edition (2011), ISBN 0-201-03804-8.

Vol 4A is about $64 new from InformIT. It is too new to be dirt cheap used. The paperback Fascicles 0 to 4 contain earlier drafts of the same material and sometimes turn up cheap used. Borrow before you buy: many public and university libraries give you free access to O'Reilly Learning, which carries TAOCP; Libby/OverDrive and interlibrary loan (search WorldCat) work too. Older used editions are fine for Vols 1 to 3; section numbers barely changed. If you buy the eBook, get the PDF from InformIT. Knuth himself warns that the Kindle and ePUB versions mangle the math.

What you need has every option with prices, and which edition do I need covers the differences.

Tips

  • Vol 4A is huge; you are reading selected sections, not all of it.
  • The exercises are full of puzzles. Pick the ones that make you curious.

Questions

How long does TAOCP Volume 4A take?

On the cracked.guide path it takes 16 weeks (weeks 118 to 133), about 4 months, and the reading guides budget about 122 hours in all.

How many exercises are in TAOCP Volume 4A?

1498 in the sections the path covers, rated M00 to 50, and 452 of them carry Knuth's triangle for recommended. Each reading guide picks the ones worth your time.

Which edition of Volume 4A do I need?

The current one is the first edition (2011). There is only one edition; the earlier paperback fascicles are drafts of the same material. Buy the PDF, not Kindle, if you want an eBook.