
Current draft of The Art of Computer Programming pre-fascicle 6a [ps] - taeric
http://www-cs-faculty.stanford.edu/~uno/fasc6a.ps.gz
======
a3n
If you don't want to DL the .gz just yet, and just want to read _about_ it,
see here: [http://www-cs-faculty.stanford.edu/~uno/news.html](http://www-cs-
faculty.stanford.edu/~uno/news.html)

Side note: I've always thought Knuth looks delightfully like a resident of
Whoville. [https://s-media-cache-
ak0.pinimg.com/236x/45/16/e3/4516e3256...](https://s-media-cache-
ak0.pinimg.com/236x/45/16/e3/4516e3256d744ca4cff19402da907d75.jpg)

------
codeshaman
If this is art then I'll have to admit - after 20 years of learning and
practicing programming, I'm still a mechanic (or craftsman), not an artist.

I will not be able to read and understand this book fully and I probably won't
even try, unless I'm locked in a cell with it.

Although I've helped build software used by millions, what I did was stitch
together things that are too brilliant (or insane) for me to fully understand.
And I assume that most of my colleagues did the same.

There are pylons of brilliance on the shoulders of which everyone builds, and
Knuth must be one of the strongest.

Thank you Mr Knuth for holding so much weight on your shoulders.

~~~
ht_th
Everyone with a good computer science education should be able to digest his
books. I know that around here college education is often derided as outdated,
impractical, too costly (which is a USA-ian problem), or outright irrelevant,
but what Knuth writes about ain't rocket science yet important for many a
programmer to understand. He writes in a quite readable style about the
fundamentals of programming and computer science theory that's relevant to
that programming. I know most programmers mostly glue together prefab
components into working systems that successfully serve millions, but if one
wants to go beyond the surface, to ask why it all works the way it does, a
good computer science education is an advantage.

~~~
anthony_d
I like your sentiment, but your "good computer science education" sounds a lot
like a "true scotsman". A lot of the people I work with have BS's in CS and a
lot don't. I haven't seen any correlation between a real in depth
understanding of computer science and a CS degree.

I agree programmers should be able to read and understand Knuth's books, but I
don't think a CS degree is preparation. Would you think someone needs a CS
degree if they already have a good understanding of the books?

My complaint with college is that it seems to be mostly fluff. If you show up
and pay the bills then you'll get your degree.

~~~
RogerL
Define 'need'. In college I learned, besides all the normal CS stuff:

* writing * accounting * organizational psychology * small amounts of business stuff * lots of EE, digital and analog * how to read and write research papers * how to research * how to prove theorems (important if you are inventing your own) * linear algebra, calculus, stats and probability, discrete algebra * physics I-III, plus 1 semester of experimental physics * chemistry (I,II, no organic) * a bit of philosophy * circuit design * numerical computation

It would be a Herculean task to take all that up in your spare time to the
level I did at school (I still learn on my own time, so you have to catch up
not just with what I did at school, but everything afterwards). It's 4+ years
of opportunity to bump against really good minds. I went to professors and
said "I want to learn x". (think of the course catalog as a suggestion!) That
got me, among other things a co-authorship with a professor on an academic
book. All of that has been relevant to my career except for the chemistry.
Even with that, my first job could have used it if I had stuck around more,
and it is useful to know if you want to be scientifically literate.

Or, you know, you can punch your time cards, do the bare minimum, and graduate
with a pretty useless certificate.

College as voc tech to learn to manipulate the LAMP stack is probably a poor
choice of time. If you want to be able to take a job to compute cancer
statistics, program robots, build digital interface cards, perform computer
vision, simulate the ocean, write aircraft wing simulations, model and
research traffic flow, work on medical devices, you almost certainly need more
then votech and/or self learning, IMO. I've done most in that list
professionally, and friends of mine have done the rest (no rockets in that
list, but I was offered a job to do that, turned it down).

There are multiple paths to life, but the chance to just think and learn for
awhile is pretty incredible if you can afford it.

~~~
rmk
This. You realise the value of the time you pissed away only when it's too
late. Unfortunately, college coincides with the most callow years of your
life, when you scarcely know the value of time, or the opportunity you are
about to squander. Sigh...

~~~
PhantomGremlin
_college coincides with the most callow years of your life, when you scarcely
know the value of time, or the opportunity you are about to squander_

THIS IS THE BEST COMMENT YOU WILL READ TODAY, IF NOT THIS WEEK!!!!

Sorry for the all caps, but "truer words were never spoken".

So, anyone reading this who hasn't gone to college or who hasn't yet
graduated, heed those words.

You will thank the poster perhaps 30 years later.

~~~
dwmtm
“I see it all perfectly; there are two possible situations — one can either do
this or that. My honest opinion and my friendly advice is this: do it or do
not do it — you will regret both.” ― Søren Kierkegaard, Either/Or: A Fragment
of Life

Thus, follow your heart- dwell not on what you did, nor on what you do, but
listen to what you need. Long after, look back, and see, more clearly, what
you need now.

~~~
aaronem
I won't say you're wrong, but I still think I'd rather regret having gone to
school than, as I do now, regret having not gone; not that I haven't done
rather well for myself, so much as that I'd have liked to do more -- I've
learned from experience that the ancestor comment, about how much you have to
make up, to be absolutely true; however autodidactic you happen to be, there's
a lot of value in the distilled knowledge university courses can provide, and
only so many hours in a day -- and days in a lifetime -- besides.

------
bkcooper
_Chapter 7 will eventually fill at least four volumes . . . assuming that I 'm
able to remain healthy._

Apparently TAOCP has a lot in common with the Wheel of Time.

I have a ton of respect for these huge, decades-long, life-defining projects
and the people who undertake them (Robert Caro's LBJ biography is another
example.) So the end of this project always receding further into the distance
makes me wistful, even if the quality of what gets put out is still excellent.

~~~
thret
"You can have a sneak preview... As usual, rewards will be given to whoever is
first to find and report errors or to make valuable suggestions."

If you want to frame one of those cheques, get in fast.

~~~
Tomte
You don't get cheques, anymore. Only certificates from his fantasy bank.

------
japhyr
I just picked up my father's old copy of vol. 1, _Fundamental Algorithms_.
It's amazing that a book published in 1973 (second edition) can still be worth
studying. I'd like to work from the copy I have, largely for sentimental
reasons. My father passed away a few years ago, and it feels really good to
work from the same book he studied decades ago.

Is it reasonable to study the second edition, or should I buy a copy of the
third edition? I've been a hobbyist programmer for 20+ years, and I'd like to
strengthen my understanding of basic data structures.

~~~
leephillips
Knuth is a mathematician, and these are, mainly, books discussing mathematical
results. Math is eternal - only the notation changes. You can, and, until
recently, many did, learn geometry directly from Euclid.

~~~
wslh
Indeed he would need to change the books if there is a breakthrough in some of
the algorithm areas described, but TAO is an excellent way to "quicky" move to
the state of art in many areas.

------
lambda
For anyone curious, this section is on SAT solving. It's section 7.2.2.2 of
TAOCP, and is over 300 pages long. Pretty thorough for a section of backtrack,
within a section on generating all possibilities, within a full chapter on
combinatorial searching.

~~~
Danltn
For what it's worth, I went to a presentation by Knuth on this exact section
with a SAT expert who frequently commented how (for the presentation at
least), significant amounts of relevant material had not been mentioned, and
some techniques introduced were not particularly close to the state of the
art, or good for educational purposes.

What I'm saying is that there's plenty of literature on SAT Solving already,
and some of it is probably better.

~~~
taosat
Could you convince this SAT expert to review Knuth's fascicle and send his
comments to Knuth? or blog about it for everyone's benefit?

------
sytelus
I'm wondering if someone should be starting a new generation of TAOCP as wiki.
As wonderful as TAOCP is, frankly, first volumes are bit outdated. Many
problems that were mentioned opened have had huge progress and many new fields
have opened up since their publications. Several Level 50 problems are now
being taught in CS Masters or some even Bachelor levels. Besides I really find
MIX too arcane and getting in the way. In a way, it's kind of disturbing that
we still fall back on ~40 years old material for the field as fast moving as
Computer Science. Sure, much of the CS is timeless but we are ignoring so much
progress and growth in fields such as Computational Geometry, Number Theory,
Cryptography, Semi-Numeral algos and so on. Also, even if Knuth manages to
complete all of his planned volumes, it would still have scratched only tip of
the tip of a iceberg. Of course, some of material will start becoming stale
pretty much as soon as it was created. Currently Wikipedia is not a great
option to create such writing because it doesn't allow content in "teaching
style" or things like creating exercise. If we can distribute this effort out
with editor that can approximate Knuth's meticulousness, it could be great
boon for our field. Knuth as an original flame bearer could be a great person
himself to start such an effort.

~~~
jcoffland
Technology is fast moving. Computer Science, the real kind, moves slowly.
TAOCP is still extremely relevant and MIX is cool, IMHO.

------
ElliotH
For Windows users the incantation to get a version with fonts that aren't
great but readable is this:

gswin64 -sDEVICE=pdfwrite -o fasc6a.pdf fasc6a.ps

You can get ghostscript here:
[http://www.ghostscript.com/download/gsdnld.html](http://www.ghostscript.com/download/gsdnld.html)
and you will need it on your path.

If you want nicer fonts you can download your preferred latex distribution
(miktex is easy to install but big) and your preferred perl distribution
(ActivePerl maybe). Then you can run pkfix (which you may need to install) on
the ps file like this:

pkfix fasc6a.ps fasc6a-pkfix.ps

Finally you can run

gswin64 -sDEVICE=pdfwrite -o fasc6a-pkfix.pdf fasc6a-pkfix.ps

Which will give you a pretty nice pdf.

------
nmrm
There's some speculation about where the next breakthroughs will come from at
the end of the chapter; it will be interesting to look back in 10-20 years and
see if Knuth was correct.

~~~
taosat
A surprising tidbit: Knuth believes that P=NP is true, but the algorithm to
solve NP is unknowable - footnote on page 1 (pdf page 9).

Proponents of RSA, DHE crypto - take note.

~~~
michaelsbradley
I too saw this footnote near the beginning (page 9):

“At the present time very few people believe that P=NP. In other words, almost
everybody who has studied the subject thinks that satisfiability cannot be
decided in polynomial time. The author of this book, however, suspects that
N^O(1)-step algorithms do exist, yet that they’re unknowable. Almost all
polynomial time algorithms are so complicated that they lie beyond human
comprehension, and could never be programmed for an actual computer in the
real world. Existence is different from embodiment.”

But would the existence of such "step algorithms" be fully equivalent to P=NP
or a limited case applicable to only a subset of NP problems (i.e. one's
thought previously to be NP)?

I don't know the answer and am genuinely curious.

~~~
sdenton4
I read that not as 'step algorithms' but as 'algorithms requiring N^(O(1))
steps'; in other words - polynomial time algorithms.

One way to think of this is in terms of galactic algorithms, which are
algorithms that incrementally improve the exponent in a polynomial time
algorithm, but have constant terms so huge that they're effectively useless,
practically. He's suggesting that there could exist a polynomial time
algorithm for an NP problem which is similarly useless - but with the
additional caveat that we won't even be able to prove theorems about it!

------
bluecalm
>>These so-called "SAT solvers" are able to handle industrial-strength
problems, involving millions of variables, with relative ease, andthey've had
a profound impact on many areas of research such as computer-aided
verification.

I would be very interested in hearing of industrial/practical applications of
those. Anyone with some experience?

~~~
ufo
One neat example that comes to my mind is how some package managers use SAT
solvers to resolve package conversioning conflicts.

I would say that SAT solvers (or SMT solvers, depending on the problem domain)
are applicable to almost any kind of problem where the first thing that comes
to your mind is implementing a brute-force search using backtracking. SAT
solvers implement lots of tricks that are likely to leave naive backtracking
algorithms in the dirt (knuth's chapter covers lots of them)

One silly example I like is the time I used a SAT solver to find the solutions
for a little Flash puzzle game.

[https://github.com/hugomg/hexiom](https://github.com/hugomg/hexiom)

My favorite part is how I could add some symmetry-breaking predicates to
greatly speed up the solver on highly symmetrical problem instances. Those
instances are very hard for hand-written algorithms and a SAT solver let me
work around the symmetry problems in a highly declarative manner.

------
crb002
Much SAT. Such generating function.

Algorithm W on page 79 (WalkSAT) is the workhorse.

Lemma L and Algorithm M page 82 were my favorites.

------
kzhahou
Does Knuth have a protege, helping him today, and to carry on the task should
it take decades still?

Also, is there a condensed version of his work that preserves the spirit and
rigor?

~~~
xentronium
> Also, is there a condensed version of his work that preserves the spirit and
> rigor?

I am not sure if this is useful for you, but Sedgewick's and Cormen's books
are among more digestible alternatives.

~~~
kzhahou
Thanks! I've read Cormen, but not Sedgewick.

------
clw8
I've been holding off on reading TAOCP because of the modernized assembly
language promised for the next version -- is this at all justified?

~~~
mpu
Nope, except for the fun, the assembly part does not add much to the matter.
The essence is how to design, describe and analyze algorithms, so it is
largely orthogonal to the language you use.

~~~
taeric
It is actually a little humbling to see just how well written and understood
some assembly can be. In particular, the section simulating elevators is
clearer than many high level examples I have seen of similar complexity.

------
zatatto
Anyone's got PDF? I can't open this .gz.ps file.

~~~
dunham
I'm reluctant to post a PDF because of the copyright, but I'd recommend
running the ps file through "pkfix" before converting to PDF. (This will
replace the bitmap fonts with outline fonts.)

~~~
zatatto
i wish i knew how to do that

------
couchand
Thanks dang et al for fixing the title so quickly!

------
spewbot
524 exercises

------
lallysingh
ps.gz? It's 2015!

~~~
bshimmin
One click to download, two double-clicks (one for the gzip, one for the PS) to
open on my Mac.

~~~
ExpiredLink
[http://view.samurajdata.se/](http://view.samurajdata.se/)

~~~
JetSpiegel
[http://view.samurajdata.se/psview.php?id=1778783f&page=1](http://view.samurajdata.se/psview.php?id=1778783f&page=1)

