Hi everyone, wanna get started?
So I wanna welcome you to the 22nd
Annual Christmas Lecture entitled,
Hamiltonian Paths in Antiquity.
Our esteemed speaker today is Don Knuth,
who really needs no introduction since
he's a wonderful pioneer in his field.
He is the author of The Art
of Computer Programming,
which is regarded as the first and
still the best comprehensive treatment
of its subject, as many of you may know.
He's created many important computer
programming systems over the years.
He has won the first ACM Grace Murray
Hopper award, the Turing Award,
the National Medal of Science Award,
among many others, and
he's also a professor emeritus
here at Stanford University.
So without further ado, as I'm sure many
of you are anxious to hear from him,
let's give Don Knuth a very warm welcome.
>> [APPLAUSE]
>> Do you have that sheet of paper?
>> I don't actually, I'm sorry.
Yeah.
>> Hi, it's great to see a lot of
old friends and new friends tonight.
So every December for a long time I've
been giving these Christmas lectures.
And but of course a lot of you
know that today is quite special,
because I think it's the first time
Stanford or maybe any university
is broadcasting a live
video in spherical 3D.
So that for people who aren't here in,
will be able to see all
the 3D things I'm gonna do.
>> [LAUGH]
>> Well,
actually I was thinking of
inviting some dancers to.
>> [LAUGH]
>> To go off on the side.
But I'm gonna tell you,
I think, a really cool story.
Something that, stories that
haven't really been told before.
Except I did a beta test last
week at Brown University and.
Anyway, for
the people who are watching from outside,
you wanna do something with 3D.
We did put some books on the floor.
So below the camera,
if you look down this way
>> [LAUGH]
>> Towards your feet,
you should see that there are four
books sitting there on the floor.
Now, but for the people in this
room I have a tradition of,
since it's Christmas time,
of giving away books every year.
So one per person, and
you have to wait until,
I used to say the person who asked
the best question gets the books,
but that was too hard to do it.
So two of the books
are in Japanese though.
So that restricts-
>> [LAUGH]
>> I can get extra copies of books when
I'm the author and
I hate to just shred them.
So I bring them to give them
away at Christmas time.
So anyway, those four books are there
in case anybody's interested afterward.
Now I'm going to sit down and
I'm to tell you this wonderful story.
Let's see, where story,
Stephanie I still don't see the picture.
[LAUGH] So now, some of you,
well look, I've got to zoom out.
>> [INAUDIBLE]
>> Okay yeah, I want to take,
they made this really nice picture, so
I thought we could use this as a title.
Okay so, some of you have found on
the internet something that I posted,
I don’t know, some time ago.
This particular one file hasn't
changed since April of this year.
But every once in a while I wake up in the
morning and I think of something that I
want to write for a future section of
the book that's going to come out later.
And this is going to be section 7.2.2.4
up there, you know, volume 4B someday.
And as I'm learning parts of the story,
I put it online.
And there were five secret files like
this that enterprising people who
know how to find URLs can figure out.
>> [LAUGH]
>> Now.
And you get paid for any errors you
find in these, just like the real one.
But so I'm going to talk you
about some stuff that's in here.
And a lot of the stuff that I learned
in February of this year,
other things in the previous year.
But anyway over the years I've
been learning that this idea
that we call Hamiltonian paths
certainly didn't start with Hamilton.
It started 1,000 years before,
more than 1,000 years before Hamilton.
So that's the story that I
want to tell you tonight.
At least what I know about it now.
I couldn't wait for
historians to go and do it, so
I had to do the research myself,
hoping that the real historians
will explore it further and
tell you what the real truth is.
But I will tell you what I was able
to learn with the help of friends,
who speak those languages
that I don't speak.
Now, so what about Hamilton though?
So I was talking to Helen Quinn
at the faculty party
earlier this afternoon and I said, I'm
gonna be talking about Hamiltonian paths.
And she's a physicist so she's,
you mean the Hamiltonian.
And no, this is different,
this is something he did earlier right
after he discovered quaternions.
And he made up something
called the Icosian game.
And here's a picture of one of the four
known examples of the Icosian game.
Hamilton sold the rights to this puzzle
for 25 pounds, and I don't think very
many were sold because otherwise there
would be more copies available today.
But so
Hamilton got his his thing out of it.
But anyway it's a beautiful thing,
but the the idea of the puzzle
was essentially what we now
call a Hamiltonian path,
that is, you want to go through
all the points of this network and
hit each point exactly
once without backtracking.
And in his game people would
choose the starting place and
the ending place and things like that.
And so
now when you look it up on Wikipedia,
it'll tell you that
the Icosian game is to find
a Hamiltonian path on a dodecahedron.
A dodecahedron is, you know,
the solid that has 12 faces.
That's what dodeca means.
And so you might say, well why did
Hamilton called it the Icosian game,
because icosahedron has 20 faces.
So the icosahedron has 20 triangles and
the dodecahedron has 12 pentagons.
Well, the answer is,
is that, these two solids
are dual to each other, so, and
I [INAUDIBLE] has 12 vertices,
and 20 faces,
but the dodecahedron has 12 faces and
20 vertices.
Okay, and so, I got a picture of that,
actually, in my notes, and
that makes it perfectly clear.
So here Is your icosahedron of
triangles twenty of them and
then dodecahedron, twelve pentagon.
And so, each vortex here corresponds
to a face here and vice versa.
So, although Wikipedia says
that Hamiltonian path is to
go between the vertices of a dodecahedron,
Hamilton described it as
going between the triangles,
a look which is mathematically
the same problem.
But as you'll see, there's something
really interesting here, because.
Well, I can show you
something else before I go.
Before I go on, there is also
something called travelers to
Decca Hedron which came out, so
Hamilton did not about dodecahedron,
and he had this other puzzle that
I thought that is very rare,
but you can find the stuff online,
but what got me interested.
Here's an image from
the Metropolitan museum.
Let's see, we go out a little bit,
so you can see this was online for
the Met, but let's look up close at this.
This is a picture of an icosahedron
in the collection in New York.
And I happen to like to
see a picture of it, and
I said we have, so here's an icosahedron,
and look at what's on in here, we've got.
Well, this is a thing that everybody
can can see that's a theater, right?
And this, and
here's where the Greeks wrote Alpha,
and there's a beta,
you can see to b there.
And here you can see
the epsilon on the left there.
And so, I'm thinking, well,
but I can't see the other.
I can only see ten faces here, but if
you look on the back, you can see alpha,
beta there, pi, gamma and
delta and then epsilon.
And then after epsilon,
you've got zeta, eta, theta, iota.
And it looks like this might very well be
a Hamiltonian path on the icosahedron.
So, exactly what Hamilton was asking for.
But of course, I couldn't the back, so
I had to conjecture whether
this would be true or not.
But I got curious about it, and
I and I found out that such icosahedron,
this goes back by the way to Greek or
Roman times,
the dates are something
like 200 BC through 400 AD,
but probably 200 AD is
most likely in all of
the cases where they do know
the origin was somewhere in Egypt.
But I found that there were a bunch of
them, and I was taking a trip to London,
so I wrote to the to the curators
of the museum there that
had copies and and so
here is one that I saw.
[INAUDIBLE] Zoom out, way out.
This is in the Petrie Museum
of the University of London.
You can see here a can anybody
could tell me what that coin is,
it's one of these small?
I think it's kind of a nickel.
And this one is, again,
and icosahedron, and with,
in this case, the letters are painted on,
at the Petrie Museum,
they had three copies of this one here,
right.
It isn't such a big.
It's different materials,
and you can see that,
you can hear the letters
are painted after being carved in.
But anyway, this was a lot of fun,
because the Petrie Museum is in a locked
room that's open one day a week.
You write to the curator and
[COUGH] they check you out, and
then they give you special
rubber gloves to wear.
I was able to handle this, and
play with this icosahedron.
And sure enough, well,
it was I could go Alpha Beta Gamma Delta
up through 20 letter, the first
20 letters of the Greek alphabet.
And not only was it a Hamiltonian path,
but
I can't help but
say that it was kind of a thrill to do it.
You just have the object in my hand.
I could imagine that the people, well,
technically, it's not very easy to make,
icosahderon, so somebody had to spend
a lot of time thinking how to do it but
after they had it.
I can imagine that they really enjoyed
moving from triangle to
triangle in alphabetical order,
because there's something very
appealing about it that, physically.
As computer scientists,
we get most of our our thrills from bytes,
but actually, every once in while,
having a real physical object in
your hand can be even more fun.
Okay, so.
So then I, but
I also had written to the British Museum,
which is a few blocks away, and the
British Museum had had also three examples
of these icosahedron, and
there I spent the rest of the day,
making some photographs that
I could use in my book.
So, here's one.
This is the one that I
actually used in my book.
It's the largest of the ones
they have in the British Museum,
I'll show you quickly the other
two that they had then.
And this, so, this one is serpentine.
The one in the book is called material,
and this is
and in every case, it was Hamiltonian, and
the British Museum also
has a fourth one that.
That isn't,
does not make it Hamiltonian [INAUDIBLE].
So, of all the known
examples of this kind,
I would say maybe 70% turn
out to be Hamiltonian when you look at
all the faces, and the others are not.
Experimentally, but it is, but it's not a
proof that the people at that time did it.
On the other hand, the fact that
it is exciting to do that makes it
plausible in any way, but it, I can also,
by the way, show you some examples,
this come from the Louvre and from Cairo.
So, there's quite a lot of,
just an example.
Now, the one, the one that I photographed,
I included in my and so,
I'm gonna zoom in on this,
on this picture here,
and let you see these.
So here,
I got it from each of the 12 vertices.
You can see the five
that go out a little bit.
You can see the five letters around
each one, Alpha Beta Gamma Delta.
Epsilon and the next one would be epsilon,
zeta, eta, theta, alpha and so on.
So I just think it's
really cool coincidence
that icosahedron did exist way before
Hamilton came up with the notion that it
would be fun to to consider going along
all the triangles of an icosahedron.
So now I have an exercise in here.
And, let's see,
I believe it's exercise nine.
As I will show you next, we'll zoom
in on that and see how this works.
I wanna make sure you can,
I'll read it to you.
It says, each letter in the Greek or
Roman icosahedron can be placed three ways
within its triangular face, depending
on the choice of the bottom edge,
except that delta and
omega are symmetrical.
From this standpoint, the fact that pi and
upsilon share the same bottom edge and
in the example from the British Museum
is a little bit disconcerting.
So redesign that layout for
the 21st century, this is the exercise.
So at first place,
we gonna use Roman letters, A ,B,
through T, to replace the Greek ones.
Secondly the bottom edge of the next
letter is always obtained by going up
to the left or up to the right,
of the current letter.
And, and then third, it makes a cycle,
so that when you get to the 20th letter,
you come back, and one more step
takes you back to where you started.
Okay, so that is the 21st century
version of the thing, and
if we look at the answer to exercise 9, I
show what such an example would look like.
And in sense actually,
Hamilton knew that the answer was unique,
up to obvious transformations like
starting the cycle at B instead of A, or
are going backwards or
Taking a mirror reflection.
So there's only one answer to
this problem, essentially.
And I said well, it would be nice to
own a 3D-printed object like this.
So at the beginning of July, I had
An interesting letter in my mailbox,
wait a minute.
From Krakow, Poland and
what in the heck was inside.
And inside was this box.
And when I opened the box,
Look what I found, can you see that?
It's black you can,
unfortunately you can't read it here.
I put it on a scanner so that you can see
a little bit, what it looked like,
and so here that this.
There's a company in Poland that
had just come out with a new
kind of a 3D printer based on laser.
The laser melts that the powder, and
it's called sintering and
somehow, even though I have no
link to this exercise [LAUGH] on the web-
>> [LAUGH]
>> Somebody there ran across the exercise
and they saw that I was asking for
a 3D print out.
So they used this as one of
the test cases, and you know,
you can come up afterwards and
take a look at it.
But here, it's really fun.
So here I have A, and
then go the right and I get a B, and
then I go to the left and I get a C,
and then I go to the left I get D,
I go to left is E, go to the right is F,
go to the right is G.
It just works.
Okay, so like I said, if someone finds
an error the they get a check for it.
So I didn't know who's responsible for
this, but
I wrote this check and I said,
what a wonderful surprise!
Thank you, thank you for
one of the best gifts I've ever received.
When I wrote it would be nice to
own a 3D printed object like this,
I clearly made a gross understatement.
So the enclosed checked is for
correcting my manuscript.
>> [LAUGH]
>> And so the next-
>> [LAUGH]
>> The author-
>> [APPLAUSE]
>> All right, so
that's the first of three stories
I want to tell you tonight.
This takes Hamiltonian as,
with high probability, but
not certainty, back to maybe 200 AD.
But now we can go with
certainty to the 800s.
So that's only 1200 years or something.
But the next part of the story is where we
get into the earliest known
examples of knight's tour.
Okay now, anybody here who hasn't
heard of a knight's tour before?
Did you ever play chess?
Okay, so anyway the game of
chess was invented about,
I don't know 600, 700 in Persia and
or India, probably India.
Kashmir or anyway some works.
And it was called shatranj or chaturaṅga,
depending on which country you are.
But this was a predecessor of chess and
most of the pieces had
had different rules,
a king was the same and the knight was
the same, that's the critical thing.
But a lot of the other pieces move
differently, but anyway, it got popular.
And in the year 842,
there was a man in Persia named
Adli who published a book about shatranj,
and he was the current world champion.
And he included in his book a knight's
tour and not all copies of his,
that's long time ago, all copies
of his book long since vanished.
But other people reprinted parts of it, so
that we can reconstruct a certain amount
of his book from what other people quoted.
And in particular, there's a guy who's
Abu Zakarya Yabya Ibrahim Hakim.
So we call him al-Hakim for short,
he quoted the knights tour
that al-Hakim gave and
so this is a Hamiltonian cycle.
This is not a- it's actually
a closed to [INAUDIBLE].
Al-Hakim also gave another
tour which is not closed,
it starts, here's a picture of the Adli's,
which is closed.
And here's a picture of Ibn Mani's and
Ibn Mani, nobody knows anything about him,
he's mentioned only on this one
page of Al-Hakim's manuscript and
And we tried to identify other people,
other interested people by that name, but
it looks like the other ones were
definitely different people.
So these are the earliest known
examples of knights tour.
And this one is dated 842.
This one we don't really know, except
there's good reason to think that actually
this one was invented before this one
because it's much easier to come up with.
And there's tens of thousands more
knight's paths than knight's tours.
Probably this one being more primitive
probably was an earlier conception,
but that's only conjecture.
Anyway, these are the two earliest ones,
and all knowledge comes from
a single manuscript of al-Hakim's work.
Al-Hakim wrote 300 years after Ali and and
the manuscript is 300 years after that.
So when you're looking
at these old things,
you're lucky to get information at all.
And maybe there were lots and
lots of other
knight stories and things written and
nobody kept good track of them.
I mean, some people thought that
it was sinful to play chess,
and so on, so books get burned.
But anyway, so
I learned that there was this one
manuscript that told about these tours.
And so there's a long story
about the [INAUDIBLE].
I don't want to go into details, but
anyway at the beginning of 1903 or
something like this, Harold Murray,
who wrote the definitive
history of chess, and his father was the
founder of the Oxford English dictionary.
Anyway, he learned of this manuscript,
that it was in the possession of Mrs.
John Rylands, and
the John Rylands library in Manchester is
one of the great historical libraries.
And this manuscript, at the time,
still hadn't been donated to that library.
But Murray got permission to come and
see it at her house.
And he looked at it, and
he knew enough Arabic to figure it out.
And so
then he wrote about it in his history.
But nobody has ever republished the
manuscript or translated it or anything.
But I wanted to find
out how in the heck did
al-Hakim describe a knight's tour.
Somewhere in his manuscript,
did he draw a picture of it?
What did he do?
And exactly how did he refer to.
Murray referred to by
three different names.
And he wasn't that careful
about his scholarship.
So I wanted to check it out and I thought
I would have to go to Manchester in order
to do this with somebody
who could read Arabic.
But it turned out that following
the clues in Murray's book,
and looking at an online catalog,
I found that I could order
a copy of the manuscript.
And I don't know, it cost me 50 bucks or
something to get those pages copied.
And my friend, Kamaman Serb,
who reads Arabic, he's an Egyptian man.
So I brought the copies over to him so
he could show me what it was.
Well, it turned out it
was wrong completely.
It was something had nothing
to do with chess whatsoever,
and so
we talked to each other a little bit.
But then I wrote back to Manchester and
I said what are you sending me this?
So it turned out,
yeah, they changed the catalog
number of the books over the years.
>> [LAUGH]
>> And so the book that I said had nothing
to do, but I said I also gave
you the title and all this.
So finally I've been going through all
kind of bureaucrats that had me fill
out forms or
stuff to get copies, and I said look, I
paid this money and I got the wrong thing.
And what should I do?
So finally I got to talk to
a senior librarian there, and
it turned out that they had digitized
the darn thing and it was already online.
>> [LAUGH]
>> And so they told me the URL, so okay.
So then I could get the thing, and well,
I could I could go on telling you,
but anyway, you get some idea
as to how much fun it is to do,
try to look at source with your.
My major failing as a teacher was that I
wasn't able to get a single one of my 28
PhD students to realize what a thrill
it is to work on source material.
But maybe one of you in the audience
will get some idea maybe.
But anyway, here is the page on which
Ali's earliest knight's tours rely.
So at the top of the page it says
something like here's a way for
the knight to kill everybody
without leaving anything.
But then I zoom in on this particular,
here is a,
[COUGH] chess board with
with Arabic written in it.
The manuscript is Persian, I'm trying
to learn what's on the screen here.
You can see an eight by eight now.
>> Mm-hm, yep.
Okay, yeah.
The guidelines I have here don't match
perfectly with what you can see.
All right, so now, but the key thing
is that there's a poem down here.
And well,
I got some things written in a poem.
So for example, this Arabic word here
is the one that appears up in this corner.
Let's go zoom out a little bit more.
So now this one is here.
The next word is this guy.
And then this one is F six is up here and
then the next one is H
seven which is here.
And so in another words here we've
got a poem that has 64 words in it.
And then by pattern matching, of course,
if I could read Arabic it would be easier.
>> [LAUGH]
>> Because the pattern matching wasn't so
easy, the handwriting is pretty atrocious.
But I actually did it.
Anyway, I took Photoshop and
made a big copy, and
little by little I was able
to match everything up.
So this tour and this one is the one Ali,
and these 64 words jump across
according to a knight's tour.
And at the bottom it says, this poem is
Is housed according to
the right path of the knight.
Literally, it means distributed
according to a knight's path.
And then the one below,
here is where it talks
about ibn Mani also having
discovered the knight's tour.
And this one is ibn Mani's tour,
the one that I think is probably earlier.
And again, the same idea but it's a
different poem and a different path here.
So this is the source of the earliest
known knight's tours which is real,
definitely a Hamiltonian path.
So we got Hamiltonian paths
traced back to the 800s.
But the next page of
this Arabic manuscript,
the flip side of it is this.
Which is now here's another way to
describe the first of those tours.
And now,
here I've written a few things on here.
So this is Arabic for
first and second, third.
And there, it says fourth,
fifth, you get the idea.
Sixth, seventh, eighth, ninth, tenth.
And then it goes into other things,
which apparently used an old notation
that my friend didn't know.
But this is clearly Arabic for 30.
This was a three,
the way they write a three and a zero.
And even though Arabic is written
from right to left, they still write
Hindu-Arabic numerals the way we do
with the units digit left to right.
So they actually thought of
the units digit coming first.
So this is 40, and this is 30,
and this is 20, and so on.
So here was another way to give the tour.
Instead of taking a poem and
rearranging the words,
they presented it as as
a matrix of numbers 1 to
64 in some old Persian
style numeral system.
Okay, so that's like if
we went to modern notation,
then this would be what
that Arabic page did.
Now, as I say, some people have
talked about this manuscript.
And say, in general,
on page such and such,
there's a description of
interesting problems.
And some of them mentioned that it's
something about a knight's tour.
But no real explanation of the notation or
anything as far as I know,
whether that has ever been published.
And actually somebody really looks
closely into this manuscript to
find all kinds of other
interesting detail, now,
You might say, well, why didn't
they draw a path picture like this?
Why didn't they do one of these things?
Well, as far as anybody knows,
that wasn't invented until the 1700s,
about 1750.
There's a book in 1766 in Italy
about just the first time
a knight's tour was actually
drawn in this kind of a fashion.
Okay now,
Let me then go to the third
part of the story.
So I told you about
the Greek Roman part and
the, wait no, yeah, I guess that's fine.
And so now, let's go to the third part,
which is about India.
In fact, here,
we go back even earlier than al-Adli.
But it's not a knight's tour
of the entire chessboard,
but only a half of a chessboard,
a four by eight.
So the earliest known,
this goes back before al-Adli,
but it's four by eight,
not eight by eight.
And here's a nice half tour, okay?
Now on a four by eight,
you can't make a close tour.
Every Hamiltonian path on a four
by eight is not too hard to show.
It starts and ends at either the top
row or in the bottom row, but
never in the middle.
So you can't have a closed tour.
If you could, you would have to have
something that starts at the top or
bottom.
But then the last move would
have to be in the middle.
But that would give you a path
if you took it backwards.
That doesn't exist.
So anyway, this is the earliest known and
it's due to Rudrata 815.
And then there's another one
just to 15 years later,
Ratnakara has this one.
And now, of course,
I ask the same question.
How did these people describe
their knight's tour?
They didn't draw a diagram like this.
So what did the source look like?
And what more can we find by
going to check out the source?
Well, so here it is.
This is an excerpt from Rudrata's
book from 815, Kavyalankara.
And the title of his book,
it means Ornaments of Poetry.
And at this time, there was kind
of a cult in Kashmir of poets
who would be hired by the Maharaja
to be witty and entertaining.
And they would write a very,
very amusing poetry.
They would show their poetic skills by not
only telling stories and things like that.
But they would also do a lot of
plays on words with their poems.
And they had something
called Chitra Kavia,
which is picture poems, picture writing.
[COUGH] And Rudrata was one of
the very first and certainly,
as far as anybody knows,
the first who took it so
far as to use a poem to
describe a knight's tour in
a very curious way that I'm
gonna tell you about now.
But since not too many
of us read Sanskrit,
I'm going to show you in English
what Rudrata's idea was.
So let me show you a poem that I came up
with that is a knight's tour.
Okay, so here I want a good,
good time, lots of fun?
Now not time so good, now not time.
Foo, So!
So now fun is lost.
Time not good now, so time not now.
>> [LAUGH]
>> I mean.
Let's face it, I'm not a poet.
>> [LAUGH]
>> But in fact,
I was thinking that instead of want,
I should say vant here,
cuz it sounds like a foreign accent,
but anyway.
Let me show you the idea of it.
So, you see, this poem can be
read in two different ways.
So, I start here and
then want a good, good time,
so, want a good, sorry, good,
sorry, I can go down here too, can’t I?
See, good, then good time,
good, good time.
Lots of fun, okay, so let me go good,
no, sorry about that.
Let's come down here, good,
good time, and then lots of fun.
Well here, I have lost instead of lots,
but that's poetic license.
>> [LAUGH]
>> So lots of fun, okay, right?
Okay, now not time so
good, so now, not time.
So good, now not time.
All right, here we are, now not time, foo.
>> [LAUGH]
>> So, wait, actually there are two
choices for so here, I don't know
which one, but the next one is it.
It gives so in both cases, so
I ought to leave this, okay.
So now fun is lost.
So now fun is lost, lots.
>> [LAUGH]
>> Time not now good.
Time not now good, so time not now, so
that's when I wanna do this.
And so time not now.
Well, there we are, all right.
>> [APPLAUSE]
>> All right, now.
>> [LAUGH]
>> That's the idea.
So I had to have a poem that
there's 12 different words here,
and I had to have a poem so
that 1, 2, 3, 4,
5, 6, 7, 8, 9, 10, and so on.
It's also equal to 1, 2, 3.
Well, I don't know where the 3 was,
maybe here.
Okay, anyway I have some pattern.
That 3 has to equal, this number,
10 has to equal this number and so on.
So there are various constraints.
So I don't have 32 different choices here.
I have, instead,
only 12 left after equivalent.
Now the thing is, it's probable
that Rudrata only knew one
knight's tour on the 4 by 8,
and the one that he knew allowed
him only four different syllables.
So the actual poem that he has in it,
if we look at the Sanskrit here.
Well, I guess I got an English
translation at the right,
so it's sena lililina
nali linana nanalilili
nalinalile nalina lilili nanananali.
Okay, so he only had four
syllables to use there because
his knight's tour had this pattern.
1 30 9 20 3 24 11 26 16 has
to equal 1 2 3 4 5 6 7 8.
So 30 has to equal 2, 9 has to equal 3,
20 has to equal 4, and so on.
You put all these things together,
you find out that you only have
four different equivalence classes that
you can use for different syllables.
So on the other hand, it turns out that
this poem actually does mean something.
I mean Sanskrit,
it much more flexible than
English that you can do wordplay more,
so it turns out that, I mean.
Okay, we go into these Sanskrit poems.
Sanskrit poems consist of groups of
32 syllables that are called slokas,
and so he found a sloka,
a 32 syllable thing
that had this property that
you could read it in two ways.
Think this sloka was a sena lililina nana,
and the translation is something like,
I praise the army whose leader is
mighty in play which is devoted.
I who am not acquainted with untruth,
whose men are mounted in cats and
keep together in various vows.
Who does not perpetrate
meaningless deals for
his dependents who have generals who
assume the leadership of happy men.
Who has men of several stores and
no fools.
Anyway, that turns out,
the meaning can be nananalili.
>> [LAUGH]
>> I can actually do that exactly, so
that's a wonderful thing.
Now but how did people know
that he was doing this?
Well, they had a little bit of a clue
because in the previous verse,
he had given a rook's tour, where he had
some more syllables that he could use.
But anyway, here's what
the Sanskrit actually looks like,
and there's a commentator named Nami Sagu,
who is 300 years later who explained
what Rudrata was talking about.
And a lot of these old Sanskrit texts,
they consist of little slokas.
I think this is sloka number muses,
I think this is 19, okay.
Anyway but then the commentator,
who is writing 300 years later,
explains what's going on in this sloka and
saying,
actually this is a knight's tour and
it's very cleverly constructed.
And so all this here was not by Rudrata,
but by the commentator 300 years later.
And who is talking about all
the different ornaments of poetry, and
here's how the commentator explains it.
I have here, here he gives 32
syllables, starting at my hand here.
And then continuing
along this vertical bar
that separates out the first half
of the sloka from the second half.
And so these 32 syllables,
it is nonsense, but has the property
that if you read them in alphabetical
order, you get a knight's tour.
Or you get Rudrata's knight's tour.
So here's what appears at
the back of this edition.
So on the upper line are these
32 syllables that had appeared.
And so each one is a different consonant
in Sanskrit, and you read those
in alphabetical order, which everybody
knew that then you would be For
following, so this was the way
he explained Rudrata's thing.
Now however, nobody actually
noticed that that's not the only
knight's tour that matches
this pattern of lililina nali.
It turns out that the total number of
knight's tours on a 4x8 is 62,176.
And if you look at all of them,
only one of them and
its dual have 12 different syllables.
In fact, 1,700 of them are so.
If Rudrata had only known them,
he would get to use only one syllable.
Wouldn't have described much of
a knight's tour, so he did everything,
but so it turned out that there
are two different knight's tours.
This one and another one that
both can be read in that way.
And so nobody really knows what his
original knight's tour was, and
this commentator 300 years
later however was evidently
preserving a tradition that had
been handed down separately.
And we don't have any
printed evidence of it, but
it turned out that the same knight's
story showed up several times later
in different parts of India, so
the word must have gotten around.
Okay, so
that's the story of the very first one.
But Ratnakara had a better idea.
He said instead of giving one sloka
that you read in both ways, and
so you only get a chance to use four
syllables, I'm gonna do two slokas.
I'm gonna write two poems,
and each one is a poem.
But if you read the second poem
in the order of the first poem,
then you've got a nice tour.
So here's an example in English
of what Ratnakara did, okay?
Zoom out a little bit.
Can you see this all right?
Now, okay, so now, okay,
back to my thing here,
okay, so 1, 2, 3, 4.
Watch each word here,
I think that's what I do here.
So [COUGH] are you ready for this?
Have some fun, watch this or
that word, great for
lies take out each gives eight its own.
Okay, so here we go,
1, 2, 3, 4, 1, 2, 3, 4.
Watch each word here.
Watch each,
each word here.
Or take some left steps and move eight,
or take some left steps, left steps.
Some left steps and
move eight, and
move eight, okay.
Just right gives this
black rook great fun,
just right gives this
black rook great fun.
Yep, I haven't used fun yet.
Then have lines make
out that white knight,
then have lines make
out that white knight.
On three, there we go.
So you can make two poems, each one is
input, so that's Ratnakara, and
modern Sanskrit scholars frown on this.
The reason that there hasn't been a great
deal of scholarship about this is because
they look at this poem, they say well, it
doesn't have much character development.
>> [LAUGH]
>> They don't understand what the beauty
of wordplay and
how clever it was to to do that.
So it's gonna take a new generation,
21st century historians to go through and
find out the other story helped her.
Ratnakara's idea was used
also by other people,
by other Sanskrit authors later.
And so, I'll give you a couple, but first,
let me show you the source
of Ratnakara here.
I found this in the library at Oxford,
they have a wonderful Indian Institute
collection of things there.
And of course, this page, I could read,
the next page, a little harder.
But the first thing you learn
in Sanskrit is the numerals.
So this is 22, you can see the 22 there.
Okay, no prob, and then there's 1890,
so that's when it's published.
This is 1890, you gotta get used to,
the 0 is okay, but
the 9 is a little strange, and the 8, wow.
But those notes you got really easy
because every page is numbered.
So immediately, you know what one,
two, three, four, five, and so on.
So then, here's the source
where those two slokas are.
These two lines are the first sloka,
it's number 145,
and these two lines are the second sloka.
And then here's commentary by
somebody else explaining them.
So here I'll show you
blown up what happened.
This was what was on that screen.
And if we rearrange the 32 syllables
in the grid, this is what we find,
and it's not quite a perfect match.
Call this 1, 2, 3, 4, 5, up to 32, and
this would be 26, 11, 24.
But 5 and
20 don't match the 5 and 20 here.
Now, that's either because of a copying
mistake or because of poetic license.
But the other 32 definitely
match perfectly,
and when somebody's copying this thing and
doesn't have a clue about chess and so on.
It's easy to see that if you have
to go through a noisy channel,
then some of these syllables will get
corrupted over a period of 1,200 years.
All right, so I jump another 200 years.
This is King Bhoja, about 1050,
and he has a word called [FOREIGN].
And this document is now
online from Oxford, and
there are three editions of this
that I found in the library,
this is from the 1880s.
And I chose this one mostly because it
has the nicest picture on the cover.
And then here's a sloka and
another one that
gives a knight's tour by Ratnakara's way,
but
the knight's tour it
gives is Rudrata's tour.
That's why I say it's known that Rudrata's
tour must have been passed around by some
other channel.
And similarly, here's a work from 1313.
This is by Desika.
And I am showing here the Tamil version,
Of his poem,
the very famous poem [FOREIGN].
It's a poem about
the sandals of Lord Rama.
And there's a cult that recites
this poem every year and
makes a pilgrimage and so on.
In this particular one
the poems are given here and
then there's commentary in Tamil
explaining that this is a nice tour.
Again the same tour as [FOREIGN] had.
Okay now I got one more chapter of
the Sanskrit story to show you.
And this one is something
that I found that's
actually digitized on
the Internet Archive.
And it is the Manasollasa
of King Somesvara,
the refresher entertainer of the mind.
And King Somesvara ruled from
1127 to 1138 in Karnataka and
he probably wrote this
early in his reign because
later on he was involved with wars and
stuff.
But he was a very clever guy and
he wrote this.
Quite a lot of interesting literature and
and
this is volume three of kind
of an encyclopedic work,
Of entertainments, For intellectuals.
And volume one and two were
translated long before volume three.
Volume three gets into stuff that
the translators have a lot of trouble with
like Chess.
And he had brand new idea for
how to describe a knight's tour.
And in fact he's the only one,
Who gave eight
by eight doors instead of four by eight
tours instead of four by eight tours.
So here in India we have,
actually his tour,
I believe, Gives the third knight's
tour on an eight by eight board.
The other two are coming from
the Persian side of the things.
And so,
His idea in it in the Mansollasa is,
To give an eight by eight array for
the chessboard.
And here, I've given an English
version of, How that would work.
So each row, you give a consonant.
And each column, you give a vowel.
For example and bah, bay,
bee, boe, boo, buh, bai, bao.
Dah, day, dee, doe doo, duh, dai, dao.
Etc, through sah, say,
see, soe, soo, suh, sao.
Boy, this is a tongue twister.
Okay, Now he says,
if you wanna remember a knight's tour and
impress your friends all you have
to do is memorize a nonsense verse.
>> [LAUGH]
>> And it's pretty easy.
The way the human brain works,
you can do that.
So all you have to do is
Sah nee soo nai lao fai
bao duh foe boo dee bah fay lah nay soe.
And you can learn that.
>> [LAUGH]
>> And so you can go jot down, and
write your write out your knight's tour.
So in Sanskrit I got the pages somewhere
to show you,
What it looked like, somewhere.
Manasollasa.
I vowed that I was gonna keep
these pages straight and
be very systematic about how I did it.
Anyway, It's in there.
>> [LAUGH]
>> It's an eight by eight grid for
using Sanskrit consonants and
Sanskrit vowels, of course.
Okay, so
that's the story about way back when,
How Hamiltonian paths
were enjoyed by people
who lived way a long time before Hamilton.
And there's a continuous history,
then through medieval times and so on.
In India there is a knight's tour
from the 18th century that shows
interest in symmetry.
Things that are 32 moves apart are along
the board and things like that.
So I really believe we
can justly call this,
The earliest graph theory problem, for
sure, Known to human civilization.
It's the root of things.
And people trace graph theory back to
Konigsburg bridge problem in 18th century.
This problem has a, Much longer pedigree.
And I believe this is just
the first time the story,
part of the story is told, and
when people start looking,
More at these sources then we'll find
out a lot more about what what went on.
Okay, thanks for listening.
>> [APPLAUSE]
>> Any questions?
Hi.
>> Does Sanskrit Japanese?
>> What now?
>> Does Sanskrit and all these
different languages and the connection?
The Sanskrit language,
is there a connection with Japanese?
>> Okay, is there a connection
between Sanskrit and Japanese?
>> Computer languages
should always be English.
Do you think computer languages
should only be in English or
do you think that it's
connected to [INAUDIBLE]?
>> There are nuances in other
languages that you can't get.
And conversely there
are things I can say in
English that people can't say well
in French and Japanese and whatever.
A lot of the languages that seem to
thrive on the ambiguities that they have.
A lot of beauty comes in
not being precise too.
So, a computer language,
when you're talking to a computer,
You wanna know what you're saying
because the computer might blow up.
>> [LAUGH]
>> But you know but
natural languages take advantage,
Of ambiguity, In order to say
things that are hard to say.
I don't like to say that one
language is superior to another.
And it's really hard to,
however, of course,
I know that I'm limited because
I can pattern match pretty much.
But then it's fun to work with friends.
I can find something and and
point them to that page and
say now tell me about this page.
It's fun for me to learn enough about it.
To get the idea.
But it takes scholars and
other people to interpret it,
even in English to properly
understand Chaucer and
Beowulf, and things like that.
Those are different days.
It's even hard to understand
things from the 90s.
>> [LAUGH]
>> [LAUGH]
>> Given your success with the 3D printed
object, what requests are you gonna
put into your next published guide?
>> [LAUGH]
>> I got an idea, but-
Actually there's something I describe in
Volume Three which I think
is the earliest object.
The earliest example of
a calculation that would take more
than one microsecond on a modern computer.
So there's a cuneiform tablet
that's in the Louvre museum.
And the author is Inakibit-Anu,
and I like the name Inakibit.
Somehow, it sounds computery.
>> [LAUGH]
>> But he computed a table of reciprocals
in 20 point base 60 arithmetic,
and I talk a little bit about it.
I wrote a paper about ancient
Babylonian algorithms.
But anyway,
in order to do that calculation with
the primitive things
available at that time, and
then to present these
reciprocals in sorted order,
which was a major task even today if I
had a typewriter or something like that.
So this tablet, I think somehow would take
a modern computer more
than a microsecond to do,
and it dates from above 300 AD.
So it would be,
I think a computer scientists would
like to have one of these on his shelf.
[LAUGH] And it's AD 65,
I forget the number [LAUGH] but
that would be a nice
thing to have 3D printed.
It's a big one, though.
[LAUGH]
>> [LAUGH]
>> It's about so big, so big.
>> So are you sure these shlokas.
>> Shloka, yeah.
>> The shlokas the nice [INAUDIBLE].
What do you think the motivation
would have been, was it just to
kind of have that [INAUDIBLE]
>> What was the motivation?
>> Yeah.
>> Well, I think it's pretty
clear that people like Rick and
Rhett they were showing
off their brilliance.
Yeah, they were competing
against each other.
I can do a much more clever poem than you.
And if you look at this,
they aren't only doing knight's tours,
they're telling a story about battles, but
they also have pictures of weapons and
things like that.
And so knight's tour was only one
of the arrows in their quiver.
And that was also their job,
in other words, the best poet gets tenure.
>> [LAUGH]
>> Way in the back.
>> Some modern tabletop games use these,
I guess [INAUDIBLE] the basis is.
>> I'm sorry, I can't hear you.
>> So modern tabletop games.
>> Modern what?
>> Modern tabletop board games.
>> Modern tabletop board games.
>> Use these 20-sided dice with
adjacent faces to count from 1 to 20.
And what were these ancient,
as opposed to-
>> What was these?
What was these things used for
[CROSSTALK] nobody knows for sure.
There's no contemporary
literature that says much,
although there's one text that seems
to say you choose a letter by lot.
And so
that might refer to having some kind of
a way to roll something and
get a Greek letter.
And that's in a document
that described divination.
So it's something analogous to
the I Ching in China where you have,
in China, they have ways of rolling,
of taking sticks and
getting a hexagram, a pattern of
six zeros and ones essentially.
And then you can look up one of the 64
hexagrams, and then that suggests
a concept on which you can meditate.
Or you can say, what's the answer
to my problem and then you,
a little bit like a ouija board,
or something like this.
So it's possible that it was used for
some kind of divination, but
it's also possible, as you say,
we use in a board game.
And whatever it is,
it was hard enough to make an icosahedron.
They like it there,
some of these the museums usually
classified as probably dice,
because sometimes
there's an example where
there will be a cube and
a dodecahedron and an icosahedron,
all in the same material and
in similar style.
And so a different number of faces and so
that you somehow went together with a cube
and the cube looks more like a dice to me.
But it's completely unknown,
and it might have had
some religious rituals associated with it,
who knows.
Yep?
>> [INAUDIBLE] in adjacent faces it's good
for accounting, but
if it's used as a dice randomly,
then you might not want adjacent faces,
because it is weighted [CROSSTALK]
>> Take our normal dice, it doesn't
follow Hamiltonian path, you want the one
and the six are opposite side and
the first four in the three are opposites
side of the three and four are definitely
non-adjacent according to-
>> [INAUDIBLE]
>> Yeah, right.
And so the fact that it had this pattern.
I don't know,
there's this undescribable pleasure
that you get by going from
triangle to triangle.
It might or it might not be a coincidence.
So I think it's probably
not a coincidence,
because a large percentage
of them have this property.
Thanks a lot, Merry Christmas to all.
>> [APPLAUSE]
