MathOverflow is a question and answer site for professional mathematicians. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This is a big-list community question, so I'm sorry in advance if it is deemed too soft but I haven't seen anything similar yet.

I've seen computer scienctists post questions looking to learn things from pure maths. This is basically the other way around... My ignorance may prevent me from being as specific as I think I would like to be and so I have separated my main question into two.

What good books - readable introductions - are there for mathematicians to learn about computer science?

By this I really mean the science of how computers work. There are perhaps some books out there which are written in a style which mathematicians can relate to - e.g. not practicality-focussed, starting from the more abstract fundamentals and building up (I may be wrong but I'm under the impression that a lot of books in other disciplines shy away from presenting things this way around, whereas mathematicians (for better or worse) are accustomed to it). Partly to illustrate what the first question is not asking, the second question is

What good books - readable introductions - are there for mathematicians looking to learn about theoretical computer science, as it is as a subfield of maths?

Here is where my ignorance prevents me from explaining the question any more because I can only assume these two aren't the same thing...

It seems quite frustrating that I have made it to grad school and know very little about computers and theoretical CS.

Standard "one recommendation per post" is probably appropriate, + a few sentences about what the books did for you. Also, maybe I should say that I'm not looking to ditch my current interests and become a computer scientist, so things being readable is a fairly strong condition. I'm not looking to become an expert, just to deal with my own ignorance. Thanks in advance.

share|cite|improve this question
I'm not sure I understand the first question. Is it about software or hardware? – Qiaochu Yuan Jan 5 '11 at 17:02
I don't want to sidetrack the discussion too much, but: is it clear that the best CS books for mathematicians would be any different from the best CS books for CS people? By contrast, I well understand the need for physics-for-mathematicians books, because math as viewed and practiced by physicists is not a subset of math as viewed and practiced by mathematicians. But is this the case for CS? [Not rhetorical questions. By the way, I don't know much CS myself and am looking forward to the answers.] – Pete L. Clark Jan 5 '11 at 17:06
Knuth's TAOCP are the best CS (not programming!) books for anyone. – Steve Huntsman Jan 5 '11 at 18:01
@Steve, hey there's a lot of assembler code in TAOCP, so certainly a very programming set of books ;-) – Suvrit Jan 5 '11 at 18:08
@Suvrit--What I mean is that while on the one hand "Teach Yourself Java" isn't a CS book so much as a programming book, TAOCP is more a CS book, and the reader shouldn't expect these to be the same. Moreover, books about computational complexity or category theory for CS are not the place to learn the basic elements of CS proper. Only after studying actual practical algorithms in some detail can a reader really gain the full benefit of the more abstract views of the subject. – Steve Huntsman Jan 5 '11 at 18:18

17 Answers 17

For the second question (theoretical computer science) I strongly recommend Sipser's Introduction to the Theory of Computation. It is a very easy read for someone with a math background, and requires essentially no specific previous knowledge. It is essentially a one-semester first course in the subject of computability and complexity theory. As such, you get all the nice classical results, but not the more recent results which are less complete, polished, or appealing to an outsider who just wants a "taste".

share|cite|improve this answer
Intro to Automata Theory, Languages, and Computation, Hopcroft, Ullman, Motwani is a good alternative. – Mitch Jan 5 '11 at 19:00

I'm surprised nobody has recommended Knuth's The Art of Computer Programming.

share|cite|improve this answer
You are? That's a mathematics book, having very little to do with computing, in my opinion. – Igor Rivin Jan 5 '11 at 18:28
@Igor: Theoretical Computer Science might as well be thought of as a part of mathematics. I don't find Knuth's books particularly useful for my mathematical work, but I used algorithms from Knuth's books literally hundreds of times in my programs. – Dmitri Pavlov Jan 5 '11 at 20:41
@Igor: Well, that's a different matter. I was responding to your statement that Knuth's work had "very little to do with computing". Just on the face of it, that's not true at all. I in fact teach an analysis of algorithms class. I use Cormen et al. And I also point out to my class that the very phrase "analysis of algorithms" was coined by Knuth in his preface to Volume 1. His work is fascinating, both for the wealth of information it contains, and also for the historical insights of someone who was "there at the time." – Carl Offner Jan 6 '11 at 22:28
@Igor: CLRS is meant for theorists, not programmers. For example, to learn linked lists from CLRS one needs to possess a very high level of programming culture. And a programmer with such a high level of programming culture almost certainly already knows linked lists. Knuth's books are much better in this respect, because they actually explain how to implement linked lists. And you wouldn't learn from CLRS that Fibanacci heaps are unsuitable for real programming, even though they have better asymptotics. No offense meant, but to claim that CLRS is "vastly superior" is simply ridiculous. – Dmitri Pavlov Jan 7 '11 at 0:22
@Igor: It might be the case that the phrase “the students appeared to have learned a lot” characterizes the situation much more accurately than you would like it to be. I really don't see any point in understanding how linked lists work if you cannot implement one yourself efficiently. For me it's much easier and faster to implement an algorithm myself than try to look it up in some library. Also, the implementations of standard algorithms such as linked lists or hash tables in languages like C++, Java, Python, or OCaml are simply way too slow. – Dmitri Pavlov Jan 15 '11 at 4:56

Abelson and Sussman's Structure and Interpretation of Computer Programs is a great introduction (but not a read-before-going-to-bed book, you must do the exercises. This comment applies no matter what book you are learning the subject from).

share|cite|improve this answer

"Computational Complexity"by Christos Papadimitriou - very good introduction to logic/theory of computation (Turing machines etc.) and computational complexity. One of the best textbooks IMHO.

share|cite|improve this answer
Very dense, though. – Daniel Litt Jan 6 '11 at 0:20

Theory A (Algorithms/Complexity):

  1. Kleinberg, Tardos - Algorithms
  2. Easley, Kleinberg - Networks Crowds and Markets
  3. Nisan, Tardos, Vazirani - Algorithmic Game Theory
  4. Arora, Barak - Computational Complexity: A Modern Approach

Theory B (Logic/Semantics/Automated Reasoning):

  1. Benjamin Pierce - Types and Programming Languages
  2. Benjamin Pierce - Software Foundations in Coq (Really lets you see how to translate theory into practice)
  3. The links here
  4. Harrison - Practical Logic and Automated Theorem Proving
share|cite|improve this answer
Basic Category Theory for Computer Scientists (Foundations of Computing) from Benjamin Pierce is probably a first read don't you think so? – Jérôme JEAN-CHARLES Jan 10 '11 at 3:40
I generally like Pierce's style but I wasn't a huge fan of BCTfCS. I think Awodey is a really good choice for a gentle introduction. – Justin Hilburn Jan 10 '11 at 23:34

If you want to know how computers work--really work, the the real world--and you have some basic understanding of logic design, so you know how elementary gates and latches are made, and some basic understanding of elementary CPU structure--ALUs, registers, sequencers and crontrollers--then I think the books by Patterson and Hennessy are tops: Computer Architectue, A Quantitative Approach and Computer Organization and Design: The Hardware/Software Interface. They're not terribly mathematical, but they show, structurally, how modern processors organize, process, and move data.

If you need the more basic stuff first, there are any number of good introductory texts.

On theoretical side, I would have to agree with John D. Cook that Knuth is the place to go. (He gives a link in his answer.) The theory in Knuth is illustrated in terms of realistic machine architecture--Knuth's MIX computer, for which simulators are available online if you want to try it out. The model in Knuth is very much a programmer's model--i.e., Von Neumann architecture, rather than Turing or state-machine based models such as utilized by most theoretical computer scientists, but they show how it really looks in practice. Furthermore, his books are quite sophisticated, mathematically, and certainly propose some problems which at the time of publication were definitely open and/or research level.

share|cite|improve this answer
Computer architecture (a la Patterson and Hennessey) as interesting and useful and having mathematical underpinnings and relevant to understanding motivations for TCS as it is, is in no way TCS and is not mathematics. – Mitch Jan 5 '11 at 19:30
@Mitch: The question was about CS in general, not just TCS. – Dmitri Pavlov Jan 5 '11 at 20:45
@Mitch: The OP asked, "By this I really mean the science of how computers work." This is not a purely theoretical issue, as evidenced by our participation in MO! – drbobmeister Jan 5 '11 at 21:50
Patterson and Hennessy's Computer Architecture, A Quantitative Approach is great for understanding how computers work. – Beren Sanders Jan 7 '11 at 0:03

I guess I've managed to take some of the path you want. My training was as a mathematician but over the last few years I've learnt a lot about theoretical computer science. (I've programmed for many years, but had limited awareness of the existence of theoretical computer science as a field in its own right.)

I mostly learnt from documents available on the web, of which there is no shortage. The exceptions were some parts of Boolos and Jeffrey for the theory of recursive functions and computability and Basic Category Theory for Computer Scientists to help with grasping some of the beautiful connections with category theory. (I know it says "for computer scientists" but I've never met a computer scientist who liked it. On the other hand, I found it very useful as a mathematician.) Years ago, Cormen et al. really opened my eyes to the kinds of non-obvious algorithms that exist and shouldn't be hard for a mathematician to read.

share|cite|improve this answer

For those who want to go from zero knowledge to substantial breadth quickly, I recommend A. K. Dewdney's The New Turing Omnibus. Once that book is finished, tackling some of the more sophisticated books like Knuth, Aho-Hopcroft-Ullman, and the like seems more reasonable. Further, the classic books will teach CS theory that is, well, classic, and will leave the reader ill-prepared (in my opinion) for the theoretical and technological developments of this millenium. The New Turing Omnibus will prepare the reader for classic CS theory, but will not impede those who wish to learn more recent theory.

The book has influenced my writing style. One project I am working on involves "moving a mountain one pebble at a time", and is inspired by the mountain of a book Dewdney has created.

Gerhard ""Ask Me About System Design" Paseman, 2011.01.05

share|cite|improve this answer

While I admire both The Art of Computer Programming and Structure and Interpretation of Computer Programs, I thought I'd mention two other books in answer to the first of your two questions.

J. Glenn Brookshear's Computer Science: An Overview, 10th ed. is intelligently organized and quite well written. It also has worthwhile chapter review problems and useful bibliographies at the end of each chapter.

David J. Eck's The Most Complex Machine: A Survey of Computers and Computing might be worth looking at. If I remember correctly, Eck received his PhD in mathematics from Brandeis University in 1980.

share|cite|improve this answer
I'd like to strongly second the recommendation of David Eck's Most Complex Machine. It is a great way for a mathematician to learn what CS is all about. David is not only a first-rate expositor, but he has one foot firmly in Math and the other just as firmly in CS; e.g., he is chair of the Dept. of math and CS at Hobart & Wm. Smith, and while his thesis "Gauge-natural Bundles and Generalized Gauge Theories" was very pure math, it was the first math thesis written in TeX---and in those days you had to be a programmer to use TeX. (And BTW, Eck also has a great book on how to program with Java.) – Dick Palais Jan 9 '11 at 20:12

Well, if you want to know how computers work, the authoritative reference on computer architecture happens to have been written by a set theorist!

John von Neumann. First Draft of a Report on the EDVAC University of Pennsylvania technical report (1945) 101pp.

Ah, the good old days: when logicians understood circuit design and computer scientists believed Rice's Theorem...

share|cite|improve this answer
Computer scientists don't believe Rice's theorem? – Qiaochu Yuan Jan 6 '11 at 19:56
Sort of a (bad) joke. There are entire conferences dedicated to approximating various decision procedures which Rice's Theorem shows cannot exist, under the name "static analysis". It's a thriving field (at least measured by volume of publications) with quite a lot of interest and activity, which is something I think would surprise the recursion theorists of the 30's-50's -- advances in computer hardware notwithstanding. – Adam Jan 7 '11 at 18:59
John von Neumann a set theorist?????????? – Igor Rivin Jan 9 '11 at 4:02
John von Neumann was pretty much an universalist. Whoever calls John von Neumann a something theorist is probably one himself. – darij grinberg Jan 9 '11 at 13:36
Igor, Darij, the topic of von Neumann's doctoral thesis was a novel axiomatization of set theory. – Adam Jan 9 '11 at 19:19

This question is meaningless if you don't specify the goal(s) you have in mind. Goals are teaching , using , understanding , linking .....
Some people like me think that Knuth is bad from a certain point of view: his writings are interesting, of high quality and contains precise and accurate facts yet it is "not functional" and it is misleading in a way.

As a mathematician try to read some of Wadler below. It is specific but may show you what computing is about. (see .

Computing is about neatly describing parts of the real world, it is not about encoding in zeroes and ones. This confusion is akin to someone saying he 'understood maths' when he has mastered calculus.

share|cite|improve this answer
"Not functional" = not in the spirit of functional programming, or not written with usability in mind? – darij grinberg Jan 9 '11 at 13:34
The second mainly but also in a sense of describing the world.I believe the first meaning (FP programming) is also concerned,but not knowledgeable enough to say so, In fact I'd be interested to know if FP think like this. Note also that I take Knuth as a serious( academically and intellectually), interesting person and mathematician too. – Jérôme JEAN-CHARLES Jan 10 '11 at 2:27

You could also be interested in the dragon book: "Compilers: principles, techniques, and tools", by Aho, Lam, Sethi and Ullman, which is considered a classic in computer science, from the angle of compilation theory and practice.

share|cite|improve this answer

Computer Networks by Andrew S. Tanenbaum is the ideal introduction to computer networks.  We used that book for a one-semester self-study,  distance education course in Computer Science at the UP Open University.

share|cite|improve this answer
The same author has written Structured Computer Operation, which is a very easy-to-read introduction to the actual mechanics of how computers work. It begins with boolean algebra and transistor-transistor logic, and moves step by step to high level programming languages like Java. This seems to be what Spencer was concerned about, perhaps more than learning how to program. I would have included a link, but I couldn't figure out how – David White Apr 12 '11 at 13:23
@David, +1 for sharing! :) Thank YOU! – user11235813 Apr 13 '11 at 2:54

Although it may not be comprehensive for your purposes, one book that's worth mentioning in this category is Modern Applied Algebra by Garrett Birkhoff and Thomas Bartee. It's mainly interesting because the theory it presents has a much more algebraic "flavor" than a typical Computer Science treatment of the same material. There doesn't seem to be a decent preview of the book online, so you may find this AMS review helpful.

share|cite|improve this answer

You don't give any indication of what types of CS you're interested in.

For algorithms, Knuth is classic but old-fashioned; CLRS is pretty standard now I think.

For a connection between CS and logic, you might start with "Proofs and Types" by JY Girard (it's online, )

Oded Goldreich ( has a few books online too. Lots of good stuff on his site, browse around. He has some complexity books and an old draft of his "Foundations of Cryptography" that you might like.

Quantum computation: Nielsen and Chuang, Quantum computation and quantum information

Hang out on some CS blogs, like Scott Aaronson's (which has quieted down lately...). Look at some of the papers ( and articles ( on his site.


share|cite|improve this answer

For your first question, you could have a look at The Elements of Computing Systems, by Nisan and Schocken. It covers the workings of a computer from logic gates, via the CPU to programming languages and the OS.

The website of the book is here; via the 'Study Plan' link you can even find most of the book online, and some presentations based on it - those could be useful to get a quick idea of whether the book is right for you.

share|cite|improve this answer

It's a subset of computer science, certainly, but on the networking front, W.R. Stephens' TCP/IP Illustrated, Vol. 1: The Protocols is a book that deserves a place on everybody's shelf. It's a very hands-on book, including the sources used to actually implement various parts of the TCP/IP stack (from a variety of Unix systems). It also has Fantastically useful diagrams, and makes extensive use of command-line tools to actually test the theory being discussed.

It is certainly the bible for understanding the theory and practice of TCP/IP networking.

share|cite|improve this answer
Despite being an element of the set "everybody", I rather doubt that this book belongs on my shelf... – Andy Putman Jan 6 '11 at 22:59
"Belongs" perhaps not, but it does deserve it. ;) – Kjell Wooding Jan 7 '11 at 1:46
I always thought that the Dodge Dart repair manual was very lucid, and yet I am not sure it belongs on every physicists' bookshelf... – Igor Rivin Jan 9 '11 at 4:05
Unless the physicist in question was asking about learning auto repair. Let me phrase the question backwards. If I were to ask "What is a good book for a computer scientist to learn about mathematics," would it make sense for someone to recommend Hardy & Wright to me? Number theory is a merely a subset of mathematics. Computer Networking is a subset of computer science, but greatly contributes to an understanding of software architectures - in particular layered design. This is the best book I know of for understanding this very significant component of "the science of how computers work." – Kjell Wooding Jan 11 '11 at 19:08
@Kjell: I was unnecessarily facetious. Networking is engineering, not science of any kind. Just as a civil engineer learns physics before he learns about bridges, so should someone start learning about computers from something much more abstract than the TCP stack. – Igor Rivin Jan 27 '11 at 5:28

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.