
Mathematics for Computer Science
by Eric Lehman, F Thomson Leighton, Albert R Meyer · first published 2017
70mentions
37recommended by
65HN commenters
2009–2025first – last mentioned
57% recommend38% neutral5% critical
Why HN recommends it
Free MIT text and course on discrete math, proofs, graph theory and probability, starting from first principles. Suits self-taught programmers and first-year students; it comes with lectures and homework.
Summarised by Claude from recommending comments
Affiliate links. As an Amazon Associate I earn from qualifying purchases.








"Concrete Mathematics" by Graham, Knuth and Patashnik is probably the best preparation for tackling TAoCP, though it is not light reading either. You could also look at "Mathematics for Computer Science" by Lehman, Leighton, and Meyer. It is available at http://courses.csail.mit.edu/6.042/fall10/mcs-ftl.pdf .
on “How The Art of Computer Programming was ruined for me” ↗The whole book is pretty fascinating, "Mathematics for Computer Science" by Lehman and Leighton: http://www.cs.princeton.edu/courses/archive/spring10/cos433/... The formula came from section 17.3.2, which goes into detail about how to derive it.
on “The Nth Fibonacci Number in O(log N)” ↗I think Mathematics for Computer Science Eric Lehman and Tom Leighton (http://www.cs.princeton.edu/courses/archive/spr10/cos433/mat...) is a great resource. It has the best explanation of induction I have seen - discrete maths books are normally…
on “Ask HN: Learn Math the Hard Way” ↗I also really enjoyed MIT's "Mathematics for Computer Science" by Lehman, Leighton & Meyer (http://courses.csail.mit.edu/6.042/spring18/mcs.pdf)
on “Computer Science textbooks that are freely available online” ↗1. Discrete Mathematics with Applications by Susanna S. Epp https://condor.depaul.edu/~sepp/DMwA4e.htm 2. Mathematics for Computer Science by by Eric Lehman, F Thomson Leighton, Albert R Meyer https://courses.csail.mit.edu/6.042/spring18/mcs.pdf
on “Ask HN: The book that did it for you in math and/or CS?” ↗…lectures, solved homeworks etc. I would start with going through those two first: Structure And Interpretation Of Computer Programs: http://ocw.mit.edu/courses/electrical-engineering-and-comput... Mathematics For Computer Science: http://ocw.mit.edu/courses/electrical-engineering-and-comput... The first one is pretty much a master class in software engineering, the other prepares you for studying algorithms, I would consider…
on “Ask HN: How to best acquire theoretical computer science knowledge?” ↗…forward and back. That being said, this book is good as a starting point that collects these topics together; I have not seen a similar book that does the same job. What's not getting enough attention as "mathematics for computer science" is category theory. Put very roughly: it gives you some very powerful formal patterns that will crop up in every computer science-related thing you do. This includes everything from theoretical computer…
on “Mathematics for Computer Science” ↗Just sharing another good book on the topic. Mathematics for Computation from MIT[1]. HN discussion on it[2]. [1]:https://courses.csail.mit.edu/6.042/spring17/mcs.pdf [2]:https://news.ycombinator.com/item?id=13800320
on “Mathematics and Computation [pdf]” ↗This is a good list of books. Unfortunately many of the links are broken? Probably just my luck, but the first few "with Sage" books I excitedly selected unfortunately 404'd. I'll send an email. > Moreover, the American Institute of Mathematics maintains a list of approved open-source textbooks. https://aimath.org/textbooks/approved-textbooks/ I also like the (free) Green Tea Press books: Think
on “Free and Open-Source Mathematics Textbooks” ↗…important parts of computer science. Here are the books that our university uses for first-year students combined with books that I found to be useful: Introduction to Programming (using Eiffel) [1] Mathematics for Computer Science (or: Discrete Mathematics) [2] Introduction to Datastructures and Algorithms [3] Introduction to Digital Design [4] Parallel Programming (using Java) [5] Optional but highly recommended, you'll probably…
on “DIY Computer Science Degree” ↗This is useful background: "Mathematics for Computer Science" https://courses.csail.mit.edu/6.042/spring17/mcs.pdf
on “Ask HN: What's the best algorithms and data structures online course?” ↗…math background if you are suggesting Concrete Math to a random person asking about self-teaching. Concrete math requires MUCH more background than this book. Besides the real gems and clever tricks Mathematics for Computer Science appear after the fourth chapter.
on “Mathematics for Computer Science: Readings” ↗MCS - Mathematics for Computer Science - is one. From MIT, free. A google should find it.
on “Mathematics for Programmers [pdf]” ↗…grasp on abstract thinking (might as well bring that up since this thread is about that). I really recommend anyone take something similar to Discrete Math by starting to go through the readings for the Mathematics for Computer Science course from MIT Open Course Ware and possibly the videos too (OCW) (e.g. [2] or [3]). Reading the beginning of the Math for Computer Science course manual prepared me for my Discrete Math class so well…
on “Ask HN: How to improve my abstract thinking?” ↗MIT's OpenCourseWare site provides a lot of course material - http://ocw.mit.edu/OcwWeb/web/courses/courses/index.htm Mathematics for Computer Science is perhaps tailor made for your needs - http://ocw.mit.edu/OcwWeb/Electrical-Engineering-and-Compute...
on “Ask HN: the road to learning useful math” ↗