Lex Fridman Podcast - Donald Knuth: Algorithms, TeX, Life, and The Art of Computer Programming

Episode Date: December 30, 2019

Donald Knuth is one of the greatest and most impactful computer scientists and mathematicians ever. He is the recipient in 1974 of the Turing Award, considered the Nobel Prize of computing. He is the ...author of the multi-volume work, the magnum opus, The Art of Computer Programming. He made several key contributions to the rigorous analysis of the computational complexity of algorithms. He popularized asymptotic notation, that we all affectionately know as the big-O notation. He also created the TeX typesetting which most computer scientists, physicists, mathematicians, and scientists and engineers use to write technical papers and make them look beautiful. This conversation is part of the Artificial Intelligence podcast. If you would like to get more information about this podcast go to https://lexfridman.com/ai or connect with @lexfridman on Twitter, LinkedIn, Facebook, Medium, or YouTube where you can watch the video versions of these conversations. If you enjoy the podcast, please rate it 5 stars on Apple Podcasts, follow on Spotify, or support it on Patreon. This episode is presented by Cash App. Download it (App Store, Google Play), use code "LexPodcast".  Episode Links: The Art of Computer Programming (book set) Here's the outline of the episode. On some podcast players you should be able to click the timestamp to jump to that time. 00:00 - Introduction 03:45 - IBM 650 07:51 - Geeks 12:29 - Alan Turing 14:26 - My life is a convex combination of english and mathematics 24:00 - Japanese arrow puzzle example 25:42 - Neural networks and machine learning 27:59 - The Art of Computer Programming 36:49 - Combinatorics 39:16 - Writing process 42:10 - Are some days harder than others? 48:36 - What's the "Art" in the Art of Computer Programming 50:21 - Binary (boolean) decision diagram 55:06 - Big-O notation 58:02 - P=NP 1:10:05 - Artificial intelligence 1:13:26 - Ant colonies and human cognition 1:17:11 - God and the Bible 1:24:28 - Reflection on life 1:28:25 - Facing mortality 1:33:40 - TeX and beautiful typography 1:39:23 - How much of the world do we understand? 1:44:17 - Question for God

Transcript
Discussion (0)
Starting point is 00:00:00 The following is a conversation with Donald Knuth, one of the greatest and most impactful computer scientists the mathematicians ever. He's the recipient of the 1974 Turing Award, considered the Nobel Prize of Computing. He's the author of the Multi-Volume Work, the Magnum Opus, the Art of Computer Programming. He meets several key contributions to the rigorous analysis of computational complexity of algorithms, including the popularization of asymptotic notation that we all affectionately know as the big-oh notation. He also created the tech type-setting system, which most computer scientists, physicists, mathematicians,
Starting point is 00:00:44 and scientists and engineers in general use to write technical papers and make them look beautiful. I can imagine no better guest than 2019 with than Don, one of the kindest, most brilliant people in our field. This podcast was recorded many months ago. It's one I avoided because perhaps Conoruitively the conversation meant so much to me. If you can believe it, I knew even less about recording back then, so the camera angle is a bit off.
Starting point is 00:01:14 I hope that's okay with you. The office space was a big cramp for filming, but it was a magical space where Don does most of his work. It meant a lot to me that he would welcome me into his home. It was quite a journey to get there as many people know, he doesn't check email, so I had to get creative. The effort was worth it. I've been doing this podcast on the side for just over a year. Sometimes I had to sacrifice a bit of sleep, but I was always happy to do it, and to be part of an amazing community of curious minds.
Starting point is 00:01:46 Thank you for your kind words to support and for the interesting discussions, and I look forward to many more of those in 2020. This is the Artificial Intelligence Podcast. If you enjoy it, subscribe on YouTube, give it 5 stars on Apple Podcasts, follow on Spotify, support on Patreon, or simply connect with me on Twitter, at Lex Friedman spelled F-R-I-D-M-A-N. I recently started doing ads at the end of the introduction. I'll do one or two minutes after introducing the episode and never any ads in the middle to break the flow of the conversation.
Starting point is 00:02:19 I hope that works for you and doesn't hurt the listening experience. I provide timestamps for the start of the conversation that you can skip to, but it helps if you listen to the ad and support this podcast by trying out the product of service being advertised. This show is presented by CashApp, the number one finance app in the App Store. I personally use CashApp to send money to friends, but you can also use it to buy, sell, and deposit Bitcoin in just seconds. Cash app also has a new investing feature.
Starting point is 00:02:49 You can buy fractions of a stock, say $1 or worth, no matter what the stock price is. Broke your services are provided by Cash App Investing, a subsidiary of Square, and a member of SIPC. I'm excited to be working with CashApp to support one of my favorite organizations called First, Best Known for their first robotics and Lego competitions. They educate and inspire hundreds of thousands of students in over 110 countries and of a perfect rating on Charity Navigator, which means that donated money is used to maximum effectiveness.
Starting point is 00:03:23 When you get CashApp from the App Store or Google Play and use code Lex Podcast, you'll get $10 and Cash App will also donate $10 to first, which again is an organization that I've personally seen inspire girls and boys to dream of engineering a better world. And now here's my conversation with Donald Knuth. In 1957, at Case Tech, you were once allowed to spend several evenings with the IBM 650 computer. As you've talked about in the past, then you fell in love with computing then. And you take me back to that moment with the IBM 650. What was it that grabbed you about that computer?
Starting point is 00:04:26 So the IBM 650 was this machine that, well, it didn't fill a room, but it was big and noisy. But when I first saw it, it was through a window and there were just a lot of lights flashing on it. And I was a freshman. I had a job with the statistics group and I was supposed to punch cards for data and then sort them on another machine,
Starting point is 00:04:57 but then they got this new computer came in and it had interesting lights. Okay, so well, but I had a kind of key to the building. So I could get in and look at it and got a manual for it. And my first experience was based on the fact that I could punch cards, basically, which is a big thing for the, but the IMS 650 was, you know, big in size, but incredibly small in power in memory.
Starting point is 00:05:30 It had, it had 2,000 words of memory and a word of memory was 10 decimal digits plus a sign. And it would do, at two numbers together, you could probably expect that would take, I'll say three milliseconds. So pretty fast. The memory is the constraint, the memory is the problem. That was why it took three milliseconds, because it took five milliseconds for the drum to go around. And you had to wait, I don't know, five cycle times. If you have an instruction, one position on the drum, then it would be ready to read the data for the instruction and you know, three notches. The drum is 50 cycles around and you go three cycles and you can get the data and then you can go another three cycles and get
Starting point is 00:06:19 and get to your next instruction. If the instruction is there, otherwise you'll spin until you get to the right place. And we had no random access memory whatsoever until my senior year. Senior year we got 50 words of random access memory, which were priced this. And we would move stuff up to the random access memory in 60 word chunks and then we would start again. So it's Subroutine when to go up there and could you have predicted the future
Starting point is 00:06:51 60 years later of computing from then? You know, in fact the hardest question I've ever asked was What could I have predicted? In other words the interviewer asked me She said, you know, what about computing has surprised you, you know, in the Iran, I rattled off a couple dozen things and then she said, okay, so what didn't surprise? And I was, I tried for five minutes to think of something that I would have predicted. And I couldn't.
Starting point is 00:07:22 But let me say that this machine, I didn't know, well, there wasn't there wasn't much else in the world at that time. The 650 was the first machine that was that there were more than a thousand of ever. Before that, there were, you know, there was each machine there might be a half a dozen examples maybe. First mass market. Mass produced. The first one, yeah, done a quantity. And IBM didn't sell them. They rented them, but they rented them to universities at great, you know, had a great deal.
Starting point is 00:08:01 And so that's why a lot of students learned about computers at that time. So you refer to people, including yourself, who gravitate toward a kind of computational thinking as geeks. At least I've heard you use that terminology. It's true that I think there's something that happened to me as I was growing up that made my brain structured in a certain way that resonates with with computers. So there's this space of people, 2% of the population you empirically estimate. That's a fair that's been proven fairly constant over most of my career. However, it might be different now because kids have different experiences when they're young. So what does the world look like to a geek? What is
Starting point is 00:08:54 this aspect of thinking that is unique to, yeah, that makes a geek. This is Yeah, that makes a geek. This is a Cutering important question in in the 50s. I Be I'm noticed that that There were geeks of non geeks and so they tried to hire geeks and they put out as with paper saying, you know If you play chess come to Madison Avenue and for an interview or something like this, you know They were trying for some things
Starting point is 00:09:24 So what it what what is it that I find easy and other people tend to find harder? And I think there's two main things. One is this, with is ability to jump levels of abstraction. So you see something in the larger, and you see something in the small, and you pass between those unconsciously. So you know that in order to solve some big problem. What you need to do is add one to a certain register, and I guess to another step. And below the, yeah, I don't go down to the electron level, but I knew what those milliseconds were, what the drum was like.
Starting point is 00:10:12 On the 650, I knew how I was going to factor a number or find a root of an equation or something, because of what was doing. And as I'm debugging, I'm going through, did I make a key punch error? of it because of what was doing. And as I'm debugging, I'm going through, did I make a keep-un-chair? Did I write the wrong instruction? Do I have the wrong thing in a register? And each level, each level is different.
Starting point is 00:10:37 And this idea of being able to see something at all at lots of levels and fluently go between them. It seems to me to be more pronounced, much more pronounced in the people that resonate with computers like I got it. So in my books I also don't stick just to the high level, but I mix low level stuff with high level. And this means that some people think that I should write better books. And it's probably true. But other people say, well, but that's
Starting point is 00:11:19 if you think like that, then that's the way to train yourself, keep mixing the levels and learn more and more how to jump between. So that's the way to train yourself, keep mixing the levels and learn more and more how to jump between. So that's the one thing. The other thing is that it's more of a talent to be able to deal with non-uniformity, where there's case one, case two, case three, instead of having one or two rules that govern everything.
Starting point is 00:11:47 So it doesn't bother me if I need, like an algorithm, has 10 steps to it. Each step does something else that doesn't bother me. But a lot of pure mathematics is based on one or two rules, which are universal. And so this means that people like me sometimes work with systems that are more complicated than necessary because it doesn't bother us that we don't that we didn't figure out the simple rule. And you mentioned that while Jacobi, Boul, Abel, all the mathematicians in the 19th century may have had symptoms of geek. The first 100% legit geek was touring, Alan Turing. I think he had, yeah, a lot more of the of this quality than anybody, just from reading the kind of stuff he did. So how does touring, what influence has touring had on you
Starting point is 00:12:50 in your way? So I didn't know that aspect of him until after I graduated some years. It has undergraduate, we had a class that talked about computability theory and touring machines. And it was all, it sounded like a very specific kind of purely theoretical approach to stuff. So when I learned that he had a design machine and that he wrote
Starting point is 00:13:23 a wonderful manual for Manchester machines, and he invented all subroutines, and he was a real hacker that he had his hands dirty. I thought for many years that he had only done purely formal work. As I started reading his own publications, I could feel the skinship. Of course, he had a lot of peculiarities. He wrote numbers backwards because I mean, left to right, stood to right to right to left because that's the that's it was easier for computers to process them that way. What do you mean left to right? He would write pi as you know Right. We got it. For one point three on the blackboard. I mean, when he had trained himself to do that because the computers he was working with worked that way inside.
Starting point is 00:14:38 Train himself to think like a computer. Well, there you go. That's geek thinking. You've practiced some of the most elegant formalism in computer science. And yet you're the creator of a concept like literate programming, which seems to move closer to natural language type of description of programming. Yeah, absolutely. How do you see those two as conflicting as the formalism of theory and the idea of
Starting point is 00:15:07 literary programming? So there we are in a non-uniform system where I don't think one sides fits all and I don't and I don't think all truth lies in one in one kind of expertise and so expertise and so somehow in a way say my life is a convict's combination of English and mathematics. And you're okay with that. And not only that, I think. Driving. I wish, you know, I want my kids to be that way. I want, etc. You know, that used left brain, right brain at the same time. You got a lot more done. That was part of the I'm, uh, you got a lot more done. That's that was part of the part of the bargain. And I've heard that you didn't really read for pleasure until into your 30s.
Starting point is 00:15:52 And you know, literature. That's true. You know more about being than I do, but I'll try to be consistent with what you read. Yeah. No, just believe me. I, uh, just go with whatever story I tell you. It'll be easier that way. The conversation was right. Yeah, no, that's true. So I've heard mentioned of Philip Roth's American Pastoral,
Starting point is 00:16:10 which I love as a book. I don't know if it was it was mentioned as something I think that was meaningful to you as well. In either case, what literary books had a lasting impact on you? What literature? Yeah, okay. Good question. So I met Roth. Already? Well, we both got doctors from Harvard on the same day. So we were, yeah, we had lunch together and stuff like that.
Starting point is 00:16:38 But he knew that computer books would never sell. Well, all right. So you say you were a teenager when you left Russia. So I have to say that Tolstoy was one of the big influences on me, especially like on a car Nina, not because of the plot of the story, but because there's this character who, the philosophical discussions, it's a whole, we have life is worked out there among the characters.
Starting point is 00:17:20 And so that I thought was especially beautiful. On the other hand, Dusty Fsky, I didn't like it all, because I felt that his genius was mostly because he kept forgetting what he had started out to do, and he was just sloppy. I didn't think that he polished his stuff at all, and I tend to admire somebody who doubts the eyes and crosses the tees. So the music of the prose is what you admire more than? I certainly do admire the music of the language, which I couldn't appreciate in the Russian original, but I can't in Victor Hugo Hugo because French is closer.
Starting point is 00:18:11 But I like the same reason I like Herman Wook as a novelist. I think like his book, Marjorie Marnick star, has a similar character in Hugo who developed his own personal philosophy and it goes in. own personal philosophy and and it goes into what's consistent. Yeah, right. And it's worth pondering. So, you don't like Nietzsche and like what? You don't like Friedrich Nietzsche or Nietzsche. Yeah, no, no, yeah, this has no, I, I, I keep seeing quotations from Nietzsche and they never tapped me to read any further. Ways full of contradictions. You will certainly not appreciate him. But Schiller, you know, I'm trying to get across what I
Starting point is 00:18:55 appreciate in literature. And part of it is the is as you say, the music of the language of the way it flows and take a Raymond Chandler versus a Tashel Hammett, Tashel Hammett senses are awful when Raymond Chandler's are beautiful, they just flow. So I don't read literature because it's supposed to be good for me or because somebody said it's great, but I find things that I like. I mean, you mentioned you were dressed like James Bond, so I love he and Fleming. I think he's got a really great gift for. If he has a golf game or a game of bridge or something and this comes into his story, it'll be the most exciting golf game or the absolute best possible hand of bridge that exists
Starting point is 00:19:55 and he exploits it and tells it beautifully. So in connecting some things here, looking at literary programming and being able to convey encode algorithms to a computer in a way that mimics how humans speak, what do you think about natural language in general and the messiness of our human world about trying to express difficult things? So the idea of literate programming is really to try to understand something better by seeing it from at least two perspectives, the formal and the informal. If we try to understand a complicated thing, if we can look at it in different ways.
Starting point is 00:20:52 And so this is in fact the key to technical writing, a good technical writer trying not to be obvious about it, but says everything twice, formally and informally, or maybe three times, but you try to give the reader a way to put the concept into his own brain or her own brain. Is that better for the writer or the reader or both? Well, the writer just tries to understand the reader. That's the goal of a writer is to have a good mental image of the reader and to say what the reader expects next and to impress the reader with what has impressed the writer, why something is interesting. So when you have a computer program, we try to instead of looking at it as something that we're just trying to give an instruction to the computer,
Starting point is 00:21:49 what we really wanna be is giving insight to the person who's gonna be maintaining this program or to the programmer himself when he's debugging it as to why this stuff is being done. And so all the techniques of exposition that a teacher uses or book writer is make you better programmer if your program is going to be not just a one-shot deal. So how difficult is that do you see hope for the combination of informal and formal for the programming task?
Starting point is 00:22:30 Yeah, I'm the wrong person to ask, I guess because I'm a geek, but but I think for a geek it's easy. I know, well, I don't know. So not some people have difficulty writing and that might be because there's something in their brain structure that makes it hard for them to write or it might be something just that they haven't had enough practice. I'm not the right one to judge but I don't think you can teach any person any particular skill. I do think that that writing is half of my life and so I put it together in
Starting point is 00:23:08 a letter program. Even when I'm writing a one-shot program, I write it in a literate way because I get it right faster that way. Now does it get compiled automatically? Or? So I guess on the technical side, my question was, how difficult is it design, a system where much of the programming is done informally? Informally. Yeah, informally.
Starting point is 00:23:39 I think whatever works to make it understandable is good, but then you have to also understand how informal it is. You have to know the limitations. You have to... So by putting the formal and informal together, this is where it gets locked into your brain. You can say informally, well, I'm working on a problem right now. So let's go there. Can you give me an example of connecting the informal and the formal? Well, it's a little too complicated an example. There's a puzzle There's a puzzle that's self-referential. It's called a Japanese arrow puzzle. And you're given a bunch of boxes, each one points north east, south or west.
Starting point is 00:24:33 And you're supposed to fill in each box with the number of distinct numbers that it points to. So if I put a three in a box, that means that, and it's pointing to five other boxes that means that there's going to be three different numbers in those five boxes. And And those boxes are pointing one of them might be pointing to me one of them might be pointing the other way, but anyway, I I'm supposed to find a set of numbers that obeys this complicated condition that each number
Starting point is 00:25:07 counts how many distinct numbers it points to. Well, and so a guy sent me his solution to this problem where he presents formal statements that say either this is true or this is true or this is true and and so I try to render that formal statement informally and I try to say I contain a three and and the guys I'm pointing to contain the numbers one two and six so by putting it informally and also I convert it into a dialogue statement. That helps me understand the logical statement that he's written down as a string of numbers in terms of some abstract variables that he had.
Starting point is 00:25:58 That's really interesting. So maybe an extension of that, there has been a resurgence in computer science and machine learning and neural networks. So using data to construct algorithms. So it's another way to construct algorithms really. If you can think of it that way. So as opposed to natural language to construct algorithms, use data to construct algorithms. So what's the view of this branch of computer science where data is almost more important than the mechanism of the algorithm? It seems to be suited to a certain kind of non-geek, which is probably why it's taken off. It has its own community that really resonates with that. But it's hard to trust something like that
Starting point is 00:26:56 because nobody, even the people who work with it, they have no idea what has been learned. That's a really interesting thought that it makes algorithms more accessible to a different community, a different type of brain. Yep. And that's really interesting, because just like literary programming, perhaps could make programming more accessible to a certain kind of brain.
Starting point is 00:27:27 There are people who think it's just a matter of education, and anybody can learn to be a great programmer, anybody can learn to be a great skier. I wish that were true, but I know that there's a lot of things that I've tried to do, and I was well motivated, and I kept trying to build myself up, and I never got past a certain level. I can't view, for example, I can't view three-dimensional objects in my head. I have to make a model and look at it and study it from all points of view. And then I start to get some ideas, but other people are good at four dimensions. Physicists. Yeah. So let's go to
Starting point is 00:28:20 the art of computer programming. In 1962, you set the table of contents for this magnum opus, right? Yep. It was supposed to be a single book with 12 chapters. Now today, what is it? 57 years later, you're in the middle of volume four of seven. And in the middle of volume four B is four B. Four precisely. Can I ask you for an impossible task which is try to summarize the book so far
Starting point is 00:28:55 maybe by giving a little examples. So from the sorting and the search and the combinatorial algorithms in the search and the combinatorial algorithms, if you were to give a summary, a quick elevator summary. elevator, that's great. Yeah, right. Well, depending how many floors there are in the building. Yeah. The first volume called fundamental algorithms talks about something
Starting point is 00:29:18 that you can't, the thought you can't do without, you have to know the basic concepts of what is a program, what is an algorithm, and it also talks about a low level machine, so you can have some kind of idea of what's going on, and it has basic concepts of input output and subroutines, induction, right? Mathematical preliminary. So, the thing that makes my book different from a lot of others is that I try not only present the algorithm, but I try to analyze them, which means quantitatively I say not only does it work, but it works this fast.
Starting point is 00:30:04 Okay. And so I need math for them. And then there's the standard way to structure data inside and represent information in the computer. So that's all volume one. Volume two talks, it's called semi-numerical algorithms. And here we're writing programs, but we're also dealing with numbers. The algorithms deal with with any kinds of objects, but specific when there's objects are numbers, well then we have certain special paradigms that apply to things that have 12 numbers. So there's arithmetic on numbers and there's matrices full of numbers. There's random numbers. And there's power series full of numbers. There's different algebraic concepts that have numbers in structured ways. And arithmetic in the way a computer would think about arithmetic. So floating point, floating point arithmetic, high precision arithmetic, not only addition subtraction multiplication, but also comparison of numbers.
Starting point is 00:31:08 So then then volume three talks about, I like that one, sorting, sorting, sorting, sorting. Right. So so here, you know, we're not getting that sort of numbers because you sort, you sort letters and other objects and searching were doing all the time with Google nowadays, but I mean, then you, we have to find stuff. So again, algorithms that that underlie all kinds of applications, like, you know, none of these volumes is about a particular application, but applications are examples of why people want to know about sorting, why people want to know about random numbers.
Starting point is 00:31:46 to know about sorting why people want to know about random numbers. So then volume four goes into combinatorial. This is where we have billions of things to deal with. And here we keep finding cases where one good idea can make something go more than a million times faster. and make something go more than a million times faster. And we're dealing with problems that are probably never gonna be solved efficiently, but that doesn't mean we give up on them. And we have this chance to have good ideas and go much, much faster on them. So that's common at Tauril algorithms.
Starting point is 00:32:22 And those are the ones that are, I mean, you say, shorting is most fun for you. Well, it's a satisfying ability too. But combinatorial algorithms are the ones that I always, that I always enjoyed the most because that's when my skillet programming had most payoff. And the difference between an obvious algorithm that you think of first thing and a good, an interesting subtle algorithm that not so obvious, but around circles around the other
Starting point is 00:32:54 one, that's where computer science really comes in. And a lot of these comatole methods were found first in applications to artificial intelligence or cryptography. And in my case, I just liked them and it was associated more with puzzles. Do you like the most in the Domain of Graphs and Graph Theory? Graphs are great because they're terrific models of so many things in the real world. And you throw a number on a graph, you've got a network, and so there you have many more things. any arrangement of objects that has some kind of a higher structure, non-random structure. And it's okay. Is it possible to put something together, satisfying all these conditions, like I mentioned, arrows a minute ago. You know, is there a way to put these numbers on a bunch of
Starting point is 00:34:02 boxes that are pointing to each other? is that going to be possible at all? That's volume four. That's volume four. What is the schedule? The volume four A was part one. And what happened was in 1962, when I started writing down a table of contents, it wasn't going to be a book about computer programming in general. It was going to be a book about how to write compilers.
Starting point is 00:34:28 And I was asked to write a book explaining how to write a compiler. And at that time, there were only a few dozen people in the world who had written compilers and I happen to be one of them. So, and I also had some experience writing for like the campus newspaper and things like that. So, so I thought, okay, great. I'm the only person I know who who's written a compiler but hasn't invented any new techniques for writing compilers. And all the other people I knew had super ideas, but I couldn't see that they would be able to write a book that would describe anybody else's ideas
Starting point is 00:35:12 with their own. So I could be the journalist and I could explain what all these cool ideas about compilers writing were. And then I started putting down, well, yeah, let me, you need to have a chapter about data structures you need to have some introductory material. I want to talk about searching because a compiler writer has to look up the variables in a symbol table and find out which when you
Starting point is 00:35:44 when you write the name of the variable in one place it's supposed to be the same as the one you put somewhere else out. You see, you need all these basic techniques and I, you know, had kind of no summer rhythm technique and stuff. So I threw in these chapters and I threw in a chapter in commentaries because that was what I really enjoyed programming the most, but there weren't many algorithms known about Commenetorial methods in 1962. So that was kind of a short chapter, but it was sort of thrown in just for fun. And chapter 12 was going to be actual compilers applying
Starting point is 00:36:19 all the stuff in chapters 1 to 11 to make compilers. Well, okay. So that was my table of contents from 1962. And during the 70s, the whole field of combinatorics went through a huge explosion. People talk about combinatorial explosion, and they usually mean by that, that the number of cases goes up, you know, you change end to end plus one and all of a sudden you, your problem has gotten more than 10 times harder. But there was an explosion of ideas about combinatorics in the 70s to the point that it like take 1975, I bet you're more than half of all the journals of computer science. We're about common soil method. What kind of problems were occupying people's minds?
Starting point is 00:37:09 What kind of problems in commonin Torx? Was it set to set a disability, graph theory? Yeah, graph theory was quite dominant. But all of the NP-hard problems that you have, like Hamiltonian path or... Phallus salesman. Going beyond graphs, you had operation research. Whenever there was a small class of problems that had efficient solutions and they were usually associated with matroid, the area's special mathematical construction, but once we went to things that involved three things at a time instead of
Starting point is 00:37:46 instead of two, all of a sudden things got harder. So we had satisfiability problems or if you have if you have clauses, every clause has two logical elements in it, then we can satisfy it in a linear time. We can test for satisfiability in a linear time, but if you allow yourself three time, we can test for satisfiability in a new time, but if you allow yourself three variables in the clause, then nobody knows how to do it. So these articles were about trying to find better ways to solve cryptography problems and graph three problems. We have a lot of data, but we didn't know how to find the best subsets of the data. Like, we're sorting it. We could get the answer.
Starting point is 00:38:28 Didn't take long. So how did it continue to change from the 70s to today? Yeah, so now there may be half a dozen conferences whose topic is common at Torx, different kind, but fortunately I don't have to rewrite my book every month, you know, like I had to in the 70. But still there's huge amount of work being done, and people getting better ideas on these problems that don't seem to have really efficient solutions, but we still get, we still look a lot more with them. And so this book that I'm finishing now is, I've got a whole bunch of brand new methods that,
Starting point is 00:39:09 as far as I know, there's no other, there's no other book that covers, that covers this particular approach. And so I'm trying to do my best of exploring the tip of the iceberg and try out lots of things and keep rewriting as I find better method. So what's your writing process like?
Starting point is 00:39:36 What's your thinking and writing process like every day? So what's your routine even? I guess it's actually the best question because I spend seven days a week You're doing it. You're the most prepared to answer it. Yeah, but okay, so The chair I'm sitting in is where I do It's where the magic happens where I do. That's where the magic happens. Well, reading and writing, the chairs, usually sitting over there where I have some reference book, but I found this chair, which was designed by a Swedish guy anyway.
Starting point is 00:40:17 It turns out this is the only chair I can really sit in for hours and hours and not know that I'm in a chair. But then I have the stand-up desk right next to us. And so after I write something with pencil and eraser, I get up and I type it and revise and rewrite, uh, uh, uh, uh, uh, uh, uh, uh, standing up. The kernel of the idea is first put on paper. Yeah. That's where, right. Right. And I'll write maybe five programs a week, of course, literate programming. And these are, before I describe something in my book, I always program it to see how it's working.
Starting point is 00:40:56 And I try a lot. So, for example, I learned at the end of January, I learned of a breakthrough in five, four Japanese people who had extended one of my methods in a new direction. And so I spent the next five days writing a program to implement what they did. And then I, you know, they had only generalized part of what I had done. So then I had to see if I could generalize more parts of it and then I Had to take their approach and I had to try it out on
Starting point is 00:41:30 Couple a dozen of the other problems. I had already worked out with with my old methods And so that took another couple of weeks and then I you know, then I then I started to see the light and I and and I started writing the final draft and then I would type it up and involve some new mathematical questions. And so I wrote to my friends who might be good at solving those problems and they solved some of them. So I put that in as exercises. And so a month later, I had absorbed one new idea that I learned. And I'm glad I heard about it in time. Otherwise, I wouldn't put my book out before I'd heard about the idea.
Starting point is 00:42:16 On the other hand, this book was supposed to come in at 300 pages, and I'm up to 350 now, that added 10 pages to the book. But if I learn about another one, I probably sure it's going to shoot me. Well, so in that process, in that one month process, are some days harder than others? Are some days harder than others? Well, yeah, my work is fun, but I also work hard, and there's every big job has parts that are a lot more fun than others. And so many days I'll say, why do I have to have such high standards?
Starting point is 00:42:52 Why couldn't I just be sloppy and not try this out and just report the answer? But I know that people are economy to do this. And so, okay, so okay, Donald, people are economy to do this and so, okay, so okay, Donald, grit my teeth and do it. And then the joy comes out when I see that actually, you know, I'm getting good results and I get, and I even more when I see that somebody has actually read and understood what I wrote and told me how to make it even better. I did want to mention something about the method. So I got this tablet here where I do the first, you know, the first writing of concepts.
Starting point is 00:43:40 Okay, so, so, and what link would it set in? Right, so here, take a look at it, but you know, here, you're random, say, explain how to draw such skewed pixel diagrams. Okay. So, I got this paper about 40 years ago when I was visiting my sister in Canada and they make tablets of paper with this nice, large size and just the right very small space between line and mind size. Yeah, yeah, tickle. Maybe also just show it. Yeah. Yeah. Wow. Yeah, I've got these manuscripts going back to the 60s. Yeah. And and those are when I'm getting my ideas on paper, okay? But I'm a good typist.
Starting point is 00:44:28 In fact, I went to typing school when I was in high school. So I can type faster than I think. So then when I do the editing and stand up and type, then I revise this and it comes out a lot different than what for style and rhythm and things like that, come out at the typing stage. And you type in tech. And I type in tech. And can you think in tech? No.
Starting point is 00:44:55 So to a certain extent, I have only a small number of idioms that I use. Like, you know, I'm beginning with theorem. I do something for display equation I do something and and so on but I but I I have to see it and In the way that it's on paper here. Yeah, right. So for example touring wrote what the other direction you don't write macros You don't think in macros in that particular, but when I need a macro, I'll go ahead and do it. But the thing is, I also write to fit. I'll change something. If I can save a line, it's like high-cool.
Starting point is 00:45:37 I'll figure out a way to rewrite the sentence so that it'll look better on the page. I shouldn't be wasting my time on that but but I can't resist because I know It's only another 3% of the time or something like that and it could also be argued that that is what Life is about. Oh, yes, in fact, that's true Like I work in the garden one day a week and that's that's kind of a description of my life is getting rid of weeds, you know Removing bugs for programs and so you know a lot of writers talk about you know basically suffering the writing processes Yeah, having you know, it's extremely difficult and I think of programming
Starting point is 00:46:21 Especially the or technical writing that you're doing can be like that. Do you find yourself methodologically? How do you every day sit down to do the work? Is it a challenge? You kind of say it's, you know, it's fun. But it would be interesting to hear if there are non-fund parts that you really struggle with. Yeah, so the fun comes when I'm able to put together ideas of two people who didn't know about each other. And so I might be the first person that saw both of their ideas. And so then I get to make the synthesis and that gives me a chance
Starting point is 00:47:07 to be creative. But the dread work is where I have got to chase everything down to its root. This leads me into really interesting stuff. I mean, I learn about Sanskrit and I try to give credit to all the authors. and so I write to people who know the people who got this if they're dead, I communicate this way. And I got to get the math right, and I got to tackle my programs, try to find holes in them, and I rewrite the programs after I get a better idea. Is there ever dead ends? Dead ends? Oh yeah, I throw stuff out, yeah.
Starting point is 00:47:49 One of the things that I spend a lot of time preparing, a major example based on the game of baseball. And I know a lot of people who, for whom baseball is the most important thing in the world, you know, but I also know a lot of people for whom cricket is the most important in the world or soccer or something. And I realized that if I had a big example, I mean, it was going to have a full-doubt illustration and everything. And I was saying, what am I really teaching about algorithms here where I had this baseball example? about algorithms here where I had this baseball example. And if I was a person who knew only cricket,
Starting point is 00:48:27 what would they think about this? And so I ripped the whole thing out. But I had something that would have really appealed to people who grew up with baseball as a major theme in their life. Which is a lot of people. But just, yeah, still a minority. Small minority. I took out bowling, too.
Starting point is 00:48:50 Even a smaller minority. What's the art in the art of programming? Why is there, of the few words in the title, why is art one of them? Yeah. Well, that's what I wrote my touring lecture about. And so when people talk about art, it really, I mean, what the word means is something that's not a nature. So when you have artificial intelligence, the art comes from the same root,
Starting point is 00:49:26 saying that this is something that was created by human beings. And then it's gotten a further meaning of a fine art, which has this beauty to the to the mix in size. You know, we have things that are artistically done, and this means not only done by humans, but also done in a way that's elegant and brings joy and and has has I guess a told story verse does to ask you right but anyway it it's that that part that says that it's done well as well as not only different from nature. In general, then art is what human beings are specifically good at
Starting point is 00:50:18 and when they say artificial intelligence, well, they're trying to mimic human beings. artificial intelligence well they're trying to mimic human beings. But there's an element of fine art and beauty. You are wonderful. That's what I that's what I try to also say that you can write a program and make a work of art. So now in terms of surprising, you know, what ideas in writing from sort and search to the combinatorial algorithms, what ideas have you come across that were particularly surprising to you that change the way you see a space of problems.
Starting point is 00:51:05 I get a surprise every time I have a bug in my program, obviously, but that isn't really what you're at. You're looking at the information of the test and surprises. For example, in volume 4A, I was especially surprised when I learned about data structure called BDD, this Boolean Decision Diagram. data structure called BDD, this Boolean decision diagram, because I sort of had the feeling that as an old timer, and I've been programming since the 50s, and BDDs weren't invented till 1986,
Starting point is 00:51:47 and here comes a brand new idea that revolutionizes the way to represent a Boolean function. And Boolean functions are so basic to all kinds of things. I mean, logic is underlies it. Everything we can describe, all of what we know in terms of logic somehow and propositional logic. I thought that was cut and dried and everything was known, but here comes a Randy Bryant and discovers that BDDs are incredibly powerful. Then, so that means I have a whole new section to the book that I never would have thought of until 1986, not until 1990s, when people started to use it, for
Starting point is 00:52:40 billion dollar of applications. And it was the standard way to design computers for a long time until, until SAT solvers came along in the year 2000. So that's another great big surprise. So a lot of these things have, have totally changed the structure of my book. And the middle third of volume for B is about SAT solvers. And that's 300 plus pages, which
Starting point is 00:53:10 was all about material, mostly about material that was discovered in this century. And I had to start from scratch and meet all the people in the field and write, I have 15 different set's of that I wrote while preparing that. Seven of them are described in the book, others were for my own experience. So newly invented data structures or ways to represent a whole new class of algorithm? A whole new class of algorithm. Yeah, and the interesting thing about the BDDs was that you class about. Yeah and the interesting thing about the BDDs was that the theoreticians started looking at it and started to describe all the things you couldn't do with BDDs. And so they were getting a bad name because you know okay they were they were useful but
Starting point is 00:54:03 they didn't solve everything. Every problem. I'm sure that the theoreticians are in the next 10 years, I'm going to show why machine learning doesn't solve everything. But I, you know, I'm not only worried about the worst case, I get a huge delight when I can actually solve a problem that I couldn't solve before, even though I can't solve the problem that it suggests as a further problem. I know that I'm way better than I was before. And so I found out that BDs could do all kinds of miraculous things. And so I had to spend quite a few years had to spend quite a few years learning about that territory. So, in general, what brings you more pleasure?
Starting point is 00:54:52 Proving or showing a worst-case analysis of an algorithm? Or showing a good average case or just showing a good case? That, you know, something good pragmatically can be done with this algorithm. Yeah, I like a good case that that is maybe only a million times faster than I was able to do before but and not worry about the fact that that is still that is still going to take too long if I double the size of the problem. So that said, you popularized the asymptotic notation for describing running time. Obviously in the analysis of algorithms,
Starting point is 00:55:32 worst cases, such an important part. Do you see any aspects of that kind of analysis is lacking? And notation too. Well, the main purpose, we should have notations that help us for the problems that we want to solve. And so that they match our intuitions. And people who worked in number theory had used asymptotic notation in a certain way,
Starting point is 00:56:00 but it was only known to a small group of people. And I realized that in fact, it was very useful to be able to have a notation for something that we don't know exactly what it is, but we only know partial about it. So, for example, instead of big onotation, let's just take a much simpler notation where I'd say zero or one or zero one or two and suppose that suppose that When I had been in high school, we would Be allowed to put in the middle of our formula x plus zero one or two equals Why okay, and then then we would learn how to multiply two such expressions together and deal with
Starting point is 00:56:49 them. Well, the same thing, big old notation says, here's something that's, I'm not true what it is, but I know it's not too big. I know it's not bigger than some constant times n squared or something like that. So I write big old of n squared. Now I learn how to add big old of n squared to something like that. So I write big ol' of n squared. Now I learn how to add big ol' of n squared to big ol' of n cubed. And I know how to add big ol' of n squared to plus one and square that and how to take logarithm next but then you also
Starting point is 00:57:15 have big ol' in the middle of them. And that turned out to be hugely valuable in all of the work that I was trying to do as I'm trying to figure out how good an algorithm is. So have there been algorithms in your journey that perform very differently in practice than they do in theory? Well, the worst case of a common trial algorithm is almost always horrible. But but but we have sad solvers that are solving where one of the last exercises in that part of my book was figure out a problem that has 100 variables that's difficult for us that solver. But you would think that a problem with 100-booming variables has The problem with 100 boolean variables has required you to do two to the 100th
Starting point is 00:58:13 Operations because that's the number of possibilities when you have 200 boolean variables in two to the 100th To 200th is way bigger than then we can handle 10 to the 17th is a lot You've mentioned over the past few years that you believe P may be equal to NP, but that it's not really, you know, if somebody does prove that P equals NP, it will not directly lead to an actual algorithm to solve difficult problems. Can you explain your intuition here? Has it been changed? And in general, on the difference between easy and difficult problems of P and NP and so on. Yeah, so the popular idea is if in algorithm exists, then somebody will find it.
Starting point is 00:58:54 And it's just a matter of writing it down one point. But many more algorithms exist than anybody can understand or ever make use of. Or discover, yeah, because they're just way beyond human comprehension. The total number of algorithms is more than mind-boggling. So, so we have situations now where we know that algorithm exists, but we don't know, we don't the fog is the idea what the algorithms are. There are simple examples based on game playing where you have, where you say, well, there must be an algorithm that exists to win in the game of Hex because for the first player
Starting point is 00:59:45 to win in the game of Hex because Hex is always either an out a win for the first player or the second player. But what's the game of Hex? There's a game of Hex which is which is based on putting pebbles onto a hexagonal board and the white player tries to get a white path from left to right and the black player tries to get a black path from bottom to right and the black player tries to get a black path from bottom to top. And how does capture occur? Just so I can't. And there's no capture. You just put pebbles down one at a time. But there's no draws because after all the white and black are
Starting point is 01:00:16 played, there's either going to be a white path across from each to west or a black path from bottom to top. So there's always, it's a perfect information game and people take turns like Tic Tac Toe. And the Hector Board can be different sizes, but there's no possibility of a draw and players move one at a time. And so it's gotta be either a first player win or a second player win, mathematically, you follow out all the trees and either there's always a win for the first player,
Starting point is 01:00:51 second player. Okay. And it's finite. The game is finite. So there's an algorithm that will decide, you can show it has to be one or the other. Because the second player could mimic the first player with kind of a pairing strategy and so you can show that it has to be one or the other but we don't know any algorithm anyway we don't know that there are cases where you can prove the existence of an exclusion, but nobody knows any way how to find it. But more like the algorithm question, there's a very powerful theorem in graph theory by Robinson to see more that says that every class of graphs that is closed under taking minors has a polynomial time algorithm to determine whether it's in this class or not.
Starting point is 01:01:48 Now, a class of graphs, for example, planar graphs, these are graphs that you can draw in a plane without crossing lines. And the planar graph is taking minors means that you can shrink an edge into a point or you can delete an edge. And so you start with a planar graph an edge into a point or you can delete an edge. And so you start with a planer graph from shrink any edge to a point is still a planer,
Starting point is 01:02:11 delete an edge is still a planer. Okay, now, but there are millions of different ways to describe a family of graph that still remains the same under taking minor. And Roberts and the Seymour proved that any such family of graphs, there's a funnett number of minimum graphs that are obstructions. So that if it's not in the family, then it has to contain, then it has to be a way to shrink it down and until you get one of these bad minimum graphs
Starting point is 01:02:56 that's not in the family. For in case of a planar graph, the minimum graph is a five-pointed star where everything points to another and the minimum graph consisting of trying to connect three utilities to three houses without crossing lines. And so there are two there are two bad graphs that are not planar. And every every non-planar graph contains one of these two bad graphs by by shrinking and moving out. Sorry. Can you say it again? So he put that there's a finite number of these bad graphs.
Starting point is 01:03:29 There's always a finite number. So somebody says, here's a family. It's hard to believe. And they present this sequence of 20 papers. I mean, it's deep work. But it's because that's for any arbitrary class. So it's for any arbitrary class that's closed under taking Miners that's closed under maybe I'm not understanding because it seems like a lot of them are closed under taking Miners almost all the important classes of graphs are
Starting point is 01:03:56 there are tons of such graphs, but also hundreds of them that arise in applications. I have a book over here called, Effect Classes of Graphs. And it's amazing how many different classes of graphs people have looked at. So why do you bring up this theorem, lower this proof? So now there's lots of algorithms
Starting point is 01:04:22 that are known for special class of graphs. For example, if I have a certain, if I have a quarter graph, then I can color it efficiently. If I have some kind of graphs, it'll make a great network, which is very interesting. So like you'd like to test it, somebody gives you a graph that's always in this family of graphs. If so, then I can go to the library and find an algorithm that's going to solve my problem on that graph. So we want to have a graph that says, algorithm that says, you give me a graph, I'll tell you whether it's in whether it's in this family or not. Okay.
Starting point is 01:05:06 And so all I have to do is test whether or not that does this given graph have a minor, that's one of the bad ones. A minor is everything you can get by shrinking and removing it. And given any minor, there's a polynomial time algorithm saying, I can tell whether this is a minor of you. And there's a finite number of bad cases. So I just tried, you know, does it have this bad case polynomial time? I got the answer. Does it have this bad case polynomial time? I got the answer. Total polynomial time. And so I've solved the problem. However, all we know is that the number of miners is finite. We don't know what that, we might only know one or two of those miners,
Starting point is 01:05:50 but we don't know that if we've got 20 of them, we don't know there might be 21, 25, there's just some, all we know is that it's finite. So here we have a polynomial time algorithm that we don't know. That's a really great example of what you worry about or why you think P equals NP won't be useful, but still, why do you hold the intuition that P equals NP? Because you have to rule out so many possible algorithms have been not working.
Starting point is 01:06:28 You can take the graph and you can represent it as in terms of certain prime numbers and then you can multiply those together and then you can take the bitwise end and construct some certain constant and polynomial time and that's, you know, perfectly valid algorithm and there's so many algorithms of that kind. A lot of times we see random take data and and we get quencentises that that that some fairly random looking number actually is useful because because it's it happens to it happens to solve it happens to solve a problem just because
Starting point is 01:07:19 you know there's so many hairs on your head, but it seems unlikely that two people are going to have the same number of hairs on their head. But they're obvious, but you can count how many people there are and how many hairs on their head. So there must be people walking around in the country that have the same number of hairs on their head. Well, that's a kind of a coincidence that you might say also, this particular combination of operations
Starting point is 01:07:49 just happens to prove that a graph has a Hamiltonian path. I mean, I see lots of cases where unexpected things happen when you have enough possibilities. So because the space of possibilities are huge, your intuition says that's all. They have to rule them all out. And so that's the reason for my intuition is it by no means approved. I mean, some people say, you know, well, P, P cat equal and P because you've had all these smart people, you know, the smartest
Starting point is 01:08:21 values have been wrecking their brands for years and years. And there's a million dollar prizes out there. And you know, none of them, nobody has thought of the algorithm. So it must be no such algorithm. On the other hand, I can use exactly the same logic. And I can say, well, P must be equal to NP because there are so many smart people out here been trying to prove it unequal to NP and they've all failed.
Starting point is 01:08:51 This kind of reminds me of the discussion about the search for aliens. They've been trying to look for them and we haven't found them yet therefore they don't exist. But you can show that there's so many planets out there that they very possibly could exist. Yeah. And then there's also the possibility that they exist, but they all discovered machine learning or something and then we each other up. Well, on that small, quick tangent, let me ask, do you think there's intelligent life
Starting point is 01:09:22 out there in the universe? I have no idea. Do you hope so? Do you think about it? I don't spend my time thinking about things that I could never know really. And yet you do enjoy the fact that there are as many things you don't know. You do enjoy the mystery of things. I enjoy the fact that there are that I have limits, yeah, but I don't, but I don't take time to answer unsolvable questions. Got it. Well, because you've taken on some tough questions that may seem unsolvable. You have taken on some tough questions, and you see it unsolvable. It gives me a thrill when I can get further than I ever thought I could. But I don't. Much like with religion, these, I'm glad that there's that there's
Starting point is 01:10:13 no proof that God exists or not. I mean, I think it would spoil the mystery. It would be too dull. Yeah. So to quickly talk about the other art of artificial intelligence, what is your view? You know, artificial intelligence community has developed as part of computer science and in parallel with computer science since the 60s. What's your view of the AI community from the 60s to now. So all the way through it was that the people who were inspired by trying to mimic intelligence or to do things that that were somehow the greatest achievements of intelligence that have been inspiration to people who have pushed the envelope of computer science maybe more than any other group of people.
Starting point is 01:11:07 So it's all through. It's been a great source of good problems to take into. And getting And partial answers and then more and more successful answers over the year. So this has been the inspiration for lots of the great discoveries of computer science. Are you yourself captivated by the possibility of creating of algorithms having echoes of intelligence in them? Not as much as most of the people in the field, I guess, I would say, but that's not to say that they're wrong or that it's just you asked about my own personal preferences. But the thing that I worry about is when people start believing that they've actually succeeded. And because the seems to me that's a huge gap between really understanding something and
Starting point is 01:12:19 being able to pretend to understand something and give the illusion of understanding something. Do you think it's possible to create without understanding? Yeah. So to, uh, I do that all the time too. I mean, that's why I use random members. I, I, yeah. But I, but, but there's, there's still this great gap. I don't assert that it's impossible, but I don't see anything coming any closer to really
Starting point is 01:12:53 the kind of stuff that I would consider intelligence. So you've mentioned something that on that line of thinking, which I very much agree with. So the art of computer programming as the book is focused on single processor algorithms in for the most part. You mentioned... That's only because I set the table of contents in 1962. You have to remember. For sure. There's no...
Starting point is 01:13:21 I'm glad I didn't wait until 1965 or something. One book, maybe we'll touch in the Bible, but one book can't always cover the entirety of everything. So I'm glad the the typical of codenns for the art of computer programming is what it is. But you did mention that you thought that understanding of the way ant colonies are able to perform incredibly organized tasks might
Starting point is 01:13:52 well be the key to understanding human cognition. So these fundamentally distributed systems. So what do you think is the difference between the way Don Knuth would sort a list and an ant colony would sort a list or performing algorithm? Sorting a list isn't the same as cognition though, but I know what you're getting at is, so to the advantage of ant colony, at least we can see what they're doing. We know which antists talk to which other ant and as much harder with brains to know, to what extent neurons are passing signal. So I'm just saying
Starting point is 01:14:36 that adcony might be, if they have the secret of cognition, I think of an ant colony as a cognitive single being rather than as a kind of a lot of different ants. I mean, just like the cells of our brain are and the microbiome and all that is interacting entities, but somehow I consider myself to be a single person. Well, you know, the Ant-Connie, you can say it might be cognitive, somehow, and it sounds, you know, I mean, you know, I, okay, I smash a certain ant and cognitive thing. That's done, what was that?
Starting point is 01:15:24 But if we're going to crack the secret of cognition, it might be that we could do so by psyching out how I ask to it because we have a better chance to measure that communicating by pheromones and by touching each other and psych, but not by much more subtle phenomenon, my collect of currents going through. But even a simpler version of that, what are your thoughts of maybe Conway's Game of Life?
Starting point is 01:15:52 Okay, so Conway's Game of Life is able to simulate any computable process. And any deterministic process is like how you went there. I mean, that's not it's most powerful thing, I would say. I mean, they can simulate it. But the magic is that the individual units are distributed. Yes. And extremely simple. Yes, we can we understand exactly what the primitives are. The primitives, just like with the ant colony, even simple though. But if we, but still it doesn't say that I understand, I understand life. I mean, I understand. It gives me, it gives me a better insight into what does it mean to,
Starting point is 01:16:43 to have a deterministic universe? What does it mean to have a free choice, for example? Do you think God plays dice? Yes. I don't see any reason why God should be forbidden from using the most efficient ways to, to, I mean, we know that dice are extremely important in, in efficient algorithms. There are things that couldn't be done well without randomness. And so I don't see any reason why, why God should be prohibited from it. When the, when the algorithm requires it, I don't, you don't see why the physics should constrain it.
Starting point is 01:17:28 So, in 2001, you gave a series of lectures at MIT about religion and science. No, that was 1999. But you published, sorry. The book came out in 2009. In 1999, you spent a little bit of time in Boston enough to give those lectures. Yeah. And I read in the 2001 version, most of it. It's quite fascinating to read.
Starting point is 01:17:54 I recommend people, it's transcription of your lectures. So what did you learn about how ideas get started and grow from studying the history of the Bible? So you've rigorously studied a very particular part of the Bible. What did you learn from this process about the way us human beings, this is society, develop and grow ideas, share ideas, and find those ideas? Well, I tried to summarize that. I wouldn't say that I learned a great deal of really definite
Starting point is 01:18:26 things where I could make conclusions, but I learned more about what I don't know. You have a complex subject which is really beyond human understanding. So we give up on saying, I'm never going to get to the end of the road and I'm never going to understand it, but you say, but maybe it might be good for me to get closer and closer and learn more about more and more about something. And so, you know, how can I do that efficiently? And the answer is, well, use randomness. And so try a random subset of that is within my grasp and study that in detail. Instead of just studying parts that somebody tells me to study or instead of studying nothing
Starting point is 01:19:21 because it's too hard. So I decided for my own amusement, once that I would take a subset of the verses of the Bible, and I would try to find out what the best thinkers have said about that small subset. And I had about, let's say, 60 verses out of 3,000, I think, is one out of 500 or something like this. And so then I went to the libraries, which are well indexed. I spent, for example, at Boston Public Library. I would go once a week for a year.
Starting point is 01:20:09 And I went, I went, I have done time stuff, and over Harvard Library to look at this, you know, that weren't in the Boston Public. Where they, of course, scholars had looked at, and you can go down the shelves, and you can pretty and you can go down the shelves and you can pretty, you can look at the index and say, oh, is this verse mentioned anywhere in this book? If so, look at page 105. So in other words, I could learn not only about the Bible, but about the secondary literature about the Bible, the things that scholars have written about it.
Starting point is 01:20:43 about the Bible, the things that scholars have written about it. And so that gave me a way to zoom in on parts of the thing so that I could get more insight. And so I look at it as a way of giving me some firm pegs which I could hang pieces of information, but not as things where I I would say and therefore this is true in this Random approach of sampling the Bible. What did you learn about the most You know central One of the biggest accumulation of ideas in our image. To me, that the main thrust was not the one that most people think of as saying,
Starting point is 01:21:28 you know, don't have sex or something like this. But the main thrust was to try to figure out how to live in harmony with God's wishes. I'm assuming that God exists. And I say, I'm glad that I, that there's no way to prove this because that wouldn't, that would, I would run through the proof once and then I'd forget it and it would, and, and I would never speculate about spiritual things and mysteries otherwise. And I think my life would be very incomplete. So I'm assuming that God exists, but a lot of the people say God doesn't exist, but that's still important to them. And so in a way that might still be,
Starting point is 01:22:24 important to them. And so in a way that might still be, what other God is there or not, in some sense, it guys important to them. It's one of the one of the verses I studied, that is you can interpret it as saying, you know, it's much better to be an atheist than not to care at all. So I would say it's, yeah, it's similar to the P equals NP discussion. Yeah, you mentioned a mental exercise that I I'd love it if you could partake in yourself a mental exercise of being God. And so how would you if you were God, don't know how would you present yourself to the people of earth? You mentioned your love of literature, and there's this book that really I can recommend to you.
Starting point is 01:23:09 If I can think, yeah, the title I think is Blasphemy. It talks about God revealing himself through a computer in Los Alamos. And it's the only book that I've ever read And it's the only book that I've ever read where the punchline was really the very last word of the book, and it explained the whole idea of the book. And so I don't want to give that away. But it's really very much about this question that you raised. But suppose God said, okay, that my previous means of communication with the world are not the best for the 21st century. So what should I do now? And it's conceivable
Starting point is 01:24:00 that God would choose the way that's described in this book. Another way to look at this exercise is looking at the human mind, looking at the human spirit, the human life in a systematic way. I think it mostly, you want to learn humility, you want to realize that once we solve one problem, that doesn't mean that all of a or other problems are going to drop out. And we have to realize that, that there are things beyond our, beyond our, our ability. I see hubris all around. Yeah. Well said. If you were to run program analysis on your own life,
Starting point is 01:24:50 how did you do? In terms of correctness, running time, resource use, asymptotically speaking, of course. Okay, yeah, well, I would say that question had not been asked me before. And I started out with library subroutines and learning how to be a automaton that was obedient. and learning how to be a automaton that was obedient. And I had the great advantage that I didn't have anybody to blame for my failures. If I started getting, not understanding something, I knew that I should stop playing ping pong
Starting point is 01:25:41 and it was my fault that I wasn't studying hard enough or something, rather than that somebody was discriminating against me in some way. And I don't know how to avoid the existence of biases in the world, but I know that that's an extra burden that I didn't have to suffer from. And then I found the, from parents I learned the idea of of service to other people as being more important than what I get out of stuff myself. I know that I need to be happy enough, enough in order to be able to be
Starting point is 01:26:34 observable, but I came to philosophy. Finally, that I phrase as point eight is enough. There was a TV show, one's called eight is enough, which was about, you know, somebody had eight kids. But I say point eight is enough, which means if I can have a way of rating happiness, I think it's good design that, happiness. I think it's good design to have an organism that's happy about 80% of the time. And if it was 100% of the time, it would be like everybody's on drugs and everything
Starting point is 01:27:22 collapses, nothing works because everybody's just too happy. Do you think you've achieved that point eight optimal? Well, I don't see a way. There are times when I'm down, and I, you know, I mean, I know that I'm chemically, that I know that I've actually been programmed to be, to be depressed a certain amount of time. And if that gets out of kilter
Starting point is 01:27:47 and I'm more depressed than you, sometimes I find myself trying to say, now who should I be mad at today? There must be a reason why I'm, you know. But then I realize, you know, it's just my chemistry telling me that I'm supposed to be mad at somebody. And so I trigger, I'd say,
Starting point is 01:28:04 okay, go to sleep and get better. But if I'm not 100% happy, that doesn't mean that I should find somebody that's screaming and try to sound as I'm. But I'm saying, OK, I'm not 100% happy. But I'm happy enough to be part of a sustainable situation. So that's kind of the numerical analysis I do. I do a very short talk on the optimal.
Starting point is 01:28:40 Human life is a point eight. Yeah. I hope it's okay to talk about, as you talked about previously in 2006, you were diagnosed with prostate cancer. Has that encounter with mortality changed you in some way or the way you see the world? Yeah, it did. The first encounter with mortality when my dad died and I went through a month when I
Starting point is 01:29:07 sort of came to King Be comfortable with the fact that I was gonna die someday and during that month. I don't know I I felt okay, but I couldn't sing. And I couldn't do original research either. I sort of remember after three or four weeks, the first time I started having a technical thought that made sense and was maybe slightly creative.
Starting point is 01:29:42 I could sort of feel that something was starting to move again, but that was, so I felt very empty for, until I came to grips with the, I learned that this is sort of a standard grief process that people go through. Okay, so then now I'm at a point in my life, even more so than in 2006, where all of my goals have been fulfilled,
Starting point is 01:30:08 except for finishing the Art of Computer Program. I had one major on fulfill goal I'd wanted all my life to write a piece of music that had an idea for a certain kind of music that I thought ought to be written at least, somebody ought to try to do it. And I felt that it wasn't going to be easy, but I wanted to prove a concept. I wanted to know if it was going to work or not. And so I spent a lot of time. And finally I finished that piece and we had the, we had the, the world premiere last year on my 80th birthday and we had another premier in Canada.
Starting point is 01:30:55 And there's talk of concerts in Europe and various things so that, but that's done. It's part of the world's music now and it's either good or bad, but I did what I was hoping to do. So the only thing that I have on my agenda is to try to do as well as I can with the Art of Computer Programme until I go to see now. Do you think there's an element of 0.8 that might have applied there? Oh, 0.8? Yeah.
Starting point is 01:31:26 Well, I look at it more than I got actually to 1.0 when that concert was over with. I mean, I, I, I, you know, I, so in 2006, I was at 0.8. So, so when I diagnosed with prostate cancer, then I said, okay, well, maybe this is, you know, I've had all kinds of good luck on my life, and there's no, I have nothing to complain about. So I might die now, and we'll see what happened. And so it's quite seriously, I went and I didn't, I had no expectation that I deserved better.
Starting point is 01:32:14 I didn't make any plans for the future. I had my surgery, I came out of the surgery and spent some time learning how to walk again and so on. It was painful for a while. But I got home and I realized I hadn't really thought about what to do next. I hadn't any expectations. I said, okay, hey, I'm still alive. Okay, now I can write some more books.
Starting point is 01:32:46 But I didn't come to the attitude that, you know, this was terribly unfair. And I just said, okay, I was accepting whatever turned out. I've gotten more than my share already. So why should I? And I didn't. And I really, when I got home, I realized that I had really not thought about the next step,
Starting point is 01:33:19 what I would do after I would be able to work again. I had sort of thought of it as if as this might, I was comfortable with the fact that it was at the end. But I was hoping that I would still be able to learn about satisfiability and also someday write music. satisfiability and also someday write music. I didn't start seriously on the music project until 2012. So I'm going to be in huge trouble if I don't talk to you about this. In the 70s, you've created the tech type setting system together with Metafot language for font description and computer modern family of typefaces. That has basically defined the methodology in the aesthetic of the countless research
Starting point is 01:34:14 fields, right? Math, physics, well beyond computer science, so on. Okay. Well, first of all, thank you. I think I speak for a lot of people in saying that. But question in terms of beauty, there's a beauty to typography that you've created, and yet beauty is hard to quantify. How does one create beautiful letters and beautiful equations?
Starting point is 01:34:42 Like what? So, I mean, perhaps there's no words to be describing. Yeah. To be describing the process, but. So the great Harvard mathematician, George Deeper Koth, wrote a book in the 30s called The Aesthetic Measure, where he would have pictures of bases, and underneath would be a number,
Starting point is 01:35:07 and this was how beautiful the base was. And he had a formula for this. And he actually also wrote about music. And so he could, he could, so I thought maybe I would, part of my musical composition, I would try to program his algorithms and you know So that I would write something that had the highest number by his score. Well, it wasn't quite rigorous enough for
Starting point is 01:35:34 For a computer to do but anyway people have tried to to put numerical value on beauty but and and he did probably the most serious attempt and George Gryffin's teacher also wrote two lines where he talked about his method of composing music, but you're talking about another kind of beauty and beauty and whatever that curvature is. Right. So, and so that's, and I'd be, to be older as they say, but, um,
Starting point is 01:36:11 getting striving for excellence and whatever, definition you want to give to beauty, then you try to get as close to that as you can somehow with it. I guess, I guess I'm trying to ask and there may not be a good answer. Uh, what loose definitions were you operating under with the community of people that you're working on? Oh, the loose definition, I want to appeal to me to me. To you personally.
Starting point is 01:36:38 Yeah. That's a good start. Yeah, knowing and it failed that test, when I got volume two came out with the with the new printing and I was expecting it to be the happiest day of my life. And I felt a like a burning like how angry I was that I opened the book and it was in the same beige covers and but but it didn't look right on the page. The number two was particularly ugly. I couldn't stand any page.
Starting point is 01:37:11 I had a two in this page number. And I was expecting that it was, you know, I spent all this time making measurements. And I had looked at stuff in different ways. And I had looked at stuff in different ways and I had great technology, but I wasn't done. I had to retune the whole thing after 1961. Has it ever made you happy finally? Oh, yes.
Starting point is 01:37:40 Or is it a point eight? No, and so many books have come out that would never have been written without this. I just thought it's just, it's just, it's just, it's, it's, it's, it's, it's, it's, it's really, but I can, but now I can, I mean, all these pages that are sitting up there, I, I, I, I, I don't have a, if I didn't like it, I might would change them. Like, that's my, nobody else has this ability. They have to stick with what I gave them. Yeah. So in terms of the other side of it, there's the typography, so the look of the type and the curves and the lines, what about the spacing? What about the spacing between the
Starting point is 01:38:21 white space? Yeah. It seems like you could be a little bit more systematic about the layout or technical. Oh, yeah, you can always go further. I didn't stop at 0.8. I stopped about 0.98. It seems like you're not following your own rule for happiness. not following your own rule for happiness. No, no, no. There's, okay, of course there's this, what is it? Japanese word, wabi sabi or something. Where the most beautiful works of art are those that have flaws because then the person who perceives them as their own appreciation
Starting point is 01:39:05 and that give you a more satisfaction, or so on. But I, but no, no, with typography, I wanted it to look good as I could in the best majority of cases. And then when it doesn't, then I say, OK, that's 2% more work for the author. But I didn't want to say that my job was to get 200% and take all the work away from the author.
Starting point is 01:39:38 That's what I meant by that. So if you were to venture a guess, how much of the nature of reality do you think we humans understand? So you mentioned you appreciate mystery. How much of the world about us is shrouded in mystery? Are we, are we, if you were to put a number on it? What, what percent of it all do we understand? Are we totally, how many leading zeros, zero point zero zero zero.
Starting point is 01:40:06 I don't know. Now, I think it's infinitesimal. How do we think about that? What do we do about that? Do we continue one step at a time? Yeah, we model through. We do our best. We realize that nobody's perfect.
Starting point is 01:40:20 And we try to keep advancing, but we don't spend time saying we're not there, we're not all the way to the end. Some mathematicians that would be in office next to me when I was in the math department, they would never think about anything smaller than countable infinity. And I never, you know, we intersected that countable infinity because I rarely got up to countable infinity. And I never, you know, we intersect with that countable infinity, because I rarely got up to countable infinity. I was always talking about finite stuff.
Starting point is 01:40:51 But even limiting to finite stuff, which is, which the universe might be, there's no way to really know when the universe isn't, isn't just made out of capital N, what ever you know you want to call them quarks or whatever, where capital N is some fun and a number, all of the numbers that are comprehensible are still way smaller than most almost all fun at numbers. I got this one paper Called supernatural numbers where I what I guess you probably ran into something called Knuth arrow notation. Did you ever run into that where anyway. So you take a number. I think it's like I and I called it super K I think it's like, and I called it super K, I named it after myself, but it's,
Starting point is 01:41:47 but in arrow notation it's something like 10 and then four arrows in a three or something like that. Okay, no. The arrow notation, if you have, if you have no arrows, that means multiplication, x, y means x times x times x times x, y times. If you have one arrow, that means explanation. So X one arrow, Y means X to the X to the X to the X to the X Y times. So I found out by the way that this notation was invented by a guy in 1830 and he was a, he was a, a, one of the English nobility who, who spent his time thinking
Starting point is 01:42:31 about stuff like this. And it was exactly the same concept that I, that I'm, that I used arrows and he used a slightly different notation. But anyway, this and then this Ackermann's function is is based on the same kind of ideas, but Ackermann was 1920s. But anyway, we got this number 10 quadruple arrow three. So so that's that says, well, we take you know, we take 10 to the 10 of the 10 to the 10 to the 10 to the 10th in how many times do we do that? Oh 10 to the 10 to the 10 to the 10th and how many times do we do that? Oh, 10 double or two times. I mean how tall is that stack? But but then we do that again because that was only 10 triple or quadruple or two. Quadruple or three. It's pretty large number. It gets way beyond
Starting point is 01:43:21 comprehension. Okay. And so, but it's so small compared to what finite numbers really are, because I want to use four arrows and, you know, 10 and a three. I mean, let's have that many number arrows. I mean, the boundary between infinite and finite is incomprehensible for us humans anyway. Infinity is a good, is a useful way for us to think about extremely large, extremely large thing. And we can manipulate it, but we can never know that the universe is actually and we're near that. So, it just, so I realized how little we know. But we found an awful lot of things that are too hard for anyone person to know, even in our small universe.
Starting point is 01:44:31 Yeah, and we did pretty good. So, when you go up to heaven and meet God and get to ask one question that would get answered, what question would you ask? that would get answered. What question would you ask? What kind of browser do you have up here? No. No, I actually... I don't think it's meaningful to ask this question. But I certainly hope we had good internet. Okay, and that note, that's beautiful actually. But I certainly hope we had good internet. Okay, on that note, that's, that's beautiful actually.
Starting point is 01:45:12 Don, thank you so much. It was a huge honor to talk to you. I really did. Well, thanks for the gamut of questions. Yeah, it was fun. Thanks for listening to this conversation with Donald Knuth. And thank you to our presenting sponsor, Cash App. Don't want it. use code Lex Podcasts, you'll get $10 and $10 will go to first, a STEM education nonprofit that inspires hundreds of thousands of young minds to learn and to dream of engineering our future.
Starting point is 01:45:37 If you enjoy this podcast, subscribe on YouTube, give it 5 stars on Apple Podcasts, support it on Patreon or connect with me on Twitter. And now let me leave you with some words of wisdom from Donald Knuth. We should continually be striving to transform every art into a science, and in the process we advance the art. Thank you for listening and hope to see you next time. you

There aren't comments yet for this episode. Click on any sentence in the transcript to leave a comment.