Insightcast AI
Home
© 2025 All rights reserved
Impressum
#219 – Donald Knuth: Programming, Algorithms, Hard Problems & the Game of Life

#219 – Donald Knuth: Programming, Algorithms, Hard Problems & the Game of Life

Lex Fridman Podcast XX

--:--
--:--

Full Transcription:

[0] The following is a conversation with Donald Knuth, his second time on this podcast.

[1] Don is a legendary computer scientist, touring award winner, father of algorithm analysis, author of the art of computer programming, creator of tech that led to late tech, and one of the kindest and most fascinating human beings I've ever got a chance to talk to.

[2] I wrote him a letter a long time ago.

[3] He responded, and the rest, as they say, say is history.

[4] We've interacted many times since then, and every time it's been joyful and inspiring.

[5] To support this podcast, please check out our sponsors in the description.

[6] As usual, I do a few minutes of ads now, no ads in the middle.

[7] I try to make this interesting, so hopefully you don't skip, but if you do, please still check out the sponsor links in the description.

[8] It is, in fact, the best way to support this podcast.

[9] I use their stuff.

[10] I enjoy it.

[11] Maybe you will too.

[12] This show is brought to you by Coinbase, which is a trusted and easy -to -use platform to buy, sell, and spend cryptocurrency.

[13] I use it.

[14] I love it.

[15] You can buy Bitcoin, Ethereum, Cardano, Dogecoin, and all the most popular digital currencies.

[16] Ever since I did a bunch of podcasts on cryptocurrency, there would be people that come up to me kind of curious about cryptocurrency and ask for advice of how they can get started with it, and I always recommend Coinbase.

[17] I think it's the easiest way to buy cryptocurrency and also to learn about the different cryptocurrencies.

[18] In fact, I agreed at some point recently, but also a long time ago, to talk to Coinbase CEO Brian Armstrong on this podcast.

[19] He's a fascinating guy.

[20] That's unrelated to the sponsorship, but I very much look forward to that because I like the way he looks at the digital currency, but even just the technology world.

[21] Anyway, go to coinbase .com slash Lex.

[22] For limited time, new users can get $5 in free Bitcoin when you sign up today at coinbase .com slash Lex.

[23] That's coinbase .com slash Lex.

[24] This show is also brought to you by Insight Tracker, a service I use to track biological bio data.

[25] They have a bunch of plans, most of which include a blood test that gives you a lot of information that you can then make decisions.

[26] based on.

[27] They have algorithms that analyze your blood data, DNA data, and fitness tracker data to provide you with a clear picture of what's going on inside you and to offer you science -backed recommendations for positive diet and lifestyle changes.

[28] The great, the powerful Andrew Huberman talks a lot about Inside Tracker.

[29] David Sinclair also talks a lot about Inside Tracker, including in my conversation with him.

[30] They love it.

[31] I love it.

[32] In general, I just love the idea.

[33] of using actual data from your body to make actionable decisions about lifestyle.

[34] For a limited time, you can get 25 % off the entire InsideTracker's story if you go to, insidetracker .com slash Lex.

[35] That'sinsidtracker .com slash Lex.

[36] This show is also brought to you by NetSuite.

[37] NetSuite allows you to manage financials, human resources, inventory, e -commerce, and many more business -related deals.

[38] all in one place.

[39] Running a company of any size, really, is very hard because of all the moving pieces involved.

[40] I've actually recently had a few conversations with Jim Keller offline about various aspects of what it takes to not just design great products, but manufacture them at scale.

[41] It's a lot easier than it sounds if you make good decisions and think from first principles and make great hiring decisions.

[42] So you build a great team.

[43] But it's also a lot more difficult if you go in naively.

[44] It can be both easier than you think and harder than you think, depending on the choices you make.

[45] And again, depending on the tools you use.

[46] Anyway, right now, special financing is back for NetSuite.

[47] Head to Netsuite .com slash Lex to get their one -of -a -kind financing program.

[48] That's netsweet .com slash Lex.

[49] NetSuite .com slash.

[50] Lex.

[51] This show is also brought to you by ExpressVPN.

[52] I use them to protect my privacy on the internet.

[53] ISBs are able to collect your data.

[54] If you don't use the VPN, even when you're using incognito mode on your browser, it can still collect the data.

[55] So if you want to protect yourself from the ISBs and use a great tool for the job of preserving your privacy, you should definitely use a VPN, and ExpressVPN is my favorite VPN.

[56] Another useful reason to use ExpressVPN is you can change your location to watch shows that are only available to certain parts of the world.

[57] So you can travel the world without ever actually leaving your computer.

[58] Finally, I really just enjoy the quality of the interface.

[59] It does one job and it does it really well.

[60] It works on basically any operating system, including Linux, my favorite operating system.

[61] But anyway, if you go to ExpressVPN .com slash Legspod, You'll get extra three months free.

[62] That's expressvpn .com slash LexPod.

[63] This episode is also brought to you by BetterHelp, spelled HELP Help.

[64] They figure out what you need and match you with a licensed professional therapist in under 48 hours.

[65] I've actually recently had a conversation with Jay McClelland, who is one of the seminal figures in the early history of artificial intelligence and neuroscience, sort of at the intersection.

[66] of those, or perhaps not neuroscience, but also cognitive science.

[67] So that whole sort of mix of biology and computation, he was part of the group with Jeff Hinton from which emerged the Bragg Propagation Paper.

[68] Anyway, I mentioned all that because I had a conversation with him about psychiatry.

[69] He also wanted to be a psychiatrist growing up as I have, and so very much believes in the magic of talk therapy, of exploring the human mind through talking.

[70] And so I think BetterHelp is worth trying.

[71] It's easy, private, affordable, available worldwide.

[72] Check them out at betterhelp .com slash Lex.

[73] That's betterhelp .com slash Lex.

[74] This is the Lex Friedman podcast, and here is my conversation with Donald Knuth.

[75] Your first large -scale program, you wrote it in IBM 650 Assembler in the summer of 1957.

[76] I wrote it in decimal machine language.

[77] I didn't know about Assembler.

[78] until a year later.

[79] But the year, 1957, and the program is tick -tac -o.

[80] Yeah, I might have learned about an assembler later that summary.

[81] I probably did.

[82] In 1957, hardly anybody had heard of assembers.

[83] You looked at the user manuals, how would you write a program for this machine?

[84] It would say, you know, you would say 69, which meant load the distributor, and then you would give the address of the number you wanted to load into the distributor.

[85] Yesterday, my friend at Doug Spicer at the Computer History Museum sent me a link to something that just went on YouTube, it was IBM's progress report from 1956, which is, you know, very contemporary with 1957.

[86] And in 1956, IBM had donated to Stanford University on IBM 650, one of the first ones, when they showed a picture of the assembly line for IBM 650.

[87] And they said, you know, this is number 500 or something coming off the assembly line.

[88] And I had never seen so many IBM 650s I did in this movie that was, it's on YouTube now.

[89] And it showed the picture from Stanford that, you know, they said, look, you know, we donated one of these to Stanford, one to MIT.

[90] And they mentioned one other, one other college.

[91] And in December of 56, they did.

[92] donated to my university case tech.

[93] But anyway, they showed a picture then of a class session where a guy was teaching programming and on the blackboard, it said 69, 8 ,000, I mean, he, it was, he was teaching them how to write code for this IBM 650, which was in decimal numbers.

[94] So the instructions were 10 decimal digits.

[95] You had two digits and said what to do, four digits to say, what to do it too, and four more digits to say where to get your next instruction.

[96] And there's a manual that describes what each of the numbers mean.

[97] And the manual was actually, if the manual had been well written, I probably never would have gone into computer science, but it was so badly written, I figured that I must have a talent for it, because I'm only a freshman and I could write a better manual.

[98] And so I started working at the computer center and wrote some manuals then.

[99] But yeah, but this was the way we did it.

[100] And my first program then was June of 1957.

[101] The Tick -Tac -Tow.

[102] No, that was the second program.

[103] The first program, the first program was factoring a number.

[104] Okay.

[105] So you dial a number on the, on the, there's switches.

[106] I mean, you sat at this big mainframe.

[107] Mm -hmm.

[108] And you turn the dials, set a number, and then it would punch out the factors of that number on cards.

[109] So that's the input, is the number?

[110] The input was, yeah, the input was a number.

[111] attended a number and and the output was its factors and and I wrote that program I still have a copy of it somewhere and how many lines of code do you remember well yeah it started out as about 20 but then I kept having me debug it and I discovered debugging of course when I wrote my first program and what does debugging look like on a program with just all numbers.

[112] Well, you sit there and you, I don't remember how I got it into the machine, but I, but I think there was a way to punch, punch it on cards.

[113] So each, each instruction would be one, one card.

[114] Maybe I could get seven instructions on a card, eight instructions, I don't know.

[115] But anyway, so I'm sitting there at the, at console of the machine.

[116] I mean, I'm doing this at night when nobody else is around.

[117] Of course.

[118] And, and so you have one set of switches where you can dial the number I'm inputting, but there's another switch that, you know, that's, you know, that's, okay now execute one instruction and show me what you did or you or you or you there was another four switches and say stop if you get to those if you get to that instruction so so I can say now go until you get there again and watch okay so I could watch you know it would take that number and it would divide it by two and if it's you know there's no remainder then okay two is a factor so so then I work on But if not divisible by two, divide by three.

[119] Okay, keep trying until you know you're at the end.

[120] And you would find a bug if you were just surprised that something weird happened?

[121] Well, certainly, I mean, first of all, I might have, you know, try to divide by one instead of two.

[122] Off by one errors that people make all the time.

[123] But maybe I go to the wrong instruction.

[124] Maybe I left something in a register that I shouldn't have done.

[125] But the first bugs were pretty, you know, I probably on the first night I was able to, I was able to get the factors of 30, you know, as equal to two, three, and five, okay.

[126] So you're, sorry to interrupt, you were, so you're sitting there late at night.

[127] Yeah.

[128] So it feels like you spent many years late at night working on a computer.

[129] Oh, yeah.

[130] So, like, what's that like?

[131] So most of the world is sleeping.

[132] And you have to be there at night because that's when you get access to the computer.

[133] Between my freshman sophomore year, I didn't need sleep.

[134] I used to do all nighters.

[135] When I was in high school, I used to do the whole student newspaper every Monday night.

[136] I would just stay up all night and it would be done on Tuesday morning.

[137] And that was, you know, I didn't get ulcers and stuff like that until later, you know, but, but, but, well, the, I don't know if you know Rod Brooks.

[138] Rod Brooks, of course.

[139] Yeah, he, he told, he told me a story that he really, you know, he really looked up to you.

[140] He was actually afraid of you.

[141] Well, vice versa, I must say.

[142] But it went, and he tells a story when you were working on tech that they screwed up something with a machine.

[143] I think this might have been MIT, I don't know.

[144] And you were waiting for them to fix the machine so you can get back to work late at night.

[145] Oh, that happened all the time.

[146] He was really intimidated.

[147] He's like, Dr. Knuth is not happy with this.

[148] Oh, that's interesting.

[149] But no, no, the machine at Danford AI Lab was down an awful lot because they had many talented programmers was changing the operating system every day.

[150] And so the operating system was getting better every day, but it was also crashing.

[151] So I wrote almost the entire manual for tech during downtime of that machine.

[152] But that's another story.

[153] Well, he was saying it's a hardware problem.

[154] They tried to fix it, they reinserted something, and smoke was everywhere.

[155] Oh, wow.

[156] Well, that didn't happen as often as the operatism coming.

[157] But yeah, it's a funny story because you're saying there's this tall Don Knuth that I look up to and there was pressure to fix the computer.

[158] It's funny.

[159] Okay.

[160] The kind of things we remember that stick in our memory.

[161] Well, okay.

[162] Yeah, well, I can tell you a bunch of Rodbrook stories too, but let's go back to the 650.

[163] So I'm debugging this, my first program.

[164] And I had more bugs in it than the number of lines of code.

[165] I mean, the number of lines of code kept growing.

[166] And let me explain.

[167] So I had to punch the answers on cards, all right?

[168] So suppose I'm factoring the number 30, then I got to put two somewhere on the card.

[169] I got to put a three somewhere on the card.

[170] put a five somewhere on the card right and and you know what my first program i i i probably screwed up and you know it fell off the edge of the card or something like that but but i didn't realize that there are some tended numbers that have that have more than eight um factors um and the card has only 80 columns and so i need 10 columns for every factor so my first program didn't take account for the fact that i would have to punch more than one card my first program first program, you know, just lined the stuff up in memory and then I punched the card.

[171] But after, you know, so by the time I finished, I had to deal with lots of things.

[172] Also, I, if you put a large prime number in there, my program might have sat there for 10 minutes, the 650 was pretty slow.

[173] And so it would sit there spinning its wheels and you wouldn't know if it was in a loop or whatever.

[174] You said 10 digit as the input?

[175] 10 digits, yeah.

[176] So I think the largest is sort of 9 -9 -9.

[177] 999 -99 -99 -9 -9 -9 -7 or something like that.

[178] That would take me a while for that first.

[179] Anyway, that was my first program.

[180] Well, what was your goal with that program?

[181] Was there something you were hoping to find a large prime maybe?

[182] No. The opposite?

[183] No, my goal was to see the lights flashing and understand how this magical machine would be able to do something that took so long by hand.

[184] So what was your second program?

[185] My second program was a converted number from binary to decimal or something like that.

[186] It was much simpler.

[187] It didn't have that many bugs in it.

[188] My third program was Tick -Tac -Ttoe.

[189] Yeah.

[190] And it had some, so the Tick -Tac -Tot program is interesting on many levels, but one of them is that it had some, you can call, machine learning in it.

[191] That's, yeah, that's right.

[192] I don't know how long it's going to be before the name of our field has changed from computer science to machine learning.

[193] But anyway, it was my first experience with machine learning.

[194] Okay, so here we had...

[195] Yeah, how does the program...

[196] Well, first of all, what is the problem you were solving?

[197] What is tick -tac -toe?

[198] What are we talking about?

[199] And then how was it designed?

[200] Right.

[201] So you've got a three -by -three.

[202] grid and each each can be in three states it can be empty or it can have an x or an o right so three to the ninth is a well what is how big is it i should know but it's 80 81 times 81 times three so anyway eight is like two to the third and so that would be that would be that would would be like 2 to the 6th, but that would be 64, then you have to, anyway.

[203] I love how you're doing the calculation.

[204] So the three.

[205] Anyway, the three comes from the fact that it's either MT, an X, or an O. Right.

[206] And the 650 was a machine that had only 2 ,010 digit words.

[207] You go from zero zero zero to one nine, 99, and that's it.

[208] and in each word you have a 10 digit number.

[209] So that's not many bits.

[210] I mean, I got to have three, in order to have a memory of every position I've seen, I need three to the ninth bits.

[211] Okay, but it was a decimal machine too.

[212] It didn't have bits.

[213] But it did have strange instruction where if you had a 10 digit number, but all the digits were either eight or nine, you'd be 899 or something like that would you could make a test whether it was eight or nine that was one of the strange things IBM engineers put into the machine I have no idea why well hardly ever used but anyway I needed one digit for every position I'd seen zero meant it was a bad position nine meant it was good position I think I started out at five or six, you know, but if you win a game, then you increase the value of that position for you, but you decrease it for your opponent.

[214] But I could, I had that much total memory for every possible position was one digit, and I had a total of 20 ,000 digits, which had to also include my program, and all the logic and everything, including how to ask the user what the moves are and things like this.

[215] Okay, so I think I had to work it out.

[216] Every position in tic -tac -toe is equivalent to roughly eight others because you can rotate the board, which gives you a factor four, and you can also flip it over, and that's another factor too.

[217] So I might, you know, so I might have needed only three to the ninth over eight positions, plus a little bit.

[218] So I had, but anyway, that was, that was a part of the program to squeeze it into this tiny.

[219] So you tried to find an efficient representation that took account for that kind of rotation?

[220] I had to, otherwise I couldn't do the learning.

[221] Wow.

[222] So, but I had three parts to my Tick -Tac -Ttoe program.

[223] And I called it Brain 1, Brain 2, and Brain 3.

[224] so brain one just played a um let's see at random okay it's your turn okay you got to put an x somewhere you has to go in an empty space but that's that's it okay choose choose one and play there uh brain two uh had a can routine and i think it was it also maybe it had maybe it assumed you were the first player or maybe it allowed you to be first or I think you're allowed to be either first or second but had a canned built -in strategy known to be optimum for Tic Tic Tocco before I forget by the way I learned many years later that Charles Babbage had had planned to had thought about programming Tick Tacto for his for his dream machine that he that he was never able to finish Wow so that was the program he thought about.

[225] More than 100 years ago.

[226] Yeah, wow.

[227] He had, he did that, okay.

[228] And I had, however, been influenced by a demonstration at the Museum of Science and Industry in Chicago.

[229] It's like Boston's Science Museum.

[230] I think Bell Labs had prepared a special exhibit about telephones and relay technology, and they had a tick -tac -toe playing.

[231] machine as part of that exhibit.

[232] So that had been one of my, you know, something I'd seen before I was a freshman in college and inspired me to see if I could write a program for it.

[233] Okay, so anyway, I had brain one, random, you know, knowing nothing, brain two, knowing everything.

[234] Then brain three was the learning one.

[235] And I could play brain one against brain one, brain one against brain two, and so on.

[236] And so you could also play against the user, against a live universe.

[237] But so I started going, the learning thing, and I said, okay, you know, take two random people, just playing tic -tac -toe knowing nothing.

[238] And after about, I forget the number now, but it converged after about 600 games to a safe draw.

[239] The way my program learned was actually it learned how not to make mistakes.

[240] It didn't try to do anything for winning.

[241] It just tried to say not losing.

[242] Yeah, not lose.

[243] So that was probably because of the way I designed the learning thing.

[244] I could have had a different reinforcement function that would reward brilliant play.

[245] But anyway, it didn't.

[246] And if I took a novice against, you know, the skilled player, it was able to learn how to play a good game.

[247] So that was, and that was really my, but after I finished that, I felt I understood programming.

[248] Was there, did you, did a curiosity and interest in learning systems persist for you?

[249] So why did you want Brain 3 to learn?

[250] Yeah, I think naturally we're talking about Rod Brooks.

[251] He was teaching all kinds of very small devices to learn stuff.

[252] If a leaf drops off of a tree, you know, he was saying something, well, it learns if there's wind or not.

[253] But I mean, he pushed that a little bit too.

[254] far, but he said he could probably train some little mini -bugs to scour out dishes if he had enough financial support.

[255] I don't know.

[256] Can I ask you about that?

[257] He also mentioned that during those years, there was discussion about inspired by touring about computation, you know, of what is computation?

[258] Yeah.

[259] Yeah, I never thought about any stuff like that.

[260] That was way too philosophical.

[261] I mean, I was a freshman after all.

[262] I mean, I didn't, I was pretty much a machine.

[263] So it's almost like, yeah, I got you.

[264] It's a tinkering mindset, not a philosophical mindset.

[265] It was just exciting to me to be able to.

[266] control something but not but not to say am I solving a big problem or something like that or is this a step for humankind or anything no no way when did you first start thinking about computation in the big sense you know like the universal turning machine well i mean i had to pass i had to take i had to take classes on computability when i was a senior so you know we We read this book by Martin Davis, and, yeah, this is cool stuff.

[267] But, you know, I learned about it because I, you know, I needed to pass the exams.

[268] But I didn't invent any of that, boy stuff.

[269] But I had great fun playing with the machine.

[270] You know, I wrote programs because it was fun to write programs and get this.

[271] I mean, it was like watching miracles happen.

[272] you mentioned in an interview that when reading a program you can tell when the author of the program changed oh okay well how the heck can you do that like what makes a distinct style for a programmer do you think you know there's different Hemingway has a style of writing versus James Joyce or something what well those are pretty yeah those are pretty easy to imitate but But it's the same with music and whatever you can.

[273] I found, well, during the pandemic, I spent a lot more time playing the piano, and I found something that I'd had when I was taking lessons before I was a teenager, and it was Yankee Doodle played in the style of, you know, And you had Beethoven and you had Debussy and Chopin and, you know, and the last one was Gershwin.

[274] And I played over and over again.

[275] I thought it was so brilliant.

[276] But it was so easy, but also to appreciate how this author, Mario, somebody or other, had been able to reverse engineer the styles of those computers.

[277] But now, specifically to your question, I mean, there would be, it was pretty obvious in this program I was reading.

[278] It was a compiler, and it had been written by a team at Carnegie Mellon, and I have no idea which program was responsible for, but you would get to a part where the guy would just not know how to move.

[279] things between registers very efficiently.

[280] And so everything that could be done in one instruction would take three or something like that.

[281] That would be a pretty obvious change in style.

[282] But there were also flashes of brilliance where you could do in one instruction.

[283] Normally, I used two because you knew enough about the way the machine worked that you could accomplish two goals in one step.

[284] So it was mostly the brilliance of the concept.

[285] more than the semicolons or the use of short sentences versus long sentences or something like that.

[286] So you would see the idea in the code and you could see the different style of thinking expressed in the code.

[287] Right, it was stylistic.

[288] I mean, I could identify authors by the amount of technical aptitude they had, but not by style in the sense of rhythm or something like that.

[289] So if you think about Mozart, Beethoven, Bach, if somebody looked at Don Canuth code, would they be able to tell that this is a distinct style of thinking going on here?

[290] What do you think?

[291] And what would be the defining characteristic of the style?

[292] Well, my code now is literate programming.

[293] So it's a combination of English.

[294] C mostly, but, but if you just looked at the C part of it, you would also probably notice that I don't, you know, that I use a lot of global variables that other people don't.

[295] And I expand things in line more than instead of calling.

[296] Anyway, I have different subset of C that I use.

[297] Okay, but that's a little bit stylistic.

[298] But with literate programming, you alternate between English and C or whatever.

[299] And by the way, people listening to this should look up literate programming.

[300] It's a very interesting concept that you proposed and developed over the years.

[301] Yeah, yeah.

[302] That's the most significant thing I think to come out of the tech project is that I realize that my programs were to be read by people and not just by computers and that typography could massively enhance that.

[303] And so, I mean, they're just wonderful.

[304] If they're going to look it up, they should also look up this book by, it's called Physically Based Rendering by Matt Farr and, gosh, anyway, it got an Academy Award but all the all the graphic effects you see in movies are accomplished by algorithms and this book the whole book is a literate program it tells you not only how you do all the shading and and bringing images in that you need for animation and textures and so on but it also you can run the code and and so I find it an extension of the way of how to teach programming is by telling a story as part of the program.

[305] So it works as a program, but it's also readable by humans.

[306] Yes, and especially by me a week later or a year later.

[307] That's a good test.

[308] If you yourself understand the code easily a week or a week.

[309] or a year later.

[310] So it's, what's this page?

[311] It's the greatest thing since sliced bread.

[312] Programming?

[313] Or literate?

[314] Literate programming.

[315] Okay.

[316] You heard it here first.

[317] Okay.

[318] You dodged this question in an interview I listened to.

[319] So let me ask you again here.

[320] What makes for a beautiful program?

[321] What makes for a beautiful program?

[322] Yeah.

[323] What are the characteristics you see?

[324] Like, you just, said literate programming, what are the characteristics you see in a program that make you sit back and say, that's pretty good?

[325] Well, the reason I didn't answer is because there are dozens and dozens of answers to that, because you can define beauty, the same person will define beauty a different way from hour to hour.

[326] I mean, it depends on what you're looking for.

[327] At one level, it's beautiful just if it works at all.

[328] another level it's beautiful if it can be understood easily it's beautiful if it's beautiful if it's beautiful if it's illiterate programming it's beautiful it makes you laugh I mean yeah I'm actually so I'm with you I think beauty if it's readable readable yeah is if you understand what's going on and also understand the elegance of thought behind it and then also as you said wit and humor i was always i remember having this conversation i had this conversation on stack overflow whether humor is good in comments and i think it is whether humor is good in comments like when you add comments yeah yeah i always thought a little bit of humor is good It shows personality.

[329] It shows character, shows wit and fun and all those kinds of things of the personality of the programmer.

[330] Yeah, okay.

[331] So a couple days ago, I received a wonderful present from my former editor at Asson Wesley.

[332] He's downsizing his house and he found that somebody at the company had found all of their internal files about the art of computer programming from the 1960s, and they gave it to him, and then, you know, before throwing it in the garbage.

[333] And then, so he said, oh, yeah, he planned to keep it for posterity, but now he realized that posterity is too much for him to handle, so he sent it to me. And so I just received this big, big stack of letters, some of which I had written to them, but many of which they had written to early guinea pigs who were telling them whether they should publish or not.

[334] And one of the things was, in the comments to volume one, the major reader was Bob Floyd, who is my great coworker in the 60s, died early, unfortunately.

[335] something.

[336] But, but, and, and he, he commented about the humor in it.

[337] And so, so we had, you know, he ran it by me, you know, says, you know, keep this joke in or not, you know.

[338] They also sent it out to focus groups.

[339] What do you think about humor in a book about computer program?

[340] What's the conclusion?

[341] And I stated my philosophy, it said, you know, the ideal thing is, that it's something where the reader knows that there's probably a joke here if you only understood it and this is a motivation to understand to think about it a little bit but anyway it's a very delicate humor I mean it's really each century invents a different kind of humor too and different cultures have different kinds of humor yeah like we talked about Russia a little bit offline, you know, there's dark humor.

[342] And there's, you know, when a country goes to something difficult.

[343] Right, better than that live and stuff like this.

[344] And, you know, and Jack Benny, I mean, you know, Steve Allen wrote this book about humor and it was the most boring book.

[345] But he was one of my idols, but it's called The Funny Men or something like that.

[346] But yeah, okay, so anyway, I think it's important to know that this is part of life and it should be fun and not.

[347] Yeah.

[348] And so, you know, I wrote this organ composition, which is based on the Bible, but I didn't refrain from putting little jokes in it also in the music.

[349] It's hidden in the music.

[350] It's there, yeah.

[351] A little humor is okay?

[352] Yeah, I mean, not egregious humor.

[353] So in this correspondence, you know, there were things I said, yeah, I really shouldn't have, I really shouldn't have done that.

[354] But other ones I, you know, I insisted on.

[355] And I've got jokes in there that nobody has figured out yet.

[356] In fact, in volume two, I've got a cryptogram, a message in ciphered, and in order to decipher it, you're going to have to have to be.

[357] break an RSA key, which is larger than people know how to break.

[358] And so if computers keep getting faster and faster, then it might be 100 years, but somebody will figure out what this message is and they will laugh.

[359] I mean, I've got a joke in there.

[360] So that one you really have to work for.

[361] I don't know if you've heard about this.

[362] Let me explain it.

[363] Maybe you'll find it interesting.

[364] So OpenAI is a company that does AI work, and they have this language model.

[365] It's a neural network that can generate language pretty well.

[366] But they also, on top of that, developed something called OpenAI Codex.

[367] And together with GitHub, they developed a system called OpenAI Copilot.

[368] Let me explain what it does.

[369] There's echoes of literate program.

[370] in it.

[371] So what you do is you start writing code and it completes the code for you.

[372] So for example, you start, let's go to your factoring program.

[373] You start, you write in JavaScript and Python in any language that it trained on.

[374] You start, you write the first line and some comments like what this code does and it generates the function for you.

[375] And it does an incredibly good job.

[376] Like, it's not provably right but it often does a really good job of completing the code for you.

[377] I see whether, but how do you know whether it did a good job or not?

[378] You could see a lot of examples where it did a good job and so it's not a thing that generates the code for you.

[379] It starts, it gives you so it puts the human in the seat of fixing issues versus writing from scratch.

[380] Do you find that kind of idea at all?

[381] interesting.

[382] Every year we're going to be losing more and more control over what machines are doing and people are saying, well, it seemed to, when I was a professor at Caltech in the 60s, we had this guy who talked a good game, he could give inspiring lectures and you'd think, well, thrilling things he was talking about.

[383] An hour later, you said, well, what did he say?

[384] But he really felt that it didn't matter whether computers got the right answer or not.

[385] It just doesn't matter whether it made you happy or not.

[386] In other words, if your boss paid for it, you know, then you had a job.

[387] You could take care of your wife.

[388] So happiness is more important than truth.

[389] Exactly.

[390] He didn't believe in truth, but he was a philosopher.

[391] I like it.

[392] And somehow you see...

[393] We're going that way?

[394] I mean, so many more things are taken over by saying, well, this seems to work.

[395] And when there's competing interests involved, neither side understands why the decision is being made.

[396] You know, we realize now that it's bad.

[397] But consider what happens five years, 10 years down the line, when things get even more further detached.

[398] And each thing is based on something from the previous year.

[399] Yeah.

[400] So you start to lose, the more you automate, the more you start to lose track of some deep human things.

[401] Exponentially.

[402] So that's the dark side.

[403] The positive side is the more you automate, the more you let humans do what humans do best.

[404] So maybe programming, there's, you know, maybe humans should focus on a small part of programming that requires that genius, the magic of the human mind, and the mess you let the machine generate.

[405] I mean, that's the positive, but of course it does come with the darkness of automation.

[406] What's better?

[407] I'm never going to try to write a book about that.

[408] I'm never going to recommend any of my students to work for them.

[409] So you're on the side of correctness, not beauty.

[410] I'm on the side of understanding.

[411] understanding.

[412] And I think these things are really marvelous if what they do is, you know, all of a sudden we have a better medical diagnosis or, you know, it'll help guide some scientific experiment or something like this, you know, curing diseases or whatever.

[413] But when it affects people's lives in a serious way, so if you're writing, if you're writing code, for, oh yeah, here, this is great.

[414] This will make a slaughter bot.

[415] So I see.

[416] So you have to be very careful.

[417] Like right now it seems like fun in games.

[418] It's useful to write a little JavaScript program that helps you with a website.

[419] But like you said, one year passes, two years, passes five years, and you forget.

[420] You start building on top of it.

[421] And then all of a sudden you have autonomous weapon systems.

[422] Well, we're all dead.

[423] It doesn't matter in that sense.

[424] Well, in the end, this whole thing ends anyway.

[425] But it pays to...

[426] There is a heat death of the universe.

[427] Yeah.

[428] I'm predicted, but I'm trying to postpone that for a little bit.

[429] Well, it would be nice that at the end, as we approach the heat death of the universe, there's still some kind of consciousness there to appreciate it, hopefully human consciousness.

[430] I'll settle for 10 to the 10 to the 10th year, some finite number, but things like this might be the reason we don't pick up any signals from extraterrestrial.

[431] They don't want anything to do with us.

[432] Oh, because they disperse themselves.

[433] They invented it too.

[434] So you do have a little bit of worry on the existential threats of AI and automation.

[435] So like removing the human from the picture.

[436] Et cetera, yeah.

[437] People have more potential to do harm now by far than they did a hundred years ago.

[438] But are you optimistic about, so humans are good at creating destructive things, but also humans are good at solving problems.

[439] Yeah.

[440] I mean, there's half empty and half full, you know.

[441] So how, are we half full?

[442] I can go.

[443] So let me put it this way because it's the only way I can be optimistic.

[444] But think of things that have changed because of civilization.

[445] You know, they don't occur just in nature.

[446] So just imagine the room we're in, for example.

[447] Okay, we've got pencils, we've got books, we've got tables, we've got microphones, clothing, food, all these things were added.

[448] Somebody invented them one by one.

[449] Millions of things that we inherit, okay?

[450] And it's inconceivable that so many millions of billions of things wouldn't have problems.

[451] And we get it all right.

[452] And each one would have no negative effects and so on.

[453] So it's very amazing that much works as it does work.

[454] It's incredibly amazing.

[455] And actually, that's the source of my optimist.

[456] as well, including for artificial intelligence.

[457] So we drive over bridges, we use all kinds of technology.

[458] We don't know how it works, and there's millions of brilliant people involved in building a small part of that, and it doesn't go wrong, and it works.

[459] I mean, it works, and it doesn't go wrong often enough for us to suffer.

[460] And we can identify things that aren't working, and try to improve on them.

[461] In a often suboptimal way.

[462] Oh, absolutely.

[463] But the kind of things that I know how to improve require human beings to be rational, and I'm losing my confidence that human beings are rational.

[464] Yeah, yeah.

[465] Now, here you go again with the worst case analysis.

[466] They may not be rational, but they're clever and beautiful in their own kind of way.

[467] I tend to think that most people have the desire and the capacity to be good to each other and love will ultimately win out.

[468] Like if they're given the opportunity, that's where they lean.

[469] In the art of computer programming, you wrote, the real problem is that programmers have spent far too much time worrying about efficiency in the wrong places and at the wrong times, premature optimization is the root of all evil in parentheses, or at least most of it, in programming.

[470] Can you explain this idea?

[471] What's the wrong time?

[472] What is the wrong place for optimization?

[473] So first of all, the word optimization.

[474] I started out writing software and optimization was, I was a compiler writer, so optimization meant making a better translation so that it would run faster on a machine.

[475] So an optimized program.

[476] It's just like, you know, you run a program and you set the optimization level to the compiler.

[477] So that's one word for optimization.

[478] And at that time, I happened to be looking in an unabridged dictionary.

[479] for some reason or other, and I came to the word optimize.

[480] So what's the meaning of the word optimized?

[481] And it says, to view with optimism.

[482] And you look in Webster's dictionary of English language in 1960s, that's what optimized me meant.

[483] Now, so people started doing cost optimization, other kinds of things, you know, whole subfields of, of algorithms and economics and whatever are based on what they call optimization now.

[484] But to me, optimization, when I was saying that, was saying, changing a program to make it more tuned to the machine.

[485] And I found out that when a person writes a program, he or she tends to think that The parts that were hardest to write are going to be hardest for the computer to execute.

[486] So maybe I have 10 pages of code, but I had to work a week writing this page.

[487] I mentally think that when the computer gets to that page, it's going to slow down.

[488] It's going to say, oh, I don't understand what I'm doing.

[489] I better be more careful.

[490] Anyway, this is, of course, silly, but it's something that we don't know.

[491] when we read a piece of code, we don't know whether the computer is actually going to be executing that code very much.

[492] So people had a very poor understanding of what the computer was actually doing.

[493] I made one test where we studied a Fortran compiler, and it was spending more than 80 % of its time reading the comments card.

[494] But as a programmer, we were really concerned about, about how fast it could take a complicated expression that had lots of levels of parentheses and convert that into something.

[495] But that was just, you know, less than 1 % of the, so if we optimize that, we didn't know what we were doing.

[496] But if we knew that, it was spending 80 % of his time on the comment card, you know, in 10 minutes, we could make the compiler run more than twice as fast.

[497] And you could only do that once you've completely to the program and then you empirically study where I had some kind of profiling that I knew what was important yeah so you don't think this applies generally I mean there's something that rings true to this across all of the program I'm glad that it applied generally but but it was it was only my good luck I said it but you know but I but I did but I said it in limited context and I and I'm glad if it makes people think about stuff because I I'm not but it applies it you know I it applies In another sense, too, that is sometimes I will do optimization in a way that does help the actual running time, but makes the program impossible to change next week because I've changed my data structure or something that made it less adaptable.

[498] So one of the great principles of computer science is late, is late, is late.

[499] or what do you call it, late binding.

[500] You know, don't hold off decisions when you can.

[501] And, you know, and we understand now quantitatively how valuable that is.

[502] What do you mean we understand?

[503] So you mean from a...

[504] People have written thesis about how you can, how late binding will improve the, I mean, you know, just in time manufacturing or whatever.

[505] You can defer a decision instead of doing your advanced planning and say, I'm going to allocate 30 % to this and 50 % percent.

[506] So in all kinds of domains, there's an optimality to laziness in many cases.

[507] Decision is not made in advance.

[508] So instead, you design in order to be flexible to change with the way the wind is blowing.

[509] Yeah, but so the reason that line resonated with a lot of people is because there's something about the programmer's mind that wants, that enjoys optimization.

[510] So it's a constant struggle to balance laziness and lay binding with the desire to optimize.

[511] The elegance of a well -optimized code is something that's compelling to programming.

[512] Yeah, it's another concept of beauty.

[513] let me ask you a weird question so roger penrose uh has talked about computation computers and uh he proposed that the way the human mind discovers mathematical ideas is something more than a computer that that a universal touring machine cannot uh do everything that a human mind can do.

[514] Now this includes discovering mathematical ideas and it also includes he's written a book about it, consciousness.

[515] So I don't know if you know, Roger, but do you think my daughter's kids played with his kids in Oxford?

[516] Nice.

[517] So do you think there is such a limit to the computer?

[518] Do you think consciousness is more than a computation?

[519] Do you think the human mind, the way it thinks, is more than a computation.

[520] I mean, I can say yes or no, but I have no reason.

[521] So you don't find it useful to have an intuition in one way or the other?

[522] Like when you think about algorithms, isn't it useful to think about the limits?

[523] Unanswerable question, in my opinion is no better than anybody else.

[524] You think it's unanswerable.

[525] So you don't think eventually science.

[526] How many angels can dance on the head of it?

[527] I mean, I don't know.

[528] But angels Anyway, there are lots of things that are beyond That we can speculate about But I don't want somebody to say Oh yeah, Cano said this And so he's he's smart And so that must be I mean, I say it's something that We'll never know Interesting Okay, that's a strong statement I don't I personally think it's something we will know Eventually like there's no reason to me why the workings of the human mind are not within the reach of science.

[529] That's absolutely possible, and I'm not denying it.

[530] But right now you don't have a good intuition one way.

[531] I mean, that's also possible, you know, that an AI created the universe.

[532] Intelligent design has all been done by an AI.

[533] Yes.

[534] This is, I mean, all of these things are, but you're asking me to pronounce on it, and I don't have any expertise.

[535] I'm a teacher that passes on knowledge, but I don't know the fact that I vote yes or no on.

[536] Well, you do have expertise as a human, not as a teacher or a scholar of computer science.

[537] I mean, that's ultimately the realm of where the discussion of human thought and consciousness is.

[538] I know where Penrose is coming from.

[539] I'm sure he has no, he might even thought he proved it, but.

[540] No, he doesn't.

[541] He doesn't prove it.

[542] He is following intuition.

[543] But, I mean, you have to ask John McCarthy, I think, we're totally unimpressed by these statements.

[544] So you don't think, so even like the touring paper on the touring tests that starts by asking, can machines think, you don't think these kind of Torring doesn't like that question yeah I don't consider it important let's put it that way because it's in the category of things that it would be nice to know but I think it's beyond knowledge and so I don't I'm more interested in knowing about the Riemann hypothesis or something so when you say it's an interesting statement beyond knowledge I think what you mean is it's not sufficiently well, it's not even known well enough to be able to formalize it in order to ask a clear question.

[545] And so that's why it's beyond knowledge, but that doesn't mean it's not eventually going to be formalized.

[546] Yeah, maybe consciousness will be understood someday, but the last time I checked, it was still 200 years away.

[547] I haven't been specializing in this by any means but I went to lectures about it 20 years ago when I was, there was a symposium at the American Academy in Cambridge and it started out by saying essentially everything that's been written about consciousness is hogwash.

[548] I tend to disagree with that a little bit.

[549] So consciousness for the longest time still is in the realm of philosophy.

[550] So it's just conversations without any basis and understanding.

[551] Still, I think once you start creating artificial intelligence systems that interact with humans and they have personality, they have identity, you start flirting with the question of consciousness, not from a philosophical perspective, but from an engineering perspective.

[552] And then it starts becoming much more I feel like...

[553] Yeah, don't misunderstand me. I certainly don't disagree with that at all.

[554] And even at these lectures that we had 20 years ago, there were neurologists pointing out that human beings had actually decided to do something before they were conscious of making that decision.

[555] Yeah.

[556] I mean, they could tell that signals were being sent to their arms before they knew that they were sick and things like this are true.

[557] And my, you know, less valiant has an architecture for the brain.

[558] And more recently, Christus Papademetrio in the Academy Science Proceedings a year ago with two other people, but I know Christos very well.

[559] And he's got this model of this architecture by which you could create things that correlate well with experiments that are done on consciousness.

[560] And he actually has a machine language in which you can write code and test.

[561] hypotheses.

[562] And so it might, you know, we might have a big breakthrough.

[563] My personal feeling is that consciousness, the best model I've heard of to explain the miracle of consciousness is that somehow inside of our brains we're having a continual survival for the fittest competition, and I'm speaking to you, all the possible things I might be wanting to say are all in there.

[564] And there's like a voting going on.

[565] Yeah, right.

[566] And one of them is winning.

[567] And that's affecting the next sentence and so on.

[568] And there was this book, Machine Intelligence or something.

[569] On Intelligence?

[570] On Intelligence, yeah.

[571] Bill Atkinson was a total devotee of that book.

[572] Well, I like, whether it's consciousness or something else, I like the storytelling part that we, it feels like, for us, humans, it feels like there's a concrete story.

[573] It's almost like literary programming.

[574] I don't know what the programming going on in the inside, but I'm getting a nice story here about what happened.

[575] and it feels like I'm in control and I'm getting a nice clear story but it's also possible there's a computation going on that's really messy there's a bunch of different competing ideas and in the end it just kind of generates a story for you to a consistent story for you to believe and that makes it all nice yeah and so I prefer to talk about things that I have some expertise than things which I'm only on the sideline.

[576] So there's a tricky thing.

[577] I don't know if you have any expertise in this.

[578] You might be a little bit on the sideline.

[579] It'd be interesting to ask, though.

[580] What are your thoughts on cellular automata and the Game of Life?

[581] Have you ever played with those kind of little games?

[582] I think the game of life is wonderful and shows all kind of stuff about how things can evolve without the creator understanding anything more than the power of learning in a way.

[583] But to me, the most important thing about the game of life is how it focused for me what it meant to have free will or not.

[584] Because the game of life is obviously totally deterministic.

[585] Yes.

[586] And I find it hard to believe that anybody who's ever had children cannot believe in free will.

[587] On the other hand, this makes it crystal clear.

[588] John Conway said he wondered whether it was immoral to shut the computer off after he got into a particularly interesting play of the game of life.

[589] Wow.

[590] Yeah, so there is, to me, the reason I love the game of life, it is exactly, as you said, a clear illustration that from simple initial conditions with simple rules, you know exactly how the system is operating, is deterministic, and yet, if you let yourself, if you allow yourself to lose that knowledge a little bit enough to see the bigger organisms that emerge.

[591] And then all of a sudden, they seem conscious.

[592] They seem not conscious, but living.

[593] If the universe is finite, we're all living in the game of life to slow down.

[594] I mean, it spit up a lot.

[595] But do you think technically some of the ideas that you used for analysis of algorithms can be used to analyze the game of life?

[596] Can we make sense of it?

[597] Or is it too weird?

[598] Yeah, I mean, I've got a doubt.

[599] exercises in volume for fascicle six that actually work rather well for that purpose.

[600] Bill Gospers came up with the algorithm that allows Gali to run thousands and thousands of times faster.

[601] You know the website called Gali, G -O -L -L -Y?

[602] It simulates the cellular automata, a game of life?

[603] Yeah, you got to check it out, yeah.

[604] Can I ask you about John Conway?

[605] Yes.

[606] In fact, I'm just reading now the issue of mathematical intelligence that came in last week.

[607] It's a whole issue devoted to remembrance of him.

[608] Did you know him?

[609] I slept overnight in his house several times.

[610] yeah he recently passed away yeah he died a year ago uh may i think it was of covid what are you what are some memories of him of his work that stand out for you is did uh on a technical level did any of his work inspire you on a personal level did he himself inspire you in some way absolutely to all of those things.

[611] But let's see, when did I first meet him?

[612] I guess I first met him at Oxford in 1967 when I was...

[613] Wow.

[614] Okay, that's a long time ago.

[615] Yeah, you were minus 20 years old or something.

[616] I don't know, 1960s.

[617] But there was a conference where...

[618] Plus 20 years.

[619] I think I spoke in...

[620] I was speaking about something that's known as the Knooth Bendix algorithm now, But he gave famous talk about knots.

[621] And I didn't know at the time, but anyway, that talk had now, the source of thousands and thousands of papers since then.

[622] And he was reported on something that he had done in high school, you know, almost 10 years earlier before this conference, but he never published it.

[623] And he climaxed his talk by building some knots.

[624] You have these little plastic things that you can stick together.

[625] It's something like Lego, but easier.

[626] And so he made a whole bunch of knots in front of the audience and so on and then disassembled.

[627] So it was a dramatic lecture before he had learned how to give even more dramatic lectures later.

[628] So, all right.

[629] Were you at that lecture?

[630] And I was there, yeah, because I had to, you know, I was at the same conference.

[631] For some reason, I was, I happened to be in Calgary at the same day that he was visiting Calgary.

[632] And it was a spring of 72, I'm pretty sure.

[633] And we had lunch together.

[634] And he wrote down during the lunch on a napkin.

[635] all of the facts about what he called numbers.

[636] And he covered the napkin with the theorems about his idea of numbers.

[637] And I thought it was incredibly beautiful.

[638] And later in 1972, my sabbatical year began and I went to Norway.

[639] And in December of that year, in the middle of the night, the thought came to me, you know, Conway's theory about numbers would be a great thing to teach students how to invent research and what the joys are of research.

[640] And so I said, and I had also read a book in dialogue by Alfred Rennie.

[641] kind of a Socratic thing where the two characters were talking to each other about mathematics.

[642] And so I, and so at the end in the morning, I woke up my wife and said, Jill, I think I want to write a book about Conway's theory.

[643] And, you know, you know, I'm supposed to be writing the art of computer programming and doing all this other stuff.

[644] but I really want to write this other book.

[645] And so we made this plan.

[646] But I said, I thought I could write it in a week.

[647] And we made the plan then.

[648] So in January, I rented a room in a hotel in downtown Oslo.

[649] We were in sabbatical in Norway.

[650] And I rented the hotel in downtown Oslo and did nothing else except write Conway's theory and I changed the name to surreal numbers.

[651] So this book is now published as surreal number.

[652] And and you know, we figured that, we'd always wonder what do you like to have an affair in a hotel room.

[653] So we figured out that she would visit me twice during the week.

[654] Things like this.

[655] You know, we would try to sneak in.

[656] This was, hotel was run by a mission organization.

[657] These ladies were probably very strict but anyway so so it's a wild week in every way but the thing is I had lost that I had lost that napkin in which he wrote the theory but I looked for it but I couldn't find it so I tried to recreate from memory what he had told me at that lunch in in Calgary and as I as I wrote the book I was going through exactly what I what the characters in the book we're supposed to be doing.

[658] So I start with the two axioms that start out the whole thing.

[659] Everything is defined, flows from that, but you have to discover why.

[660] And every mistake that I make as I'm trying to discover it, my characters make too.

[661] And so it's a long, long story, but I worked through this week, and it was one of the most intense weeks of my life.

[662] And I described it in other places.

[663] But anyway, after six days, I finished it, and on the seventh day, I rested.

[664] And I sent to my secretary to type it.

[665] It was flowing as I was writing it faster than I could think almost.

[666] But after I finished and tried to write a letter to my secretary telling her how to type it, I couldn't write anymore.

[667] You give it everything.

[668] The muse had left me completely.

[669] Can you explain how that week could have happened?

[670] Like, why?

[671] That seems like such a magical week of productive.

[672] I have no idea, but anyway, it was almost as if I was channeling.

[673] So the book was typed, they sent it to Conway.

[674] And he said, well, Dan, you got the one axiom wrong.

[675] there is a difference between less than or equal and not greater than.

[676] I don't know.

[677] The opposite of being greater than and less than or equal.

[678] But anyway, technically it can make a difference when you're developing a logical theory.

[679] And the way I had chosen was harder to do than John's original.

[680] And we visited him at his house in Cambridge in April.

[681] or we took a boat actually from Norway over to across the channel and so on and stayed with him for some days and and uh go he told he talked we talked about all kinds of of things he has he had puzzles that i'd never heard of before he had a great way to to solve the game of solitaire many of the common interest that we'd you know he'd never written them up and but but anyway uh this Then in the summertime, I took another week off and went to a place in the mountains of Norway and rewrote the book using the correct vaccine.

[682] So that was the most intensive connection with Conway.

[683] After that...

[684] It started with a napkin.

[685] It started with a napkin.

[686] But we would run into each other.

[687] Well, yeah, the next really, I was giving lectures in Montreal, I was giving a series of seven lectures about the topic called stable marriages.

[688] And he arrived in Montreal between my sixth and seventh lecture.

[689] and we met at a party and I kind of telling him about the topic I was doing and he sat and thought about it and he came up with a beautiful theory to show that the I mean in technical terms it's that the that the set of all stable marriages it forms a lattice and and there was a simple way to find the greatest lower bound and of two stable fairings and least upper bound of two marriage and so I could use it in my lecture the next day and he came up with this theorem during the party and it's a brilliant it's a distributive lesson I mean it's it's a you know it added greatly to the theory of stable mansion so you mentioned your wife Jill you mentioned stable marriage can you tell the story of how you two met so we celebrated 60 years of what at list last month, and we met because I was dating her roommate.

[690] This was my sophomore year, her freshman year.

[691] I was dating her roommate, and I wanted her advice on strategy or something like this.

[692] And anyway, I found I enjoyed her advice better than her.

[693] I enjoyed her roommate.

[694] You guys were majoring the same thing?

[695] No, no, no. Because I read something about working on a computer in grad school on a difficult computer science topic.

[696] So she's an artist and I'm a geek.

[697] What was she doing with a computer science book?

[698] I read, was it the manual that she was reading?

[699] What was she reading?

[700] I wrote the manual that she had to take a class in computer science.

[701] Okay.

[702] So you're the tutor.

[703] No, no, yeah, no, we, yeah, we, there were terrible times, you know, trying to learn certain concept, but I learned art from her.

[704] And so we work together, you know, occasionally in design projects, but, but every year we write a Christmas card and we each have to compromise our own notions of beauty.

[705] Yes.

[706] When did you fall in love with her?

[707] That day that I asked her about her roommate.

[708] Okay.

[709] I mean, no, I, okay, so you're, I don't mind telling these things, depending on how far you go, but, but let me tell you.

[710] I promise not to go too far.

[711] Let me tell you this, that I never really enjoyed kissing.

[712] until I found how she did it.

[713] Wow.

[714] And 60 years.

[715] Is there a secret you can say in terms of stable marriages of how you stayed together so long?

[716] The topic, stable marriage, by the way, is not, is a technical term.

[717] Yes.

[718] It's a joke, done.

[719] But to, different people will have to learn how to compromise and work together, and you're going to have ups and downs and crises and so on.

[720] And so as long as you don't set your expectation on having 24 hours of bliss, then there's a lot of hope for stability.

[721] but if you decide that there's going to be no frustration.

[722] So you're going to have to compromise on your notions of beauty when you write Christmas cards.

[723] That's it.

[724] You mentioned that Richard Feynman was someone you looked up to.

[725] Yeah.

[726] Probably you've met them in Caltech.

[727] Well, we knew each other.

[728] Yeah, at Caltech for sure.

[729] You are one of the seminal personalities of computer science.

[730] He's one for physics.

[731] Have you, is there specific things you picked up from him by way of inspiration?

[732] So we used to go to each other's lectures and, and, but if I saw him sitting in the front row, I would throw me for a loop, actually.

[733] and I would miss a few sentences.

[734] What unique story do I have about?

[735] I mean, I often refer to his time in Brazil where he essentially said they were teaching all the physics students the wrong way.

[736] They were just learning how to pass exams and not learning any physics.

[737] And he said, you know, if you want me to prove it, you know, here I'll turn to any page of this textbook and I'll tell you what's wrong with this page and he did so.

[738] And the textbook had been written by his host and it was a big embarrassing incident, but he had previously as his host if he was supposed to tell the truth.

[739] But anyway, it epitomizes the way education goes wrong in all kinds of fields and has to periodically be brought back from a process of giving credentials to a process of giving knowledge.

[740] That's probably a story that continues to this day in a bunch of places where it's too easy for educational institutions to fall into credentialism versus inspirationalism.

[741] I don't know if those are words, but sort of understanding versus just giving a little plaque.

[742] And, you know, it's very much like what we're talking about if you want the computer to, if you want to be able to believe the answer computer is doing one of the things Bob Floyd showed me in the 60s, there was a he loved this cartoon.

[743] There were two guys standing in front of in those days, the computer was a big thing, you know, and the first guy says to the other guy, he said, this machine can do in one second what it would take a million people to do in a hundred years, and the other guy says, oh, so how do you know it's right?

[744] That's a good line.

[745] Is there some interesting distinction between physics and math to you?

[746] Have you looked at physics much to, like, Speaking of Richard Feynman, so the difference between the physics community, the physics way of thinking, the physics intuition versus the computer science, the theoretical computer science, the mathematical sciences.

[747] Do you see that as a gap?

[748] Are they strongly overlapping?

[749] It's quite different, in my opinion.

[750] I started as a physics major and I switched into math.

[751] And probably the reason was that I could get A plus on the physics exam.

[752] but I never had any idea why I would have been able to come up with the problems that were on those exams.

[753] But in math, I knew why the teacher set those problems, and I thought of other problems that I could set to.

[754] And I believe it's quite a different mentality.

[755] It has to do with your philosophy of geekdom of geeks?

[756] No, I mean, some of my computers.

[757] scientist friends are really good at physics and others are not.

[758] And I'm, you know, I'm really good at algebra, but not at geometry.

[759] Talk about different parts of mathematics.

[760] You know, so they're different kind of physical, but physicists think of things in terms of waves.

[761] And I can think of things in terms of waves, but it's like a dog walking on high legs if I'm thinking about.

[762] So you basically, you like to see the world in, in, uh, in discrete ways, and then physics is more continuous.

[763] Yeah, I'm not sure if Turing would have been a great physicist.

[764] I think it was a pretty good chemist, I don't know.

[765] But anyway, I see things.

[766] I believe that computer science is largely driven by people who have brains who are good at resonating.

[767] with certain kind of concepts.

[768] And quantum computers takes a different kind of brain.

[769] Yeah, that's interesting.

[770] Well, quantum computers is almost like at the intersection in terms of brain between computer science and physics.

[771] Because it involves both, at least at this time.

[772] But there is like the physicists I've known, they have incredibly powerful intuition.

[773] And there's a lot, I mean, statistical mechanics, so I, I study statistical mechanics and, you know, I mean, random processes are related to algorithms in a lot of ways, but there's lots of different flavors of physics as there are different flavors of mathematics as well.

[774] But the thing is that I don't see, well, actually, when they talk to physicists, use a completely different language than when they're talking to, when they're writing expository papers.

[775] And so I didn't understand quantum mechanics at all from reading about it in Scientific American.

[776] But when I read, you know, how they described it to each other talking about eigenvalues and various mathematical terms that made sense, then it made sense to me. But Hawking said that every formula you put.

[777] put in a book, you lose half of your readers.

[778] And so he didn't put any formulas in the book.

[779] So I couldn't understand his book at all.

[780] You could say you understood it, but I really didn't.

[781] Well, Feynman also spoke in this way.

[782] So Feynman, I think, prided himself on a really strong intuition, but at the same time he was hiding all the really good, the deep computation he was doing.

[783] So there was one thing that I was, was never able to, I wish I had more time to work out with him, but I guess I could describe it for you.

[784] There's, there's something that got my name attached to it called Knuth Arrow Notation, but it's a notation for very large numbers.

[785] And so I find out that somebody invented it in 1830s, It's fairly easy to understand anyway.

[786] So you start with X plus X plus X plus X plus X, N times, and you can call that XN.

[787] So XN is multiplication.

[788] Then you take X times X times X and N time.

[789] That gives you exponentiation, X to the nth power.

[790] So that's one arrow.

[791] x so x n with no arrows is multiplication x arrow n is x to the nth power yeah so just to clarify for the uh so x times x times x and times is obviously x n times x plus x n times oh yeah okay and then x n no multiplication is x to the end uh and then and then here the arrow is when you're doing the same kind of repetitive operation for the exponential.

[792] So I put in one arrow and I get X to the nth power.

[793] Now I put in two arrows, and that takes X to the X to the X to the X to the X, N times power.

[794] So in other words, if it's two, double arrow three, that would be two to the two to the two to the two.

[795] So that would be two to the fourth power.

[796] That would be 16, okay.

[797] Okay.

[798] So that's the double arrow.

[799] And now you can do a triple arrow, of course, and so on.

[800] And I had this paper called, well, essentially big numbers.

[801] You try to impress your friend, but by saying a number they've never thought of before.

[802] And I gave a special name for it and designed a font for it that has script K and so on.

[803] But it really is 10, I think like 10 quadruple arrow 3 or something like that.

[804] And I claim that that number is so mind -boggling that you can't comprehend how large it is.

[805] But anyway, Feynman, I talked to Feynman about this and he said, oh, let's just use double arrow.

[806] but instead of taking integers, let's consider complex numbers.

[807] So, you know, you have, I mean, okay, X, X, arrow, arrow two, that means X, X, or X, but what about X, X, X double arrow 2, 2 .5?

[808] Well, that's not too hard to figure out that's interpolate between those.

[809] But what X double arrow I or one plus I or some complex number?

[810] And so he claimed that there was no analytic function that would do that would do the job.

[811] But I didn't know how he could claim that that wasn't true.

[812] And his next question was, did then have a complex.

[813] number of arrows.

[814] Yeah, okay.

[815] Wow, okay.

[816] Okay, so that's Feynman.

[817] That's Feynman.

[818] Can you describe what the Knuth -Morris -Pratt algorithm does, and how did you come to develop it?

[819] One of the many things that you're known for and has your name attached to it.

[820] Yeah, all right.

[821] So it should be actually Morris -Pratt -Knooth.

[822] But we decided to use alphabetical order when we published the paper.

[823] The problem is something that everybody knows now if they're using a search engine.

[824] You have a large collection of text, and you want to know if the word Knooth appears anywhere in the text, or some other word that's less interesting than Knooth.

[825] That's the most interesting.

[826] Like Morris or something.

[827] Like Morris, right.

[828] So we have a large piece of text, and it's all one long, one -dimensional thing.

[829] You know, first letter, second letter, et cetera, et cetera, et cetera.

[830] And so the question, you'd like to be able to do this quickly.

[831] And the obvious way is, let's say we're looking for Morris.

[832] So we would go through and, well, Wait till we get to letter M. Then we look at the next word, and sure enough, it's an O and then an R. But then, oh, too bad, the next letter is E. So we missed out on Morris.

[833] And so we go back and start looking for another.

[834] All over again.

[835] So that's the obvious way to do it.

[836] All right.

[837] And Jim Morris noticed there was a more clever way to do it.

[838] The obvious way would have started, let's say, we found that letter M at character position 1 ,000.

[839] So it would have started next at character position 1001.

[840] But he said, no, look, we already read the O and the R, and we know that they aren't M's.

[841] So we can start, we don't have to read those over again.

[842] So, and this gets pretty tricky when the word isn't Morris, but it's more like abracadabra, where you have patterns that are occurring.

[843] Like repeating patterns.

[844] At the beginning, at the middle.

[845] Right, right.

[846] So he worked it out and he put it into the system software at Berkeley.

[847] I think it was, where he was writing some Berkeley Unix, I think it was some routine that was supposed to find occurrences of patterns in text, and, and, but he didn't explain it, and so he found out that several months later somebody had looked at it, didn't look right, and so they ripped it out.

[848] So he had this algorithm, but it didn't make it through, you know, because he wasn't understood.

[849] Nobody knew about this particularly.

[850] Vaughn Pratt also had independently discovered it a year or two later.

[851] I forget why.

[852] I think Vaughn was studying some technical problem about palindromes or something like that.

[853] He wasn't really, Vaughn wasn't working on text searching, but he was working on an abstract problem that.

[854] That was related.

[855] Well, at that time, Steve Cook was a professor at Berkeley.

[856] And it was the greatest mistake that Berkeley CS department made was not to give him tenure.

[857] So Steve went to Toronto.

[858] But I knew Steve while he was at Berkeley.

[859] And he had come up with a very peculiar theorem about a technical.

[860] concept called a stack automaton, and a stack automaton is a machine that can't do everything a touring machine can do, but it can only look at something at the top of a stack or it can put more things on the stack or it can take things off of the stack.

[861] Like it can't remember a long string of symbols, but it can remember them in reverse order.

[862] So if you tell a stack automaton, A, B, C, D, E, It can tell you afterwards, EDCBA, you know, it doesn't have any other memory except this one thing that it can see.

[863] And Steve Cook proved this amazing thing that says, if a stack automaton can recognize a language where the strings of the language are length N in any amount of time whatsoever, for the stack automaton, you might use a zillion steps, a regular computer.

[864] can recognize that same language in time, n -log -n.

[865] So Steve had a way of transforming a computation that goes on and on and on and on, into using different data structures into something that you can do on a regular computer fast.

[866] The stack of times on goes slow, but somehow the fact that it can do it at all means that there has to be a fast way.

[867] So I thought this was a pretty, you know, cool theorem.

[868] And so I tried it out on a problem where I knew a stack automaton could do it, but I couldn't figure out a fast way to do it on a regular computer.

[869] I thought I was a pretty good programmer, but by golly, I couldn't think of any way to recognize this language efficiently.

[870] So I went through Steve Cook's construction.

[871] I filled my blackboard with all the, everything that stack automaton did, you know, I wrote down.

[872] And then I tried to see patterns in that.

[873] And how did he convert that into a computer program on a regular machine?

[874] And finally, I psyched it out.

[875] what was the thing I was missing so that I could say, oh yeah, this is what I should do in my program, and now I have an efficient program.

[876] And so I would never have thought about that if I hadn't had his theorem, which was purely abstract thing.

[877] So you used this theorem to try to intuit how to use the stack automaton for the string matching problem.

[878] Yeah, so the problem I had started with was not the string matching problem, but then I realized that the string matching problem was another thing, which would also be, could be done by a stack automaton.

[879] And so when I looked at what that told me, then I had a nice algorithm for this string matching problem, and it told me exactly what I should remember as I'm going through the string.

[880] And I worked it out, and I wrote this little paper called Autometer Theory can be useful.

[881] And the reason was that it was the first, I mean, I had been reading all kind of papers about automata theory, but it never taught me, it never improved my programming for everyday problems.

[882] It was something that you published in journals, and, you know, it was interesting stuff.

[883] But here was a case where I couldn't figure out how to write the program.

[884] I had a theorem from automata theory.

[885] Then I knew how to write the program.

[886] So this was, for me, a change in life.

[887] I started to say, maybe I should learn more of autonomy.

[888] And I showed this note to Bon Pratt, and he said, that's similar to something I was working on.

[889] And then Jim Morris was at Berkeley too at the time.

[890] Anyway, he's had an illustrious career, but I haven't kept track of Jim.

[891] But Vaughn is my colleague at Stanford and my student later.

[892] But this was before Vaughn was still a graduate student and hadn't come to Stanford yet.

[893] So we found out that we'd all been working on the same thing.

[894] So it was our algorithm we'd each discovered independently, but each of us had discovered a different part of the elephant.

[895] a different aspect of it, and so we could put our things together.

[896] It was my job to write the paper.

[897] How did the elephant spring to life?

[898] Spring to life was because I had drafted this paper, Autometer Theory.

[899] Oh.

[900] It can be useful, which was seen by Vaughn and then by Jim, and then we combined, because maybe they had also been thinking of writing something up about it.

[901] About specifically a string match.

[902] the string migration problem in a period.

[903] Let me ask a ridiculous question.

[904] Last time we talked, you told me what the most beautiful algorithm is, actually, for strongly connected graphs.

[905] What is the hardest problem, puzzle, idea in computer science for you personally that you had to work through?

[906] Just something that was just a...

[907] The hardest thing that I've ever been involved with?

[908] Yeah.

[909] Okay, well, yeah, that's, I don't know how to answer questions like that, but in this case, it's pretty clear.

[910] Okay.

[911] Because it's called the birth of the giant component.

[912] Okay, so now let me explain that, because this actually gets into physics too, and it gets into something called Bose Einstein statistics.

[913] But anyway, it's got some interesting stories and it connected with Berkeley again.

[914] So start with the idea of a random graph.

[915] Now, this is, here we just say we have end points that are totally unconnected.

[916] And there's no geometry involved.

[917] There's no saying some points are further apart than others.

[918] All points are exactly, are exactly alike, and let's say we have 100 points, and we number them from zero to 99, all right.

[919] Now, let's take pie, the digits of pie, so two at a time.

[920] So we had 31, 41, 59, 26.

[921] We can go through pie.

[922] And so we take the first two, 31, 41, and let's put a connection between point 31 and point 41.

[923] That's an edge in the graph.

[924] So then we take 5 -9, 26, and make another edge.

[925] And the graph gets bigger, gets more and more connected as we add these things one at a time.

[926] okay.

[927] We started out with endpoints and we add um edges.

[928] Okay.

[929] Each edge is completely we forgot about edges we had before.

[930] We might an edge twice.

[931] We might an edge from a point to itself even.

[932] You know, maybe pie is going to have a run of four digits in there.

[933] So we're going to but anyway, we're evolving a graph at random.

[934] And, A magical thing happens when the number of edges is like .49 and maybe end is a million and I have, you know, 490 ,000 edges, then almost all the time, it consists of isolated trees, not even any loops.

[935] it's a very small number of edges so far a little less than half N but if I had 0 .51 edges it's a little more than half end so a million points 510 ,000 edges now it probably has a one component that's much bigger than the others and we We call that the giant component.

[936] So can you clarify?

[937] First of all, is there a name for this kind of random, super cool pie random graph?

[938] Well, I call it the pie graph.

[939] No, no, the pie graph is actually, my pie graph is based on binary representation of pie, not the decimal representation of pie.

[940] But anyway, let's suppose I was.

[941] was rolling dice instead.

[942] Okay.

[943] So it doesn't have to be pie?

[944] Any source of, the point is every step choose totally at random one of those endpoints.

[945] Choose totally at random another one of those endpoints.

[946] Make that an edge.

[947] That's the process.

[948] Yeah.

[949] So there's nothing magical about pie that you were just giving us an example.

[950] I was using pie to sort of saying pie is sort of random that nobody knows a pattern.

[951] Exactly.

[952] Got it.

[953] I got it.

[954] But it's not, yeah, I could have just as well drawn straws or something.

[955] This was a concept invented by Erdus and Rainey, and they called the evolution of random graphs.

[956] And if you start out with a large number N and you repeat this process, all of a sudden a big bang happens at one half end.

[957] There'll be two points together, then maybe we'll have three.

[958] then they maybe branch out a little bit, but they'll all be separate until we get to one half end.

[959] And we pass one half end and all of a sudden there's substance to it.

[960] There's a big clump of stuff that's all joined together.

[961] So it's almost like a phase transition of some kind.

[962] It's exactly.

[963] It's a phase transition, but it's a double phase transition.

[964] It turns out it happens.

[965] There's actually two things going on at once.

[966] at this phase transition, which is very remarkable about it.

[967] Okay, so a lot of the most important algorithms are based on random processes, and so I want to understand random processes now.

[968] So there are data structures that sort of grow this way.

[969] Okay, so Dick Karp, one of the leading experts on randomized algorithms, has students looking at this at Berkeley.

[970] And we heard a rumor that the students had found something interesting happening.

[971] The students are generating this, are simulating this random evolution of graphs.

[972] And they're taking snapshots ever so often to take a look at what the graph is.

[973] And the rumor was that every time they looked, there was only one component that had loops in it, almost always.

[974] They do a million experience, and only three or four times did they ever happen to see a loop at this point.

[975] No, more than one component with a loop.

[976] So they watch until the graph gets completely full.

[977] So it starts out totally empty and gets more and more and more edges all the time.

[978] And so, okay, certainly a loop comes along once.

[979] But now all the loops stay somehow joined to that one.

[980] There never were two guys with lutes.

[981] Wow.

[982] Interesting.

[983] In his experiments, okay.

[984] So anyway, this was almost always, certainly not always.

[985] But with very high probability, this seemed to be true.

[986] So we heard about this rumor at Stanford, and we said, if that's true, then must, you know, a lot more must also be true.

[987] So there's a whole theory out there waiting to be discovered that we haven't ever thought about.

[988] So let's take a look at that.

[989] And so we look closer and we found out, no, actually, it's not true.

[990] But in fact, it's almost true.

[991] Namely, there's a very short interval of time when it's true.

[992] And if you don't happen to look at it during that short interval of time, then you miss it.

[993] So, in other words, there'll be a period where there are two or three components have loops, but they join together pretty soon.

[994] Okay.

[995] So if you don't have a real fast shutter speed, you're going to miss that instant.

[996] So separate loops don't exist for long.

[997] That's it, yeah.

[998] I started looking at this to make it quantitative.

[999] And the basic problem was to slow down the big bang so that I could watch it happening.

[1000] Yeah.

[1001] I think I can explain it actually in fairly elementary terms, even without writing a formula.

[1002] Let's try.

[1003] Like Hawking would do.

[1004] And so let's watch the evolution.

[1005] And at first, these edges are coming along and they're just making things without loops, which we call it trees, okay?

[1006] So then all of a sudden a loop first appears.

[1007] So at that point I have one component that has a loop.

[1008] Now I say that the complexity of a component is the number of edges minus the number of vertices.

[1009] So if I have a loop, I have like a loop of length five, has five edges and five vertices.

[1010] Or I could put a tail on that.

[1011] that would be another edge or another vertex.

[1012] It's like a zero, one, two complexity kind of thing.

[1013] So if the complexity is zero, we have one loop, I call it a cycle, or I call it a cyclic component.

[1014] So a cyclic component looks like a wheel to which you attach fibers or trees.

[1015] They go branching, but there's no more loops.

[1016] There's only one loop and everything else feeds in.

[1017] into that loop, okay?

[1018] And that has complexity zero.

[1019] But a tree itself has complexity minus one because it has, you know, like it might have ten vertices and nine edges to tie them together.

[1020] So nine minus ten is minus one.

[1021] So complexity minus one is a tree.

[1022] It's got to be connected.

[1023] That's what I mean by a component.

[1024] It's got to be connected.

[1025] So if I have ten things connected, I have to have nine edges.

[1026] Can you clarify why when complexity goes, you can go above zero?

[1027] I'm a little...

[1028] Yes, right.

[1029] So the complexity plus one is the number of loops.

[1030] So if complexity is zero, I have one loop.

[1031] If complexity is one, that means I have one more edge than I have verdicts.

[1032] So I might have like 11 edges and 10 vertices.

[1033] So it turns, we call it a bicycle because it's got two loops and it's got to have two loops in it.

[1034] Well, why can't it be trees just going off of the loop?

[1035] That I would need more edges than I. All right, right.

[1036] Okay, I got it.

[1037] So every time I get another loop, I get another excess of edges over vertices.

[1038] I got you.

[1039] Okay.

[1040] So in other words, we start out and.

[1041] And after I have one loop, I have one component that has a cycle in it.

[1042] Now, the next step, according to the rumor, would be that at the next step, I would have a bicycle in the evolution of almost all graphs.

[1043] It would go from cycle to a bicycle.

[1044] But in fact, there's a certain probability it goes from cycle to two different cycles.

[1045] right.

[1046] And I worked out the probability with something like five out of 24.

[1047] It was pretty high.

[1048] It was substantial.

[1049] Yeah.

[1050] But still, soon they're going to merge together almost on.

[1051] Okay.

[1052] So.

[1053] That's so cool.

[1054] But then it splits again.

[1055] After you have either two or one -one, the next step is you either have three or you have two -one or you have one -on -one.

[1056] Okay.

[1057] And so I worked out the probability for those transitions.

[1058] And I worked it out up to the first five transitions.

[1059] And I had these strange numbers, 524s.

[1060] And I stayed up all night and about 3 a .m. I had the numbers computed and I looked at them and here were the denominator was something like 223023.

[1061] So the probability was something over 2 .302 .3.

[1062] I don't know how you worked that out, but...

[1063] I had a formula of that.

[1064] I could calculate the probability.

[1065] And I could find the limiting probability as N goes to infinity.

[1066] And it turned out to be this number, but the denominator was 2 -3 -0.

[1067] And I looked at the denominator, and I said, wait a minute.

[1068] This number factors, because 1001 is equal to 7 times 11 times 13.

[1069] I had learned that in my first computer program.

[1070] So 23 -023 is 7 times 11 times 13 times 23.

[1071] That's not a random number.

[1072] There has to be a reason why those small primes appear in the denominator.

[1073] So all of a sudden that's suggested another way of looking at the problem where small prime would occur.

[1074] So what would that be?

[1075] So that said, oh, yeah, let me take the logarithm of this formula, and sure enough, it's going to simplify, and it happened.

[1076] So I wouldn't have noticed it except for this factorization, okay?

[1077] So I go to bed, and I say, oh, okay, this looks like I'm flowing down the Big Bang.

[1078] I can figure out what's going on here.

[1079] And the next day, it turned out, Bill Gates comes.

[1080] to Stanford to visit, they're trying to sell him on donating money for a new computer science building.

[1081] Sure.

[1082] And they gave me an appointment to talk to Bill, and I wrote down on the blackboard this evolutionary diagram, you know, going from one to two, five, 24th in all this business.

[1083] Yeah.

[1084] And I wrote it down.

[1085] And anyway, at the end of the day, he was discussing people with the development office and he said, boy, I was really impressed with what Professor Knuth said about this giant component.

[1086] And so, you know, I love this story because it shows that theoretical computer science is really worthwhile.

[1087] Does Bill, have you ever talked to Bill Gates about it since then?

[1088] Yeah.

[1089] That's a cool little moment in history.

[1090] Yeah.

[1091] But, but, but, but, Anyway, he happened to visit on exactly the day after I had found this pattern, and that allowed me to crack the problems so that I could develop the theory some more and understand what's happening in the big, but because I could now write down explicit formulas for stuff, and so it would, you know, it would work not only the first few steps, but also study the whole process.

[1092] And I worked further and further, and I, with two authors, co -authors, and we finally figured out that the probability that the rumor was true.

[1093] In other words, look at the evolution of a random graph, going from zero to complete, and say, what's the probability that at every point in time there was only one component with a cycle?

[1094] We started with this rumor saying there's only one component with a cycle.

[1095] So the rumor was that it's 100%.

[1096] The rumor was that was 100%.

[1097] It turned out the actual numbers is like 87%.

[1098] I should remember the number, but I don't have it with me. But anyway, but the number, it turned out to be like 12 over pi squared or 8 over Anyway, it was a nice, it related to pie.

[1099] Yeah.

[1100] And we could never have done that with it.

[1101] So that's the hardest problem I ever solved in my life was to prove that this probability is.

[1102] It was proven.

[1103] The probability was proven.

[1104] Yeah, I was able to prove that this, and this shed light on a whole bunch of other things about random graphs.

[1105] That was sort of the major thing we were after.

[1106] That's super cool.

[1107] What was the connection to physics that you mentioned?

[1108] Well, Bose -Ein statistics is a study of how molecules bond together without geometry, without this.

[1109] You created the tech typesetting system and released it as open source.

[1110] Just on that little aspect, why did you release it as open -source?

[1111] Why did you release it as open -source?

[1112] open source.

[1113] What is your vision for open source?

[1114] Okay, well, the word open source didn't exist at that time, but I didn't want proprietary rights over it because I saw how proprietary rights were holding things back.

[1115] In the late 50s, people at IBM developed the language called Fortran.

[1116] They could have kept it proprietary.

[1117] They could have said only IBM can use this language.

[1118] language.

[1119] Everybody else has to, but they didn't.

[1120] They said anybody who can write, who can translate Fortran into the language of their machines is allowed to make Fortran compilers to.

[1121] On the other hand, in the typography industry, I had seen a lot of languages that were developed for composing pages.

[1122] And each manufacturer had his own language for composing pages and that was holding everything back because people were tied to a particular manufacturer and then a new equipment is invented a few later but printing printing machines they have to expect to amortize the cost over 20 30 years so you didn't want that for tech I didn't need the income I already I already had a good job and my books were people were buying enough books that I that that it would bring me plenty of supplemental income for everything my kids needed for education whatever so there was no reason for me to try to maximize income any further income is sort of a threshold function if you don't have if you don't have enough you're starving but if you get over the threshold then you start thinking about philanthropy or else you're trying to take it with you but anyway there's a I had my income was over the threshold so I didn't need to keep it and so I specifically could see the advantage of making it open for everybody do you think most software should be open so I think that people should charge for non -trivial software but not for trivial software.

[1123] Yeah, you give an example of, I think, Adobe Photoshop versus Gimp on Linux as Photoshop has value.

[1124] So it's definitely worth paying for all this stuff.

[1125] I mean, well, they keep adding stuff that my wife and I don't care.

[1126] about, but somebody obviously done, but I mean, but they have built in a fantastic undo feature, for example, in Photoshop, where you can go through a sequence of a thousand complicated steps on graphics and it can take you back anywhere in that sequence.

[1127] Yeah, that's a long history.

[1128] With really beautiful algorithm, I mean, yeah, it's Oh, that's interesting.

[1129] I didn't think about what algorithm, it must be some kind of efficient representation.

[1130] It's really, yeah, no. I mean, there's a lot of really subtle Nobel Prize class creation of intellectual property in there.

[1131] And with patents, you get a limited time to, I mean, eventually the idea of patents is that you publish so that it's not secret, it's not a trade secret.

[1132] That said.

[1133] You've said that I currently use Ubuntu Linux on a standalone laptop.

[1134] It has no internet connection.

[1135] I occasionally carry flash memory drives between the machine and the Macs that I use for network surfing and graphics, but I trust my family jewels only to Linux.

[1136] Why do you love Linux?

[1137] The version of Linux that I use is stable.

[1138] Actually, I'm going to have to upgrade one of these days, but...

[1139] To a newer version of Ubuntu?

[1140] Yeah, I'll stick with Ubuntu, but right now I'm running something that doesn't support a lot of the new software.

[1141] The last day will read.

[1142] I don't remember the number of like 14.

[1143] Anyway, it's quite, and I'm going to get a new computer.

[1144] I'm getting new solid -state memory instead of a hard disk.

[1145] Yeah, the basics.

[1146] Well, let me ask you, thinking on the topic of tech, when thinking about beautiful typography, what is your favorite letter, number, or symbol?

[1147] I know, I know, ridiculous question, but is there a son?

[1148] Let me show you here.

[1149] Or look at the last page at the very end of the index.

[1150] What is that?

[1151] There's a book by Dr. Seuss called On Beyond Zebra, and he gave a name to that.

[1152] Did you say Dr. Seuss gave a name to that?

[1153] Dr. Seuss, this is S -E -U -S -S -E -S -E.

[1154] He wrote children's books in the 50s, 40s and 50s.

[1155] Wait, are you talking about Cat in the Hat?

[1156] Cat in the Hat, yeah.

[1157] That's it, yeah.

[1158] I like how you hit the sound like.

[1159] On beyond Scebra, did it get to Soviet Union?

[1160] Yeah, Dr. Seuss did not come to the Soviet Union, but since you, oh, actually, I think it did actually a little bit when we were, that was a book, his, maybe cat in the hat or green eggs and ham, I think was used to learn English.

[1161] Oh, okay.

[1162] So I think it made it in that way.

[1163] Okay, I didn't like those as much as Bartholomew Cubbins, but I used to know Bartholomew Covins by heart when I was young.

[1164] So what the heck is the symbol we're looking at?

[1165] There's so much going on.

[1166] He has a name for it at the end of his book on Beyond Zebra.

[1167] Who made it?

[1168] He did.

[1169] He did.

[1170] So there's, it looks like a bunch of vines.

[1171] Is that symbol exist in fact?

[1172] By the way, he made a movie in early 50s.

[1173] I don't remember the name of the movie.

[1174] Now you can probably find it easily enough, but it features dozens and dozens of pianos all playing together at the same time.

[1175] But all the scenery is sort of based on the kind of artwork that was in his books and the fantasy big, you know, based of Seussland or so.

[1176] And I saw the movie only once or twice, but it's quite, I'd like to see it again.

[1177] That's really fascinating that you gave them, they gave them shout out here.

[1178] Okay.

[1179] Is there some elegant basic symbol that you're attracted to?

[1180] Some, uh, give something that gives you pleasure, something used a lot.

[1181] Pie?

[1182] Pie, of course.

[1183] I try to use pie as often as I can when I need a random example.

[1184] Because it doesn't have any known characters.

[1185] So for instance, I don't have it here to show you, but do you know the game called Masu, M -A -S -Y -U?

[1186] no it's it it's a great recreation i mean pseudoku is easier to understand but masio is it is more addictive uh you you have black and white stones like a like on a go board uh and you have to draw a path that goes straight through a white stone and makes a right angle turn at a black stone um and it turns out to be a really nice puzzle because Because it doesn't involve numbers, which is visual, but it's 3D pleasant to play with.

[1187] So I wanted to use it as example in art of computer programming, and I have exercised on how to design cool Masu puzzles.

[1188] You can find it on Wikipedia, certainly, as an example, M -A -S -Y -U.

[1189] And so I decided I would take pie, the actual image of it, and it had pixels, and I would put a stone wherever it belongs in the letter pie, in the Greek letter pie.

[1190] But the problem was find a way to make some of the stones white, some of the stones black, so that there's a unique solution to the Masu puzzle.

[1191] that was a good test case for my algorithm on how to design mastew puzzles because I insisted in advance that the stones had to be placed in exactly the positions that make a letter pie make a huge letter all right that's cool and and I saw you know and it turned out there was a a unique way to do that and so so pie is a source of of examples where I can prove that I'm starting with something that isn't canned.

[1192] Yeah.

[1193] And most recently I was writing about something called graceful graphs.

[1194] Graceful graphs is the following.

[1195] You have a graph that has M edges to it, and you attach numbers to every vertex in the following way.

[1196] So every time you have an edge between vertices, you take the difference between those numbers and that difference has got to be and tell you what edge it is so one edge two numbers will be one apart there'll be another edge where the numbers are two apart and so it's a great computer problem can you find a graceful way to label a graph so I started with a so I started with a graph that I use for an organic graph not a mathematically symmetric graph or anything.

[1197] And I take the 49 states of the United States, the edges go from one state to a next state.

[1198] So, for example, California, be next to Oregon, Nevada, Arizona.

[1199] And I include District of Columbia, so I have 49.

[1200] I can't get Alaska and Hawaii in there.

[1201] because they don't touch.

[1202] You have to be able to drive from one to the other.

[1203] So is there a graceful labeling of the United States?

[1204] Each state gets a number.

[1205] And then if California is number 30 and Oregon is number 11, that edge is going to be number 19.

[1206] The difference between those are, okay?

[1207] So is there a way to do this for all the states?

[1208] And so I was thinking of having a contest for people.

[1209] to get it as graceful as they could.

[1210] But my friend Tom Rukiki actually solved the problem by proving that.

[1211] I mean, I was able to get it down within seven or something like this.

[1212] He was able to get a perfect solution.

[1213] The actual solution, or to prove that a solution exists?

[1214] More precisely, I had figured a hard way to put labels on so that all the edges were labeled somewhere between 1 and 117, but there were some gaps in there because I should really have gone from 1 to 105 or whatever the number is.

[1215] So I gave myself too much, you know, a lot of slack.

[1216] He did it without any slack whatsoever, a perfect graceful labeling.

[1217] And so, you know, I call out the contest because problems already solved and too easy in a sense because Tom was able to do it in an afternoon.

[1218] Sorry, he gave the algorithm or for this particular...

[1219] For the United States.

[1220] For the United States.

[1221] This problem is incredibly hard.

[1222] For the general.

[1223] It's like a coloring.

[1224] But it was very lucky that would work for the United States, I think.

[1225] But I mean, the theory is still very incomplete.

[1226] But anyway, then Tom came back a couple days later and he had been able to not only find a graceful labeling, but the label of Washington was 31.

[1227] The label of Idaho was 41, following the digits of pie.

[1228] Going across the topic of the United States, he has the digits of pie perfectly.

[1229] Do you do it on purpose?

[1230] He was able to still get a graceful labeling with that extra thing.

[1231] What?

[1232] Wow.

[1233] Wow.

[1234] And it's a miracle, okay.

[1235] But I like to use pie in my book, you see, and this is the...

[1236] All roads lead to pie.

[1237] Yeah.

[1238] Somehow often hidden in the middle of, like, the most difficult problems.

[1239] Can I ask you about productivity?

[1240] Productivity.

[1241] Yeah, you said that, quote, my scheduling principle is to do the thing I hate most on my to -do list.

[1242] By week's end, I'm very happy.

[1243] Can you explain this process to a productive life?

[1244] Oh, I see.

[1245] Well, but all the time I'm working on what I don't want to do, but still, I'm glad to have all those unpleasant tasks finished.

[1246] Yes.

[1247] Is that something you would advise to others?

[1248] Well, yeah, I don't know how to say.

[1249] it.

[1250] During the pandemic, I feel my productivity actually went down by half because I have to communicate by writing, which is slow.

[1251] I mean, I don't like to send out a bad sentence.

[1252] So I, you know, I go through and reread what I've written and edit and fix it.

[1253] So everything takes a lot longer when I'm communicating by my text messages instead of just together with somebody in the room.

[1254] And it's also slower because the libraries are closed and stuff.

[1255] But there's another thing about scheduling that I learned from my mother that I should probably tell you, and that is different from what people in robotics field do, which is called planning.

[1256] so she had this principle that was see something that needs to be done and do it you know just instead of saying I'm going to do this first and do this first just you know just do it oh yeah pick this up you know but you're at any one moment there's a set of tasks that you can do and you're saying a good heuristic is to do the the one you want to do least.

[1257] Right.

[1258] The one I haven't got any good reason.

[1259] That I'll never be able to do it any better than I am now.

[1260] I mean, there are some things that I know if I do something else first, then I'll be able to do that one better.

[1261] Yeah.

[1262] But there's some that are going to be harder because, you know, I've forgotten some of the groundwork that went into it or something like that.

[1263] So I just finished a pretty tough part of the book, and so now I'm doing the parts that are more fun.

[1264] But the other thing is, as I'm writing the book, of course, I want the reader to think that I'm happy all the time I'm writing the book.

[1265] You know, it's upbeat.

[1266] I can have humor.

[1267] I can, you know, I can say this is cool, you know, wow, and this.

[1268] I have to disguise the fact that it was painful in any way to come up.

[1269] The road to that excitement is painful.

[1270] Yeah, it's laden with pain.

[1271] Okay, is there, you've given some advice to people before, but can you, can you?

[1272] You give me too much credit, but anyway, this is my turn to say things that I believe.

[1273] but I want to preface it by saying I also believe that other people do out of these things much better than I do, so I can only tell you my side of it.

[1274] So can I ask you to give advice to young people today, to high school students, to college students, whether they're geeks or the other kind about how to live a life?

[1275] It can be proud of how to have a successful career, how to have a successful life.

[1276] It's always the same as I've said before, I guess, not to do something because it's trendy, but it's something that you personally feel that you were called to do rather than somebody else expects you to do.

[1277] How do you know you're called to do something?

[1278] You try it and it works or it doesn't work.

[1279] I mean, you learn about yourself.

[1280] Life is a binary search.

[1281] You try something and you find out, oh, yeah, I have a background that helped me with this.

[1282] Or maybe I could do this if I worked a little bit harder.

[1283] But you try something else and you say, I have really no intuition for this.

[1284] And it looks like, you know, it looks like it doesn't have my name on it.

[1285] Was there advice along the way that you got about what you should and shouldn't work on?

[1286] Or do you just try to listen to yourself?

[1287] Yeah.

[1288] I probably overreacted another way.

[1289] When something, when I see everybody else going some way, I probably, I probably say, hmm, that's too much competition.

[1290] I don't know.

[1291] But mostly I played with things that were interesting to me. And then later on I found, oh, actually, the most important thing I learned was how to be interested in almost anything.

[1292] Yeah.

[1293] I mean, not to be bored.

[1294] It makes me very sad when I see kids talking to each other and they say, that was boring.

[1295] And to me, a person should feel upset if he had to admit that he had to admit that he wasn't able to.

[1296] to find something interesting.

[1297] So, you know.

[1298] It's a skill that you're saying, I haven't learned how to, how to enjoy life.

[1299] I have to have somebody entertain me instead of.

[1300] Right.

[1301] That's really interesting.

[1302] It is a skill.

[1303] David Foster Wallace, I really like the thing he says about this, which is the key to life is to be unborable.

[1304] And I do really like you saying that it's a skill.

[1305] because I think that's a really good advice which is if you find something boring that's not I don't believe it's because it's boring it's because you haven't developed I haven't learned how to how to find the beauty in there how to find the fun in it that's a really really good point sometimes it's more difficult than others to do this I mean during the COVID lots of days when I never saw another human being but I still find other ways to It still was a pretty fun time Yeah, oh yeah I came earlier, I came a few minutes early today and I walked around Foster City I didn't know what was going on in Foster City I saw some beautiful flowers at the nursery at Home Depot for a few blocks away Yeah.

[1306] Life is amazing.

[1307] It's full of amazing things like this.

[1308] Yeah, I just, sometimes I'll sit there and just stare at a tree.

[1309] Nature is beautiful.

[1310] Let me ask you the big, ridiculous question.

[1311] I don't think I asked you last time.

[1312] So I have to ask this time in case you have a good answer.

[1313] What is the meaning of life?

[1314] Our existence here on earth?

[1315] The whole thing.

[1316] Do you have?

[1317] No, no, you can't.

[1318] You can't.

[1319] I will not allow you to try to escape the answer in this question.

[1320] You have to answer definitively because there's surely, surely, Don Canuth, there must be an answer.

[1321] What is the answer?

[1322] Is it 42 or?

[1323] Yeah, well, I don't think it's in numerical.

[1324] That's the SDS.

[1325] That was in Zen and, okay, but all right.

[1326] So, anyway, it's only for me. But I personally think of my belief that that God exists, although I have no idea what that means.

[1327] But I believe that there is something beyond human capabilities.

[1328] and it might be some AI, but whatever it is, but whatever I, but I do believe that there is something that goes beyond the realm of human understanding, but that I can try to learn more about how to resonate with whatever that being would like me to do.

[1329] So you think you can have occasional glimpses of that being?

[1330] I strive for that.

[1331] Not that I ever think I'm going to get close to it, but it's not for me. It's saying, what should I do that that being wants me to do?

[1332] That's, that's, in a way, I'm trying to ask what that, I mean, does that being want me to be talking to Lex Friedman right now, you know, and I said, yes, okay, but.

[1333] Thank you.

[1334] Well, thank you.

[1335] But what I'm trying to say is, I'm not trying to say, what of all the strategies I could choose or something, which one, I try to do.

[1336] it not strategically but i try to imagine that i'm following somebody's wishes even though you're not smart enough to know what they are yeah it's the funny little dance well i i mean this a i or whatever is it probably is is smart enough to help to give me clues and to make the whole journey from clue to clue a fun one yeah i mean it's as so many people have said it's the journey not the destination and people live through crises help each other things come up history repeats itself you try to say in the world today Is there any government that's working?

[1337] I read history.

[1338] I know that things were...

[1339] They were a lot worse in many ways.

[1340] There's a lot of bad things all the time.

[1341] And I read about...

[1342] I look at things and people had good ideas and they were working on great projects.

[1343] And then I know that it didn't succeed, though, in the end.

[1344] But the new insight I've gotten, actually in that way was I was reading what book was I reading recently?

[1345] It was it was by Ken Follett and it was called The Man from St. Petersburg but it was talking about the prequel to World War I and Winston Churchill according to this book sees that that Germany has been spending all its gold reserves building up a huge military and there's no question that if Germany would attack England, that England would be wiped out.

[1346] So he wants Russia to help to attack Germany from the other side because Germany doesn't have enough of an army to be fighting two wars at one.

[1347] Okay.

[1348] Now, then there's an anarchist in Russia who sees that wars are something that.

[1349] Something that leaders start but actually people get killed and so he wants to stop any alliance between england and russia because that would mean that a thousand and thousands of people of russia would be killed that wouldn't be otherwise killed all right and so his his life's goal is to assassinate a russian prince who's visiting in England, because that will make, will mean the Tsar will not form the alliance, all right?

[1350] So we have this question about what should the government do?

[1351] Should it actually do something that will lead to, is the war inevitable or is there a way to have people?

[1352] And it struck me that if I were in a position of responsibility for people's lives, in most cases I wouldn't have any confidence that any of my decisions were good that these questions are too hard probably for any human being but certainly for me well I think I think coupling the not being sure that the decisions are right so that that's actually a really good thing coupled with the fact that you do have to make a decision and carry the burden of that and ultimately I have faith in human beings in the great leaders to arise and help build a better world.

[1353] I mean, that's the hope of democracy.

[1354] Yeah, Ben, let's hope that we can enhance their abilities with algorithms.

[1355] Well put, done.

[1356] It's such a huge honor.

[1357] You've been an inspiration to me and to millions for such a long time.

[1358] Thank you for spending your really valuable time with me. Once again, it's a huge honor.

[1359] I really enjoyed this conversation.

[1360] Thanks for listening to this conversation with Donald Knuth.

[1361] To support this podcast, please check out our sponsors in the description.

[1362] And now, let me leave you some words from Don Canuth himself.

[1363] Science is what we understand well enough to explain to a computer.

[1364] art is everything else we do.

[1365] Thank you for listening.

[1366] I hope to see you next time.