Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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

I've been on google for a while now searching for a good book on mathematics combined with programming, but either the level of math they're starting at is too high or the level of programming is too high, so now I'm here for your help.

My math is pretty bad(still struggling with pre-calculus), I'm trying to improve. I also just started to learn programming for about a month now. Is there a good book that could improve my understanding of mathematics through programming?(any programming language will do)

Thank you.

share|cite|improve this question
What do you mean by this? What language? Also, algorithms? Optimization? Statistics? Discrete Math? For example, look at the last listing on here. Is that the sort of thing? – Amzoti Jun 23 '13 at 23:24
@GitGud Sorry about that. – Amodar Jun 23 '13 at 23:27
@Amzoti Discrete Math, statistics and algorithms. – Amodar Jun 23 '13 at 23:28
Have a shot at Project Euler. Not much pre-cal sort of stuff, but you'll learn some basic number theory and math literacy that will take you far. – apnorton Jun 23 '13 at 23:29
@anorton Thank you, I'll check it out :) – Amodar Jun 23 '13 at 23:31

I suggest you look into the book Concrete Mathematics: A Foundation for Computer Science, by Graham, Knuth, and Patashnik. It is a highly respected text and addresses much of the territory needed, in particular, by computer scientists and those studying computer science. You can learn more about the text at the link provided, and/or by "Googling" the title, along with "Knuth."

Excerpt from Review:

This book introduces the mathematics that supports advanced computer programming and the analysis of algorithms. The primary aim of its well-known authors is to provide a solid and relevant base of mathematical skills - the skills needed to solve complex problems, to evaluate horrendous sums, and to discover subtle patterns in data. It is an indispensable text and reference not only for computer scientists - the authors themselves rely heavily on it! - but for serious users of mathematics in virtually every discipline. Concrete Mathematics is a blending of CONtinuous and disCRETE mathematics. "More concretely," the authors explain, "it is the controlled manipulation of mathematical formulas, using a collection of techniques for solving problems."

share|cite|improve this answer
that is an excellent book!+1 – Amzoti Jun 24 '13 at 0:34

For a good book on mathematics and programming, I recommend The Haskell Road to Logic, Maths and Programming by Kees Doets and Jan van Eijck. It uses the functional programming language Haskell, which "allows implementations to remain very close to the concepts that get implemented". The level seems to be about what you describe.

We do not assume that our readers have previous experience with either programming or construction of formal proofs. We do assume previous acquaintance with mathematical notation, at the level of secondary school mathematics.

Functional programming and Haskell are useful in themselves, but they also give you long term benefits in programming ability even in more traditional paradigms. If you plan to do program in procedural/object-oriented languages (e.g. java) you'll still need to do some short term work to learn them.

Another book in a similar vein is Discrete Mathematics Using a Computer by Cordelia Hall and John O'Donnell. It also aims to teach mathematics using Haskell, but I am less familiar with it.

For a book dedicated to Haskell itself at an introductory level, I recommend the excellent Programming in Haskell by Graham Hutton.

For a book just covering the mathematics for computer science I second Concrete Mathematics which was recommended in another post. I also recommend an excellent book I don't hear mentioned much, Mathematical Foundations of Computer Science by Fejer and Simovici, although it's probably a bit terse/difficult for the level of "mathematical maturity" you mention.

share|cite|improve this answer

In another direction, I like Hacker's Delight (2nd Edition) by Henry S. Warren.

share|cite|improve this answer

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.