Lex Fridman Podcast XX
[0] The following is a conversation with Donald Knuth, one of the greatest and most impactful computer scientists and mathematicians ever.
[1] He's the recipient of the 1974 Touring Award, considered the Nobel Prize of Computing.
[2] He's the author of the Multivolium Work, the Magnum Opus, the Art of Computer Programming.
[3] He made 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 O notation.
[4] He also created the tech typesetting system, which most computer scientists, physicists, mathematicians, and scientists and engineers in general used to write technical papers and make them look beautiful.
[5] I can imagine no better guest to end 2019 with than Don, one of the kindest, most brilliant people in our field.
[6] This podcast was recorded many months ago.
[7] It's one I avoided because perhaps counterintuitively, 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.
[8] I hope that's okay with you.
[9] The office space was a big crammed for filming, but it was a magical space, where Don does most of his work.
[10] It meant a lot to me that he would welcome me into his whole, home.
[11] It was quite a journey to get there.
[12] As many people know, he doesn't check email, so I had to get creative.
[13] The effort was worth it.
[14] I've been doing this podcast on the side for just over a year.
[15] Sometimes I had to sacrifice a bit of sleep, but always happy to do it, and to be part of an amazing community of curious minds.
[16] Thank you for your kind words of support and for the interesting discussions, and I look forward to many more of those in 2020.
[17] This is the Artificial Intelligence Podcast.
[18] If you enjoy it, subscribe on YouTube, give it five stars an Apple podcast, follow on Spotify, support on Patreon, or simply connect with me on Twitter, and Lex Friedman, spelled F -R -I -D -M -A -N.
[19] I recently started doing ads at the end of the introduction.
[20] I'll do one or two minutes after introducing the episode and never any ads in the middle that break the flow of the conversation.
[21] I hope that works for you and doesn't hurt the listening experience.
[22] I provide time stamps 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.
[23] This show is presented by Cash App, the number one finance app in the App Store.
[24] I personally use Cash App to send money to friends, but you can also use it to buy, sell, and deposit Bitcoin in just seconds.
[25] Cash App also has a new investing feature.
[26] You can buy fractions of a stock, say $1 worth, no matter what the same.
[27] stock price is.
[28] Broker services are provided by Cash App investing, a subsidiary of Square, and member SIPC.
[29] I'm excited to be working with Cash App to support one of my favorite organizations called First, best known for their first robotics and Lego competitions.
[30] They educate and inspire hundreds of thousands of students in over 110 countries and have a perfect rating on charity navigator, which means that donated money is used to maximum effectiveness.
[31] We you get Cash App 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.
[32] And now here's my conversation with Donald Knuth.
[33] In 1957 at Case Tech, you were once allowed to spend several evenings with an IBM 550 computer, as you've talked about in the past, then you fell in love with computing then.
[34] Can you take me back to that moment with the IBM 650?
[35] What was it that grabbed you about that computer?
[36] So the IBM 650 was this machine that, well, it didn't fill a room, but it was big and noisy.
[37] But when I first saw it, it was through a window, and there were just a lot of lights flashing on it.
[38] And I was a freshman.
[39] I had a job with the statistics group, and I was supposed to punch cards for data and then sort them on another machine.
[40] But they got this new computer, came in, and it had interesting lights, okay.
[41] So, well, but I had a key to the building, so I can, you know, I could get in and look at it 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 IMA 650 was, you know, big in size, but incredibly small in power in memory.
[42] It had 2 ,000 words of memory, and a word of memory was 10 decimal digits plus a sign.
[43] And it would do, to add two numbers together, you could probably expect that would take, I'll say, three milliseconds.
[44] So.
[45] It's pretty fast.
[46] It's the memory is the constraint.
[47] The memory is the problem.
[48] That was why it was, it took three milliseconds, because it took five milliseconds for the drum to go around.
[49] And you had to wait, I don't know, five cycle times.
[50] If you have an instruction, one position on the drum, then it would be ready to read.
[51] The data for the instruction, you know, go 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 to your next instruction if the instruction is there.
[52] Otherwise, otherwise you spin until you get to the right place.
[53] And we had no random access memory whatsoever until my senior year.
[54] In senior year, we got 50 words of random access memory, which were priceless, and we would move, stuff up to the random access memory in 60 -word chunks, and then we would start again, so a subterteen wanted to go up there.
[55] Could you have predicted the future 60 years later of computing from then?
[56] No. In fact, the hardest question I was ever asked was, what could I have predicted?
[57] In other words, the interviewer asked me, she said, you know, what about computers?
[58] has surprised you, you know, and immediately I ran, I rattled off a couple dozen things, and then she said, okay, so what didn't surprise?
[59] And I was, I tried for five minutes to think of something that I would have predicted, and I couldn't.
[60] But let me say that this machine, I didn't know, well, there wasn't much else in the world at that time.
[61] The 650 was the first machine that there were more than a thousand of ever.
[62] before that there was each machine there might be a half a dozen examples maybe the first mass market mass produced was the first one yeah done in quantity and and ibn didn't sell them they they rented them to universities at great uh you know had a great deal and and so that's why uh a lot of students learned about computers at that time.
[63] So you refer to people, including yourself, who gravitate toward a kind of computational thinking as geeks.
[64] At least I've heard you use that terminology.
[65] It's true that I think there's something that happened to me as I was growing up that made my brain structure in a certain way that resonates with computers.
[66] So there's this space of people, it's 2 % of the population you empirically estimate that's a pretty 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 what is this aspect of thinking that is unique to uh that makes it yeah that makes a geek this is huge really important question.
[67] In the 50s, IBM noticed that that were geeks and non -geeks, and so they tried to hire geeks and they put out Asford paper saying, you know, if you play chess, come to Madison Avenue for an interview or something like this.
[68] They were trying for some things.
[69] So what is it that I find easy and other people tend to find harder?
[70] And I think there's two main things.
[71] One is the ability to jump levels of abstraction.
[72] So you see something in the large and you see something in the small and you pass between those unconsciously.
[73] So you know that in order to solve some big problem, what you need to do is add one to a certain register.
[74] and that gets you to another step.
[75] 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 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.
[76] And as I'm debugging, I'm going through, you know, did I make a key punch error?
[77] Did I write the wrong instruction?
[78] Do I have the wrong thing?
[79] a register.
[80] And each level, each level is different.
[81] And this idea of being able to see something at all, at lots of levels and fluently go between them seems to me to be more pronounced, much more pronounced in the people that resonate with computers.
[82] So in my books, I also don't stick just to the high level, but I, but I mix.
[83] 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 if you think like 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 one thing the other 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.
[84] So it doesn't bother me if I need, like an algorithm has ten steps to it.
[85] You know, 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.
[86] 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 didn't figure out the simpler rule.
[87] And you mentioned that while Jacoby, Boul, Abel, all the mathematicians in the 19th century may have had symptoms of geek.
[88] The first 100 % legit geek was touring, Alan Turing.
[89] I think he had, yeah, a lot more of this quality than any, just from reading the kind of stuff he did.
[90] So how does touring, what influence has Turing had on you?
[91] Well, okay, so I didn't know that aspect of him until after I graduated some years.
[92] As undergrad, 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.
[93] So when, how old was it when I learned that he had a design machine and that he wrote the, you know, he wrote a wonderful manual for, for Manchester machines, and he invented all, you know, subroutines, and he was a real hacker that he got his hands dirty.
[94] I thought for many years that he had only done purely formal work.
[95] As I started reading his own publications, I could, you know, I could feel this kinship.
[96] and of course he had a lot of peculiarities like he wrote numbers backwards because, I mean, left to right instead of right to left because it was easier for computers to process them that way.
[97] What do you mean left to right?
[98] He would write pie as 9 -514 .3.
[99] I mean, okay.
[100] Right.
[101] Got it.
[102] 4 .1 .3.
[103] On the blackboard.
[104] I mean, when he had trained himself to do that because the computers he was working with worked that way inside.
[105] Train himself to think like a computer.
[106] Well, there you go.
[107] That's geek thinking.
[108] You've practiced some of the most elegant formalism in computer science.
[109] And yet you're the creator of a concept like literate programming.
[110] which seems to move closer to natural language type of description of programming.
[111] Yeah, absolutely.
[112] Do you see those two as conflicting as the formalism of theory and the idea of literate programming?
[113] So there we are in a non -uniform system where I don't think one size fits all and I don't think all truth lies in one kind of expertise.
[114] And so somehow, in a way, you'd say my life is a convex combination of English and mathematics.
[115] And you're okay with that.
[116] And not only that, I think, I wish, you know, I want my kids to be that way I want, et cetera.
[117] You know, used left brain, right brain at the same time, you got a lot more done.
[118] That was part of the bargain.
[119] And I've heard that you didn't really read for pleasure.
[120] until into your 30s, you know, literature.
[121] That's true.
[122] You know more about it than I do, but I'll try to be consistent with what you read.
[123] Yeah, no, just believe me. Just go with whatever story I tell you.
[124] It'll be easier that way.
[125] The conversation would be...
[126] Right, yeah, I know, that's true.
[127] So I've heard mention of Philip Roth's American Pastoral, which I love is a book.
[128] I don't know if it was mentioned of something, I think, that was meaningful to you as well.
[129] in either case, what literary books had a lasting impact on you?
[130] What literature?
[131] Yeah, okay, good question.
[132] So I met Roth.
[133] Oh, really?
[134] Well, we both got doctors from Harvard on the same day, so we were, yeah, we had lunch together and stuff like that, but he knew that, you know, computer books would never sell.
[135] Well, well, all right, so you say you, you, you, you, uh, you, uh, you, uh, 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 Anna Karnina, not because of particular of the plot of the story, but because there's this character who, you know, the philosophical discussions, it's all, it's a whole, way of life is worked out there among the characters and so that I thought was especially beautiful on the other hand Dostoevsky 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 dots the eyes and crosses the T's.
[136] So the music of the prose is what you admire more than...
[137] I certainly do admire the music of the language, which I couldn't appreciate in the Russian original, but I can in Victor Hugo because French is closer.
[138] But Tolstah, I like the same reason I like Herman Wouk as a novelist.
[139] I think, like his book, Marjorie Morningstar, has a similar character in who developed his own personal philosophy and it goes in it was consistent.
[140] Yeah, right.
[141] And it's worth pondering.
[142] So you don't like Nietzsche and like what?
[143] You don't like Friedrich Nietzsche or?
[144] Nietzsche, yeah, no, no, yeah.
[145] This has, I keep seeing quotations for Nietzsche and they never tempt me to read any first.
[146] Well, he's full of contradictions, so you will certainly not appreciate him.
[147] But Schiller, you know, I'm trying to get across what I appreciate in literature, and part of it is, as you say, the music of the language, the way it flows, and take Raymond Chandler versus Dashal Hammett.
[148] Dashal Hammett's sentences are awful when Raymond Chandler are beautiful.
[149] they just flow.
[150] 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.
[151] I mean, you mentioned you were dressed like James Bond, so I love Ian Fleming.
[152] I think he's got a really great gift for it.
[153] 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 hands of bridge that exist and he exploits it and tells it beautifully.
[154] So in connecting some things here, looking at literate programming and being able to it convey encode algorithms to a computer in a way that mimics how humans speak.
[155] What do you think about natural language in general and the messiness of our human world, about trying to express difficult things?
[156] 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're trying to understand a complicated thing, if we can look at it in different ways.
[157] 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.
[158] but you try to give the reader a way to put the concept into his own brain or her own brain.
[159] Is that better for the writer or the reader or both?
[160] Well, the writer just tries to understand the reader.
[161] That's the goal of a writer, is to have a good mental image of the reader.
[162] and to say what the reader expects next and to to impress the reader with what has impressed the writer why something is interesting.
[163] 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, what we really want to be is giving insight to the person who's going to be maintaining this program or to the programmer himself when he's debugging it as to why this stuff is being done.
[164] And so all the techniques of exposition that a teacher uses or book writer uses make you better programmer if your program is going to be not just a one -shot deal.
[165] So how difficult is that do you see hope for the combination of informal and formal for the programming task.
[166] Yeah, I'm the wrong person to ask, I guess, because I'm a geek, but I think for a geek it's easy.
[167] Well, I don't know, some people have difficulty writing, and it 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.
[168] I'm not the right one to judge, but I don't think you can teach any person, any particular skill.
[169] I do think that writing is half of my life, and so I put it together in a literate program.
[170] Even when I'm writing a one -shot program, I write it in a literate way because I get it right faster that way.
[171] Now, does it get compiled automatically?
[172] 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?
[173] Informally.
[174] Yeah, informally.
[175] I think whatever works to make it understandable is good, but then you have to also understand how informal it is.
[176] to know the limitations you have to you so by putting the formal and informal together this this is where this is where it gets locked into your into your brain you can you can say informally uh well i'm working on a problem right now so let's go there do get let's give me an example of um yeah of connecting the informal on the formal well it's a little too complicated an example There's a puzzle that's self -referential.
[177] It's called a Japanese arrow puzzle, and you're given a bunch of boxes, each one points north, east, south, or west.
[178] And at the end, you're supposed to fill in each box with the number of distinct numbers that it points to.
[179] 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 four.
[180] five boxes.
[181] 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'm supposed to find a set of numbers that obeys this complicated condition that each number counts how many distinct numbers it points to.
[182] Well, and so a guy sent me his solution to this problem where he, where he, presents formal statements that say either this is true or this is true or this is true.
[183] And so I try to render that formal statement informally, and I try to say, I contain a three, and the guys I'm pointing to contain the numbers one, two, and six.
[184] 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.
[185] That's really interesting.
[186] So maybe an extension of that there has been a resurgence in computer science and machine learning and neural networks.
[187] So using data to construct algorithms.
[188] So it's another way to construct algorithms really.
[189] Yes, exactly.
[190] If you can think of it that way.
[191] So as opposed to natural language to construct algorithms, use data to construct algorithms.
[192] So what's your view of this branch of computer science where data is almost more important than the mechanism of the algorithm?
[193] It seems to be suited to a certain kind of non -geek which is probably why it's taken off that it has its own community that that really resonates with that but it's hard to you know to trust something like that because nobody even the people who who work with it that they have no idea what has been learned that's a really interesting thought that it's it makes algorithms more accessible to a different community a different type of brain yep and that's really interesting because just like literate programming perhaps could make programming more accessible to a certain kind of brain.
[194] 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.
[195] 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 in my head I have to have to make a model and look at it and study it from all points of view and then I start to get some idea of but other people are good at four dimensions I mean physicists yeah so let's go to the art of computer programming.
[196] In 1962, you set the table of contents for this magnum opus, right?
[197] 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 4 of 7.
[198] In the middle of volume 4B is 4B.
[199] More precisely.
[200] Can I ask you for an impossible, possible task, which is try to summarize the book so far, maybe by giving a little examples.
[201] So from the sorting and the search and the combinatorial algorithms, if you were to give a summary, a quick elevator summary.
[202] Elevator, that's great.
[203] Yeah, right.
[204] But depending how many floors there are in the building.
[205] Yeah.
[206] The first volume called Fundamental Algorithms Talks about something that you can't, the stuff you can't do without.
[207] You have to know the basic concepts of what is a program, what is an algorithm?
[208] And it also talks about a low -level machine so you can have some kind of an idea of what's going on.
[209] And it has basic concepts of input and output and subroutines.
[210] Induction.
[211] Induction, right.
[212] Mathematical, preliminary.
[213] So the thing that makes my book different from a lot of others is that I try to 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.
[214] Okay, and so I need math for that.
[215] And then there's the standard way to structure data inside and represent.
[216] information in the computer.
[217] So that's all volume one.
[218] Volume 2 talks, it's called semi -numerical algorithms, and here we're writing programs, but we're also dealing with numbers.
[219] Algorithms deal with any kinds of objects, but specific, when there's objects on numbers, well, then we have certain special paradigms that apply to things that involve numbers, And 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.
[220] There's different algebraic concepts that have numbers in structured ways.
[221] And arithmetic in the way a computer would think about arithmetic, so floating point.
[222] Floating point arithmetic, high precision arithmetic, not only addition, subtraction, multiplication, but also comparison of numbers.
[223] So then volume three talks about...
[224] I like that one, sort and search.
[225] Sorting and searching.
[226] I love sorting.
[227] Right.
[228] So here, you know, we're not dealing necessarily with numbers because you sort letters and other objects and searching we're doing all the time.
[229] We've Googled nowadays, but, I mean, we have to find stuff.
[230] So, again, algorithms that underlie all kinds of applications.
[231] None of these volumes is about a particular application, but the applications are examples of why people want to know about sorting, why people want to know about random numbers.
[232] So then volume four goes into combinatorial.
[233] 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.
[234] And we're dealing with, problems that are probably never going to be solved efficiently, but that doesn't mean we give up on them.
[235] And we have this chance to have good ideas and go much, much faster on them.
[236] So that's commentatorial algorithms.
[237] And those are the ones that are, I mean, you say sorting is most fun for you.
[238] Well, like, it's true, it's fun, but combinatorial algorithms are the ones that I always enjoyed the most because that's when my skillet programming had most payoff.
[239] The difference between an obvious algorithm that you think up first thing and an interesting, subtle algorithm that's not so obvious, but run circles around the other one, that's where computer science really comes in.
[240] And a lot of these commentatorial methods were found first in applications to artificial intelligence or cryptography.
[241] And in my case, I just liked them, and it was associated more with puzzles.
[242] Do you like the most in the domain of graphs and graph theory?
[243] Graphs are great because they're terrific models of so many things in the real world.
[244] And you throw numbers on a graph, you've got a network, and so there you have many more things.
[245] But commentatorial in general is any arrangement of objects that has some kind of a higher structure, non -random random structure.
[246] And is it possible to put something together satisfying all these conditions?
[247] Like I mentioned arrows a minute ago, you know, is there a way to put these numbers on a bunch of boxes that are pointing to each other?
[248] Is that going to be possible at all?
[249] That's volume four.
[250] That's volume four.
[251] What is the future hold?
[252] Volume 4A was part one.
[253] 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.
[254] it was going to be a book about how to write compilers.
[255] And I was asked to write a book explaining how to write a compiler.
[256] And at that time, there were only a few dozen people in the world who had written compilers, and I happened to be one of them.
[257] And I also had some experience for writing for, like, the campus newspaper and things like that.
[258] And so I said, okay, great, I'm the only person I know who's written a compiler but hasn't invented any new techniques for writing compilers.
[259] 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 with their own.
[260] So I could be the journalist and I could explain what all these cool ideas about compiler writing were.
[261] And then I started putting down, well, yeah, let me, you need to have a chapter about data structures.
[262] You need to have some introductory material.
[263] I want to talk about searching because a compiler writer has to look up the variables in a symbol table and find out, you know, which, when you write the name of a variable in one place, it's supposed to be the same as the one you put somewhere else.
[264] So you need all these basic techniques, and I, you know, had in those some arithmetic and stuff.
[265] So I threw in these chapters, and I threw in a chapter on commentatorics because that was what I really enjoyed programming the most, but there weren't many algorithms known about commentatorial methods in 1962.
[266] So that was kind of a short chapter, but it was sort of thrown in just for fun.
[267] And chapter 12 was going to be actual compilers, applying all the stuff in chapters 1 to 11 to make compilers.
[268] Well, okay, so that was my table of contents from 1962.
[269] And during the 70s, the whole field of combinatorics went through a huge explosion.
[270] People talk about a combinatorial explosion, and they usually mean by that the number of cases goes up.
[271] You know, you change end to end plus one, and all of a sudden your problem has gotten more than 10 times harder.
[272] But there was an explosion of ideas about combinatorics in the 70s to the point that, like, take 1975, I bet you more than half of all the journals of computer science were about combinatorial method.
[273] What kind of problems were occupying people's minds?
[274] What kind of problems in combinatorics?
[275] Was it satisfiability, graph theory?
[276] Yeah, graph theory was quite dominant.
[277] I mean, but all of the N .P. hard problems that you have like, you know, Hamiltonian path.
[278] Travel salesman.
[279] Going beyond, yeah, yeah, going beyond graphs, you had operation research whenever it was a small class of problems that had efficient solutions, and they were usually associated with matroide theory, special mathematical construction.
[280] But once we went to things that involved three things at a time, instead of, instead of, of two.
[281] All of a sudden, things got harder.
[282] So we had satisfiability problems where if you have clauses, every clause has two logical elements in it, then we can satisfy it in linear time.
[283] We can test for satisfiability in linear time.
[284] But if you allow yourself three variables in the clause, then nobody knows how to do it.
[285] So these articles were about trying to find better ways to solve cryptography problems and graph theory problems.
[286] We have lots of data, but we didn't know how to find the best subsets of the data.
[287] Like, with sorting, we could get the answer.
[288] It didn't take long.
[289] So how did it continue to change from the 70s to today?
[290] Yeah, so now there may be half a dozen conferences whose topic is common at times, a different kind, But fortunately, I don't have to rewrite my book every month, you know, like I had to in the 70s.
[291] But still, there's a 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 a lot more with them.
[292] And so this book that I'm finishing now is I've got a whole bunch of brand new methods that, as far as I know, there's no other.
[293] There's no other book that covers this particular approach.
[294] And so I'm trying to do my best of exploring the tip of the iceberg, and I try out lots of things and keep rewriting as I find better method.
[295] So what's your writing process like?
[296] What's your thinking and writing process like every day?
[297] So what's your routine even?
[298] Yeah, I guess it's actually the best question because I spend seven days a week.
[299] You're doing it.
[300] You're the most prepared to answer it.
[301] Yeah, but okay, so the chair I'm sitting in is where I do.
[302] It's where the magic happens.
[303] Well, reading and writing.
[304] The chair is usually sitting over there where I have other books.
[305] some reference book, but I found this chair, which was designed by a Swedish guy.
[306] 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.
[307] But then I have the stand -up desk right next to us.
[308] And so after I write something with pencil and eraser, I get up and I type it and revise and rewrite.
[309] I'm standing up.
[310] The kernel of the idea is first put on paper.
[311] Yeah.
[312] That's where...
[313] Right.
[314] And I'll write maybe five programs a week, of course, literate programming.
[315] And these are, before I describe something in my book, I always program it to see how it's working and I try it a lot.
[316] So, for example, I learned at the end of January, I learned of a breakthrough.
[317] by four Japanese people who had extended one of my methods in a new direction.
[318] And so I spent the next five days writing a program to implement what they did.
[319] And then I, you know, they had only generalized part of what I had done.
[320] So then I had to see if I could generalize more parts of it.
[321] And then I had to take their approach and I had to try it out on a couple of dozen of the other problems I had already worked out with my old methods.
[322] And so that took another couple of weeks.
[323] And then I started to see the light, and I started writing the final draft.
[324] And then I would type it up, involve some new mathematical questions.
[325] And so I wrote to my friends who might be good at solving those problems, and they solved some of them.
[326] So I put that in as exercises.
[327] And so a month later, I had absorbed one new idea that I learned, and I'm glad I heard about it in time.
[328] Otherwise, I wouldn't put my book out before I'd heard about the idea.
[329] On the other hand, this book was supposed to come in at 300 pages, and I'm up to 350 now.
[330] That added 10 pages to the book.
[331] But if I learn about another one, my publisher is going to shoot me. Well, so in the process, in that one -month process, are some days harder than others?
[332] Are some days harder than others?
[333] Well, yeah, my work is fun, but I also work hard, and every big job has parts that are a lot more fun than others.
[334] And so many days I'll say, why do I have to have such high standards?
[335] Why couldn't I just be sloppy and not try this out and, you know, just report the answer?
[336] But I know that people are constantly, me to do this and so, okay, so okay, Don, I'll grit my teeth and do it.
[337] And then the joy comes out when I see that actually, you know, I'm getting good results.
[338] 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.
[339] I did want to mention something about the method.
[340] So I got this tablet here where I do the first, you know, the first writing of concepts.
[341] Okay, so, so.
[342] And what language is that in?
[343] Right.
[344] So take a look at it.
[345] But, you know, here, you random say, explain how to draw such skewed pixel diagrams.
[346] Okay.
[347] So I got this paper about 40 years ago when I was, I visited.
[348] my sister in Canada, and they make tablets of paper with this nice large size and just the right thing.
[349] A very small space between lines.
[350] All spaces, yeah, yeah, take a little.
[351] Maybe also just show it.
[352] Yeah.
[353] You know, I've got these manuscripts going back to the 60s.
[354] And those are when I'm getting my ideas on paper, okay.
[355] But I'm a good typist.
[356] In fact, I went to typing school when I was.
[357] when I was in high school and 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 state and you type in tech and I type in tech and can you think in tech no to a certain extent I have I have only a small number of idioms that I use, like, you know, I'm beginning with theorem, I do something for displayed equation, I do something and so on.
[358] But I have to see it.
[359] In the way that it's on paper here.
[360] Yeah, right.
[361] So, for example, touring wrote, what, the other direction, you don't write macros, you don't think in macros.
[362] Not particularly, but when I need a macro, I'll go ahead and do it.
[363] But the thing is, I also write to fit.
[364] I mean, I'll change something if I can save a line.
[365] You know, it's like haiku.
[366] I'll figure out a way to rewrite the sentence so that it'll look better on the page.
[367] And I shouldn't be wasting my time on that, but I can't resist because I know it's only another 3 % of the time or something like that.
[368] And it could also be argued that that is what life is about.
[369] Ah, yes, in fact, that's true.
[370] Like I work in the garden one day a week, and that's kind of a description of my life is getting rid of weeds, you know, removing bugs for programs.
[371] So, you know, a lot of writers talk about, you know, basically suffering, the writing process is having, you know, it's extremely difficult.
[372] and I think of programming, especially the technical writing that you're doing, can be like that.
[373] Do you find yourself methodologically, how do you every day sit down to do the work?
[374] Is it a challenge?
[375] You kind of say it's, you know, it's fun.
[376] But it would be interesting to hear if there are non -fun parts that you really struggle with.
[377] Yeah, so the fund comes when I'm able to put together ideas of two people who didn't know about each other.
[378] And so I might be the first person that saw both of their ideas.
[379] And so then I get to make the synthesis, and that gives me a chance to be created.
[380] But the dredge work is where I've got to chase everything down to its root.
[381] This leads me into really interesting stuff.
[382] I mean, I learn about Sanskrit and I, you know, I try to give credit to all the authors.
[383] And so I write to people who know the people, authors if they're dead, or I communicate this way.
[384] And I got to get the math right.
[385] And I've got to tack all my programs, try to find holes in them.
[386] And I rewrite the programs after I get a better idea.
[387] Is there ever dead ends?
[388] That ends.
[389] Oh, yeah, I throw stuff out, yeah.
[390] One of the things that I spent a lot of time preparing a major example based on the game of baseball.
[391] And I know a lot of people who, for whom baseball is the most important thing in the world.
[392] But I also know a lot of people for whom cricket is the most important in the world or soccer or something.
[393] And I realized that if I had a big example, I mean, it was going to have a fold -out illustration and everything, and I was saying, well, what am I really teaching about algorithms here where I had this baseball example?
[394] And if I was a person who knew on a cricket, what would they think about this?
[395] And so I've ripped the whole thing out.
[396] But I had something that would have really appealed to people who grew up with baseball as a major theme in their life.
[397] Which is a lot of people, but still a minority.
[398] Small minority.
[399] I took out bowling too.
[400] Even a smaller minority.
[401] What's the art in the art of programming?
[402] Why is there, of the few words in the title, why is art one of them?
[403] Yeah, well, that's what I wrote my Turing lecture about.
[404] And so when people talk about art, it really, I mean, what the word means is something that's not in nature.
[405] So when you have artificial intelligence, art comes from the same root, saying that this is something that was created by human beings.
[406] And then it's gotten a further meaning often of fine art, which has this beauty, to the mix and says, 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 has, has, I guess, Tolstoyvers Dostoevsky going back, but anyway, it's that part that that says that it's done well as well as not only different from nature.
[407] In general, then, art is what human beings are specifically good at.
[408] And when they say artificial intelligence, well, they're trying to mimic human beings.
[409] But there's an element of fine art and beauty.
[410] You are one.
[411] That's what I try to also say that you can write a program.
[412] 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 changed the way you see a space of problem Okay.
[413] I get a surprise every time I have a bug in my program, obviously, but that isn't really what you're...
[414] More transformational, the less than surprising.
[415] For example, in volume 4A, I was especially surprised when I learned about data structure called BDD, Boolean Decision Decision Diagram, because I sort of had the feeling that as an old -timer, and I've been programming since this, or since the 50s.
[416] And BDDs weren't invented until 1986.
[417] And here comes a brand new idea that revolutionizes the way to represent a Boolean function.
[418] And Boolean functions are so basic to all kinds of things.
[419] I mean, logic is underlies everything we can describe all of what we know in terms of logic somehow.
[420] Propositional logic, I thought that was cut and dried and everything was known.
[421] But here comes how Randy Bryant and discovers that BDDs are incredibly powerful.
[422] 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, you know, a billion dollar of applications.
[423] And it was the standard way to design computers for a long time until Sat -Salvers came along in the year 2000.
[424] So that's another great big surprise.
[425] So a lot of these things have totally changed the structure of my book.
[426] and the middle third of volume 4B is about that solvers and that's 300 plus pages which is 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 solvers that I wrote while preparing that seven of them are described in the book, others for my own experience.
[427] So newly invented data structures or ways to represent?
[428] A whole new class of algorithm.
[429] A whole new class of algorithm.
[430] 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.
[431] And so they were getting a bad name.
[432] because, you know, okay, they were useful, but they didn't solve every problem.
[433] I'm sure that the theoreticians are, in the next 10 years, are going to show why machine learning doesn't solve everything.
[434] But I, you know, 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.
[435] And so I found out that BDDs could do all kinds of miraculous things.
[436] And so I had to spend quite a few years learning about that territory.
[437] So in general, what brings you more pleasure, proving or showing a worst -case analysis of an algorithm?
[438] or showing a good average case or just showing a good case that, you know, something good pragmatically can be done with this algorithm.
[439] Yeah, I like a good case that is maybe only a million times faster than I was able to do before, but not worry about the fact that that it's still going to take too long if I double the size of the problem.
[440] So that said, do you popularize the SM.
[441] notation for describing running time, obviously in the analysis of algorithms, worst case is such an important part.
[442] Do you see any aspects of that kind of analysis is lacking and notation, too?
[443] Well, the main purpose, we should have notations that help us for the problems we want to solve, and so they match our intuitions.
[444] And people who worked in number theory had used.
[445] used asymptotic notation in a certain way, but it was only known to a small group of people.
[446] 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.
[447] So, for example, instead of big O notation, let's just take a much simpler notation where I'd say zero or one, or zero.
[448] one or two.
[449] And 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 Y, okay.
[450] And then we would learn how to multiply two such expressions together and, you know, I'd deal with them.
[451] Well, the same thing, Big O notation says, here's something that's, I'm not true what it is, but I know.
[452] I know it's not too big.
[453] I know it's not bigger than some constant times n squared or something like that.
[454] So I write big O of N squared.
[455] Now I learn how to add big O of N squared to big O of N cubed, and I know how to add big O of N squared to plus one and square that and how to take logarithms, exponentials, so I have big O's in the middle of them.
[456] 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.
[457] So have there been algorithms in your journey that perform very differently in practice than they do in theory?
[458] Well, the worst case of a combinatorial algorithm is almost always horrible.
[459] But we have sat -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 a sat -savours.
[460] solver.
[461] But you would think that our problem with 100 -bullying variables has requires you to do two to the 100th operations, because that's the number of possibilities when you have 100 -billion variables, and 2 -to -the -100th.
[462] Two -to -the -100th is way bigger than we can handle 10 to the 17th is a lot.
[463] You've mentioned over the past few years that you believe P may be equal to N -P, 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.
[464] Can you explain your intuition here?
[465] Has it been changed and in general on the difference between easy and difficult problems of P and NP and so on?
[466] Yeah, so the popular idea is if an algorithm exists, then somebody will find it.
[467] And it just a matter of writing it down.
[468] But many more algorithms exist than anybody can understand or ever make use of them.
[469] Or discover, yeah.
[470] Because they're just way beyond human comprehension.
[471] The total number of algorithms is more than mind -boggling.
[472] So we have situations now where we know that algorithm exists, but we don't know, we don't have the foggist idea what the algorithms are.
[473] 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 to win in the game of hex, because hex is always either a win for the first player or the second player.
[474] Well, what's the game of hex?
[475] There's a game of hex 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 top.
[476] And how does capture occur?
[477] And there's no capture.
[478] You just put pebbles down one at a time.
[479] But there's no draws, because after all the white and black are played, there's either going to be a white path across from each to west or a black path from bottom to top.
[480] So there's always, you know, it's a perfect information game and people, people take turns like tick -tac -toe.
[481] And the heckboard can be different sizes, but there's no possibility of a draw.
[482] And players move one at a time.
[483] And so it's got to be either a first player win or a second player win.
[484] Mathematically, you follow out all the trees and either there's always a win for the first player, second player.
[485] Okay.
[486] And it's finite.
[487] The game is finite.
[488] So there's an algorithm that will decide.
[489] You can show it has to be one or the other.
[490] Because the second player could mimic the first player with kind of a pairing strategy.
[491] And so you can show that it has to be one way there.
[492] But we don't know any algorithm anyway.
[493] We don't know that.
[494] In other words, there are cases where you can prove the existence of a, of a, of a, of a, of a, of a, of a, solution, but nobody knows any way how to find it.
[495] More like the algorithm question, there's a very powerful theorem in graph theory by Robinson and Seymour that says that every class of graphs that is closed undertaking minors has a polynomial time algorithm to determine whether it's in this class or not.
[496] Now, a class of graphs, for example, planar graphs.
[497] These are graphs that you can draw in a plane without crossing lines.
[498] And a planar graph is close.
[499] Taking minors means that you can shrink an edge into a point or you can delete an edge.
[500] All right.
[501] And so you start with a planar graph and shrink on the edge to a point is still planar.
[502] Delete an edge is still planar.
[503] Okay.
[504] Now, but there are millions of different.
[505] ways to describe a family of graph that still remains the same under taking minor.
[506] And Robertson and Seymour proved that any such family of graphs, there's a finite number of minimum graphs that are obstructions.
[507] So that if it's not in the family, then it has to contain, then there has to be a way to shrink it down until you get one of these bad minimum graphs that's not in the family.
[508] In the case of a planar graph, the minimum graph is a five point of the star where everything pointing to another, and the minimum graph consisting of trying to connect three utilities to three houses without crossing lines.
[509] And so there are two bad graphs that are not planar, and every non -planar graph contains one of these two bad graphs by shrinking and a moving edge.
[510] Sorry, can you say it again?
[511] So he proved that there's a finite number of these bad graphs.
[512] There's always a finite.
[513] So somebody says, here's a family.
[514] It's hard to believe.
[515] And they proved a sequence of 20 papers, I mean, and it's deep work.
[516] But it's, you know, it's.
[517] Because that's for any arbitrary class.
[518] So it's for any arbitrary class that's closed undertaking minors.
[519] It's closed under, maybe I'm not understanding, because it seems like a lot of them are closed under taking minor.
[520] Almost all the important classes of graphs are.
[521] There are tons of such graphs, but also hundreds of them that arise in applications.
[522] I have a book over here called Classes of graphs, and it's amazing how many different classes of graphs that people have looked at.
[523] So why do you bring up the theorem, lower this proof.
[524] So now, there are lots of algorithms that are known for special class of graphs.
[525] For example, if I have a chordal graph, then I can color it efficiently.
[526] If I have some kinds of graphs, it'll make a great network, various things.
[527] So you'd like to test, somebody gives you a graph, oh, is it in this family of graphs?
[528] If so, then I can go to the library and find an algorithm that's going to solve my problem on.
[529] that graph.
[530] Okay.
[531] So we want to have a graph that says, an algorithm that says, you give me a graph, I'll tell you whether it's in, whether it's in this family or not.
[532] Okay.
[533] 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.
[534] A minor is everything you can get by shrinking and removing edge.
[535] And given any minor, there's a polynomial time algorithm saying, I can tell whether this is a minor of you.
[536] And there's a finite number of bad cases.
[537] So I just try, you know, does it have this bad case?
[538] Polynomial time, I got the answer.
[539] Does it have this bad case, polynomial time I got the answer.
[540] Total polynomial time.
[541] And so I've solved the problem.
[542] However, all we know is that the number of minds.
[543] minors is finite.
[544] We don't know what, we might only know one or two of those miners, but we don't know that if we've got 20 of them, we don't know there might be 21, 25.
[545] All we know is that it's finite.
[546] So here we have a polynomial time algorithm that we don't know.
[547] That's a really great example of what you worry about or why you think p equals n p won't be useful, but still why do you hold the intuition that p equals n p because you have to rule out so many possible algorithms as being not working you know 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 and and construct some certain constant in polynomial time, and that's perfectly valid algorithm.
[548] And there are so many algorithms of that kind.
[549] A lot of times we see random take data, and we get coincidences that some fairly random -looking number actually is useful because, because it happens to solve a problem just because, you know, there's, there's so many hairs on your head, but it seems like unlikely that two people are going to have the same number of hairs on their head, but, but they're obvious, but you can count how many people there are and how many hairs on the head.
[550] So there must be people walking around.
[551] around in the country that have the same number of hairs on their head.
[552] Well, that's a kind of a coincidence that you might say also, you know, this particular combination of operations just happens to prove that a graph has a Hamiltonian path.
[553] I see lots of cases where unexpected things happen when you have enough possibilities.
[554] So because the space of possibility is so huge, your tuition just says it's up.
[555] They have to rule them all out.
[556] And so that's the reason for my intuition.
[557] It by no means approved.
[558] I mean, some people say, you know, well, P can't equal NP because you've had all these smart people, you know, the smartest designers of algorithms 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 there must be no such algorithm.
[559] 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 have been trying to prove it unequal to NP and they've all failed this kind of reminds me of the discussion about the search for aliens that we'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 right and then there's also the possibility that they exist, but they all discovered machine learning or something and then blew each other up.
[560] Well, on that small, quick tangent, let me ask, do you think there's intelligent life out there in the universe?
[561] I have no idea.
[562] Do you hope so?
[563] Do you think about it?
[564] I don't spend my time thinking about things that I could never know, really.
[565] And yet you do enjoy the fact that there's many things you don't know.
[566] You do enjoy the mystery.
[567] of things?
[568] I enjoy the fact that I have limits, yeah.
[569] But I don't take time to answer unsolvable questions, right?
[570] Got it.
[571] Well, because you've taken on some tough questions that may seem unsolvable.
[572] You have taken on some tough questions that may see unsolvable, but they're in the space.
[573] It gives me a thrill when I can get further than I ever thought I could.
[574] Right, yeah.
[575] But I don't.
[576] But much like with religion.
[577] I'm glad that there's no proof that God exists or not.
[578] I mean, I think...
[579] It would spoil the mystery.
[580] It would be too dull, yeah.
[581] So to quickly talk about the other art of artificial intelligence, what's 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?
[582] So all the way through, it was the people who were inspired by trying to mimic intelligence or to do things that were somehow the greatest achievements of intelligence that had been inspiration to people who have pushed the envelope of computer science maybe more than any other group of people.
[583] So all through, it's been a great source of good problems to sink teeth into, and getting partial answers and then more and more successful answers over the year.
[584] So this has, this has been the inspiration for lots of the great discoveries of computer science.
[585] Are you yourself captivated by the possibility of creating?
[586] of algorithms having echoes of intelligence in them?
[587] 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.
[588] It's just you asked about my own personal preferences.
[589] But the thing that I worry about is when people start believing that, actually succeeded.
[590] And because it seems to me this huge gap between really understanding something and being able to pretend to understand something and give the illusion of understanding something.
[591] Do you think it's possible to create without understanding?
[592] Yeah.
[593] So to...
[594] Oh, I do that all the time too.
[595] I mean, that's why I use random numbers.
[596] But there's still this great gap.
[597] I don't assert that it's impossible, but I don't see anything coming any closer to really the kind of stuff that I would consider intelligence.
[598] So you've mentioned something that on that line of thinking, which I very much agree with.
[599] So the art of computer programming as the book is focused on single processor algorithms.
[600] And for the most part, you mentioned...
[601] That's only because I set the table of contents in 1962.
[602] You have to remember.
[603] For sure.
[604] There's no...
[605] I'm glad I didn't wait until 1965 or anything.
[606] One book, maybe we'll touch in the Bible, but one book can't always cover the, entirety of everything.
[607] So I'm glad, I'm glad the table of cottons for the art of computer programming is what it is.
[608] But you did mention that, that you thought that an understanding of the way ant colonies are able to perform incredibly organized tasks might well be the key to understanding human cognition.
[609] So these fundamentally distributed systems.
[610] So what do you think is the difference between the way Don Canuth would sort a list and an ant colony would sort a list or perform an algorithm?
[611] Sorting a list isn't the same as cognition, though, but I know what you're getting at is, well, the advantage of ant colony, at least we can see what they're doing.
[612] We know which ant has talked to which other ant, and it's much harder with the brains to know to what extent of neurons are passing signal.
[613] So I'm just saying that ant colony might be a, you know, if they have the secret of cognition, I think of an ant colony as a cognitive single being rather than as a colony of lots of different ants.
[614] 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.
[615] Well, you know, and Connie, you can say might be cognitive somehow.
[616] That sounds like, yeah, I mean, you know, okay, I smash a certain ant and the organism saying, hmm, that's stung.
[617] What was that?
[618] Right.
[619] But if we're going to crack the secret of cognition, it might be that we could, you know, do so by psyching out how ants do it because we have a better chance to measure.
[620] They're communicating by pheromones and by touching each other and sight, but not by much more subtle phenomenon like currents going through.
[621] But even a simpler version of that, what are your thoughts of maybe Conway's Game of Life?
[622] Okay, so Conway's Game of Life is able to simulate any, any computable process.
[623] And any deterministic process is...
[624] I like how you went there.
[625] I mean, that's not its most powerful thing, I would say.
[626] I mean, it can simulate it, but the magic is that the individual units are distributed and extremely simple.
[627] Yes, we understand exactly what the primitives are.
[628] The primitives, just like with the ant colony, even simpler, though.
[629] But still, it doesn't say that I understand, I understand life.
[630] I mean, I understand.
[631] It gives me a better insight into what does it mean to have a deterministic universe?
[632] What does it mean to have free choice, for example?
[633] Do you think God plays dice?
[634] Yes.
[635] 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 inefficient algorithms there are things that couldn't be done well without randomness and so I don't see any reason why God should be prohibited.
[636] When the algorithm requires it you don't see why The physics should constrain it.
[637] So in 2001, you gave a series of lectures at MIT about religion and science.
[638] No, that was 1999.
[639] You published, sorry.
[640] The book came out in 2001.
[641] In 2000.
[642] So in 1999, you spent a little bit of time in Boston enough to give those lectures.
[643] Yeah.
[644] And I read in the 2001 version, most of it.
[645] It's quite fascinating read.
[646] I recommend people.
[647] It's transcription of your lectures.
[648] So what did you learn about how ideas get started and grow from studying the history of the Bible?
[649] So you've rigorously studied a very particular part of the Bible.
[650] What did you learn from this process about the way us human beings as a society, develop and grow ideas, share ideas, and define by those ideas?
[651] Well, it's hard to summarize that.
[652] I wouldn't say that I learned a great deal of really definite things, where I could make conclusions, but I learned more about what I don't know.
[653] You have a complex subject, which is really beyond human understanding, so we give up on saying, I'm ever going to get to the end of the road, and I'm ever going to understand it, but you say, but maybe it might be good for me to get closer and closer and learn more and more about something.
[654] And so, you know, how can I do that efficiently?
[655] And the answer is, well, use randomness.
[656] And so try a random subset of that is within my grasp and study that in detail.
[657] instead of just studying parts that somebody tells me to study or instead of studying nothing 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 thinker have said about that small subset.
[658] And I had about, let's say, 60 verses out of 3 ,000, I think it's one out of 500 or something like this.
[659] And so then I went to the libraries, which are well indexed.
[660] I spent, for example, at Boston Public Library, I would go once a week for a year.
[661] and I went to have done times to and over Harvard Library to look at this that weren't in the Boston public where the scholars had looked and you can go and you can go down the shelves and you can put 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.
[662] And so that gave me a way to zoom in on parts of the things so that I could get more insight.
[663] And so I look at it as a way of giving me some firm pegs in which I could hang pieces of information, but not as things where I would say, and therefore this is true.
[664] 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 humanists?
[665] It seemed to me that the main thrust was not the one that most people think of as saying, you know, don't have sex or something like this.
[666] But the main thrust was to try to figure out how to live in harmony with God's wishes.
[667] I'm assuming that God exists.
[668] And as I say, I'm glad that there's no way to prove this because that would, that would, I would run through the proof once and then I'd forget it.
[669] And it would, and I would never speculate about spiritual things.
[670] things and mysteries otherwise, and I think my life would be very incomplete.
[671] 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.
[672] And so in a way that might still be, whether God is there or not, in some sense, God is important to them.
[673] One of the verses I studied, you can interpret it as saying, it's much better to be an atheist than not to care at all.
[674] So I would say it's, yeah, it's similar to the P equals NP discussion.
[675] You mentioned a mental exercise that I'd love it if you could partake in yourself, a mental exercise of being God.
[676] And so how would you, if you were God, Doc Nuth, how would you present yourself to the people of earth?
[677] You mentioned your love of literature, and there was this book that really I can recommend to you if I think, yeah, the title I think is blasphemy.
[678] It talks about God revealing himself through a computer in Los Alamos.
[679] And it's the only book that I'm not.
[680] I've ever read where the punchline was really the very last word of the book and explained the whole idea of the book.
[681] And so I don't want to give that away.
[682] But it's really very much about this question that you raised.
[683] 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?
[684] And it's conceivable that God would choose the way that's described in this book.
[685] 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.
[686] I think mostly you want to learn humility.
[687] You want to realize that once we solve one problem, that doesn't mean that all of a sudden other problems are going to drop out.
[688] And we have to realize that there are things beyond our ability.
[689] I see hubris all around.
[690] Yeah, well said.
[691] If you were to run program analysis on your own life, how did you do?
[692] In terms of correctness, running time, resource use, asymptotically speaking, of course.
[693] Okay, yeah.
[694] Well, I would say that question had not been asked me before.
[695] And I started out with library subroutines.
[696] and learning how to be an automaton that was obedient.
[697] And I had the great advantage that I didn't have anybody to blame for my failures.
[698] If I started getting, not understanding something, I knew that I should stop playing ping pong, 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.
[699] 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.
[700] 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.
[701] I know that I need to be happy enough in order to be able to be of service, but I came to a philosophy finally that I phrase as point eight is enough.
[702] There was a TV show once called Eight is Enough, which was about a, you know, somebody had eight kids.
[703] But I say point A is enough, which means if I can have a way of rating happiness, I think it's good design that to have an organism that's happy about 80 % of the time.
[704] and if it was 100 % of the time it would be like everybody's on drugs and never and everything collapses and nothing works because everybody's just too happy do you think you've achieved that 0 .8 optimal balance?
[705] There are times when I when I'm down and I 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 and I'm more depressed than you sometimes I find myself trying to think now who should I be mad at today?
[706] There must be a reason why I'm, you know, but then I realize, you know, it's just my, it's just my chemistry telling me that I'm supposed to be mad at somebody and so I trigger it up and say, oh, okay, go to sleep and get better.
[707] But if I'm not 100 % happy, that doesn't mean that I should find somebody that's screwing me and try to silence them.
[708] But I'm saying, you know, okay, I'm not 100 % happy, but I'm happy enough to be a part of a sustainable situation.
[709] So that's kind of the numerical.
[710] analysis.
[711] I do.
[712] You've converged towards the optimal, which for human life is a point eight.
[713] Yeah.
[714] I hope it's okay to talk about, as you talked about previously, in 2006, you were diagnosed with prostate cancer.
[715] Has that encounter with mortality changed you in some way or the way you see the world?
[716] Yeah, it did.
[717] The first encounter with mortality when my dad died, and I went through a month when I sort of came to be comfortable with the fact that I was going to die someday.
[718] And during that month, I don't know, I felt okay, but I couldn't sing.
[719] And I couldn't do original research either.
[720] 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, I could sort of feel that something was starting to move again.
[721] But that was, you know, 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.
[722] 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 except for finishing the art of computer programming.
[723] I had one major unfulfilled goal.
[724] I'd wanted all my life to write a piece of music and I had an idea for a for a certain kind of music that I thought ought to be written.
[725] At least somebody ought to try to do it.
[726] And I felt that it wasn't going to be easy, but I wanted to proof of concept.
[727] I wanted to know if it was going to work or not.
[728] And so I spent a lot of time.
[729] And finally, I finished that piece, and we had the world premiere last year on my 80th birthday, and we had another premiere in Canada, and there's talk of concerts in Europe and various things.
[730] But that's done.
[731] 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.
[732] 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 programming until I go to see now.
[733] Do you think there's an element of 0 .8 that might apply there?
[734] of what, 0 .8?
[735] Yeah.
[736] Well, I look at it more that I got actually to 1 .0 when that concert was over with.
[737] I mean, I, you know, I, so in 2006, I was at 0 .8.
[738] So when I was diagnosed with prostate cancer, then I said, okay, well, maybe this is, you know, I've had all kinds of, of good luck all my life and 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 deserve better I didn't make any plans for the future I had my surgery I came out of the surgery and and spent some time learning how to walk again and so on is painful for a while.
[739] But I got home, and I realized I hadn't really thought about what to do next.
[740] I hadn't any expectation.
[741] I said, okay, hey, I'm still alive.
[742] Okay, now I can write some more books.
[743] But I didn't come with the attitude that this was.
[744] This was terribly unfair, and I just said, okay, I was accepting whatever turned out, you know, I, I'd gotten more than my share already, so why should I, and I, and I didn't, and I really, when I got home, I realized that I had really, I realized that I had really not thought about the next step, what I would do after I would, after I would, after I would, after I, would be able to work again.
[745] I had sort of thought of it as if, as this might, I was comfortable with the fact that it was at the end.
[746] But I was hoping that I was still, you know, be able to learn about satisfiability and also someday write music.
[747] I didn't start seriously on the music project until 2012.
[748] So I'm going to be in huge trouble if I don't talk to you about this.
[749] In the 70s, you've created the tech typesetting system together with metafont language for font description and computer modern family of typefaces.
[750] That has basically defined the methodology in the aesthetic of countless research fields, right?
[751] Math, physics, beyond computer science, so on.
[752] Okay, well, first of all, thank you.
[753] I think I speak for a lot of people in saying that.
[754] But a question in terms of beauty, there's a beauty to typography that you've created, and yet beauty is hard to quantify.
[755] Right.
[756] How does one create beautiful letters and beautiful equations?
[757] Like what...
[758] So...
[759] I mean, perhaps there's no words to be describing to be describing the process, but...
[760] So the great Harvard mathematician, George D. Berkov wrote a book in the 30s called The Aesthetic Measure, where he would have pictures of vases and underneath would be a number, and this was how beautiful the vase was.
[761] And he had a formula for this.
[762] And he actually also wrote about music, and so I thought maybe part of my musical composition I would try to program his algorithms so that I would write something that had the highest number by his score well it wasn't quite rigorous enough for a computer to do but anyway people have tried to put numerical value on beauty and he did probably the most serious attempt and George Gershwin's teacher also wrote two volumes where he talked about his method of composing music but you're talking about another kind of beauty and beauty and letters and letter elegance and whatever that curvature is right so and so that's in the eye of the beholder as they say but kind of striving for excellence in whatever definition you want to give to beauty then you try to get as close to that as you can somehow.
[763] I guess I'm trying to ask, and there may not be a good answer, what loose definitions were you operating under with the community of people that you're working on?
[764] Oh, the loose definition, I wanted it to appeal to me, to me. To you personally.
[765] Yeah.
[766] That's a good start.
[767] Yeah, no, and it failed that test when I got volume two.
[768] came out with the new printing and I was expecting to be the happiest day of my life and I felt like a burning how angry I was that I opened the book and it was in the same beige covers and but it didn't look right on the page the number two was particularly ugly I couldn't stand in any page that had a two in his page number and I was expecting that I was, you know, I spent this time making measurements and I had looked at stuff in different ways and I had great technology but it didn't, you know, but I wasn't done.
[769] I had to retune the whole thing after 1961.
[770] Has it ever made you happy finally?
[771] Oh, yes.
[772] Or is it a point eight?
[773] No, and so many books have come out that would never have been written without this.
[774] I just, it's just, it's just joy.
[775] But now I can, I mean, all these pages that are sitting up there, I don't have a, if I didn't like them, I would change them.
[776] That's my, nobody else has this ability.
[777] They have to stick with what I gave them.
[778] Yeah.
[779] 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.
[780] What about the spacing?
[781] What about the spacing between the white space?
[782] Yeah.
[783] It seems like you could be a little bit more systematic about the layout or technical.
[784] Oh, yeah, you can always go further.
[785] I didn't stop at 0 .8.
[786] I stopped about 0 .98.
[787] It seems like you're not following your own rule for happiness.
[788] No, no, no. There's, okay, of course, there's this, what is the 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 adds their own appreciation and that gave the viewer more satisfaction or so on.
[789] But I, but no, no, with typography, I wanted it to look as good as I could in the vast majority of cases.
[790] And then when it doesn't, then I say, okay, that's 2 % more work for the author.
[791] But I didn't want to say that my job was to get 200 % percent.
[792] and take all the work away from the author.
[793] That's what I meant by that.
[794] So if you were to venture a guess, how much of the nature of reality do you think we humans understand?
[795] So you mentioned you appreciate mystery.
[796] How much of the world about us is shrouded mystery?
[797] Are we, if you were to put a number on it, what percent of it all do we understand?
[798] Are we totally?
[799] How many leading zeros do you point?
[800] 0 .00, I don't know.
[801] Now, I think it's infinitesimal.
[802] How do we think about that, and what do we do about that?
[803] Do we continue one step at a time?
[804] Yeah, we muddle through.
[805] I mean, we do our best.
[806] We realize that nobody's perfect, 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.
[807] Some mathematicians that would, be in the office next to me when I was in the math department, they would never think about anything smaller than countable infinity.
[808] And I never, you know, we intersected that countable infinity because I rarely got up to countable infinity.
[809] I was talking about finite stuff.
[810] But even limiting to finite stuff, which is, which is, which the universe might be, there's no way to really know whether the universe is, it isn't.
[811] isn't just made out of capital N whatever units you want to call them quarks or whatever where capital N is some finite number all of the numbers that are comprehensible are still way smaller than most almost all finite numbers I got this one paper called supernatural numbers where I guess you probably ran into something called Canuth arrow notation?
[812] Did you ever run into that?
[813] Anyway, so you take the number, I think it's like, and I called it super K, I named it after myself, but it's, but in arrow notation, it's something like 10 and then four arrows and a three or something like that.
[814] 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 times, X, Y times.
[815] If you have one arrow, that means exponentiation.
[816] So X, one arrow, Y means X to the X to the X to the X to the X, Y times.
[817] So I found out, by the way, that this notation was invented by a guy in 1830.
[818] And he was one of the English nobility who spent his time thinking about stuff like this.
[819] And it was exactly the same concept that I used arrows, and he used a slightly different notation.
[820] But anyway, and then this Ackerman's function is based on the same kind of ideas.
[821] But Ackerman was 1920s.
[822] But anyway, we got this number, 10, quadruple arrow 3.
[823] So that says, well, we take, you know, we take 10 to the 10 to the 10 to the 10th, And how many times do we do that?
[824] Oh, 10 double arrow two times or something.
[825] I mean, how tall is that stack?
[826] But then we do that again, because that was only 10 -tri -R -R -2.
[827] Quadruple -R -R -3 means we have a pretty large number.
[828] It gets way beyond comprehension.
[829] Okay.
[830] And so, but it's so small compared to what finite numbers really are because I want to use four arrows and a 10 and a 3 I mean, let's have that many number arrows, I mean.
[831] The boundary between infinite and finite is incomprehensible for us humans anyway.
[832] Infinity is a good, is a useful way for us to think about extremely large things.
[833] And and we can we can manipulate it, but we can never know that the universe is actually anywhere near that.
[834] So it just, so I realize how little we know.
[835] But we found an awful lot of things that are too hard for any one person to know, even in our our small universe.
[836] Yeah, and we did pretty good.
[837] 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?
[838] What kind of browser do you have up here?
[839] No. No, I actually, I don't think it's meaningful to ask this question, but I certainly hope we I got good internet.
[840] Okay, on that note, that's beautiful, actually.
[841] Don, thank you so much.
[842] It was a huge honor to talk to you.
[843] I really appreciate it.
[844] Well, thanks for the gamut of questions.
[845] Yeah, it was fun.
[846] Thanks for listening to this conversation with Donald Knooth.
[847] And thank you to our presenting sponsor, Cash App.
[848] Download it, use Code Lex podcast.
[849] You'll get $10, and $10 will go to first.
[850] A STEM education nonprofit that inspires hundreds of of thousands of young minds to learn and to dream of engineering our future.
[851] If you enjoy this podcast, subscribe on YouTube, give it five stars on Apple Podcasts, support it on Patreon, or connect with me on Twitter.
[852] And now, let me leave you with some words of wisdom from Donald Knuth.
[853] 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.