Donald E. Knuth Q&A Session 1 Transcript

See also the event landing page and the Q&A Session 2 Transcript.

Gruska: Good afternoon. Dear informaticians, we have today very special colloquium. We have the legend of informatics, father of analysis of algorithm, father of art of programming, father of many other books, father of TeX and so on and so on... I better stop, because I would spend probably all my time here talking about his outcome. He came here to answer your questions. Sessions will be so interesting, how interesting will be the questions you ask. There are two ways to ask questions. Either by microphone or you can use mobile. Ok?

I mentioned that this legend of informatics and one argument supporting that is when in 1989 there was the IT World Computer Congress in US in San Francisco, professor Knuth was invited to give the first talk, the most important talk. So welcome, professor Knuth. Welcome here, and you can start the session, colloquium, by asking the questions from your audience. Welcome in Brno. applause

Knuth: Prof. Gruska, do you have a question?

Gruska: Yes! 42 years ago I wrote you letter.

Knuth: Oh!

Gruska: I was waiting for answer. After one month I decided to call you. Secretary took the phone and said: "Oh, he's three months behind answering letters. However, he is next to me." So I could talk to you. Has that changed with your custom to respond to letters?

Knuth: Can you hear me? Testing... Testing, testing. Zero one, zero one. laughter

So the secretary I had 42 years ago is Phyllis Winkler who served me for many years, but she died about 15 years ago and actually retired before that. However, I go into campus at Stanford four days a week, and I have lunch with the students every Thursday and with the faculty every Tuesday and things like that... However, I found that one of the great secrets of computer science is called batch processing. So when I answer mail, I don't do it by interruption, but by batch processing. So I gave up email, I guess, on January 1, 1990, and I've been a happy man ever since. But the questions come in, and they're filtered, and I answer a lot of them all at once. So it turns out that that's necessary for me in order to work efficiently. But Phyllis was a wonderful protector. So she kept it possible for me to work efficiently for me all these years.

Gruska: And there's also another question, well, they ask, one student: Can you talk to Knuth? He said: "Yes, Friday night."

Knuth: Friday night? Ok.

Before I go on to more questions I want to mention that the whole inspiration for this kind of a session came about when I was at Caltech during these 1960s and Richard Feynman, our famous physics professor, would end every one of his classes the last day of class: Anybody can ask any question they wanted to. And so I started using that in my own classes, and I kept that up until I retired. And so now I find this as a best way to customise the lecture. So I will try to give an answer to basically any question, and I'll try to keep it short, so we can move to a variety of question.

On the other hand, tomorrow I'm giving another talk at 12:30, and it's also called Questions and Answers. Tomorrow I'm gonna have a piano keyboard, so that I can answer questions if they have anything to do with music because I think when you walked in here, you've got an ad for a concert that's gonna be given on Friday. So today let's not have questions about music, but anything else is fine.

Then I also brought this with me. This is a prop for a paperback book that I published, I don't know, 2–3 years ago, which is the middle third of Volume 4B of The Art of Computer Programming. So far I've finished Volume 1, 2, 3 and 4A and I'm working on Volume 4B. I started writing it in the middle, and this came out. It's called satisfiability, and the big six on it here says Volume 6, Fascicle 6. Fascicles 0, 1, 2, 3 and 4 were part of Volume 4A.

Now the reason I'm saying this is that right now, maybe as we speak, Fascicle 5 is being printed and it will be available in bookstores a month from now, and you will love it. It's a wonderful book. Ask your parents to get it for you for Christmas. laughter And the main thing is that it's, I would say, maybe eighty percent of it is about puzzles or topics that are often considered not only worthwhile but fun. I sort of have been waiting all my life to present this material in showing how puzzles are very relevant to learning how to be a good computer programmer. And so that's Fascicle 5 gonna be coming out in a month. So that's end of advertisement.

Gruska: There is a question: What is your favorite unsolved problem in computer science?

Knuth: My favorite unsolved problem in computer science... Ok, well... I guess, personally, what is the worst kind of question to ask? And I'm sorry, but it's a question that starts by "what is your favorite X?". Because it's really hard to say what is my favorite X: almost always "what's my favorite algorithm?", "what's my favorite... relative? – Do I like my son better than my daughter?", and so on... So I hope not too many of the questions today are gonna be "what's my favourite X?", however, I don't wanna duck this one.

So unsolved problems in computer science. It depends on who and whether I think it's gonna be solved or not. So in order to be a really favorite problem, it would one where I expect that when I tell you what it is, then next week someone in the room will solve it. So often my favorite problem is one that I've just thought up. And last week I thought up a problem that I mentioned to one of Dan Kráľ's students on Sunday night, and so I'm not gonna repeat that one now, so he can work on it and solve it for me.

Of course, the most famous unsolved problem in computer science in a sense that it's got a million-dollar price associated with it is a question "does P equal NP or not?" Someone is gonna ask me about that anyway, so I might as well spend one or two minutes on that. So the question is: The P is the set of all problems for which we can solve in polynomial time, and NP is a set of all problems for which we can verify a solution in polynomial time, more or less. And so the big question people say is "Does P equal NP or not?" Now, I wanna amplify that question. So let's try to be specific. It's known that the question "P equals NP?" is equivalent to saying "is there a polynomial-time algorithm to solve one particular problem?" Let me take satisfiability, for example because I held that up.

So there's a problem called 3-SAT which says: I have n clauses and each clause is of the form (a or b or c) and (d or e or f) and so on. Various clauses like these and all together [logical] and of these. And a, b, c, d, e and f are actually x or y bar or z or something like that... a, b and all of these things are Boolean variables that are either negated or not. And the question is: Can we satisfy all these clauses simultaneously? Is there a way to say that x is true, saying y is true and z is false, and all of the clauses are gonna be true? And that it's satisfiable if and only if there is a way to set these variables.

So when you look at this problem, you say: "Oh, sure, I can easily solve this problem." However, I don't wanna say if you've solved it tell me how you did it because a lot of people have told me that, but it was a waste of time. A lot of people think they've solved this problem, but they didn't.

The question "P equals NP?" says "is there an algorithm that solves 3-SAT to some constant steps?" I wanna ask another question, and that is: Could we know an algorithm that solves 3-SAT? Some people think that these are the same questions. If an algorithm exists, certainly, we would know what it is, right? However, that is a giant step to go from saying that there is an algorithm, and there is an algorithm we actually can find. A lot of things are proved non-constructively, so it can go several ways. One is that we have "yes, there is an algorithm, yes, we know it". Or it might be "yes, there is an algorithm, but no, it actually is beyond our grasp". You can never write it down. It exists up there, but you need to be God in order to know, actually to use it. And then there is a case "well, there is no algorithm". Well, then this [the fourth cell in a schematic combinatorial table] had better be no. I'm not gonna have an N and Y in here.

Gruska: Would you be happy to have non-constructive solution?

Knuth: Well, that's what I believe is probably true. I'm not sure how happy I would be, but it could be that the total number of algorithms is huge, and if it doesn't exist, it's a completely different question. It's quite likely, but hardly anyone thinks about this puzzle. It's quite likely that the algorithm exists but only because there's only finitely many reasons why it doesn't exists. And that's not gonna tell us much. There are many cases of non-constructive things where we know, for example, that there's a winning strategy in a game of hex, but nobody has any way to actually win hex. It's just known that there is a winning strategy for the first ...

Gruska: So next question...

Knuth: Yeah... laughter

Gruska: Do you still write any code? If so, why and which programming language?

Knuth: In this case, I could even say what my favourite programming language is. laughter When I wrote Fascicle 5 I probably wrote about 600, I don't know, many hundreds of programs and every week I write on average at least five. Most of programs are rather short, of course, but some of them get to be fairly good size. The language I use all the time is called CWEB. It just really works for me. It comes installed with Linux, and so I've got many dozens of CWEB programs as examples on my website. If anybody wants more information about any of the ones that I didn't put on the website yet, I'm glad to put it online.

It's a combination of TeX and C. It's so much better than any other way to write programs, but I'd better not get started on it. To me, it's the greatest outcome of all of my work on TeX. The fact that I now have CWEB in order to solve lots of problems.

Gruska: Ok, a related question. Did you try to write program for quantum computer?

Knuth: Ahaaa! Quantum computing is something that I have absolutely no intuition for. If quantum computing turns out to be the best way to go and everybody switches over to quantum computing, in a way, that will be the best thing for me, because then I'll have more time to write my books. Because I'm never gonna write anything about quantum computing. I only promise to write about things that were known in 1962 when I started a project [The Art of Computer Programming]...

Gruska: Another question is such that you may have a difficulty to answer. The question is: What were the research problems you worked on during your cooperation with NSA? laughter

Knuth: So I spent a year before going to Stanford working on code breaking, and I'm not allowed to tell my wife what I did during that year. laughter

Gruska: She's not here! LAUGHTER

Knuth: But this is being recorded, and maybe she would watch the recording.

Gruska: [Disappointedly] Oh...

My question is: What was your subject in your thesis? PhD. thesis. And did your advisor help you?

Knuth: I was lucky to work with Marshall Hall at Caltech, and so my thesis was about a general area that now would be called combinatorial designs. More specifically, finite projective plane. This is an arrangement of points and lines that are abstract. There is a parameter n, and I think it was... n2 + n + 1 point, and every line contains n + 1 points and every point is on n + 1 lines and any two lines intersect at exactly one point. So this is like a projective geometry, but finite projective geometry, instead of the projective geometry of the sphere or something. So my thesis was to show that certain kinds of finite projective planes do exist and they hadn't been known before to exist. The whole area of designs is to find families of sets that have interesting properties that might be useful in application.

Now the interesting thing is that over the year since I graduated, I applied almost every branch of mathematics that I've ever heard of to computer programming except the theory of design. Because subsequently, we've found out that we can do better with random choices in almost all cases instead of trying to find these very rare patterns that sometimes exist. It was very good training, and my advisor helped me in the following way: I was working on another problem and one morning as I rode up in the elevator, got to my office and said hey, I betcha I can solve this particular problem I just heard about. And my advisor said: Ok, that's your thesis.

Gruska: Another question: Vim or Emacs? [The question wasn't answered at this moment. But see a later mention near the text "Tabs or spaces" in this transcript.]

Knuth: What do I think about artificial intelligence? Ok. Do you think it could be dangerous?

Certainly, I prefer real intelligence to artificial intelligence. I have always felt that the working ??? AI has been at the cutting edge of computer science. Of the last sixty years, the people working on the challenging problems of artificial intelligence have come up with many of the most important innovations in the field. I always regarded it as something that tells us how to stretch what we know and invent better algorithms rather than as something where I would actually use the algorithms afterwards and believe that.

In other words, suppose we develop a really good algorithm that decides whether or not a student ought to graduate. Should I let the computer decide which students graduate or should I try to understand their working and see if it has some value?

Right now, the question about the danger is extremely pressing and especially with respect to military applications. There is this really frightening movie, short video... I can't remember the name of it. Came out about three years ago. Where you could pretty much, with today's technology, you could program drones to kill anybody you wanted to. The scenario I should remember, some of you will maybe remember the title, but my friend Stu Russell at Berkeley was one of the people behind that film. Essentially it's already possible to do these horrible things, so we gotta find some way to keep that from happening. Stu has the best idea so far about how to prepare for such dangers, but still, I'm afraid his ideas are not satisfying me because they depend on assumption that human beings are rational. And the more I read about these days, the less and less I believe that human beings are rational.

It's very serious to see how to restrain the things that we don't understand and figure out how, because with the new techniques we are able to solve many problems, wonderful problems in all branches of science that we weren't able to solve before. The ones that are encouraging to me are the ones where there's no enemy involved. Like somebody trying to defeat us in the experiment, but the only enemy is that we're battling ignorance, we're trying to find some pattern in the way stars work or something like this, the way biology works, how to identify diseases of different kinds... And these machine learning techniques are wonderful. Even though we don't understand anything about how they work. But you use the same algorithm for something where there's adversarial interest involved, then everything gets bad.

Gruska: Another question was very nice, and I think you will like it: Could you tell us the story of TeX from the very beginning to implementation?

Knuth: Ah, yes. laughter Yes. In short, I found out that computer technology had changed so that the work that was once done by hand with hot metal was no longer being done. It was replaced by new technology which was based on photography. And the new technology looked awful. I saw the proofs for the new edition of Volume 2 of The Art of Computer Programming, and I was almost sick. I didn't wanna have a book that looked like that. And then a couple of weeks later I learned that computers might be the answer, because somebody working in Southern California had found out that actually with digital methods, with pixel zeros and ones you could potentially make books that would look just as good as the real printed one.

So I got in an airplane and flew down to South California, talked to the people there and decided to change my sabbatical plans for the next year where I was gonna study combinatorial algorithms. Instead, I decided that oh, I can now solve the problem with the books if I only write the computer program that makes patterns of zeros and ones that say what should be on every page of the book. Well it took a little longer than a year, but that was the beginning of my work on typography.

Zlatuska: So the proofs for Volume 2. That means Volume 1 was already printed not using TeX? Does it exist?

Knuth: No. Volume 1, 2nd edition have already come out.

Zlatuska: The first edition you ??? about.

Knuth: Volume 1 would have come out looking bad at some point, but I was revising Volume 2, and so those proofs came in. What happened, is the technology went away from hot metal, basically monotype setting, and actually in Eastern Europe was the only place left for people who were still doing monotype during the 70s. So I have a translation of my book in Hungarian that as done by these hand methods still look good in the 70s, but the books that were printed... if you look at all the journals of mathematics that were printed in the 70s you see what I mean. So I was feeling bad about until I realised it was just a matter of programming. The machines were there that would make the book, but I need to get the pixels figured out. So I spent a long time in the library looking at everything that I could see about how to make good-looking books, and I brought the experts to Stanford, and we worked together on it for a while.

Gruska: How many months you worked on TeX?

Knuth: It's hard to say because I was also doing a few other things, but at one point I took a leave of absence from Stanford for a year because I found that working on software was harder than writing books. You can write books, you can write papers, but software involves much more of your brain, and I couldn't swap in and swap out so much without taking a year off of teaching and getting TeX done. Then I could go back and resume the other schedule. But in calendar time I finished this five-volume set of books called Computers in Typography. I finished that in 1984, I have started the project in 1977. So that's seven years. Then I came back to it in 1989. I came back to it because I didn't realise that people were gonna be using it for typesetting strange languages like Czech. laughter You know, you have accents on letters. Wow. So I went from 7-bit to 8-bits in 1989. Took a year.

Gruska: As far as I remember, when working on TeX every evening or every morning you wrote down what was good, what was bad. Did you make use of these comments?

Well, I got a paper out of it. I have a paper called "The Errors of TeX" which I think is a good idea for everybody – to keep track of what mistakes you make. Programming is too complicated, you can't get it right all. And I wanted to find out what were the kind of errors that I made and also learn something about patterns and that I could change my actions. I kept this log showing every century(???), every major non-trivial change that I made, some of the trivial ones too, to TeX and to Metafont over the years. Then I was able to get a good understanding of the scale, how important are certain kind of errors. For example, people say: goto statements are bad. Look at my history with TeX – sure enough, I made some errors, because I used goto statements improperly. However, I had also used every other kind of statement improperly too. Every statement – assignment statements are bad, conditional statements are bad, everything from that aspect can be misused. But I did learn something about which kinds of things to avoid and the corrections were not only to fix errors but also to improve user interface and things like that.

Gruska: Next two questions are pretty ??? so please ???.

Knuth: All right so... What would you advise to your 25 years [old your]self?

So 25 year, that would be... 1963. That's the year I got my PhD. ... I decided that year to become a college professor. I actually been offered the year before when I was 24 to drop out of grad school. Essentially I was offered a salary of $100,000 a year plus an assistant. Now in 1962 that would be like $10,000,000. It's not anywhere near Bill Gates's salary, but anyway I knew that my role in life, my interest was going to be to work with students rather than to maximize the amount of income that I had. On the other hand, I'm not saying everybody should make that decision. Anyway, at 25, that's when you want to start becoming stable and making long-term decisions that you're gonna live with.

Knuth: Next question: Anonymous:

Gruska: How being a Christian affected you as computer scientist?

Knuth: It's hard for me to say what it would have been like if I had been born into a different family, but certainly, I guess, one of the ways, my Christian upbringing with respect to work on crypto and questions of computer security. I'm not very good at doing work on cryptography, because I'm not as sneaky as the people who are trying to defeat these things, but with respect to security all my life I had this idea... I'm sorry, not security­– privacy... I always had the idea that everything that I do is known to God, so I don't have absolute privacy. And I didn't understand until later that there are people who think that nobody should know what their thoughts are. So it makes it harder for me to understand, but some people concern about privacy, although of course, I don't want my thoughts to be used by the devil, by something that's going to exploit me, but I'm not very comfortable if there was something beneficent watching over what I'm doing.

All these things, I guess I should say, I'm very happy that there are parts of my life in which there's no mystery, and I can prove that something is right, but I wouldn't be happy if there was no mystery whatsoever, so I appreciate the fact that there are things that I'll never understand, so it teaches me some humility that I shouldn't expect to understand everything. So I don't claim to understand everything, and I'm very happy that God did not make it possible to prove or disprove the existence of God.

Gruska: Related to this question: Let us assume that you will live still 30 years.

Knuth: Do I? What now? ... Oh goodness. laughter

Gruska: By famous visionary Kurzweil at that time we should have laptop with information processing power better than all human brains. What would you do with such laptop?

Knuth: I would certainly try to finish The Art of Computer Programming. Let me rephrase your question. How do I want to continue, you know, what should I do the next week and the week after that? How do I want to continue to live? I have to be watching when am I gonna start going senile. At the moment I don't think I've reached that point yet, but it might come to the point where I should stop writing The Art of Computer Programming because I'm starting to write stupid stuff.

Gruska: In which area of computer science or mathematics do you see the most potential?

Knuth: In which area... This is one of these favourite questions again. The much harder question would be: "Which area does not have much potential?" because I think everywhere I look, I see potential. The problem is really have to go to sleep at night not using the knowledge we have. Everywhere I look, I see that it's not saturated yet.

Gruska: Additional question is pretty philosophic: What your opinion on Curry-Lambek correspondence? Do you think mathematics is constructed or exists independently?

Knuth: I guess I'm a Platonist in the sense that I'm discovering things that are there already. The stuff that's there is all consistent with my own attitude that these truths are there and I just am learning a few of them at a time. There might be an algorithm that solves 3-SAT, and that would be there. In fact, I'm not sure I even understand how I could be a non-Platonist.

Gruska: What was the most valuable ??? you learned during your career?

Knuth: Not to use email? laughter There we go.

Gruska: Is too late for 20 years old students to start learning real mathematics and programming?

Knuth: A 20-year old student? My goodness, no. I didn't now that much math when I was 20. It depends on what you've seen so far and the teachers you've had. But I consider life to be a binary search where you find out things that are relatively easy for you, because of the unique experiences that you've had, and you try some things, and some things work, and some things don't work. Then you keep learning more about yourself. I'm 81 years old now, I'm still not sure exactly where to go, but I keep trying different thing. I have given up on quantum computing, though. laughter. I tried to understand quantum computing, and I know people who do understand quantum computing, but I ??? it's not me.

Gruska: Do you believe in non-locality in physics?

Knuth: I understand a few things about multiverse and things like that. For example, there's no way to distinguish between whether or not this lecture I'm giving now is simultaneously forking into many different things and so each different incarnation of it will have a different series of questions, and I'll give different answers to different questions and so on. And all of this idea that there are these all the different universes all simultaneously existing is consistent with quantum mechanics.

Gruska: Biggest challenge of becoming a good programmer?

Knuth: What does it say? Spaces... Tabs or spaces? hehehe laughter

So I use Emacs for my hacking, and I always untabify ??? but I also read a lot of programs that other people have written, and I start out with changing all the tabs to spaces. Of course, I'm using CWEB, not Python.

Knuth: Next... Some of the exercises are known to be open research problems. Yes indeed. If the number is 46 or higher, it's something where, as far as I know, it hasn't been solved yet.

Knuth: Has anyone ever contacted you that they have solved one of them while reading the book? Yeah. People look at them ??? I do want to point out that a lot of people haven't been looking at those lately, so ... I'm sorry...

Gruska: Excuse me... We make break for 5 minutes because they need to change [the microphone].

Knuth: So we had a celebration at Berkeley, I guess a month ago, celebrating the life of Dick Karp and at that time there were a dozen speakers, and I decided I would say something about the Karp's work that the others weren't going to talk about. So I looked again at Volume 3 of The Art of Computer Programming, where Dick had told me about some things he never published that applied to sorting on tapes. Nowadays people don't use tapes for sorting, but when Volume 3 came out, this was one of the biggest topics in all of computer science. People were saying one third of all computer time was spent on sorting, and people had these tapes, and these were must have to have in the book. But since we don't do sorting that way anymore, I should rip out all this, I don't know, sixty pages or something of Volume 3. And then people say "no, no, don't take it away, because we're just finding out there's a new memory kind of being invented which is rather similar to tape and so these old techniques are gonna be good!"

Anyway one of the things about magnetic tape is that you can read it forward and backwards, so you can write information on the tape, and then you can read it in the other direction, and that would be much faster than rewinding and reading back forward. And Dick Karp worked out a beautiful theory about patterns of using tapes for sorting that he showed me at lunch one day and I put it in my book, and he never published it. So I showed it to the people at Berkeley, and as I was looking through this I came across a research problem, you know the level 46, which it seems to me is ripe for solution now. 50 years have gone by, and people know a lot more math than then, so I suspect that there are dozen problems in there that are just waiting to be solved. So you can go through, you have to spend a little time paging through and checking out the numbers. And if it's 46 or more then think about it and say "hm, I wonder if I can solve this now", because people haven't been doing that systematically.

Zlatuska: How many girls you seduced because of computer science?

Knuth: How many girls have I had thanks to computer science?

Gruska: Forget it. Forget it.

Knuth: So, in fact, I had 28 grad students, but none of them were female, laughter but I did serve on many committees and many others and so on...

Gruska: Here is better question: What's the biggest motivation that kept you going through career?

Knuth: I guess it's the example of my parents which was always to somehow be a servant, to see how I could be of use to somebody else. My father's name was Erwin. He had an informal, I guess you'd call it a startup ???, he is a one-person operation, and he would do services for all churches and schools and a few other nonprofit things like this, and he called it ERW service. He thought it was clever he could write the word service but make ERW large, so would say ERW service. But anyway, that epitomized all the philosophy that I grew up with – to be a service. If I got to a point where I thought that I couldn't be of use to anybody anymore, I told my children not to keep me alive just to make me happy, but if I get to a point where I don't recognize them or anything like this... How do I express this... There's a novel, came out less than 20 years ago by P. D. James and it was about... the world... the people discover that from now on all women in the whole world would be infertile and so there will be no more children ever born again. So humanity was eventually going to die out. So what did people do? That was very devastating to me, to imagine what it would be like if I was in a situation where I could not do something that would be of use to people, more than my immediate family, but to people in the future.

Well there's a short story by... Oh, goodness... Okay, who's the greatest Argentinan author?

Zlatuska: Borges.

Knuth: Borges, yes, of course, Borges. So he has this short story. I think it even takes place maybe in Czechoslovakia, I don't know. But anyway, it's a story of a person who is a playwright, but he's facing a firing squad, because of his political views. And just as the guns are aimed at him and so on, he prays to God, and he says: "God, I have to finish this play I'm working on. Please, make time stand still so that I can work out all the details and figure out exactly what should happen in this play." So God says okay and time stands still, and this playwright solves the problem, he figures out exactly what's the perfect play. And then he's shot. So nobody ever gets to see what happened in the play. It was just that the playwright himself was able to solve that particular problem. So that's the opposite of my own way to do it. It has to be something that I do that somebody can use. I hope that's making myself a little clearer what this idea of service is.

Gruska: There are quite a few people that try to put the idea of formal method into programming, software development.... What do you think about that?

Knuth: When you're putting ideas into formal methods, it forces you to understand what the ideas are. You don't realize what you don't know until you try to formalize it some way. So it's a great educational experience. On the other hand, I guess I said a similar thing about artificial intelligence a while ago that I consider it as a very useful way, a source of good problems and continuing to learn. But then I was less interested in actually using the programs afterwards because I knew that they would only be approximately right.

I once had a language called SOL, Simulation Oriented Language, and the idea was that it would be it would be pretty easy to write models for discrete systems. And you could simulate the system. As I was working on this language, I looked at a lot of different applications, and in each case, I found out that the idea of formalizing the application and putting it into this language was a wonderful educational experience. I can build models of things to simulate, but I learned much more writing the model than I did actually running the model afterwards. So I almost thought I should take output statements out of the language. The people only use language for formalizing their model instead of for actually running it and believing the answers that they get afterwards.

Nobody seems to understand what I'm saying, but anyway, I believe the main advantage of formalism is educational rather than actually having a payoff afterwards.

Gruska: Next question: For how long can you program or read papers per day until you are exhausted? How do you relax? Do you relax sometimes? laughter

Knuth: Yes, but in fact, I'm relaxing right now. laughter At night, I have to take my mind off whatever I'm doing. So I read James Bond or something not really heavy literature. I'm reading right now a novel by Frederick Forsyth called The Odessa File which is story about the German SS in Latvia... what you'd call a thriller. Some kind of story like that and I go right to sleep. I read novels at the same speed as I read a math paper. laughter I don't know any other way to do it, so I don't get through that many books. However, when I do come across a book, that I think is especially nice, I put it on my website. So I think if you look on my website and under... I think, there's a Frequently Asked Questions and it says "so you're retired" or something like this. You click on that, and it'll tell you, I think, maybe three dozen books that I think were special to me.

Gruska: Did you work hard when you were student?

Knuth: I was a machine. I was a problem-solving machine. Somebody said: "Okay, Don, do this," and I would do it. And I didn't start reading for pleasure probably until I was about thirty years old. I was given an assignment, and I was a good boy. So I did it.

At least that's the way I remember how it was. I don't know how it really was. I think I also was a... they might call me a wise guy. I mean, I was cracking jokes and not paying too much attention to what I was supposed to do.

Gruska: Did you watch westerns or detective stories?

Knuth: What about detective stories?

Gruska: Did you watch westerns movie or detective stories?

Knuth: I certainly watch a lot of movies, but, by the way, I might as well mention one thing. I guess it was a month ago when I saw again a movie. It's called Double Indemnity. It came out in 1944 or something like that. It's one of the earliest noir movies, and it stars Fred MacMurray and Edward G. Robinson and Barbara Stanwyck. That movie has special significance for me because when I was writing The Art of Computer Programming, that movie was playing almost every night on The Late Show. As I was typing The Art of Computer Programming, I would have the TV on, and I would see Double Indemnity over and over again. So The Art of Computer Programming was written largely to this movie Double Indemnity. The music to Double Indemnity was written by Miklós Rózsa, and it's haunting music that I hadn't remembered how haunting it was until about ten years ago. I saw Double Indemnity again at a theater and immediately when they showed the title, and I heard this music, and I said: "Oh my god, what powerful music is it." So I've included music from Double Indemnity in my piece that's gonna be played on Friday. Although I'm not sure if I'm gonna be sued for this. But one of the things that occurs, you can check it out by watching the movie.

Gruska: Didn't you have idea to write science fiction?

Knuth: I talked about writing it or? I enjoy different kinds of science fiction, of course, but I haven't had time to... I wrote this little book called Surreal Numbers. I kind of think of it as a little bit like opera in the sense that opera is good music to a little bit of a plot. My book Surreal Numbers is good mathematics to a little bit of a plot. The characters in this story work on a math problem together, and it makes a little plot, but mainly there's beautiful mathematics that they're discussing.

If I live long enough and finish The Art of Computer Programming, I'd like to write some science fiction. One book I'd like to write is where the story is told by ant colony. Not by an ant, but by ant colony. There are tens of thousands of ants, and somehow they cooperate with each other and so that they form a consciousness and so I think there ought to be a short novel that's told by an ant colony.

The other thing is a short story something like... you could call it The Fly. Now, Mark Twain in one of his books, I think it's called The Mysterious Stranger, there's a character in there representing the devil, and early on in the book the devil opens a window, and a fly goes out the window. And he said: "Because I let this fly out the window, there's gonna be war next year." He's predicting what they call the butterfly effect of chaos theory. All kind of things are codependent.

So maybe people have seen this movie Run Lola Run that came out of Germany a few years ago. It tells a story, three or four times the story starts out exactly the same way, but then there are three or four different, completely different endings, just because of little changes in time. So I think it would be fun to write stories that... Well, it's not one story, but it's two or three stories that all start out the same, but end completely differently. But on the other hand, did this movie, it's German name is Lola rennt. Run Lola Run in English. So the author of that movie already did it, what I was planning some time to do.

Gruska: So, please, ask questions. Yes, will be finishing. Maybe those who don't have mobile with, they should have the chance also to ask questions.

Knuth: Yes!

student: You have a trouble ??? distractions or maintaining focus when you're working on a problem during the day? And if you do, how do you sit down and focus and do some piece of work during the day? You have like a ???.

Knuth: If I understand, you're saying how can I focus on one thing instead of many others? I don't have all the distractions of modern day. I don't have the radio play, music blaring ???. I found that, for example, if my job for the day is to do something like proofreading, then it helps me to have some kind of music like Telemann or something playing in the background. It sharpens my mind. But if I have Bach playing the background, it's too much, and everything goes away. So part of it is having no distractions, no interruption.

When my children were babies, they would be crying. I had this problem: How am I gonna concentrate on writing a book when the baby is screaming? The answer was white noise. I had a waterfall, and I could turn the fountain on and crying plus white noise equal white noise. laughter

But in general to concentrate on one thing I collect a lot of material, all on the same subject. I'll read thirty papers about that subject all at once, instead of reading about many different things. So I spent a lot of my time filing things away to be read later. Batch processing is very important.

Sochor: My question is: Do you prefer screen and keyboard or paper and pencil?

Knuth: I love that question because it turns out that I learned when I was in college that I could write a letter home to my parents faster with pencil and paper than on a typewriter. The reason was, actually, because I'm a good typist, I type faster than I think. laughter I had actually gone to typing school, so I can type so fast that it's a synchronization problem. laughter I'm not ready for it. But pencil and paper for me is a perfect sync with my thought process. So I make the first draft of everything in pencil paper, but then I go to the computer, and I polish it, and I edit for style. And I'm typing on it ??? I do that.

Gruska: So, you don't have to think, you just looked on your fingers.

Knuth: That doesn't work for me.

student: So my question is: How has your stay in Czechia been so far?

Knuth: In fact, I wanted to say at the very beginning that it's a thrill for me to be invited here to celebrate your 25th anniversary. It couldn't have been better in every way, and I'm really enjoying this week. I was babbling over with enthusiasm for that, but I forgot about it at the beginning.

Of course, I've only had five/six days so far, but each one has been a joy.

Gruska: Ok, I think it's time to make break. The break will be quite long. Continuation will be tomorrow. Thank you, professor Knuth.

applause

Sojka: Come tomorrow and those who want to make a photo with Don and the faculty, the photography ???.