Post navigation

A Programmer’s Introduction to Mathematics

For the last four years I’ve been working on a book for programmers who want to learn mathematics. It’s finally done, and you can buy it today.

The website for the book is pimbook.org, which has purchase links—paperback and ebook—and a preview of the first pages. You can see more snippets later in the book on the Amazon listing’s “Look Inside” feature.

If you’re a programmer who wants to learn math, this book is written specifically for you! Why? Because programming and math are naturally complementary, and programmers have a leg up in learning math. Many of the underlying modes of thought in mathematics are present in programming, or are otherwise easy to explain by analogies and contrasts to familiar concepts in software. I leverage that in the book so that you can internalize the insights quickly, and appreciate the nuance more deeply than most books can allow. This book is a bridge from the world of programming to the world of math from the mathematician’s perspective. As far as I know, no other book provides this.

Programs make math more interesting and applicable than otherwise. Typical math writers often hold computation and algorithms at a healthy distance. Not us. We embrace computation as a prize and a principle worth fighting for. Each chapter of the book culminates in an exciting program that applies the mathematical insights from the chapter to an interesting application. The applications include cryptographic schemes, machine learning, drawing hyperbolic tessellations, and a Nobel-prize winning algorithm from economics.

The exercises of the book also push you beyond the book itself. There’s so much math out there that you can’t learn it from a single book. Perspectives and elaborations are spread throughout books, papers, blog posts, wikis, lecture notes, math magazines, and your own scratch paper. This book will prepare you to read a variety of sources by introducing you to the standard language of math, and also push you to engage with those resources.

Finally, this book includes a healthy dose of culture. Quotes and passages from the writings of famous mathematicians, contextual explanations of cultural attitudes, and a light dose of history will provide a peek into why mathematics is the way it is today, and why at times it can seem so confounding to an outsider. Through all this, I will show what progress means for math, what attitudes and patterns will help you along the way, and how to stay sane.

Of course, I couldn’t have written the book without the encouragement and support of you, my readers. Thank you for reading, commenting, and supporting me all these years.

I don’t have plans for this yet. I have to explore how Kindle will actually format the book. In my experience nobody gets math typesetting right, and most of the resources I looked into for “epub with math” couldn’t even get basic examples to format correctly. This is also difficult because I don’t own a kindle >_<

I just bought the book. It looks really exciting—and I’m always happy to support a fellow author!

BTW, I definitely think it’s worth making a Kindle version available if it’s not too much work.
It’s much better experience on a mobile device than a PDF. You don’t need to own a Kindle device to test it. You can use the Kindle app, which is available for free on all major platforms in their various app stores (e.g. Apple App Store, Google Play, Windows Store, etc.). There are various options for supporting math in Kindle (e.g. https://tex.stackexchange.com/questions/16735/latex-options-for-kindle).

I haven’t heard any complaints from the few hundred people who bought the ebook on Gumroad thus far, and I chose Gumroad because a colleague of mine used it successfully to publish a few ebooks. I wouldn’t be concerned, but if you still are, shoot me an email at mathintersectprogramming@gmail.com and we can do a direct exchange.

The website (pimbook.org) has the first 45 pages, and the Amazon Look Inside preview has more.

Generally, if you have a serious phobia of equations and anything that sounds like math, the book is not for you. If you made it through a calculus course some time in the past (derivative rings a bell, something something rate of change), then I think you’re just the right target audience. The book contains little in the way of CS theory proper (no Turing machines, some informal discussions of complexity just for fun and variety).

That being said, the book does have a ramp. The first three technical chapters are (in my view) gradual and accessible, and then it ramps up. By the end, I think there is not that much difference between what I’m writing and what you’d see in a typical math undergraduate text, in terms of difficulty.

Fantastic achievement. I am excited by this book. I have to vote strongly in the e-reader version camp. PDFs are ostensibly a electronic piece of paper, ebook formats allow for text reflow and readability. A good start would be to change the text from ebook to PDF for gumroad. This caught me off guard. Otherwise I am really looking forward to this book. Thank you 🙂

since a famous AI Independent media introduced your website and book, there is still a lot of developers and researchers are eager to read your book in china. But we can not buy the physical book from amazon and we are not convenient to buy the online version..

I’ve been reading through it, and looking at/working on the exercises. A question: Are all the exercises meant to be more or less readily solvable by the intended target readers, or are some meant more to provoke you to work on it to better understand the problem, and go look for more information on your own?

I’ve been going through the book bit by bit (this is really good). A question about the exercises: are they all meant to be solvable by the intended target readership; or are some meant more to provoke you to work on them to understand the problem better, and to go look for more information on your own?

I was very glad to see the book was finally out, and bought it right away – and then was a bit sad to realise I’d bought a .pdf. To be honest, I would have bought it anyway, but I echo some of your other commentors in urging to do a version Kindle or epub version. Being able to control the font size would make a world of difference to me.

Hello Jeremy, I’ve just ordered the printed edition of your book. I took a look at the PDF versions as well, it looks like it’s 20$. Is there any discount available for people that got the printed edition as well (if there’s any kind of discount code printed inside, disregard this comment, I’m still waiting for it to be delivered). Thanks!

I’ve just received my copy this afternoon. Two quick comments for now.
First, this book feels like it was written just for me–and everybody like me. Exactly the right level, exactly the right tone. Intelligent, practical, exact and curious, all with equal weight.
Secondly, I think it is the best-written textbook I have ever come across. Every sentence reads as if, at least once in its life, it has been read out loud.
Thank you!

Hi Jeremy, is there going to be a Kindle or e-book version? I know someone asked this before, but I just find reading books on tablet a much better experience nowadays, better searching, more convenient to carry, etc. Hope you consider it and looking forward to buying a Kindle version 🙂

Is this the right book if I’d like to become better at learning how to take a formula in Sigma Notation and turn it into an algorithm? I’m looking for something that will help me learn and get better at reading a mathematical formula in sigma notation and turn it into code.

Hi Jeremy, awesome book. I like your approach because it’s more pragmatic and I just spotted one thing I never explicitly realized (shame on me). I’ve been running through your examples of polynomials and I missed that one with negative exponents, even if I tested them on top of your definition. Gone through the wikipedia page and checked that in fact that the definition there is almost identical but exclude non-negative exponents (I also observe that non-negative is more appropriate than zero because it is a perfectly valid option).
Now, I’ve been wondering, is this an omission on purpose? I mean, that was certainly useful for me because now I will never forgot that again. But technically it is the definition that miss an important aspect, so I urge the need to ask about that : ) and see what are your thoughts.

There is a version of polynomials that allows for negative integer exponents, called Laurent polynomials. It is used heavily in the study of complex analysis (the study of functions that take complex numbers as inputs). The reason it’s not included in the polynomial definition is because of the “intuitive” version of the definition of a polynomial as “any function you can get only by adding and multiplying the input by things.” To get a negative exponent you need to divide the input.