Hacker News new | past | comments | ask | show | jobs | submit login
A Good Year for “A Programmer’s Introduction to Mathematics” (jeremykun.com)
167 points by ingve 4 days ago | hide | past | web | favorite | 51 comments

I picked up this book, wasn't a huge fan.

The idea is great: teach mathematics in a way a computer programmer would understand.

But the title is misleading. The premise that this book will teach you maths using your already existing programming knowledge as a metaphor to build against is false.

It is literally a programmer introducing you to mathematics. Not an introduction to mathematics using programming as a foundation.

The title is catchy. The book had no editor.

I recommend you check out the minireference No Bullshit books.


I own both. They're not aimed specifically at programmers, which I don't see as a downside.

Thank you for the link. I am at a juncture where I need to relearn some of the basics to help my higher school going daughter. The book on math and physics was exactly something I was looking for.

I would also like to get my hands on Resnick and Halliday books that I studied back in India during 11th and 12th.


The book assumes you are already a programmer, then in most chapters it begins with a comparison of programming definitions vs math definitions, sometimes will model mathematics in java code, but for most of the chapters the programming content and examples disappear and it just becomes a math text, which for me was fine.

The title should have probably been changed to something like 'A Programmer's Guide to Calculus and Linear Algebra' to avoid confusion. I hope there is a second version, where an editor mercilessly omits a lot of the decorative medium-esque blog text in some of the intros, and cleans up the jacket description or the title to prevent more bad reviews on Amazon and the like ("I thought this would teach me how to pass interviews! zero stars!").

The best part of this book is the 'culture of mathematics', where he is handing you grad school advice like how you should be reading a math text by writing your own examples whenever a definition is dropped in the book.

I think what he's trying to convey necessitates such an introduction of mathematics. He's trying to convey the true nature of mathematics rather than the "applied mathematics" most programmers/people are familiar with.

Such an introduction requires conceptual and foundational understanding over a full blown computational application which will likely hinder understanding.

I finished this recently, and ended up with a mixed-but-overall-negative view.

As someone who had a reasonable aptitude for mathematics in the past but essentially no practice in the last 10 years, it seemed like the content varied wildly in how well it built on previous chapters, or more generally adhered to the "introduction" label. The programming-based content was thin to the point of being pretty much irrelevant, leaving the whole as something more like a scatter-brained textbook for an odd curriculum rather than a refocused version of a sensible one.

Kun misquoted my review, stating "As the Amazon reviewer 'SCB' put it, 'the book feels more like a refresher than an introduction.' User 'zach' concurred, calling it 'not a kind introduction'..." In fact, I am not qualified to describe the book as a refresher, because I have no background to be refreshed.

Moving on, it's disappointing that Kun didn't see any value in improving his product based on common feedback. It seems like negative reviews would be an opportunity for the author to better understand the audience he marketed his book toward.

At the same time, it's disorienting to see a real person acknowledge one of my reviews. I'm sure if I knew Kun in person I would be far more appreciative and impressed with his dedication and work than I allowed myself to be as a paying customer. I want to thank him for taking the high road and not lashing out at me for the unproductive snark that peppered my review.

I have this book. I did not take a ton of math in college and it was pretty good to refresh and get better understanding on some topics I missed out on. Would recommend for someone with a similar background (undergrad in business college not math or engineering).

I'm sure you can easily find all these lessons online or in videos but I like having the physical book. Partially to hold it and read it in my hands, and partially to have a consistent format and tone over a lot of topics.

I didn't read this book, I tried reading books like this though [1].

Because of my experience [1], I have an entirely different approach to learning mathematics as a developer. The "do the normal track and suck it up approach."

This should be a blog post, but I don't have a blog and don't have the time to edit a story that nicely.

1.5 years before graduation, I couldn't handle advanced math anymore and I flunked the year. The next year I transferred to an easier math curriculum and have been coasting ever since. Even in my CS degree courses they never taught us linear algebra and calculus (I did learn graph theory, that was hard).

I didn't regret this decision of not studying maths for more than a decade, until a few months ago. I am noticing that my solid fundamental progress of mathematics has stopped in high school, learning graph theory was more about passing the course.

But now I want to join the conversation in math. So time to change that.

My method:

I am using the book of Haese & Harris IB HL. It's the most advanced high school math book for international students. I am now up to chapter 6 (complex numbers).


Maths is just like software engineering, or at least algebra is.

I'm having tons of fun, who knew? I really didn't. I think it's because my approach to math is really different than when I was young.

Every time when I freak out, I use my programmer instincts to treat math as a 'best practices software system for numbers' and that mentality really helps.

A couple of examples:

1. I found ways to 'debug' algebraic applications (rewrite them in R and see if the evaluated value stays correct) which means I always know at which step I went wrong with my thinking,

2. I can use variables/abstract things away for a little while (grouping math expressions to letters),

3. My understanding about looping is useful (summations).

It's insane how much programmer instincts maps to mathematics. It's not fully 1 to 1, but it helps a lot more than it harms.


I'm still looking for a math tutor/coach. So if someone feels bored, or if you just want to discuss math and software engineering. Hit me up (my email is in my profile)!

[1] I tried to read the no bullshit guide to linear algebra. That was not a nice experience at all. Reading an actual high school textbook is a much better experience.

I agree completely. The only risk is that once you get to real analysis, your prof will yell at you for mixing notions of complexity and computability into your ideas of what a function is (happened to me).

Of that sounds harsh. What do you mean by complexity? I understand computability (having made a Turing machine from a mostly XML based language :D).

A function is (at least formally) a relationship between two sets of things. It doesn’t matter whether there’s any sort of algorithm that lets you input an object from the domain and calculate the corresponding image under the function, or even an approximation. This came up when we were talking about Dedekind cuts or something like that so it’s very much not pedantry at all in that sort of context.

The main difference between pure math and computer science is that mathematicians assume uncountable sets exist and then use that to prove all sorts of nonsense that are not true in the physical or computable Universe.

Given that Cantor’s Diagonal Argument – which demonstrates the existence of uncountable sets – is the technique which underlies Turing’s solution to the Entscheidungsproblem, you might want to re-examine your assumptions.

Many CS papers, at least in machine learning, state an algorithm in terms of real numbers and use results from real analysis to prove properties of the algorithm.

Give an example of this kind of _nonsense_, please.

> It's insane how much programmer instincts maps to mathematics. It's not fully 1 to 1, but it helps a lot more than it harms.

I worked on khanacademy videos and problems for a few months and had the same experience! I enjoyed the gamification aspect of khanacademy and need to take it up again.

Edit: for full clarity, the author of [1] did reach out in order to get feedback. Which I can only applaud.

Does anyone know any good books for someone who wants to re-learn (and in some places learn for the first time) highschool math as an adult?

I tried Khan academy but I honestly find I get impatient watching videos.

I did well in my Discrete Mathematics class at university because I found it to be intuitive, but if I'm honest I am not as proficient with even basic algebra as I should be

I wrote a book that is exactly what you describe (high school math review for adults), which you can check here: https://www.amazon.com/dp/099200103X/noBSmath (~200 pages = compact review of high school math topics with lots of exercises and practice problems)

The green book is a subset of the longer book that also covers mechanics and calculus https://www.amazon.com/dp/0992001005/noBSmathMechCalc (see preview here https://minireference.com/static/excerpts/noBSguide_v5_previ... )

High school math is very deep, so I will not claim to cover all topics, but I present the most useful parts (equations, algebra, functions and inverses, math modelling), so it would be a good starting point.

Independent and in addition to the above, you can check out this printable tutorial on SymPy that can also be helpful as a review of lots of high school math material: https://minireference.com/static/tutorials/sympy_tutorial.pd...

Awesome thanks, I'll check those out too. A very brief skim of the preview pdf makes me think The NoBS guide would be a good fit for me

Here's an alternative suggestion: try to find a set of the 4 books of the OU's MST124 Essential Mathematics 1 [1]. You'll probably pay more for them than a typical teach-yourself-math type book, but it's well worth it. They will take you from basic algebra right up to calculus, with a little linear algebra thrown in, and they're extremely well written.

You will have no gaps in your foundation with this approach - all the tricky stuff from basic algebra like negative/fractional exponents, simplifying square roots etc. will become very clear.

[1] http://www.openuniversity.edu/courses/modules/mst124?

It’s not comprehensive but I really like betterexplained.com. Everything is available online for free (I think) but there are print books and ebooks available now too.

I am also finding desmos.com (and their app) helpful for getting insight by visualizing and playing with equations and functions.

Thanks, I'll give those a look.

Lack of being comprehensive isn't necessarily a problem. I had a very strange math education, a lot of what I am bad at or fuzzy on is because I am basically missing parts of highschool due to various reasons. So there are parts I have and parts I don't.

If you found the Khan academy videos too slow paced then my suggestion would be to jump straight into the problem sets. Keep trying to solve things and if you get it wrong then you can get an explanation of the steps in text form. You don’t need to watch the videos at all unless you’re really stuck, and then you can try skipping around the videos instead of watching all the way through.

As I’ve seen written elsewhere on HN: math is not a spectator sport. The best way to learn is to work through problems until you master them. Heck, there are plenty of people in college who never bother going to lectures yet still achieve top grades by putting in the work.

The Art of Problem Solving books are great and have complete solution manuals: https://artofproblemsolving.com/store

You could schedule review of concepts and problems you understand with spaced repetition software like Anki to keep them in long term memory. (http://augmentingcognition.com/ltm.html)

I am reading " Burn Math Class: And Reinvent Mathematics for Yourself from Jason Wilkes ". Its pretty good.

"If you want your career to grow beyond shuffling data around to meet arbitrary business goals, you should learn the tools that enable you to write programs that captivate and delight you. Mathematics is one of those tools."

His quote from the introduction of his book rings kind of true to me. I kind of hit a wall in my CS education. It's like I'm learning and building different flavors of the same thing over and over again with no deeper insight. New frameworks and new languages but the same concepts on an endless loop.

At my old age I've come to realize that the deeper insight is located in mathematics... and programming was just a small aspect of what was ultimately a larger structure. If you stay in the programming field, the only thing that's going to happen is you're going to travel in circles, you need to move to math or move part of your learning into something more mathematics based in order to gain that "deeper insight".

I've been reading this on and off over the last few months. I just want to say that the linear algebra material is excellent and really helpful. It's conversational and yet it's pitched at the style/standard of linear algebra you'd get if you were taking it as an introductory course in a pure math sequence (i.e. abstract vector spaces and linear transformations, matrices and vectors of coordinates only enter when you have a basis, etc), and yet it stays focused on the core important topics; other linear algebra courses I've been working on have got a bit too theoretical/fancy too early (e.g. quotient spaces and rings and ideals and vector spaces over finite fields), when I felt like I should be focusing more on eigenvectors and orthonormal bases and more basic stuff like that, as PIM does.

>I didn’t provide solutions, and I didn’t make a Kindle version. I have no plans to change that as of now.

This hurts those that are self-studying without access to other mathematicians. I’m not buying his book for this reason, so are there any other introductory math books people recommend that include solutions?

> didn’t provide solutions

Does he mean he didn’t provide solutions as in he doesn’t work out the answers, or he doesn’t even provide the answers at all? Like, work the problem, get the answer “12” and flip to the back of the book and make sure that the correct answer was 12? Not providing solutions I understand. Not providing answers makes for a pointless (math) book.

He doesn't provide any answers.

The Art of Problem Solving books are great and have complete solution manuals: https://artofproblemsolving.com/store

You could schedule review of concepts and problems you understand with spaced repetition software like Anki to keep them in long term memory. (http://augmentingcognition.com/ltm.html)

If you want advanced high school level maths, Haese and Harris does have worked solutions. I've also heared good things about the Oxfort math book I think.

I went to a lot of subreddits where high schoolers hang out. They are brutally honest when it comes to what good math textbooks are.

Thanks! What is the title of the Oxford math book? Have you found any good Calculus text?

One of my favorite calculus textbooks that I've ever read is (Calculus Made Easy)[http://calculusmadeeasy.org/], available in entirety at the link. The book does a great job of not being pretentious about the subjects, the subtitle is even "What one fool can do, another can."

If you are in the Internet you have access to the math sectiom of Stack Exchange and Reddit, both loaded with volunteer math tutors.

While this is true I tend to solve problems in bulk. I do not want to post 16 questions all at once for people to check my proofs. Sometimes people think you are a student and are trying to get answers for homework assignments.

It would be better if authors would write textbooks aimed at beginners that are self-studying and thus provide solutions. The author of this textbook has a missed opportunity by ignoring to provide solutions. I don't recommend this book to anyone for this reason.

People think you are a student trying to cheat if you just post the problem (or worse, a photograph of it). People will be more receptive if you post the problem, your attempted proof, and ask for some review/verification. Certainly it doesn’t look like you’re trying to cheat (I don’t know about other universities but at mine you weren’t marked for correct problem sheet answers; the purpose was to improve understanding so this kind of posting online for help would be quite reasonable)

The tricky case is with a problem where you don’t know where to start, it’s hard to ask a question like “here’s a problem and I don’t know where to start. Can you try to give me a hint?” But certainly explicitly asking for a hint will reflect better on you and adding some ideas you had (and why you couldn’t make them work or didn’t think they would work) would improve it more.

The other tricky case would be if you were missing something you never thought about, eg never thinking to check that your functions were well-defined. These systematic errors are hard but could hopefully be found by asking for help with verification with a subset of your solutions.

Posting solutions for verification/reading would hopefully also help you improve the clarity of the argument and your thought (and I guess it might help with style too).

Hopefully over time, you would find that your confidence in your own verification abilities increases and that your rate of errors if you do ask for verification decreases.

A final issue you might see is that if a question is elementary for those whom you are asking for verification (and this will happen a lot however advanced the topic), you may get a reply like “why not just say <some short solution>?” This is about as useful as an author-provided solution but not so great for proof verification. (The reason for these answers is that often exercises are hinting at some higher-level structure/theorem which you don’t yet know about and if you did know about it, you could use that knowledge to much more easily solve the problem)


I wonder how useful author-provided solutions really are. If the exercise is to prove something (as many good exercises are) then your solution is never going to be the same as the author’s and looking at the author’s proof won’t tell you if yours is any good.

I'm not talking about posting a question online and asking "how do I solve this" but posting bulk proofs (that you did) and asking someone to verify them all at once. This can be side-stepped if the author provided solutions. Yes, the author's solutions may be different than yours, but that isn't a good reason to not include solutions.

>Hopefully over time, you would find that your confidence in your own verification abilities increases and that your rate of errors if you do ask for verification decreases.

Yes, but without feedback this is hard to do.

This book is not for self-studiers, least not in current form. It seems like there is a disconnect between authors and self-studiers. I can understand if the textbook is written so solutions aren't provided such that universities will buy the book, but there is a market for those no longer in classrooms that want to learn and an author that takes the time to provide solutions helps tremendously.

The one good thing about this is that, if it's a popular textbook, the problems are likely already there. Though of course your proofs might be different and/or take a different approach.

That is a fantastic waste of everyone's time: both for the customer who has to transcribe a problem according to the whims of an online community and to the volunteers who may or may not actually be able to help.

Seems like translation rights for a popular book would be really easy money, plus helpful to folks who don't know English. What am I missing?

I read the book and loved it. I hope there will be a follow-up book with more advanced topics.


Personal attacks aren't ok. We've banned this account.


I support everyone who writes their own textbook or programming book. It is a great use of time and I would much rather someone do this than play video games all day.

I have a few books in progress, some farther along than others, and seeing posts like this with actual numbers on revenue is extremely helpful.

After all the work he did, he made about $150k so far. Honestly that isn’t a lot of money for his expertise and the amount of time he put into it - if he moonlighted as a consultant for those hours he would have made more, with less to show for it.

> I have a few books in progress, some farther along than others, and seeing posts like this with actual numbers on revenue is extremely helpful.

This. You might find @b0rk's post on her zine sales interesting: https://jvns.ca/blog/2019/10/01/zine-revenue-2019/

My book (Rust in Action) isn't quite finished yet, but I've made ~4k pre-sales through Manning's Early Access Program.

The majority of sales (2.7:1) are ebooks. I expect that will change when things get to print.

The most effective marketing strategy for me has been to just be active in relevant communities. This tweet (https://twitter.com/timClicks/status/1154300574151483394) netted me over 300 sales, for example.

The royalties are _far_ less for me than the $15 that Kun has been able to achieve, however. Using a traditional publisher achieves about $2.5/sale for me. Although the retail price is $40, it's often heavily discounted. I have 0 influence over the price sold.

He completed a successful project and didn't spend his time anonymously putting down other people on the internet. That counts for something.

Also, it's quite interesting to see actual sales figures. Most authors tend to be shy to reveal numbers.

For one, the opinion is put forward in a pointlessly mean way

Writing a textbook is inherently egotistical. Either:

1. You think you can explain well-known material better than everyone who tried before

2. Your field recently exploded, and you feel that you are the contributor most suited to converting the papers into a book

3. Your field is solitary and obscure, but you think your papers need to be collected into a book

I like textbooks! They generally put in effort to unify the notation and find connections between papers, making it easier to learn the topic. I'm glad some people are egotistical enough to write them.

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact