218 comments

[ 2.5 ms ] story [ 255 ms ] thread
"If you’re a programmer who wants to learn math, this book is written specifically for you!"

Singleton Book B is written specifically for Programmer P, for all values of P such that P wants to learn math?

Maybe I'm being pedantic, but this book is not written specifically for each individual programmer who wants to learn math. It is a one-size-fits-all solution, unlike in-person learning processes that are actually, you know, tailored to each student's strengths, weaknesses and interests. I'm sorry, but this kind of overselling is annoying and a very bad sign.

It’s a shame you don’t get to read any of the actual maths in the sample pages. Otherwise I might have been able to evaluate whether I want to buy this book. Intros don’t really tell us much
I have been searching for something like this for a while. Just bought the book, I will get back to you. I hope the book will give me exactly what it promises.
I would have loved to have the printed version of this book. Unfortunately not available in India.
It's good to have something that lowers the bar for programmers so they could learn themselves some math without much fear. Knowing math is very important if you are a coder - and not just linear algebra: knowing a formula, for example, might let you do certain things in constant rather than linear time or, perhaps, reduce the cost of the iteration. Unfortunately, too many of those who can call themselves programmers by trade know very little math (you'd be lucky if they remember what they learned in high school).
That's really me to a "tee". I just never had a teacher in high school who really understood more than basic math, and I went to work instead of college afterwards.

I expect I'll have to work at it to follow this book but that's why I need something like this. And I need to spend some time with Python too so I'm looking forward to digging into it.

I'm sorry if this isn't your intent but the way you structured your comment comes off as very condescending.

Aside from that, I'm also skeptical that the frequency in which these maths apply to practical, commercial programming is really that high.

Im not anti math or something. I just think the practical value gets way over sold by some people. And sometimes it feels like it's because of the dislike of "those who can call themselves programmers by trade."

If anything, I think the practical value of mathematics is generally undersold. It seems OK if some people tend to oversell it.
It is an incredibly important foundation for analyzing any kind of data. That is a need that crosses many different fields, be it sales forecasting, quantitative finance, econometrics, deep learning, signal processing, any sort of scientific computing etc.

I would be more interested in hearing an argument about why math knowledge is not useful or lucrative.

Seconded for this. Going back and taking an actual structured math course at community college after working professionally as a programmer for years was a real eye opening experience for me. So many things that seemed so abstract and meaningless as a 12 year old were instantly apparently useful in an unimaginable number of ways.
What courses did you take?
>What courses did you take?

Nothing advanced, just Trig, Geometry (proofs based), Algebra and Precalculus. Basically what a sharp high school senior in college prep classes would be familiar with. Geometry was probably the best. If you've never encountered formal proofs before, it's probably the best training for pure logic I can imagine. They start out incredibly frustrating but become addictive once you figure out how to crack them. Precalc was insanely useful too. Learning how to build up a function and shape it with various operators, and work with polynomials is absolutely essential for things like graphics shaders and timing functions and all kinds of other stuff that comes up in UI development (my work). All I can say is that it will give you a much greater appreciation for studying the purely abstract rather than always focusing on practical matters that come up in engineering, as well as making apparent more elegant solutions you may have brute forced in the past.

Where are you that high school only covers up to precalculus? In Australia (depending on the level) you do multivariate calculus among other things. Perhaps other subjects aren't covered as deeply.
>Where are you that high school only covers up to precalculus? In Australia (depending on the level) you do multivariate calculus among other things. Perhaps other subjects aren't covered as deeply.

I'm from the US. The state of mathematics education here is absolutely embarrassing to pretty much any other developed country. Taking precalculus is actually considered advanced, most students graduate with nothing more than an "Algebra" class that covers basic algebraic notation, quadratic equations, linear equations, and not much beyond that. Calculus 1 (single variable) is considered an advanced math class that is only taken by STEM majors for freshman university students here.

I started on the Project Euler problems years ago, and like most naive coders I took the brute force route. After discovering the problems have a deeper mathematical basis I decided to start again and learn some math. Wikipedia illustrates with the first problem, the difference in elegance and efficiency knowing some math can make. https://en.wikipedia.org/wiki/Project_Euler
Hmm, the "first few pages" end just before the "meat" begins.

From the table of contents, there seem to be short prose sections inteleaved with the teaching sections. I hoped to see an example of the teaching section, not the prose.

Amazon lets you browse more of the book and you can get a better feel for it. The E-Book you have to suggest a price, which in theory seems nice to pay what you what, but now I don't know what I'd pay. :)
Yeah, I should update that to have the full first chapter.
Would love to see a little more of the math - am hooked on the idea though!
First chapter is up now at https://pimbook.org/pdf/pim_first_pages.pdf

Also note that the Amazon "Look Inside" lets you see basically any page. Some readers have told me the first chapters were too slow, and so I think more advanced readers will want to breeze through that (though the applications in the first two technical chapters have a coolness to them that is hard to beat!).

The description got me excited, but looking at the table of contents, the level is ultra basic - appears to roughly correspond to first year of a cs degree.
Still potentially useful for people who got into programming by some path that doesn't include a CS degree.
Certainly more than just the first year, and I don't think the majority of CS degrees require multivariable calc or any group theory.

I do wish there were more of a preview than just the TOC to see how novel the examples are and how much it helps with intuition for these mathematical concepts beyond what you would learn in a plain CS sequence. That would be my reason for buying the book and I wouldn't write it off just because the list of topics covers the first two years of college math.

My uni did this weird thing where they put all the math courses into the first year (except for one stat course in the second year). The first semester had highschool basics like calc and trig, followed up by another two courses the following semesters that covered linear algebra and ... something else. I don't remember, I because I was too busy with girl problems.

Looking back, that first year was brutal with each successive year getting way easier and way more fun.

The title is "introduction to mathematics." I think you are probably looking for a different book.
Not all software developers have been through a CS curriculum. Not all CS curriculums teach rigorous math.
Thanks for the effort. I purchased the e-book and will start working through it immediately. I'll let you know what I think.
As someone who works as a programmer but wasn’t super interested in mathematics, I’ve found this blog to be a fantastic read time and time again. I’d highly recommend going through Jeremy’s previous posts if this is your first time seeing his site on here.

If this topic piques your interest I would also recommend Mathematics for Computer Science: https://courses.csail.mit.edu/6.042/spring17/mcs.pdf

What's provided currently at [1] doesn't provide the reader with any impression of the teaching style or quality/quantity of visual aids.

I'm very likely to buy a hard copy of such a book, but not unless I can do the equivalent of flipping through it like I would in a book store.

Consider changing the preview instead to a scattered sampling of some of your proudest pages.

[1] https://pimbook.org/pdf/pim_first_pages.pdf

minor suggestion: make it easier to see the table of contents. A survey book leaves uncertain exactly what is included.
I guess this is for the nontraditional programmers since computer science is a mathematical field and programming is simply applied mathematics in some sense. I don't see how you could get a CS degree without being competent in mathematics to some degree since CS is a mathematical field.
(comment deleted)
On a related note, I'm curious if anyone has taken the Mathematics for Machine Learning (https://www.coursera.org/specializations/mathematics-machine...) courses on Coursera, and whether it really covers enough to be comfortable with ML. The course bills itself as enough math knowledge for folks who barely remember high school math.
Looking at the courses, it doesn't cover calculus and probability. That's two topics that you should already know and that you might not have mastered in High School. Otherwise, you are good to go.
I have. It’s great because it’s developed using geometric intuition (a la 3b1b). Just missing probability/stats.
I have completed all three courses in the series. It was a good supplement to other resources, especially 3blue1brown's Linear Algebra course on youtube[0] (mind-blowing, do check it out) but I wouldn't recommend it as a first course. The first two courses weren't rigorous enough for my taste (I am yet to find a rigorous course on Coursera), but the third was pretty good. You should take up books if you are serious.

MIT OCW Scholar(independent study) course on Linear Algebra by Prof. Strang[1] is really good and is designed for self-study. If you have the time, you could look up Coding the matrix[2] too. I read probability from Mathematics for Computer Science-MIT[3] and also referred Khan Academy[4] and PennState STAT 414/415 [5] for statistics and probability. StatQuest channel[6] on Youtube has handwavy but easy to understand videos on statistics for ML too. The Deep learning book[7] by Ian Goodfellow et al. has a couple of chapters at the beginning that gives you a fairly good idea of the mathematics required to get into Deep learning. Communities like r/AskStatistics and r/statistics on Reddit were really helpful when I got stuck.

I also chanced upon Mathematics for Machine Learning[8] book recently and it seems to be good. It has a chapter on optimization that is left out in most books but skips statistics.

[0] - https://www.youtube.com/playlist?list=PLZHQObOWTQDPD3MizzM2x...

[1] - https://ocw.mit.edu/courses/mathematics/18-06sc-linear-algeb...

[2] - http://codingthematrix.com/

[3] - https://courses.csail.mit.edu/6.042/spring18/mcs.pdf

[4] - https://www.khanacademy.org/math/statistics-probability

[5] - https://onlinecourses.science.psu.edu/stat414/

[6] - https://www.youtube.com/user/joshstarmer/videos

[7] - https://www.deeplearningbook.org

[8] - https://mml-book.com

These are great insights! Thanks so much. Do you think it's worth going through pre-calc/calc deeply? I assumed I should do that first, but it would take quite a while (I haven't taken calc in ~8 years and barely remember more than the basics).
Essence of calculus[0] by 3blue1brown for the basics and the second course in the Coursera Mathematics for Machine Learning would let you get started. You would rarely need calculus more advanced than that covered in the above, and if need be you will be in a position to look it up quickly. If you can sustain your interest in ML over a long period of time and are in no hurry, I would recommend going through all the math mentioned. If you are a top-down learner, the fast.ai course on ML and deep learning for coders will get you started head-first. All the best!

[0] - https://www.youtube.com/playlist?list=PLZHQObOWTQDMsr9K-rj53...

Just ordered from Amazon! I used to read his blog a few years ago and I loved the articles and the breadth of topics. Thank you!
Do the exercises have solutions? The most annoying things about math books is the lack of solutions. A beginner absolutely needs to know whether or not their solutions are correct.

The “the reader should know if they are correct” logic doesn’t apply here. A beginner could easily have faulty logic and fool themselves into thinking their solutions are correct.

I usually don’t buy math books without solutions if I’m self-studying. Would like to know if solutions are provided in this book. If not, I won’t consider buying it.

If this book doesn’t make the cut with a solution manual, does anyone have recommendations on an intro to proofs book with one?

Agree. Actually, studying a good solution even if you have one of your own is one of the best ways to learn mathematical tricks of the trade, so to speak - just as it's a great way to learn coding: one learns from the master (as one should) and not just "from the book."
being told a solution can sometimes lead to "rote" learning - where you learn a particular way of solving the problem, rather than applying creative thinking.

Also, if you can't prove a solution correct, then you haven't solved it!

Is this a feature or a bug? If it takes you two weeks to apply creative solutions and it take me one week to apply a “rote” solution, what is the benefit?
The idea is that it might take you longer to learn, but when you are applying it in the real world and hit real world problems that are messy, you’ll be a lot faster
That’s the idea. In practice does it actually work out like that?
The main reason to study mathematics is to build and fix your intuition, hence studying rote solutions is a waste of time. It might help you pass the class but it wont help you much at all in other parts of life.

For example, at work nobody will care if you have rote memorized a solution or not since they will have already done the math, you will just apply formulas others have came up with. In order to do anything important with the math (not just solving school problems) you need to have intuition for it.

I’d argue that a true beginner shouldn’t trust their intuition unless they have the rigor to prove it is correct. True beginners may think they have solid intuition and a rigorous proof, but without outside validation, may have a blantant or subtle error they cannot see. The point is not to study rote solutions, but to check correctness.

Edit: To your reply below, I’m talking about someone that is self-studying and has no access to a teacher. The suggestion the beginner (without a teacher) should “know” whether or not their solutions are correct is something I disagree with.

I do agree with there are multiple ways to prove something and such a beginner may think their proof is incorrect based on a provided solution, when it may be correct, just different. This is why an instructor is valuable.

> I’d argue that a true beginner shouldn’t trust their intuition unless they have the rigor to prove it is correct.

Yes, which is why you want a teacher until you reach that stage.

> The point is not to study rote solutions, but to check correctness.

Looking at others solutions can in no way prove that your solution is incorrect so I am not sure how those would help you. However having access to others solutions often makes students doubt their own solutions if they don't look very similar, this hampers their growth since they learn to distrust intuitions which are actually correct.

It might not prove that your solution is wrong, but it can help show that your solution is correct (if you trust the provided solution), and if you made a silly mistake in your solution then seeing someone else's solution might well help you spot it.
Yes, which is why you want a teacher until you reach that stage.

Not everyone has that luxury.

I absolutely agree. From my experience this is also true for the best professional mathematicians, it seems that generally they have picked a very large toolbox of memorized "tricks" that they can effectively (and intuitively) apply, rather than approaching every problem as if it were an entirely new challenge.
>Also, if you can’t prove a solution correct, then you haven’t solved it!

This is the type of thinking I’m talking about. A beginner can think they “proved a solution correct” but have a subtle or even blantant error that isn’t obvious to them.

Also, if reader wants to just skip to the solutions then that’s their fault. But don’t let such people rob the student that put serious effort into their work from seeing the solution.

I also champion this method; I used solutions manuals as guides until I could internalize and reproduce the logic on my own. I was a particularly dense student though.
I would pay for the solutions as a book on its own. Solutions are essential for self learning, specially for tricky parts in mathematics i.e writing proofs, probability problems. I think the book “how to prove it” has good examples
I read once, the key to mastery is perceptual exposure and deliberate practice.

Don't know how the first part would work with Math.

Observing someones approaches at solutions and proofs would be perceptual exposure to mathematical analysis.
> The most annoying things about math books is the lack of solutions.

To me the most annoying thing about math books is hand-waving, lack of rigor, and unexplained notation.

At least in programming, everything is formal and I can figure out the entire problem by looking at the source.

I think you aren't buying very good math books then. I find the exact opposite: the thing about math books I have read is that they overemphasize rigor at the expense of intuition. Everything is painstakingly illustrated in such great detail that I sometimes see the trees and lose sight of the forest. I feel as if reading proofs and doing problem sets in math books is just manipulating symbols in well-known ways without really understanding intuitively why something must be true. For example my introduction to metric spaces started by defining the characteristics of a certain function d without explaining how this could be thought of as a generalization of distance.

On the other hand, many programming stuff is ruefully hand-waving and lacks rigor. They might present important algorithms in pseudocode; even when they present in real code, the precise semantics of the real code is often underspecified and vaguely described in English. I mean take a language; how often do you see in the language specification the semantics of the language defined rigorously, using operational or denotational semantics? PL nitpicking aside, how many programmers think a piece of code must be correct because they pass a few test cases, without ever giving a proof?

I'm of course not saying the lack of rigor in programming is bad. Perhaps 95% of the software we are building isn't mission-critical and relying on intuitions is fine; we ain't got no time to prove every piece of code we write. But my point is your observation really does not match mine.

>the thing about math books I have read is that they overemphasize rigor at the expense of intuition

I think these are not contradictory notions! Bad maths books lack rigour. Many books are like you say: rigorous but difficult to make sense of. But truly great books both explain the concepts in the simplest, most lucid and succinct way possible AND maintain the rigour necessary to do mathematics.

I like this quote from Michael Spivak: "In addition to developing the students’ intuition [...], it is surely equally important to persuade them that precision and rigor are neither deterrents to intuition, nor ends in themselves, but the natural medium in which to formulate and think about mathematical questions."

I couldn't agree more. Rigour is not a "masturbatory" end in itself to feel very smart, but it is not also an obstacle to understanding.

Agree, additionally I've found that the key to thw very best books is explaining how the intuition and rigour link. I have found that many books (and teachers) exaplin both seperately, but fail to adequately connect the two.
But at least all imperative procedural steps are clearly understandable from source code given in many programming books. Where as maths books routinely leave out many steps in proofs and calculations, on top of many ambiguously used notations and terminology that can leave a self-student confused.
A program proves nothing at all so I am not sure what you can understand from it? Typically in programming you are presented with a piece of code, a statement that this piece of code solves a specific problem and then a proof of that it actually works. Those proofs are typically far from understandable or rigorous.
But programs are proofs!

At least in the light of the Curry–Howard correspondence. :)

Anyways, I do agree that in programming it’s easier to see what are introductions, assumptions, definitions, functions, values etc. You can’t just invent a notation and go with it. Everything needs to be defined from the ground up. It’s constructive and I like that, probably because I’m a programmer.

That’s true but in most languages the things you prove are relatively obvious propositions like “(A and A)implies A.”
> Typically in programming you are presented with a piece of code, a statement that this piece of code solves a specific problem and then a proof of that it actually works.

Not really. It's quite unusual to see a serious formal approach.

I'm working through a book that uses C++. Every few pages I find undefined behaviour (struct punning, illegal use of memset to zero-out objects, etc) and needless usage of non-standard compiler-specific language features.

This is the well it works on my machine mindset used widely in programming, even in books written by highly qualified people.

> Those proofs are typically far from understandable or rigorous.

I'm not sure what kind of thing you're thinking of here. Can you give an example?

> I feel as if reading proofs and doing problem sets in math books is just manipulating symbols in well-known ways without really understanding intuitively why something must be true.

I have a few thoughts about this. The first is that it is largely up to the learner. Sure, you can just symbolically manipulate things with no real understanding, but no one says you have to stop there (and arguably that's what you should be working on when you read the proof).

The second is that a lot of times the intuition comes later. There was a joke in my school (and I presume others) that you learn algebra in calculus, calculus in DEs, etc. It takes a while to develop that intuition and sometimes just doing it frequently is part of what it takes. I think of it like learning music theory but not really getting it until you've gotten proficient at an instrument.

The third is that some math is just like that. There might be someone somewhere who has some type of intuitive understanding of it, but they are an outlier.

That said, the best learning I've done in mathematics is to take a book without answers in the back and work through it with other people. It's difficult, but very rewarding to really grok the topic and be confident in your answer; and having people you have to explain your solution to helps tremendously.

>I think you aren't buying very good math books then.

Just to follow up. A comment[0] on the book `Discrete Mathematics and Its Applications by Kenneth H. Rosen`

`I'm convinced that math gurus are incapable of teaching math.

Whenever I encounter math textbooks like this one, I'm reminded of Underpants Gnomes on South Park. For the unwashed: Underpants Gnomes stole underwear from the residents of South Park hoping that they'd profit from the thefts, but although their business plan included a Phase 1 ("Steal underwear") and a Phase 3 ("Make a profit"), Phase 2—the connective tissue—was just "?".

Rosen and others like him fail to grasp how much "?" connective tissue they're leaving out when they "teach" math. He'll describe a math concept using almost-but-not-quite human language, then—oh, there's always a "then" with these books—the math gymnastics begin. Math teachers can't resist the gymnastics, can they? No, they really can't. At some point they lose their ability to see how much they assume other people know, and when that happens they cease being effective at teaching. This describes almost every math teacher I've had, and it definitely describes almost every math textbook that I've read. Rosen's book isn't the worst math textbook that I've read, but it's still pretty awful.

Seriously, corner cases and extreme mind-bending problems don't help people learn math; giving students time to grasp concepts before baffling them with bullshit does. This is why math schools like Khan Academy are amazing and college/university level math courses are not. This stuff can be taught, but not like this.`

I strongly agree with this argument. I had this book in my undergrad and I felt barely learning anything and just kept getting drowned in the way the content was written. I switched to a different text in a few weeks and it became an easy subject. The difference was more intuitive examples and gradual difficulty in exercises and less of the proof is left for the reader as an exercise.

[0] https://www.goodreads.com/book/show/1800803.Discrete_Mathema...

May I ask what the "different text" was that you switched to? I have Rosen, and I'd like something more approachable and clear.
FWIW, I found Susanna Epp's book on Discrete Math to be more accessible than Rosen's. YMMV.
Advanced math topics are based on layers upon layers of abstraction (theorems, corollary etc.), like an enterprise software. I also dislike the hand-waviness, but I do understand that I have to read up on the basics in order to grasp the advanced concepts.
How do programming books prove correctness of the algorithms taught? Hand waving. It is very frustrating to read for me, mathematical texts are a lot better at proving things.
In mathematics as well as in programming, there are rigorous and less rigorous texts. Compare “Linear Algebra for Dummies” with “Principia Mathematica”, for example. I haven’t read the first or more than a page or so of the second, but I think you’ll find the latter more rigorous.

Similarly, in programming, “Teach Yourself PHP in 24 Hours” is wildly different from “the Art of Computer Programming” (a series of books that you may like reading)

Sentences like "It similarly follows that..." , "It is left as an exercise to the reader to show that..." , "Clearly, ..." always leave me dumbfounded.
Those phrases can definitely be abused. When used correctly I think they invite the reader to actively engage with the text and learn to think for themselves instead of passively have everything given for them. The author needs to make sure that they’ve actually given enough information up to that point that the reader, with maybe a few minutes of thought, can see why it’s “clear” or work out the similar case in their notes.
You may enjoy this blog post, "I no longer understand my PhD dissertation".

A sample quote:

> This was not the casual read I had in mind. The notation was alien. I even had to scour the examiner’s report to direct me to the key results. And while I could have sworn this was a well-written thesis, I repeatedly found myself bamboozled by my own prompts. “The result now follows easily…” may have made sense back when, but now the author-turned-confused reader can profess that it most certainly does not follow easily, at least in his own mind.

I'm reading Calculus, Multivariable from William L. Briggs (amazon link: shorturl.at/ltGVY) ; it has the answers at the back of the book ; I'm quiet happy about it for someone who always sucked in maths. If anybody has books to share, i'm especialy interested in linear algebra and signal processing
I like Gilbert Strang’s Introduction to Linear Algebra (there are videos too: https://ocw.mit.edu/courses/mathematics/18-06-linear-algebra...). The book has answers for some, but not all, of the problems.

I think Strang does a good job balancing intuition and rigor, without too much mindless grinding. Other books I’ve used either leap right into “Let F be a field....” or have you learn a bunch of matrix manipulations but don’t really explain why these are interesting or useful.

A good math book has examples and proofs of theorems in the text that demonstrate what a solution should look like. In a sense, these ARE worked solutions to some problems. If you ever get stuck on an exercise, it helps to go back and look at those. Nothing beats having an expert to look at your solutions and provide feedback, though.
There seems to be a github repo [0]. It mentions code solutions to examples.

  [0] https://github.com/pim-book/programmers-introduction-to-mathematics
Jeremy, been reading your blog for years. Just wanted to say thanks for the wealth of readable intros to interesting mathematics.
I'd like to tag onto this: I've been reading your blog for nearly a decade and can say that you were one of my inspirations for studying math and CS.
I’ve found myself unable to do even elementary maths recently just because I’m sorely out of practice. Hasn’t really affected my performance as a programmer. Wondering, what kind of math I could learn that would benefit me in my job?
What kind of work do you do? For some types of development, basic knowledge of mathematics will take you reasonably far. Knowing more math opens up possibilities. For example, I recently found myself wanting to add features to some flight control software for drones. I wanted a return-to-home feature, which involved implementing a PID controller for gps navigation. I studied control theory in college decades ago, and hadn't used it for anything professionally until this year. Also, autonomous navigation requires taking vectorial inputs from sensors that must be rotated to the frame of reference of the drone (e.g. the accelerometer). I could not have participated in this project if I didn't have enough knowledge of calculus and algebra.
> Wondering, what kind of math I could learn that would benefit me in my job

It depends on what you want to do. I’ll get to your question in a bit, but I think this passage from the book on page (i) describes why you might want to learn mathematics.

> So why would someone like you want to engage with mathematics? Many software engineers, especially the sort who like to push the limits of what can be done with programs, eventually come to realize a deep truth: mathematics unlocks a lot of cool new programs. These are truly novel programs. They would simply be impossible to write (if not inconceivable!) without mathematics. That includes programs in this book about cryptography, data science, and art, but also to many revolutionary technologies in industry, such as signal processing, compression, ranking, optimization, and artificial intelligence. As importantly, a wealth of opportunity makes programming more fun! To quote Randall Munroe in his XKCD comic Forgot Algebra [0], “The only things you HAVE to know are how to make enough of a living to stay alive and how to get your taxes done. All the fun parts of life are optional.” 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.

You should never feel like a lesser programmer, because you don’t know mathematics it’s just something that might make things a little more interesting and fun while adding some value. Of course it’s not always fun for everyone, so let yourself decide if it’s for you. Mathematics can create value for a programmer in a lot of different ways like as stated above, but yet again people should not feel belittled not having this knowledge because there are many other ways you can add value to your job as a programmer without mathematics.

With that said, I’ll give you a list of programming topics below that are enabled by mathematics and what kind of mathematics can help with those topics. If you’re not needing to study any of these topics or needing to use them in your daily job I think one of the most useful and fun types of mathematics is discrete math for everyday programming. This can build foundations of logic and reasoning needed for programming. Someone else already mentioned the mathematics for computer science course from MIT [9] in this thread and that’s a great intro to discrete though it can be pretty challenging at times especially if you’re new to the topic.

Programming Topic - Math Topics to Study

cryptography - number theory, abstract algebra, probability, basic combinatorics, information theory and asymptotic analysis of algorithms [1]

data science - Linear algebra, Regression techniques, Probability theory, Numerical analysis [2]

art/computer graphics - geometry, linear-algebra, physics-based calculus, topology and numerical methods [3]

signal processing: Fourier transforms, Laplace transforms, differential equations, statistics, linear algebra, and complex analysis [4]

Data structures and algorithms: mostly discrete math (set theory, logic, combinatorics, number theory, graph theory, formal proofs), asymptotic notation.

compression: Information theory, statistics, probability, linear algebra [5]

ranking: statistics, markov chains (think PageRank), probability, linear-algebra [6]

optimization: numerical analysis, computational geometry, discrete mathematics, probability, linear-algebra, calculus [7]

artificial intelligence: discrete math, statistics, analysis, linear-algebra [8]

[0] see the hover over: https://www.xkcd.com/1050/

[1]: https://crypto.stackexchange.com/a/10468

[2]:

This looks really nice, from the preview content---I really like the approach of explaining the background assumptions of reading mathematical definitions and such. Ordered!
From the ToC, is the any reason there is no chapter covering probability/statistics? It has chapters for single/multivariable calculus and linear algebra, and all CS programs I know have all three, especially when there are some nice connections between them, not to mention how useful they are in other CS/engineering subjects.
I am basically trying to understand the formulas in machine learning papers, will this book help achieve improvements in speed?

I just realize I fear math because the educational system I grew up in was violent (like beating kids for getting a quiz wrong wtf).

It was only through psilocybin mushrooms did I discover math and calculus again.

Plenty of cliffhangers in this comment
Sure, I grew up in South Korea much of my childhood, corporal punishments was the norm.

So I have this phobia of calculus and math. Anytime I'm faced with a formula I get this panic attack. Some may call it PTSD. But it explains why I had such problem with calculus and it really made me feel inferior.

it's still a cliff hanger, searching for my arc.

From the bit I've read from https://pimbook.org/pdf/pim_first_pages.pdf it seems to be very very poor.

* 19 pages of droning before you start with something concrete. Much talk talk talk about your experiences before you get to the point. I can't put into words how much it frustrates me when I'm expecting to read something interesting and the author takes 3 paragraphs talking about nothing (usually with lots of overexcited exclamation marks).

[sorry if I am being blunt, but it's how I feel]

* Imprecise definitions. This defeats the purpose of learning mathematics. Like Leslie Lamport says, rigour in mathematics is not a hurdle or a chore one must endure, it's the whole point of learning the damn thing. You give imprecise definitions, and then obscure it even further with neverending paragraphs of confusing explanations. This to me kills the whole pedagogical value the book might have. Here is a rule of thumb that in my experience applies well to almost everything in mathematics: the simpler your explanation is, the better. Your goal is to explain a concept as succintly and beautifully as possible. This exposes the idea behind it. A long and meandering explanation only serves to obscure the idea behind. Less is more.

* Attempting to shoe-horn programming "lingo" into mathematics. Sometimes, the best way to explain something, even to programmers themselves, is not to force an awkward analogy with Java programming. EDIT: 5 pages later: "The best way to think about this is like testing software." oh boy...

* The graph in e.g. page 8 (20 of the pdf) is terribly typeset. The axes text is way too small to read and in a font that doesn't match the rest of the content.

I am curious how many people the author has taught mathematics to.

It doesn't seem a good idea to jump into writing a textbook teaching mathematics unless one has experience of teaching mathematics.

But the author makes the very point about early failures of programming, due to lack of experience, so perhaps he can supply information about what his pedagogical experience consists of.

Teaching other people is a craft, similar to programming or mathematics, with its own necessities.

Apparently he was a TA as a math PhD student at UIC. Now is a programmer working at Google. He wrote a bunch of posts on his website over the years, https://jeremykun.com/main-content/
His blog has appeared here before and I've found it well written.
It's a good question, and sort of hard to balance. I don't have any formal training as a teacher, or really a _pedagogy_ per se. I did teach five years of discussion sections among calculus, python programming, and differential equations. I do guest lectures for high school math classes, volunteered with groups like Black Girls Code and Hour of Code. I also did years of tutoring-center style tutoring, which meant I worked with students from the entire math curriculum. One time I even did an impromptu linear algebra course for a group of co-interns when I worked at MIT Lincoln Lab.

So in terms of number of people face to face, somewhere in the low thousands seems right. In terms of writing, my blog has on the order of millions of all-time page views.

I think it's a stretch to call the book a textbook. I think of it as an O'Reilly-type general technical book, but for math. If someone uses it to teach a course, that would be pretty wild, and I'd feel honored.

Hope you enjoy it :)

I enjoyed reading this opinion, do you have any recommendations for math textbooks that reach the standards you've described?
Not exactly math, but physics, since that was my background. Perhaps my favourite textbooks are Landau and Lifschitz[1]. They pretty much exemplify what I mean. They are concise, lucid, entirely self-contained. All the relevant information is there and not one bit more. The material is reduced to its key ideas, therefore making their exposition as clear as it can possibly be. Many people I've spoken to, however, don't like it precisely for being "too terse", so there you have it as well: ymmv.

Another book that fits this is Cohen-Tannoudji's Quantum Mechanics[2]. The first two chapters explain quantum mechanics from absolute scratch. It starts as all physics does: with an experiment. Then everything else follows from looking carefully at the consequences of that observation, and the concepts are truly explained for what they are, because they are presented in the simplest way possible. "Idea" is more understandable than "Idea+Cruft". This is remarkable to me: much fuss is made about how quantum mechanics is strange and confusing and difficult to grasp, and it is indeed so. In that first chapter, however, I've found the most illuminating explanation of quantum mechanics I've ever read.

[1] https://en.wikipedia.org/wiki/Course_of_Theoretical_Physics

[2] https://en.wikipedia.org/wiki/Claude_Cohen-Tannoudji#Selecte...

EDIT: I just opened Landau's Mechanics Vol I, and here's what his colleague had to say about his writing and teaching style: "[These are] all the features of his characteristic scientific style: clarity and lucidity of physical statement of problems, the shortest and most elegant path towards their solution, no superfluities.". Indeed.

Landau-Lifschitz as a reference is also very polarizing. There are people that really like the style (myself included), but I have also met many people that really dislike it, think it is too hard, too brief, too dry, too little description of intuition... . Similarly, the Feynman lectures are loved by some and disliked by others.
I find this a bit funny. You are comparing books that are used by advanced undergraduates or graduate students to a book written essentially for the subset of programmers with almost no math background. There are beautiful mathematics books by Springer (Undergraduate Texts in Mathematics), Carus Mathematical Monographs and Dover that provide both intuition and rigor at an introductory level. The main problem for a beginner though is knowing where to start and getting a survey of the arena they are entering. They might think linear algebra is adding vectors together with a vector being just a list of numbers.

This book hopefully fills that gap. There are other introductory books like Mathematics: Its Content, Methods & Meaning by Aleksandrov and Kolmogorov but that requires a serious investment of time.

Lastly, I apologize but I am going to rant about this physicist phenomenon. I am a physicist myself (high-energy theory) that entered quantitative finance after my PhD (a heavily disliked field on HN). I found a lot of physicists outside academia who tend to be aggressive and condescending and often haven't actually gone through the rigors of a PhD program themselves. Maybe it makes one feel smarter to tell other people that they are reading easy books or can't jump straight to Landau or Bourbaki (those two couldn't be more different but you get the point) and there are no other physicists around to correct the notion that there are multiple ways to gain knowledge and build intuition.

It doesn't matter who says what about which book. Sample some books, find what you like as long as its not junk science/mathematics, do plenty of exercises, and try to derive things yourself and don't fool yourself that you understand something deeply by studying it for a year.

Attempting to shoe-horn programming "lingo" into mathematics.

This statement is particularly amusing and highlights to me the fact that mathematics are a natural language, and not a programming language. Sussman had a really great presentation on this point; anyone who’d argue this please watch!

https://www.infoq.com/presentations/Expression-of-Ideas

Do you mind summarizing Sussman's presentation? I can't view it on the link you provided without making an account. I can't tell from your comment whether you agree or disagree with the parent's point.
That was very interesting! Certainly a different perspective.
Regarding the first point, if you are the type of person who just wants it to get to the equations with a minimum of talk, you're probably not the intended audience of this book.

The culture of mathematics (including its lingo) has always been a big barrier for me. Thus far, I've only skimmed it, but that part looks promising to me.

It seems reasonable to guess that if someone has learned a good bit about programming but managed to avoid learning about math, reasons like culture, terminology, accessibility, and motivation might be a big part of why. So including that sort of material in this book makes sense to me.

Regarding the first point, if you are the type of person who just wants it to get to the equations with a minimum of talk

I don't want "no talk" and "just equations, I want the "minimum of talk possible" that communicates the ideas and nothing more. I find the more stuff you write the more there is to confuse people. The best way is to strip everything that is superfluous. You are left with the essential, in the clearest form there can be.

Math books already exist for that audience.

Indeed, most of the canonical texts for undergrads would likely fit the bill.

wtf is wrong with hn.

>[sorry if I am being blunt, but it's how I feel]

you should learn to keep your feelings to yourself when the only function they serve is to denigrate others and derive cruel satisfaction for yourself.

>Here is a rule of thumb that in my experience applies well to almost everything in mathematics

this is aspirational pretension - everyone claims to appreciate formal purity /after/ they've learned something but when you're /learning/ none of that matters because you're just trying to develop intuition. to be one of those people that understands after their own stumblings/ruminations and then begrudge the next person the same is despicable. shame on you and i hope you're never in a position where someone depends on you to teach them absolutely anything.

>Imprecise definitions. This defeats the purpose of learning mathematics. Like Leslie Lamport says, rigour in mathematics is not a hurdle or a chore one must endure,

but that's just like your opinion man (or leslie lamport's). there are shelves and shelves of books for people like you - go read bourbaki or rudin or mochizuki or whomever you'd like. this book is not for /you/ - it's stated purpose is to excite and entice people that don't have formal mathematical training to learn mathematics and those sorts of people decidedly don't enjoy austere definitions and succinct theorems and terse proofs.

hence the only purpose your comment serves is to hurt the author's feelings, an author whom i might add has done infinitely more for the math community than you have with your pedantry and vitriol by maintaining a blog https://jeremykun.com/ with literally reams of interesting mathematical content that is simultaneously exciting /and/ rigorous. and furthermore iirc jeremy was originally a math ed phd student so i trust his opinion of the right way to teach math infinitely more than i do yours mr random internet physics guy.

next time think twice before posting this kind of lowbrow mean shit.

I'm grateful for OP opinion and your opinion. I agree with you except in "next time think twice...", I think that opinion trigger your response which was great!

Enjoy your weekend, both of you!

"wtf is wrong with hn"

One thing that's wrong with HN is that perceived "negativity" often gets condemned in exactly the way you have done here.

It seems as if a significant number of HN readers have never really participated in a spirited discussion with arguments made from multiple different perspectives. Maybe any kind of apparent conflict scares them, maybe they project their own aggression onto a comment that seems to go against the grain of the discussion. It will never change.

There are many easy ways to rephrase OP's comment into one that isn't so direct and denigrating. The only thing "apparent" here is that OP has trouble with empathy.
"Direct", yes. "Denigrating", how?? I'm genuinely asking so I can fix that in the future, unless you think criticising is offending.

>The only thing "apparent" here is that OP has trouble with empathy.

Again, I can do without the online pretend-therapy. Amazing how perceptive some people are that they deduce the most profound things from a dozen lines of text!

Maybe you should take a hint huh? If many people are telling you something about yourself (a subject you're inexorably biased on) you think maybe you should reconsider your position?
I wanted to say I found your original comment critical, but not offensive. But I found the reply made to you offensive, because personal and aggressive. Which I think is how you see it too.

However, it seems several people took the side of the replier.

So I reviewed your original comment, and I think I've found the problem: it exaggerated and labelled, e.g. droning, talk talk talk, talking about nothing, neverending paragraphs.

Many of these aren't literally true ("nothing", "neverending"). Others are emotionally loaded ("drone"). It's probably almost always better to speak directly, without exaggeration or emotion... but this is particularly important when criticizing.

I didn't notice these at first because I tend to filter out decoration, and just hear the content (i.e the literal meaning) - though this is much easier to do when I'm not personally involved!

I think, "to be blunt", to speak plainly, to get to the point, really mean to be factual and accurate - without emotional language, exaggeration or labeling.

Anyway, I notice dang asked to not continue this thread, but I was troubled by it, and reviewing it helped me - maybe it will help you too.

What's the problem, too much empathy? I mean, if the opposite of empathy is appathy, then I don't see that in the OP.
The opposite of empathy is antipathy.
The opposite of antipathy is sympathy.
there are zero "arguments" in the post I responded to outside of argument from authority. there's nothing about /why/ precise definitions are better than meandering, nothing about simplicity etc just proclamation that it is
I have not one single time invoked any kind of authority to make the points I'm making. It was only below, after you've (ironically) invoked the writer's credentials and insultingly proclaimed I never should be allowed to ever teach anything, that I let you know my qualifications.

I do justify why simplicity and succinctness are better than meandering. More superfluous information obscures the "nugget" or the essence of we really want to talk about. Strip away the accessory, write the simplest, most lucid explanation that captures the idea, and you will see the concepts and connections in their elegance, more clearly than when that is obscured in the middle of pages and pages of talk. In summary: "idea" is more understandable than "idea+cruft".

What do you mean no reason why? Are you expecting a scientific trial? I'm sorry to disappoint you: these are but my opinions.

The comment of yours that I responded to only has an allusion to a quotation and nothing else substantiating any of your points. Yes if you're going to proclaim and critize on something material (like the best way to teach someone something) I expect you to have scientific trials.
>wtf is wrong with hn.

I believe you must have mistaken me for someone else. My name is andrepd. Is this "hn" a friend of yours?

>you should learn to keep your feelings to yourself when the only function they serve is to denigrate others and derive cruel satisfaction for yourself.

It never ceases to amaze me how some people are so perceptive that they can confidently deduce the intentions and personality of a person half a world away by reading a short text online. Are you available for therapy sessions? I could use your valuable insights.

Also, I was under the impression that I was making constructive criticism. I made concrete points and showed examples of books that in my opinion did those things right (see my other comment). I regret the "very very poor" phrase at the start though. I've changed it to just "poor".

>everyone claims to appreciate formal purity /after/ they've learned something but when you're /learning/ none of that matters because you're just trying to develop intuition

Oh, I see you know more about how I felt learning stuff than I do myself! Lovely.

I can tell you that I found it was almost always reading the most succinct treatments that I truly understood the greatest insights. Although from your tone I suspect that none of this will make a difference about how you feel. I won't repeat myself. You can (re)read my other comments if you're interested (and if you find I didn't explain myself well I'd be happy to discuss it more), and also check the examples I've mentioned.

>shame on you and i hope you're never in a position where someone depends on you to teach them absolutely anything

>an author whom i might add has done infinitely more for the math community than you have with your pedantry and vitriol

>jeremy was originally a math ed phd student so i trust his opinion of the right way to teach math infinitely more than i do yours mr random internet physics guy.

I am doing a maths PhD and (woe is you) I teach undergraduate classes AND I've been tutoring students of physics, maths and computer science for over 4 years now, online and in person. I can say with no false modesty that I've been repeatedly complimented by students on my ability to teach and explain concepts.

What Nobel prizes have you got, since that seems to be so important to you?

Is there any way we can keep this somewhat civil?
You're totally right. Apologies for my part. I should know better than to engage with

"next time think twice before posting this kind of lowbrow mean shit".

It was meant to attack and irritate and I fell for it.

on the internet everyone is a dog and has read all of the volumes and TAOCP and all of the volumes of landau lifshitz (and also peskin and shroeder and read baby rudin at 5). no one cares about /you/ man - it's a public forum so the point is to give advice that is generally relatable.
*>on the internet everyone is a dog and has read all of the volumes and TAOCP and all of the volumes of landau lifshitz (and also peskin and shroeder and read baby rudin at 5). no one cares about /you/ man - it's a public forum so the point is to give advice that is generally relatable.

I am again very sorry to disappoint I've not read TAOCP or Landau or even Peskin from cover to cover. I'm however curious if you can let me know where you got that idea from, cause I scoured my comments and can't for the life of me find anywhere I indicated so.

Seriously though, I have no idea what your point is supposed to be. I shouldn't give my opinion because... it might not be relevant to someone else, is that it? Someone might not agree? If it interests you I've met many people in the past few years who share my view (and also many personalities, again, Lamport, Dijkstra, Knuth, in the field of computer science). I've also met many who don't agree! And that's fine, what works for some might not work for others. Clearly this concept does not sit well with you.

This is being an uninteresting conversation which is only serving to irritate me (and you, it seems). I will stop replying now.

As far as I can tell, you are what's wrong with HN. His post is a well-justified opinion, with reasoning provided, whether you chose to agree or disagree with that. Somebody may (or may not) take it into consideration. Yours are simply "how dare you!"-post, adding absolutely no value to the discussion. Also, learn capitals, it's hard to read you like that.
there is zero justification in the post I responded to outside argument from authority and prescription so i have no idea what you're talking about
I have not one single time invoked any kind of authority to make the points I'm making. It was only below, after you've (ironically) invoked the writer's credentials and insultingly proclaimed I never should be allowed to ever teach anything, that I let you know my qualifications.
Erm...

> Like Leslie Lamport says

Pretty clear appeal to authority, IMO.

20 lines of reasoning and one quote that I think conveys what I mean. I think if you can't honestly engage with that besides accusing me of "appeal to authority" there is nothing to be gained from continuing a discussion.

Btw it's actually Lamport quoting Spivak.

This was close to being a great, meaty comment, but personalizing your criticism kind of ruined it. Which is too bad! I’m inclined to agree with the substance of what you’re saying.
It's funny, because I discuss Lamport's view in the book as well in a later chapter. I think some folks are annoyed that the first chapter is slow, but I promise it ramps up :)
https://news.ycombinator.com/newsguidelines.html ("Guidelines" link at bottom of every page)

> In Comments

> Be civil. Don't say things you wouldn't say face-to-face. Don't be snarky. Comments should get more civil and substantive, not less, as a topic gets more divisive.

> When disagreeing, please reply to the argument instead of calling names. "That is idiotic; 1 + 1 is 2, not 3" can be shortened to "1 + 1 is 2, not 3."

I personally think this is exactly wrong. Most people struggle with Maths because they don’t have the implicit understanding that books like you’re talking about rely on. It’s like telling a novice programmer to read the documentation. I’m not sure how successful this book is but it seems a worthy attempt.
That's not at all the point I was trying to make. Indeed, if you check my other comment, both the books I give as an example have precisely the feature of being self-contained. Landau's Mechanics starts with the basic concept of a particle. Cohen-Tannoudji's Quantum Mechanics starts with the simplest possible description of the double-slit experiment. Again, they assume no prior knowledge about what they are trying to teach (wouldn't be much of a textbook about the subject if it did require previous knowledge about the subject, now would it? :))
There is a common category of misguided book review that the parent comment falls under: the reviewer has some particular things they are looking for from a book and fails to see that there are more uses for it than their own; so they generalize, reading the book's failures to meet their personal criteria as a failure intrinsic in the book's content, and mistakenly lambaste the work.

> 19 pages of droning before you start with something concrete.

One person's "droning" may be another person's "rare, illuminating presentation"; we are not all interested in the same things. I can offer another perspective that what the author wrote on polynomials within the first 19 pages there is in fact pretty unique and interesting.

> Imprecise definitions. This defeats the purpose of learning mathematics.

The commenter is again taking a minority viewpoint and baselessly extending it. There is a special kind of paranoia that often manifests in discussions of mathematical pedagogy that any departure from perfect rigor will weaken the minds of students. This is a blatantly shallow and one-sided view of things: the fact that rigor has value does not imply that the most effective method of teaching—which is a matter of both mathematics and human psychology—is to offer nothing but the most rigorous presentation possible.

This particular book is explicitly targeted at helping to transition programmers into mathematics. Given that goal, do you really think the pedagogically superior approach would be to offer a more rigorous definition of polynomial than:

"A single variable polynomial with real coefficients is a function f that takes a real number as input, produces a real number as output, and has the form: f(x) = a0 + a1x + a2x^2 + ... + anx^n"

—in the introductory chapter of the book?

I would urge potential readers to take the parent comment with a grain of salt. And also, if you're among this book's target audience and trying to teach yourself mathematics, be aware of such personalities preaching this particular dogma of mathematical instruction: it's fairly common on the internet. But it basically represents the same corner of the mathematics world as that of the programming world where folks insist on using nothing but VI/Emacs on Linux with C++ and/or Haskell, and are all too ready to belittle any alternatives perceived as softer/weaker. These aren't necessarily the most impressive programmers—they just project the most intimidating auras. Don't let their counterparts in mathematics scare you off.

>One person's "droning" may be another person's "rare, illuminating presentation"; we are not all interested in the same things.

You are absolutely correct in that regard. I've talked to many people who hated the textbooks I most liked, and preferred ones that I found unreadable. Just goes to show that what works for you may not work for me.

You are very wrong on the other point: none of what I said is borne out of a view that mathematics should be difficult and "hard" an impenetrable (rather than soft and approachable). Indeed I view this sort of overlong prose as impenetrable and confusing, and the succinct style of e.g. Landau textbooks much clearer (see my other comment).

>The commenter is again taking a minority viewpoint and baselessly extending it.

This is not a minority viewpoint. I'd daresay is the majority opinion among mathematicians. It is also the opinion of prominent computer scientists: Dijkstra, Leslie Lamport, Donald Knuth, to name a few off the top of my head.

It is also plainly true: mathematics is about rigour. It is not an obstacle, nor is it an end in itself, but it is a fundamental part of mathematical study and reasoning. If you aren't being rigorous, you're not doing mathematics, it's just a waste of time. I'll let Michael Spivak speak for me:

"In addition to developing the students’ intuition [...], it is important to persuade them that precision and rigor are neither deterrents to intuition, nor ends in themselves, but the natural medium in which to formulate and think about mathematical questions."

>be aware of such personalities preaching this particular dogma of mathematical instruction: it's fairly common on the internet. But it basically represents the same corner of the mathematics world as that of the programming world where folks insist on using nothing but VI/Emacs on Linux with C++ and/or Haskell

Completely nonsensical comparison (C++ and Haskell?? two languages who could not be further apart), and again, not in the least bit what I mean with my criticism.

> I'd daresay is the majority opinion among mathematicians. It is also the opinion of prominent computer scientists: Dijkstra, Leslie Lamport, Donald Knuth, to name a few off the top of my head.

There are reasons partly historical and partly due to the subject matter of CS that mathematicians closer to it tend to place relatively higher value on formality.

> It is also plainly true: mathematics is about rigour.

This is taking taking it too far and you're placing yourself in the formalist camp, which is a minority viewpoint. You gave a nice quote from Spivak where he characterizes rigor, "...the natural medium in which to formulate and think about mathematical questions."

Labelling it a 'medium' is very informative. Computer programs likewise depend totally on the formality of the medium; it's in intrinsic part of how they are able to operate. Same with the magic of formality + inference in mathematics.

That said, the psychological questions of pedagogy involve much more than the intrinsic features of some subject. In learning to write completely formal computer programs, one benefits immensely from instruction which departs from total formality. I'm assuming this would be obvious to the readership here so I won't go into more detail.

> Completely nonsensical comparison (C++ and Haskell?? two languages who could not be further apart)

I was referring to the social standing of the languages (which is all that matters for the points I was making), not their intrinsic features.

I'm sure the author would have liked for you to enjoy his book, but if you've already read Spivak and Landau, then you are most definitely not his intended audience.

Your criticism is like that of a professional mathematician complaining of the elementary results presented in some high school math book.

Please tell me you wrote it in LaTeX. It would be another reason to buy it.
It appears the ebook is in PDF format[1], does anyone know if an EPUB will become available?

[1]: https://gumroad.com/l/pim-book

I prefer EPUB for most ebooks, but maths books work far better in PDF because mathematical notation gets turned into image files in an EPUB and don't render nearly as nicely.
Can you create an EPUB version? I'd like to buy it but I need EPUB for my reader.
(comment deleted)