Home Lex Fridman Notes
Lex Fridman · 2021-09-09 · 2h 21m

Donald Knuth: Programming, Algorithms, Hard Problems & the Game of Life | Lex Fridman Podcast #219

Donald Knuth reflects on a lifetime of programming, beauty in algorithms, free will in the Game of Life, and the meaning of life.

Donald Knuth: Programming, Algorithms, Hard Problems & the Game of Life | Lex Fridman Podcast #219
The guest

Donald Knuth — Legendary computer scientist, Turing Award winner, father of algorithm analysis, author of The Art of Computer Programming, and creator of the TeX typesetting system.

The gist

In his second appearance on the podcast, Donald Knuth tells Lex Fridman the story of his first program written in 1957 decimal machine language on an IBM 650, including a tic-tac-toe program that learned to play. The conversation ranges across what makes a program beautiful, literate programming, premature optimization, and the limits of automation and AI. Knuth shares memories of John Conway and the surreal-numbers week, the Knuth-Morris-Pratt algorithm, and the hardest problem he ever solved: the birth of the giant component in random graphs. He closes with personal reflections on his 60-year marriage, Feynman, productivity, and his belief in something beyond human understanding.

Big reveals

  • Knuth says the IBM 650 manual was so badly written he figured he must have a talent for computing because he could write a better one.
  • His goal with his first program wasn't to find a large prime but just to see the lights flash and understand the magical machine.
  • Knuth reacts skeptically to OpenAI Codex/Copilot, worrying we are losing more and more control over what machines do.
  • He declares he is on the side of honor, happiness, and understanding, and would never recommend a student work on autonomous weapons.
  • On consciousness and whether the mind exceeds computation, Knuth insists it is unanswerable and that he is no better placed than anyone to say.
  • He describes writing Surreal Numbers in a single intense week in an Oslo hotel, feeling like he was channeling, then losing the muse entirely.
  • The denominator 23023 factoring into 7x11x13x23 was the clue that cracked the giant-component problem for him.
  • Knuth states his belief that God exists and that he tries to resonate with something beyond human understanding.

Things worth remembering

  • Knuth's third program was a self-learning tic-tac-toe with three 'brains'; it converged to a safe draw after about 600 games.
  • Charles Babbage had planned to program tic-tac-toe for his unfinished machine over a hundred years earlier.
  • A Fortran compiler Knuth studied spent more than 80% of its time reading the comments card, illustrating premature optimization.
  • John Conway wondered whether it was immoral to shut the computer off after an interesting play of the Game of Life.
  • During a party, Conway invented a lattice theory of stable marriages that Knuth used in his lecture the next day.
  • Knuth says he never really enjoyed kissing until he found how his wife Jill did it; they have been married 60 years.
  • Feynman challenged Knuth's arrow notation by asking about complex numbers of arrows.
  • Knuth wrote a paper titled 'Automata Theory Can Be Useful' after a stack-automaton theorem helped him crack string matching.
  • Bill Gates visited Stanford and was impressed by Knuth's giant-component explanation while being pitched to fund a CS building.
  • Knuth says the most important thing he learned was how to be interested in almost anything and never bored.

Recommended in this episode

Books, products and media the guest or host genuinely endorsed here — with the buy link.

Affiliate link — we may earn a commission at no extra cost to you.

Guest’s ownBook

The Art of Computer Programming

Donald Knuth

“father of algorithm analysis author of the art of computer programming creator of tech that led to late tech” — Lex Fridman 00:00:00
Find it on Amazon
Guest’s ownBook

Surreal Numbers

Donald Knuth

“i changed the name to surreal numbers that so this book is now published as surreal number” — guest 01:04:56
Find it on Amazon
RecommendedBook

Physically Based Rendering

Matt Pharr

“they should also look up this book by called physically based rendering by matt farr and anyway it got an academy award” — guest 01:00:00
Find it on Amazon
Guest’s ownProduct

TeX

Donald Knuth

“you created the tech type setting system and released it as open source just on that little aspect” — Lex Fridman 01:29:14
Find it on Amazon
RecommendedMedia

Golly

Andrew Trevorrow and Tomas Rokicki (inferred)

“the website called golly g-o-l-l-y it simulates the cellular automata like game of life yeah you got you got to check it out yeah” — guest 00:59:39
Find it on Amazon
RecommendedMedia

Masyu

Nikoli (inferred)

“do you know the game called masu it's a great recreation i mean sudoku is easier to understand but matthew is more addictive” — guest 02:00:09
Find it on Amazon
RecommendedProduct

Ubuntu Linux

Canonical (inferred)

“i trust my family jewels only to linux why do you love linux the version of linux that i use is stable” — guest 01:55:31
Find it on Amazon
RecommendedProduct

Adobe Photoshop

Adobe

“photoshop has value which so it's definitely worth paying paying for all the stuff” — guest 01:54:26
Find it on Amazon