
> it's kind of evident that writing clearly wasn't in Knuth's DNA just by reading his famous books
— my experience, from reading (parts of) several of Knuth's books and papers, is the very opposite: Knuth is one of the finest writers, and writing is clearly in Knuth's DNA — even among the many hats he has worn (mathematician, programmer, computer scientist, teacher), at heart of everything is writing. (His Selected Papers on Fun and Games includes some stuff he wrote in high school and college; even those show his spirit.)
IMO, every page of his is a delight to read. I think the issue for those who find it otherwise may be that he writes in a very personal way (his personality shines through), and for those who are looking for something bland or generic, this can be a surprise.
Then again, this may be one of the chief problems with literate programming in general (why it works so well with one author, and doesn't seem to have had much success with a large team): writing is very personal, and for many-person codebases something "generic" may in fact work better.
You're missing out on some of the best writing on any topic!
Not all Knuth's books are the same: The Art of Computer Programming (TAOCP) is his mangum opus, an ever-expanding encyclopedic knowledge fire-hose of various computer science topics. But the series of books that are simply "collected papers" makes it easy to focus on something much narrower. For impractical, you may want to start from Selected Papers on Fun and Games.
And then he has books like Surreal Numbers, which is written as a story of a couple discovering mathematical notation and deriving a whole system...
I guess we'd not know without asking him, but having waded through much of TAOCP, Concrete Mathematics (a book filled to the brim with the kind of delightful discovery of pattern that Lockhart describes as optimal in learning math), Knuth's marvelously playful book "Selected Papers on Fun and Games"[2], and the novel he wrote about Conway's astonishing "Surreal Numbers"[3]...listening to him lecture on "importunate permutation" at the last local (SF) Joint Meeting of the American Mathematical Association, hearing about Knuth's thoughts on the mathematics of pipe organs, and even seeing the play/pattern-making that went into the entrance mosaic in his home [1]....I think you're way off base about what you think Knuth thinks about math education.
Lockhart: "...if I had to design a mechanism for the express purpose of destroying a child’s natural curiosity and love of pattern-making, I couldn’t possibly do as good a job as is currently being done— I simply wouldn’t have the imagination to come up with the kind of senseless, soulcrushing ideas that constitute contemporary mathematics education."
Knuth [Preface to Concrete Mathematics]: "Some people think that mathematics is serious business that must always be cold and dry; but we think mathematics is fun, and we aren't ashamed to admit the fact. Why should a strict boundary line be drawn between work and play? Concrete mathematics is full of appealing patterns; the manipulations are not always easy, but the answers can be astonishingly attractive."
I make an annual pilgrimage to Palo Alto for Knuth's Christmas Tree lecture[4], which content continuously emphasizes exactly the kind of joy in experimenting, discovering, and learning real math that Lockhart is talking about in his paper.
Everything I know about Don Knuth speaks to his amazing playfulness and joy in pattern finding and making - a delight in the music of math...and a denial of the value of making sure everyone's labeled their axes and memorized their circle of fifths.
[1]: https://www.youtube.com/watch?v=v678Em6qyzk
[2]: http://www-cs-faculty.stanford.edu/~uno/fg.html
The preface states "I've never been able to see any boundary between scientific research and game-playing. ... The topics treated here were often inspired by patterns that are visually compelling, or by paradoxical truths that are logically compelling, or by combinations of numbers and/or symbols that fit together just right. These were papers that I couldn't not write.
I believe that the creation of a great puzzle or a great pattern is a scholarly achievement of great merit, an important contribution to world culture, even though the author of such a breakthrough is often an amateur who has no academic credentials. Therefore I'm proud to follow in the footsteps of the pioneers who have come up with significant new “mind-benders” as civilization developed.
Many years ago I wrote an essay that asked “Are toy problems useful?” [reprinted as Chapter 10 in Selected Papers on Computer Science] in which I discussed at some length my view that students are best served by teachers who present them with well-chosen recreational problems. And I've carried on in the same vein ever since, most recently on pages 7--9 of The Art of Computer Programming, Volume 4A, in a section entitled “Puzzles versus the real world.”
[3]: http://www-cs-faculty.stanford.edu/~uno/sn.html
Surreal Numbers: "How two ex-students turned on to pure mathematics and found total happiness" - In 1973 during a week of relaxation in Oslo, Knuth wrote an introduction to Conway's method in the form of a novelette. ... I believe it is the only time a major mathematical discovery has been published first in a work of fiction. ... The book's primary aim, Knuth explains in a postscript, is not so much to teach Conway's theory as ``to teach how one might go about developing such a theory.'' He continues: ``Therefore, as the two characters in this book gradually explore and build up Conway's number system, I have recorded their false starts and frustrations as well as their good ideas. I wanted to give a reasonably faithful portrayal of the important principles, techniques, joys, passions, and philosophy of mathematics, so I wrote the story as I was actually doing the research myself.'' ... It is an astonishing feat of legerdemain. An empty hat rests on a table made of a few axioms of standard set theory. Conway waves two simple rules in the air, then reaches into almost nothing and pulls out an infinitely rich tapestry of numbers that form a real and closed field. Every real number is surrounded by a host of new numbers that lie closer to it than any other ``real'' value does. The system is truly ``surreal.''
The appendix (written for the book in 2011) points out an earlier (1962) 1.5-page paper π in Four 4's by J. H. Conway and M. J. T. Guy, written when they were students at Cambridge, that has a similar idea: https://archive.org/details/eureka-25/page/18/mode/1up?view=...
For example,
5 = ⌊√√√√√(4!)!⌋
because 24! lies between 5^{32} and 6^{32}.I was certain he wrote the article about MOO and/or bulls and cows, but it seems like I remember wrong.
> The computer as Master Mind. Journal of Recreational Mathematics 9 (1976), pp. 1–6. Reprinted with an addendum as Chapter 25 of Selected Papers on Fun and Games.
https://www.cs.uni.edu/~wallingf/teaching/cs3530/resources/k... is the original paper, but the addendum in the 2011 book is 5 pages long, longer than the original article itself (not counting its figure/table), and discusses various later results/ideas. For example, the addendum mentions that while Knuth's approach only minimizes the worst-case number of guesses (5, with 4.4753 on average), we can try to also minimize the expected number of guesses: I don't want to quote at length, but see https://stackoverflow.com/a/54917672 and the discussion on the German Wikipedia https://de.wikipedia.org/w/index.php?title=Mastermind_(Spiel....
In this post however, it looks like
• the scoring function is wrong, as pointed out in comment here by danbruc,
• the code in the post simply guesses at random ("It only randomly selects its next guess from a pool of possible remaining guessing"), while Knuth's approach is of "choosing at every stage a test pattern that minimizes the maximum number of remaining possibilities over all conceivable responses by the codemaker". (In fact if you run the program in the post, it takes 6 guesses to win!)
