Volume P0 · Guide
How to read an exercise: the ratings and the markers
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 rating scale
Each exercise of TAOCP has a rating, a number from 00 to 50 in square brackets before the text. The rating estimates the time that a prepared reader needs. The scale grows roughly like a logarithm: each step of ten points multiplies the time by a large factor.
The six bands
The handbook reads the scale in six bands. The words are those of the handbook. Read Knuth's own description in the Notes on the Exercises.
| Band | What it asks of you | Time for a prepared reader |
|---|---|---|
| 00 to 09 | Recall a fact of the text. You can answer in your head. | seconds |
| 10 to 19 | Think once about what you just read. Paper can help. | about a minute |
| 20 to 29 | Use the text in a short argument or a short computation. | a quarter of an hour to half an hour |
| 30 to 39 | Find an idea that the text does not give, then do real work. | two hours or more |
| 40 to 49 | Do a large piece of work, of the size of a course project. | days or weeks |
| 50 | Solve a research problem that was open when the book was printed. | unknown |
A rating between two bands means something between them. A rating of 17 is a little easier than an average exercise. A rating of 23 is a little harder.
Example. Exercise 1.2.6-1 has the rating 00. It asks for a value that you read from a definition. If you need more than a few seconds, read the definition again.
Example. Exercise 1.2.3-15 has the rating M22. It is an average exercise with a mathematical side. Plan for about twenty minutes, and expect to use one method of the section, not a new idea.
The last digit
The last digit of a rating carries a second message. A rating that ends in 5, such as 25, asks for more insight. A rating just below it, such as 24, asks for more routine work. So an exercise rated 24 can take longer than one rated 25, but the one rated 25 needs a better idea.
Example. Two exercises in the same section have the ratings M24 and M25. The first may be a long computation with a clear plan. The second may be short once you see the trick. Give the first steady work. Give the second time to think before you write.
Research problems
A rating of 50 marks a problem that was open when the book was printed. In Volume 1, a rating of 46 to 49 also marks an open problem, and the number grows with the number of attacks that the problem has resisted. When a reader solves a problem of this kind, its rating can fall in a later printing.
The map of the project treats every exercise rated 46 to 50 as a candidate for the kind K9, research (Section 2.5). The research list of the project records the state of each one, because some were solved after the printing (spec 07.6).
Example. Volume 1 used Fermat's Last Theorem as its sample of a problem rated HM45 (exercise V1-NE-4 in the numbering of spec 07.5). The theorem was proved in 1995. So a rating is a statement about the state of knowledge at a date, not a fixed fact.
A rating is a guess
Knuth says plainly that ratings are estimates. A problem that is easy for one reader is hard for another. Also, the rating is for a reader with pencil and paper. A rating of 20 can mean a hard proof in Lean, and a rating of 40 can mean a short computation by machine (spec 03.6). Use the rating as a guide for your plan, not as a judgement of your ability.
Example. An exercise rated 20 asks for a count that you can get by a short argument. A friend writes a ten-line program, runs all cases up to , and guesses the formula. The guess is not a proof, but it tells your friend what to prove. The rating does not change, but the path does.
How much time to give an exercise
The rating gives the time of a prepared reader. A student is not yet prepared, so a student needs more time. This section gives a plan for each band: how long to work before you read the first hint, and how long before you read the answer. The numbers are advice of the handbook, not rules of the book.
The plan by band
| Band | Work before the first hint | Work before the answer |
|---|---|---|
| 00 to 09 | one minute | five minutes |
| 10 to 19 | five minutes | fifteen minutes |
| 20 to 29 | thirty to forty minutes | one hour, after all hints |
| 30 to 39 | one session of two hours | two sessions on two days, after all hints |
| 40 to 49 | a week of work | when the project is done or stopped |
| 50 | no fixed time | read the state of the problem first |
The hints are in the Solutions volume of the handbook (Chapter 3). Each exercise has one to three hints. The first hint says where to look. The second gives the method. The third gives the key step. Read one hint, then work again for at least half the time of the line above.
Example. You start an exercise rated 12. After five minutes you have nothing. Read the definition in the section once more, then try again for ten minutes. If you still have nothing, read the first hint. Exercises of this band usually need only the text that you just read.
Example. You start an exercise rated M28. You work for forty minutes and find a recurrence, but you cannot solve it. Read the first hint. It may tell you that Section 1.2.6 has the identity you need. You find it and finish in twenty more minutes. You used one hint and did most of the work yourself.
Signs that you should stop
Stop and read a hint when one of these is true:
- You have worked for the time of the table and have no new idea since the last half of it.
- You do not understand a word or a symbol of the exercise. Go back to the section first.
- Your method grows longer and longer, and the rating is below 30. A rating below 30 usually means a short way exists.
Do not stop because the first idea fails. Most exercises of rating 20 and above need two or three tries.
Example. An exercise rated 25 asks for a closed form. You start an induction, and the algebra fills two pages. The rating suggests a shorter path. Stop, compute the first five values, and look at them. Often the numbers suggest a known sequence, and the known sequence suggests the method.
Small cases first
Before a long attack, compute small cases. Write the quantity for , 1, 2, 3 and 4, by hand or by a short program. Small cases do three jobs: they test your understanding of the question, they suggest the answer, and they check your answer at the end.
Example. An exercise asks for . For , 2, 3 and 4, the values are 1, 4, 12 and 32. These are . Now you know what to prove, and you can look for a proof by the absorption identity of Section 1.2.6, which P2 Ch. 6 teaches.
Example. An exercise asks how many times a step of an algorithm runs. Run the algorithm by hand on three inputs of size 3. If your formula gives a different count on one of them, the formula is wrong, and you found the error before you wrote a proof.
The markers M and HM
A rating can have a letter in front of it: M or HM. The letters do not change the time. They tell you what kind of knowledge the exercise needs.
The marker M
M marks an exercise that is mathematical. It asks for more mathematics than a reader needs who only wants to program the algorithms. It often asks for a proof, an identity or a count. A reader who reads TAOCP for the programs can leave the M exercises out. A reader who wants the analyses must do many of them.
In Volumes 1 to 4B, 2,301 of the 5,359 exercises have the marker M (spec 03.6). In Section 1.2, most exercises have it.
The background for M exercises is P1 and P2. P1 teaches proof and induction. P2 teaches the sums, the integer functions and the special numbers of Section 1.2.
Example. Exercise 1.2.4-24 is rated M20. It asks how far the laws of congruence of the section extend from integers to real numbers. You need the definition of for real , a careful case split, and a counterexample where a law fails. P2 Ch. 4 and Ch. 5 give the tools.
Example. Exercise 1.2.3-15 is rated M22. It asks for a closed form of a sum by a method of the section. It needs only algebra, but it needs it carefully. This is a typical M exercise of the 20 band.
The marker HM
HM marks an exercise that needs higher mathematics: calculus, real or complex analysis, or other mathematics that the book does not develop. HM does not mean hard. An HM exercise can be rated 15 if it needs only one fact of calculus.
In Volumes 1 to 4B, 615 exercises have the marker HM (spec 03.6). Most of them are about asymptotics, infinite series and integrals.
The background for HM exercises is P5, with P3 for generating functions. P5 teaches asymptotics and the complex analysis that the analysis of algorithms uses.
Example. Exercise 1.2.3-5 is rated HM20. It asks you to prove a rule for sums when the sums are infinite series. You need the definition of a convergent series and of its limit. The algebra is easy. The point is the analysis.
Example. An exercise rated HM30 in Section 1.2.6 gives a formula with cosines for a sum of binomial coefficients. You need complex numbers and roots of unity. Section 2.6 plans an attack on it.
Exercises with no marker
An exercise with no letter asks about programs, algorithms or the text. Many of them ask you to write a program, change an algorithm or explain a step. Some ask for your opinion. Read them as a programmer would.
Example. An exercise with no marker in Section 1.3.2 asks you to write a short MIX program. The background is P7. You check the program in the MIX simulator of the learner kit.
Example. An exercise with no marker asks why an algorithm needs a certain step. The answer is a sentence or two. The map gives such an exercise the kind informal when it has no formal content (Section 2.5).
The triangle
Some exercises have a small black triangle, ▶, before their number. The triangle marks an exercise that Knuth recommends: one that teaches much for the time it takes. In Volumes 1 to 4B, 1,110 of the 5,359 exercises have it (spec 03.6).
How to use the triangle
Nobody works all the exercises. The triangle tells you which ones to do first. A good plan for a first reading of a section is this:
- Work every exercise rated 10 or less. Knuth suggests this for every reader.
- Work every exercise with a triangle whose rating fits your time.
- Read the answers of the other exercises, at least for the topics that you want to know well.
The handbook follows the triangle too. The Solutions volumes write the solutions of the recommended exercises first (spec 11.10). The part "The exercises" of each companion section says which exercises to do first, and the recommended ones are on that list.
Example. Section 1.2.6 of Volume 1 has more than 60 exercises. On a first reading, work exercises 1 to 4, which are rated 10 or less, and then the recommended ones that fit your plan, for example 1.2.6-5 and 1.2.6-6. This gives a good start in a few hours.
Example. Exercise 1.2.6-10 is rated M25 and has the triangle. It teaches the behaviour of binomial coefficients modulo a prime, a tool that Volumes 2 and 4 use again. So the triangle points at an exercise that pays back later.
The triangle is not a rating
The triangle says nothing about difficulty. A recommended exercise can be rated 05 or 40. A recommended exercise with a high rating is still a large job. Plan it with the table of Section 2.2.
Example. Exercise 1.2.3-9 is rated 05 and has the triangle. It asks a short question about a step of a derivation in the text. It takes a minute, but it makes you read one line of the text with care. That is why it is recommended.
Example. A recommended exercise rated M30 asks for a full proof of an identity. Give it two sessions. Its value is in the method, so after you finish, compare your proof with the answer and with the solution of the handbook.
The kinds of exercise
The map of the project gives each exercise a kind (spec 06.3). The kind says what the exercise asks you to produce: a proof, a value, an estimate, an algorithm, a program, an analysis, a computation, or the state of a research problem. The kind also fixes the form of the Lean statement. Chapter 4 shows these forms. This section says what each kind means for you as a reader.
The ten kinds
| Kind | The exercise asks you to | What you hand in | What a check looks like |
|---|---|---|---|
| K1 prove | prove a stated fact | a proof | each step follows; small cases agree |
| K2 decide | answer yes or no | the answer and a proof or a counterexample | the counterexample is small and checkable |
| K3 find a value | find a number, a set or a closed form | the value and a proof | the value agrees with a computation for small |
| K4 find an estimate | find an asymptotic form or a bound | the main term, the error term and a proof | the estimate agrees with exact values for large |
| K5 design an algorithm | give a method with a cost | the method, its proof and its cost | a run on small inputs; the cost is as asked |
| K6 write a program | write a MIX or MMIX program | the program and its time | a run in the simulator |
| K7 analyze | find a mean, a variance or a distribution | the formula and a proof | an average over all small inputs |
| K8 compute by machine | find a value by a large computation | the value and a certificate | another program agrees |
| K9 research | solve an open problem | the state of the problem | a dated survey of what is known |
| informal | discuss, recall history, give an opinion | a short text | none |
A multi-part exercise has one kind for each part. "Write a program, then find its running time" has two parts: K6 for the program and K7 for the time.
Example. "Prove eq. (17) of the section" is K1. You hand in a proof. You can check each line of it, and you can test the identity for small values.
Example. "Find a closed form for a sum" is K3. Your answer is a formula. A closed form may use powers, factorials, binomial coefficients, harmonic and Fibonacci numbers, floors and ceilings, and logarithms. A sum of terms is not a closed form of a sum of terms. The fidelity check F4 tests this for the Lean answer (spec 06.6).
What the kind means for your plan
The kind tells you what a finished answer looks like. Decide this before you start.
- For K1 and K2, the work is a proof. Start from the definitions.
- For K3 and K7, the work is a computation and a proof. Start from small cases.
- For K4, the work is an estimate. Find the exact value first when you can, then the main term.
- For K5 and K6, the work is a design. Write the invariant before the code.
- For K8, the work is a program. Plan how a second person can check its output.
- For K9, the work is reading. Find what is known before you try anything.
Example. An exercise asks for an algorithm that lists all subsets of a set in constant time per subset. This is K5. The cost bound is part of the task. A method that takes time for each subset does not solve it, even if it lists all subsets.
Example. An exercise asks for the mean number of times a step runs, over all orders of the input. This is K7. Compute the average for , 2 and 3 by listing all orders. For there are only 6 orders. Your formula must give these three averages.
Informal exercises
An exercise is informal when it has no formal content: an opinion, a question of history, or a request to run a program on your own computer. The map accepts the kind informal only when two people agree that no faithful statement exists. The handbook gives an answer in words for each one.
Example. An exercise that asks which algorithm of a chapter you find most surprising is informal. The handbook gives a short discussion, and you write your own answer.
Example. An exercise that asks about the speed of "your computer" usually has a formal core about MIX or MMIX. The map takes that core, so the exercise is K6 or K7, not informal.
Three exercises at three ratings
This section plans an attack on three exercises of Section 1.2.6 of Volume 1. They have the ratings 05, M25 and HM30. Open your copy at the exercises of Section 1.2.6 and read each one before you read its plan here. The plans stop before the solution. The solutions are in X1.
Exercise 1.2.6-5, rated 05, recommended
What it asks. It links a power of 11 with a row of Pascal's triangle. The kind is K1: you explain why a fact holds.
The plan. The rating 05 says that the answer is one idea from the section. The section is about binomial coefficients, so look for the binomial theorem. Write and expand . Each term is a binomial coefficient times a power of 10.
The check. The row of Pascal's triangle for is 1, 4, 6, 4, 1. Read it as the digits of a number. Then compute by hand.
Example. Try the same idea for . The row is 1, 5, 10, 10, 5, 1, and . The digits do not match the row, because 10 is not one digit. The terms carry into the next place. A good answer to the exercise says for which the simple reading works, and why.
Time. One or two minutes. If you need more, read the binomial theorem of Section 1.2.6 again. P2 Ch. 6 teaches it with a full proof.
Exercise 1.2.6-10, rated M25, recommended
What it asks. It asks for three congruences that binomial coefficients satisfy modulo a prime . The kind is K1, in three parts.
The plan. The rating M25 says: average length, but one real idea. The marker M says that the idea is mathematical. The section gives the factorial formula and the addition formula. The idea is to look at which factors of a factorial are multiples of , or to use the addition formula with induction on the lower index.
The check. Take . The row of Pascal's triangle is 1, 5, 10, 10, 5, 1. Every inner entry is a multiple of 5. The row is 1, 4, 6, 4, 1, and modulo 5 this is 1, 4, 1, 4, 1, that is, . Such numbers suggest the statements and test your proof.
Example. Take and . Then , and . Also . A small case of this kind tests one of the three parts. Before you write a proof, test each part on two or three such cases.
Time. About half an hour for a prepared reader, so plan an hour. P2 Ch. 5 (congruences and Fermat's theorem) and P2 Ch. 6 (binomial coefficients) give the background.
Exercise 1.2.6-38, rated HM30
What it asks. It gives a formula with cosines for the sum of every th binomial coefficient of a row: the terms , , , and so on. The kind is K1.
The plan. The marker HM says that the proof needs mathematics outside the book; here, complex numbers. The rating 30 says that you need an idea and some work. The idea is to average over the th roots of unity . The average keeps exactly the terms whose index has the right residue modulo . Then write in polar form, and pair each root with its complex conjugate. The cosines come from these pairs.
The check. Start with and . Add and , and divide by 2. You get the sum of the even entries of row , which is for . Next take . For , the three sums are , and . Any formula that you derive must give 5, 5 and 6.
Example. For , and , the cube roots of unity are , and , with . So . The average is . This agrees with the count above.
Time. Two hours or more. Spread it over two sessions. P3 teaches the averaging over roots of unity, and P5 teaches the complex numbers that it uses.
What the three plans have in common
Each plan did four things before any proof:
- It read the rating and the marker, and chose a time.
- It named the kind, so it knew what a finished answer looks like.
- It named one tool from the section or from a P volume.
- It computed small cases, to test the question and later the answer.
Use the same four steps on every exercise.
Things to try
- Pick five exercises of Section 1.2.3 with different ratings. For each, write the band, the marker and the time that you plan to give it (Sections 2.1 and 2.2).
- Find three recommended exercises in Section 1.2.4. Work the one with the lowest rating. P2 Ch. 4 and Ch. 5 teach the background.
- For one M exercise of Section 1.2.6, compute the quantity for to 4 before you start. P2 Ch. 6 and Ch. 7 teach the identities.
- Find an exercise rated 46 or more in Volume 1, and find out on the site whether it is still open. Chapter 5 shows how to search the site.
- Name the kind (K1 to K9 or informal) of five exercises of Section 1.2.10 (Section 2.5). P4 teaches the probability that those exercises use.
The exercises are the heart of TAOCP. The book has 5,359 of them in Volumes 1 to 4B, and each one carries a rating and sometimes a marker. The rating tells you how long the exercise should take. The marker tells you what kind of knowledge it needs. This chapter teaches you to read these signs and to plan your time with them.
Section 2.1 gives the rating scale in the handbook's words. Section 2.2 says how much time to give an exercise in each band, before you read a hint and before you read the answer. Section 2.3 explains the markers M and HM. Section 2.4 explains the triangle that marks a recommended exercise. Section 2.5 gives the kinds of exercise of the map, K1 to K9 and informal, and what each kind means for you. Section 2.6 plans an attack on three exercises of Volume 1 at three ratings.
Knuth explains his scale in the Notes on the Exercises at the front of each volume (Volume 1, pages xv to xvii). Read those pages in the book. This chapter does not copy them. It tells you how the handbook uses the same scale.
The source of this page. Something is wrong? Report it.