Volume P0 · Guide
What TAOCP is, its volumes and fascicles, and which printing to use
Draft. This chapter is written and checked by the tools of the project, and a person has not reviewed it yet. Read it with care.
Contents
The plan of the series
TAOCP is one long work in several volumes. Knuth numbers the chapters through the whole series, so Chapter 5 is in Volume 3 and Chapter 7 starts in Volume 4A. A section number such as 1.2.6 tells you the chapter (1), the section (1.2) and the subsection (1.2.6). The handbook uses these numbers everywhere.
The volumes in print
The table gives the five volumes in print, with the edition that the project follows (spec 07.3).
| Volume | Title | Edition | Chapters |
|---|---|---|---|
| 1 | Fundamental Algorithms | 3rd ed., 1997 | 1 Basic Concepts; 2 Information Structures |
| 2 | Seminumerical Algorithms | 3rd ed., 1997 | 3 Random Numbers; 4 Arithmetic |
| 3 | Sorting and Searching | 2nd ed., 1998 | 5 Sorting; 6 Searching |
| 4A | Combinatorial Algorithms, Part 1 | 1st ed., 2011 | 7 (opening), 7.1 Zeros and Ones, 7.2.1 |
| 4B | Combinatorial Algorithms, Part 2 | 1st ed., 2023 | Mathematical Preliminaries Redux, 7.2.2 Backtrack Programming, with 7.2.2.1 and 7.2.2.2 |
Chapter 7, Combinatorial Searching, is so large that it fills Volumes 4A and 4B and continues into later volumes. The plan has further volumes after 4B. Volume 4C continues Chapter 7. Volume 5 is planned for syntactic algorithms. The project maps a later part only when Knuth releases it (spec 07.4).
Example. Section 2.3.4.5 is in Volume 1, because Chapter 2 is in Volume 1. It is subsection 5 of 2.3.4, which is part of 2.3 (Trees). The number alone tells you where to look.
Example. Section 7.2.2.2 (Satisfiability) is in Volume 4B. Section 7.1.3 (bitwise tricks) is in Volume 4A. Both belong to Chapter 7, but they are in different books.
The fascicles
A fascicle is a short paperback that gives a part of a future volume before the volume is complete. Knuth uses fascicles to publish new sections early and to get corrections from readers. When the volume appears, the text of the fascicle goes into it, often with changes.
The fascicles that matter to the handbook are these:
- Volume 1, Fascicle 1 (2005). It describes MMIX, the new machine of the series. Volume 4 uses MMIX, so a reader of Chapter 7 needs this fascicle or P7, the volume of the handbook that teaches the machines.
- Volume 4, Fascicles 5 and 6. They held early versions of the material of Volume 4B. The project maps only the text of Volume 4B and keeps the fascicles as a source of errata (spec 07.2).
- Volume 4, Fascicle 7 (2025). It gives Section 7.2.2.3, constraint satisfaction, which will go into Volume 4C.
Knuth also posts pre-fascicles on his web page. A pre-fascicle is a draft. Its exercise numbers can change from one draft to the next, so the project gives a draft exercise a reference with the date of the draft, for example 7.2.2.4-224@2026-04-10 (spec 07.5).
Example. Suppose that a friend cites "exercise 7.2.2.2-100". You look in Volume 4B. If your friend used Fascicle 6, the number may point to a different exercise there. Ask which book the number came from.
What the volumes contain
Each volume has a preface, a list of contents, the chapters, the answers to the exercises, appendices with tables and notation, and an index. Each section of a chapter has text, numbered equations, algorithms, often programs, and then a set of exercises. The answers are at the back of the volume (Section 1.5).
The book has seven kinds of objects: definitions, theorems, algorithms, programs, analyses, exercises, and prose that makes a claim (spec 03.1). The handbook explains all of them. The map of the project gives each one a node (Chapter 5).
Example. Section 1.2.6 of Volume 1 has many numbered equations, for example eq. 1.2.6(21), Vandermonde's convolution. It has no algorithm. Section 1.1 has Algorithm 1.1E, Euclid's algorithm, and no program. Section 1.3.2 has MIX programs with their running times. So the kinds of object differ from section to section.
Example. Volume 1 has 861 exercises, Volume 2 has 890, Volume 3 has 942, Volume 4A has 1,464 and Volume 4B has 1,202 (spec 07.2). The total is 5,359. These are the counts of the extracted text that the project uses.
The order of the chapters
You can read the chapters of TAOCP in many orders. Each chapter uses some earlier ones. This section shows the dependencies, so that you can plan a route.
Chapter 1 comes first
Chapter 1 is the base of the series. Section 1.1 defines an algorithm. Section 1.2, Mathematical Preliminaries, gives the mathematics that the later chapters use without comment: sums, integer functions, binomial coefficients, harmonic and Fibonacci numbers, generating functions and asymptotic notation. Section 1.3 defines the machine MIX. Section 1.4 gives basic methods of programming, such as subroutines and coroutines.
Every later chapter refers to Section 1.2 by equation number. A reader who knows Section 1.2 well reads the rest of the series with much less effort. For this reason the handbook gives Section 1.2 the most space: P1 and P2 prepare it, C1 explains it, and X1 solves its exercises.
Example. Section 5.1.3 counts runs in permutations with the Eulerian numbers. Its analysis uses binomial identities of Section 1.2.6 and generating functions of Section 1.2.9. You need both before 5.1.3 is easy to read.
Example. Section 6.4 analyses hashing. The analysis uses the binomial theorem, sums of Section 1.2.3 and the asymptotic methods of Section 1.2.11. So a reader of 6.4 goes back to Section 1.2 many times.
The main dependencies
The table gives the main dependencies in a simple form. Each chapter also uses many single results from other places, and the map records these as edges (Chapter 5).
| Chapter | Uses mostly |
|---|---|
| 2 Information Structures | 1.1, 1.2, 1.3, 1.4 |
| 3 Random Numbers | 1.2, with the number theory of 1.2.4 |
| 4 Arithmetic | 1.2; the methods of 1.4; Chapter 3 for the random methods of 4.5.4 |
| 5 Sorting | 1.2 in full; the trees of 2.3; the permutations of 1.3.3 |
| 6 Searching | 1.2; the trees of 2.3; parts of 5 |
| 7 Combinatorial Searching | 1.2; the trees of 2.3; parts of 5.1; MMIX |
Some sections have a star in the book. A star marks a section that covers a special topic, and a first reading can omit it. The handbook follows the same rule. Each companion chapter of a starred section says so in its first paragraph.
Example. A reader who wants only Chapter 5 can read Section 1.2, then Section 2.3 up to 2.3.4, then Chapter 5. This is the core of the path "Sorting and searching" of spec 11.5.
Example. A reader who wants only Section 7.1.3 needs binary arithmetic, some of Section 1.2 and MMIX. Section 7.1.3 uses little of Chapters 2 to 6.
The order of the handbook
The handbook follows the same order. The P volumes come before the companion volumes, because they teach the mathematics that the book assumes. P2 prepares Section 1.2. P3, P4 and P5 prepare the analyses of Chapters 5 and 6. P6 prepares Chapters 3 and 4. P7 teaches MIX and MMIX. P8 prepares Chapter 7.
Example. A student who has finished a first year of calculus and discrete mathematics, and who wants Volume 1, reads P0, P1, P2 and P7 first. The student then reads C1 with X1. This is the start of the path "Full" of spec 11.5.
Example. A student who knows Concrete Mathematics well skips P2. The path "Concrete Mathematics reader" goes from P0 and P7 directly to the companion volumes.
MIX and MMIX
TAOCP gives its algorithms in two forms. The first form is a list of steps in English, with a letter and a number for each step. The second form is a program for an imagined computer. The program lets Knuth count the exact running time. The series has two such computers: MIX and MMIX.
MIX
MIX is the machine of Volumes 1, 2 and 3. Section 1.3.1 defines it. A word of MIX has a sign and five bytes. The size of a byte is not fixed: a byte holds at least 64 and at most 100 values. A program that is correct must work for every byte size in this range. MIX has an accumulator rA, an extension register rX, six index registers, a jump register, and 4000 words of memory. Each instruction has a time in units .
Section 1.3.2 gives the assembly language MIXAL. The programs of Volumes 1 to 3 are in MIXAL, with a column that counts how often each line runs. From these counts, Knuth gets a running time such as , where and are counts that depend on the input.
Example. A MIX program that finds the largest of numbers runs one loop times. The number of times that the current maximum changes depends on the order of the input. Section 1.2.10 studies this number. Its mean over all orders of distinct numbers is , where is the harmonic number of Section 1.2.7. So a fact about the time of a program becomes a fact about permutations.
Example. Because the byte size can be 64 or 100, a MIX program must not depend on the exact value of a byte. A program that keeps a number from 0 to 99 in one byte works when bytes hold 100 values. It fails when they hold 64, because 64 to 99 do not fit. The Lean model of the project states every MIX theorem for each byte size with (spec 06.5).
MMIX
MMIX is a newer machine, with 64-bit words and 256 general registers. Volume 1, Fascicle 1 defines it. Knuth plans to replace MIX by MMIX in later editions of Volumes 1 to 3. Volume 4 already uses MMIX, mostly for short programs on 64-bit words in Section 7.1.3.
Volume 4 counts the cost of a program in a new way. It counts the memory accesses, called mems and written , and the other operations, called oops and written . A cost such as means three memory accesses and twelve other operations.
Example. The ruler function gives the number of trailing zero bits of a nonzero word . For , the binary form is , so . Section 7.1.3 gives short MMIX programs for and for many similar functions, with their cost in .
Example. The book writes the cost of a backtrack program in Section 7.2.2 as a number of mems. Two programs that search the same tree can have very different costs, because one of them reads memory less often. The count in mems shows this difference without a real computer.
Where the handbook teaches the machines
P7, Machines, programs and their correctness, teaches both machines. Its first chapters describe a machine model in general, then MIX and MIXAL, then MMIX and MMIXAL. Later chapters teach how to prove a program correct and how to count its time. The path "Volume 1 course" of spec 11.5 reads P7 Ch. 1 to 7.
The learner kit of each release has a MIX simulator and the MMIX simulator of Knuth's MMIXware (spec 11.6, item 5). With them, you can run each program of a companion volume and see its time.
Example. A reader of Volume 1 who has never used an assembly language reads P7 up to MIXAL before Section 1.3.2 of the book. The reader then runs the first programs of Section 1.4 in the simulator, and checks the time that the book gives for each one.
The edition and the printing
Knuth corrects the text of TAOCP in every new printing. A printing is one run of the press. An edition is a larger revision. Two copies of the same edition can differ in a printing. Most changes are small. Some change an exercise, an answer or a rating. So the project records which text it read.
What a printing changes
Knuth keeps a list of errata for each volume on his web page. A list gives each change by page and line. The changes go into the next printing. Since 2026-11-25, Knuth does not read new error reports until he posts updated errata (spec 14.4). The project follows this rule.
Example. In Volume 1, the sample exercise rated HM45 in the Notes on the Exercises was the statement of Fermat's Last Theorem. Wiles proved the theorem in 1995. A problem that a reader solves can get a lower rating in a later printing. Volume 4B uses another famous problem as its sample. So the rating of an exercise can depend on the printing.
Example. Suppose that the answer to an exercise in your copy differs from the answer in the handbook by a constant term. Check the errata list of the volume first. The difference may be a correction that your printing does not have yet.
Which printing the project follows
The project follows the editions in the table of Section 1.1. For each volume it records the printing of its copy and the date of Knuth's errata list that it has applied. The table of spec 07.3 gives the current state. For Volume 1, the errata list of 2026-05-31 is the one in use.
Each node of the map records where its statement was read (spec 07.3):
| Field | Example | Meaning |
|---|---|---|
source |
vol1.pdf with its hash |
the file that the statement was read from |
edition |
V1 3rd ed. |
from the copyright page |
printing |
27th printing or unknown |
from the copyright page, when the copy shows it |
errata_date |
2026-05-31 |
the date of the errata list applied to the node |
rating, rating_as_of |
M22, with the printing |
the rating and the copy that gave it |
pages |
52 to 53 |
the pages of the statement and of the answer |
Example. A node with printing: unknown and errata_date: 2026-05-31 says this: the copy did not show its printing, and the project applied every correction that Knuth listed up to 31 May 2026. If your copy is newer, it agrees with the node. If your copy is older, a correction of the list can be missing from your copy.
How the handbook records it
The first page of every companion and Solutions volume gives the edition and the printing that it follows. The key follows of the file volume.yaml of a C or X volume holds the same data. The file EDITION of the handbook pins the commits of the map and of the Lean code that a build uses. So a release of the handbook names exactly the text and the records that it describes.
Example. Suppose that the first page of C1 says that it follows Volume 1, third edition, with the errata of 2026-05-31. A reader with an early printing of 1997 knows that some pages differ, and checks the errata list for each surprise.
Example. The file EDITION of a release has a line such as taocp c97f50531dbf3c7e8245bcab7ace8e2e94236a32. This is the commit of the map at the time of the build. The status of each node in that release is the status at this commit.
The answers at the back of each volume
Each volume of TAOCP ends with a long section of answers. Almost every exercise has an answer there. Knuth explains how to use them in the Notes on the Exercises (Volume 1, pages xv to xvii). This section says what the answers give and why they are short.
What an answer gives
An answer gives the result and the key idea. It often leaves out the steps between. Knuth writes the answers for a reader who has already worked on the problem. Such a reader knows the difficulties, and a short hint is enough to finish. A reader who opens the answer first finds it hard to follow.
An answer can give less than the exercise asks. It can also give much more: a generalization, a reference to a paper, or the history of the problem. Some answers are only a reference. For a research problem, the answer often says what is known.
Example. Exercise 1.2.6-5 has the rating 05. It asks for a link between a power of 11 and a row of Pascal's triangle. Its answer is one short sentence. A reader who knows the binomial theorem sees the whole argument in it. A reader who does not know the theorem sees nothing. So the length of an answer tells you what the book expects you to know.
Example. An exercise rated M30 or more can have an answer of half a page. That half page is a plan of the proof. Each step of the plan can hide an hour of work. The Solutions volumes of the handbook fill in those steps.
Why the answers are short
There are three reasons.
- The answers are for checking, not for learning. Knuth expects a reader to try each exercise first.
- The volumes are already long. Full solutions of all 5,359 exercises would double the size of the series.
- A short answer leaves room for the reader. A reader who finds the missing steps alone learns more than a reader who reads them.
The handbook keeps this idea. The Solutions volumes X1 to X5 give hints first and the full solution after them. On the site, the hints are folded and open one at a time, and the solution opens only after a click (spec 11.4). The handbook hides nothing that the book does not hide. It only helps you not to look too early.
How to use an answer
Use an answer in this order.
- Work on the exercise for the time that its rating suggests (Chapter 2).
- Read the first hint of the Solutions volume, then work again.
- Read the answer in the book.
- If the answer is not clear, read the full solution in the Solutions volume.
- Check your result with the Check part of the solution: small cases, a special value, or a computation.
You may use the results of earlier exercises in a later one, unless the book says otherwise. So a later exercise can have a lower rating than an earlier one that it extends.
Example. Suppose that you try an exercise rated M22 and you have a formula after 30 minutes. Before you read the answer, test the formula for , 2 and 3. If it fails a small case, the error is yours, and you can find it. If it passes, read the answer and compare the forms. Two correct formulas can look different.
Example. Suppose that your answer differs from Knuth's answer, and your small cases agree with a computation by machine. Check the errata list of the volume. If the difference is not there, it can be a new error. Chapter 6 says how the project treats such a case.
Where the handbook fits
The handbook is a companion to TAOCP. It is not a replacement. You need the book on the desk next to it. The handbook has three series of volumes, and each series has one job.
The three series
- The P series, P0 to P8. These volumes teach the mathematics, the machines and the reasoning about programs that TAOCP assumes or teaches fast. P0 is this guide. P1 teaches proof and induction. P2 teaches sums, integer functions, binomial coefficients and special numbers. P3 to P8 go on to generating functions, probability, asymptotics, algebra, machines and Boolean functions.
- The C series, C1 to C9. There is one companion volume for each group of chapters of TAOCP. A companion volume goes through the sections of the book in order. It explains the ideas, gives every proof in full, runs each algorithm by hand on a small input, and guides you through the exercises.
- The X series, X1 to X5. There is one Solutions volume for each volume of TAOCP: 1, 2, 3, 4A and 4B. It gives a full solution of every exercise that has an answer, with hints first, a check and a link to the Lean code.
| Series | Volumes | Pages (estimate) | Job |
|---|---|---|---|
| P | P0 to P8 | about 3,600 | the background |
| C | C1 to C9 | one volume per chapter group | the reading of each section |
| X | X1 to X5 | about 5,300 | the solutions of the exercises |
Example. A student meets eq. 1.2.6(21), Vandermonde's convolution, in Volume 1. P2 Ch. 7 teaches the identity with a full proof and its variants. The chapter of C1 on Section 1.2.6 explains how the book uses it and gives the item a number of C1. The exercises of Section 1.2.6 that use it are solved in X1.
Example. A reader of Section 5.2.2 (quicksort) needs the harmonic numbers, a recurrence and an asymptotic step. P2 has the harmonic numbers, P3 has the recurrences and P5 has the asymptotics. The companion volume for Chapter 5 cites each of them by number and does not prove them again.
The rule of own words
The handbook never copies the text of the book. It refers to each item by number: "Theorem 1.2.4A", "eq. 1.2.6(21)", "Algorithm 5.2.2Q", "exercise 1.2.6-42". It explains each idea in its own words and in its own order, with its own examples and often with its own proofs. Its algorithms are in its own pseudocode and in Lean, never in the step format of the book. A check, the leak guard, runs on every change to the handbook and stops any run of words taken from the book (spec 08.6).
So the handbook is useful only with the book. This is on purpose. The book is the source. The handbook is the teacher who sits next to you.
Example. C1 discusses Algorithm 1.1E. It does not print Knuth's steps. It gives the algorithm in its own pseudocode, runs it on an input of its own, such as and , and shows the state after each step. You read the steps of the book and compare.
Things to try
- Find the copyright page of your copy of Volume 1. Write down the edition and the printing. Compare them with the edition that the handbook follows (Section 1.4).
- Open your copy at the contents. Find Section 1.2.6 and Section 5.1.3, and count the pages between them. P2 and P3 prepare most of what lies between.
- Pick one exercise of Section 1.2.3 rated 10 or less. Work it, then read its answer at the back of the book. Note how long the answer is (Section 1.5, and Chapter 2 of this volume).
- Read the first page of Section 1.3.1 and find the range of byte sizes. P7 teaches MIX in full.
- Choose a reading path from spec 11.5 that fits your goal. Chapter 3 helps you choose.
This chapter describes the book that the handbook follows. The Art of Computer Programming (TAOCP) by Donald E. Knuth is a series of volumes on algorithms, their analysis and the mathematics behind them. The series is not finished. Five volumes are in print, and new parts appear first as short paperbacks called fascicles.
The chapter has six sections. Section 1.1 gives the plan of the series and the chapters of each volume. Section 1.2 gives the order of the chapters and the dependencies between them. Section 1.3 says which volumes use the machine MIX and which use MMIX. Section 1.4 tells which edition and printing the project follows, and how the project records it. Section 1.5 describes the answers at the back of each volume. Section 1.6 shows where the three series of the handbook fit around the book.
The chapter has no proofs and no exercises. It ends with a short list of things to try. Every reading path of the handbook starts here, and the companion volumes C1 to C9 assume it. You need a copy of the volume of TAOCP that you study. The handbook never prints the text of the book. It refers to the items of the book by number, so you read the book and the handbook side by side.
The source of this page. Something is wrong? Report it.