# TAOCP Volume 4A: Combinatorial Algorithms, Part 1

> Knuth's The Art of Computer Programming, Volume 4A (first edition, 2011, ISBN 0-201-03804-8), as studied on the cracked.guide path in weeks 118 to 133: 17 reading guides, 1498 exercises, about 122 hours.

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.

## Every section, week by week

| Section | Week | Exercises | Picked | Hours |
| --- | --- | --- | --- | --- |
| [7 Combinatorial Searching intro (part 1)](https://cracked.guide/guide/knuth-w100-0) | 118 | 145 (M00 to 50) | 8 | 7 |
| [7 Combinatorial Searching intro (part 2)](https://cracked.guide/guide/knuth-w101-0) | 119 | 145 (M00 to 50) | 8 | 8 |
| [7.1.1 Boolean Basics (part 1)](https://cracked.guide/guide/knuth-w102-0) | 120 | 133 (05 to M48) | 8 | 7 |
| [7.1.1 Boolean Basics (part 2)](https://cracked.guide/guide/knuth-w103-0) | 121 | 133 (05 to M48) | 8 | 8 |
| [7.1.2 Boolean Evaluation](https://cracked.guide/guide/knuth-w104-0) | 122 | 88 (15 to 47) | 8 | 7 |
| [7.1.3 Bitwise Tricks and Techniques (part 1)](https://cracked.guide/guide/knuth-w105-0) | 123 | 218 (10 to 47) | 8 | 8 |
| [7.1.3 Bitwise Tricks and Techniques (part 2)](https://cracked.guide/guide/knuth-w106-0) | 124 | 218 (10 to 47) | 8 | 8 |
| [7.1.4 Binary Decision Diagrams (part 1)](https://cracked.guide/guide/knuth-w107-0) | 125 | 267 (05 to M47) | 8 | 8 |
| [7.1.4 Binary Decision Diagrams (part 2)](https://cracked.guide/guide/knuth-w108-0) | 126 | 267 (05 to M47) | 8 | 8 |
| [7.2.1.1 Generating All n-Tuples](https://cracked.guide/guide/knuth-w109-0) | 127 | 112 (10 to HM48) | 8 | 8 |
| [7.2.1.2 Generating All Permutations](https://cracked.guide/guide/knuth-w110-0) | 128 | 113 (M15 to 48) | 8 | 8 |
| [7.2.1.3 Generating All Combinations](https://cracked.guide/guide/knuth-w111-0) | 129 | 111 (M01 to M49) | 8 | 7 |
| [7.2.1.4 Generating All Partitions](https://cracked.guide/guide/knuth-w112-0) | 130 | 73 (15 to 47) | 8 | 7 |
| [7.2.1.5 Generating All Set Partitions](https://cracked.guide/guide/knuth-w113-0) | 131 | 82 (14 to HM46) | 8 | 6 |
| [7.2.1.6 Generating All Trees](https://cracked.guide/guide/knuth-w114-0) | 132 | 124 (05 to HM46) | 8 | 8 |
| [7.2.1.7 History and Further References](https://cracked.guide/guide/knuth-w115-0) | 133 | 32 (10 to M40) | 7 | 4 |
| [Vol 4A review](https://cracked.guide/guide/knuth-w115-1) | 133 | 1498 (M00 to 50) | 8 | 5 |

## 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

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.


## 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.

---

Source: https://cracked.guide/taocp/volume-4a
cracked.guide: A free, dated 145-week path to getting genuinely cracked at programming.
