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