Home Lex Fridman Episode
Lex Fridman · 2021-09-09

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.

What this episode covers

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.

Recommended on this episode

BookRecommendedISBN verified

Physically Based Rendering

Matt Pharr

“they're just wonderful”
“they should also look up this book by called physically based rendering by matt farr and anyway it got an academy award”— guest
MediaRecommended

Golly

Andrew Trevorrow and Tomas Rokicki

“you got you got to check it out”
“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
MediaRecommended

Masyu

Nikoli

“it's a great recreation”
“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
ProductRecommended

Ubuntu Linux

Canonical

“i trust my family jewels only to linux”
“i trust my family jewels only to linux why do you love linux the version of linux that i use is stable”— guest
ProductRecommended

Adobe Photoshop

Adobe

“it's definitely worth paying for”
“photoshop has value which so it's definitely worth paying paying for all the stuff”— guest

The guest's own work

BookBy the guestISBN verified

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
BookBy the guestISBN verified

Surreal Numbers

Donald Knuth

“i changed the name to surreal numbers that so this book is now published as surreal number”— guest
ProductBy the guest

TeX

Donald Knuth

“you created the tech type setting system and released it as open source just on that little aspect”— Lex Fridman

Also referenced (named, not recommended)

BookReferencedISBN verified

On Beyond Zebra

Dr. Seuss

“there's a book by dr seuss called on beyond zebra and he gave a name to that”— guest
BookReferencedISBN verified

The Man from St. Petersburg

Ken Follett

“it was by ken follett and it was called the man from saint petersburg but it but but it was talking about the prequel to world war one”— guest
BookReferencedISBN verified

On Intelligence

Jeff Hawkins

“there was this book machine intelligence or unintelligent on intelligence yeah bill atkinson was a total devotee of that book”— guest

Big reveals from this episode

  • 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.

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.