Machine Learning Zoomcamp: Free ML Engineering course. Register here!

DataTalks.Club

Math for Programmers

by Paul Orland

The book of the week from 15 Feb 2021 to 19 Feb 2021

To score a job in data science, machine learning, computer graphics, and cryptography, you need to bring strong math skills to the party. Math for Programmers teaches the math you need for these hot careers, concentrating on what you need to know as a developer. Filled with lots of helpful graphics and more than 200 exercises and mini-projects, this book unlocks the door to interesting–and lucrative!–careers in some of today’s hottest programming fields.

Questions and Answers

Wendy Mak

Hi Paul, my questions are:
Are there topics that you really want to cover in the book, but decided against in the end?

Paul Orland

There are a lot of topics I wish I could have included! Originally, I wanted to write about abstract algebra and functional programming. This is a bit more advanced, and so I decided with my publisher to focus on topics that were more accessible and interesting to a broader audience. Also, there’s not much on probability or statistics in this one – I hope to write another book on “statistics for programmers” soon.

Wendy Mak

Most of the topics in the list of contents seems more or less fairly general, except the chapter on gravity simulation– what made you add that particular topic?

Paul Orland

I tried to have at least one application in each chapter – the new math in that chapter is the concept of partial derivatives and the gradient. I think that force fields are a useful example to think of when learning about the gradient, which is why I picked it!

Wendy Mak

In the intro, you mentioned that you wrote it partly with the idea of ‘scientific software engineer’ in mind– it’s not a job description I see very often, outside of universities, where do these jobs come up? And what sort of skills do they usually look for? (ie do they assume you’ll have a background in the science as well?)

Paul Orland

Job titles vary, but some software engineer job postings require more math than others. I would say there are a lot of data science and quantitative finance jobs out there that require math, as well as software eng. jobs at high-tech companies (e.g. aerospace, biotech, hardware)

Evren Unal

Hi Poul,
The book’s cover is interesting.
But particularly the lady’s hand sign is prominent.
İs there a meaning in it or is it aimless?

Paul Orland

I wish I could tell you! My publisher (Manning) has a tradition of putting people in old-fashioned dress on their covers. This woman is wearing traditional dress from Finland from a few hundred years ago. I picked this one from three options, because I like her smirk! No idea what she is doing with her hand… but it almost looks to me like she’s gesturing at a blackboard

A McCauley

Hey Paul Orland , great book 👏🏼, this is definitely something I want to expand my understanding in some more.
I like that you’ve added exercises at the end of the topics; How did you get your ideas for the exercises you listed? Are they short questions to test understanding or small practical project styled etc?

Paul Orland

Glad you’re enjoying it so far! Good question. I’ve designed most of the exercises to be doable in 1-15 minutes

Paul Orland

They are supposed to be relatively quick checks of your understanding, to help you make sure you are keeping up with the material. Then, if one takes longer than a few minutes to figure out, it’s a good sign you should reread the chapter and think through the topic again.

Paul Orland

Anything more involved is marked as a “mini project”, indicating that it will take what you’ve learned and go a bit beyond the material introduced in the text.

Paul Orland

The way I come up with these is roughly: I think of some small example I could work through in a paragraph, and rather than explaining it, I try to give a carefully worded hint so you can basically connect the dots and figure it out yourself.

Vladimir Finkelshtein

Will there be a book called “Programming for mathematicians”? Asking for a friend.

Paul Orland

Maybe not with that title, but yes 🙂 Later this year I’m releasing a book relating abstract math and functional programming, and I think it is the right way for mathematicians to learn programming!

Poornima

Hi Paul Orland, glad to converse with you. Are you covering the mathematical fundamentals needed for computer vision ( I saw you were covering 3D graphics) such as various image transforms. Thanks.

Paul Orland

Hmm… I don’t know much about computer vision in general, so I can’t say for sure. I bet many of the topics in the book are used in computer vision. And, the last chapter is on image recognition using neural networks!

Poornima

That sounds great !🙂 Will give it a try and thank you for answering.

Matthew Emerick

Hello, Paul Orland! Thanks for doing this. My question(s): if you were going to expand your book, what would you add? What would you expand? What would you cut?

Paul Orland

I would definitely add some content on probability and statistics! I think it is increasingly important math for applications, and I’m sad it didn’t fit in this book. It’s also not my area of expertise. I think most of the big topics in the current book are good, but if I could do it again, I might trim down some of the les useful sections and subsections (not thinking of any off the top of my head, but there are surely some!)

Matthew Emerick

I agree that statistics and probability are very important. I also think that too many rely on them without full understanding. Do you think machine learning engineers, data scientists, and AI practitioners in general need to focus more on math?

Paul Orland

I suppose most engineers, data scientists, etc. know the math they “need” to do their jobs, but I suspect there is room for most people to think more deeply about the math they use. In my book, I’ve tried to emphasize the philosophy behind each topic, as in why it is the way it is, and how it fits into the grand scheme of things. This perspective, I think, is similar to a software engineer taking the time to understand how the compiler of their favorite language works. It gives a deeper perspective on how your tools work.

Doink

Hi Paul Orland do you plan to have a separate book on the lines of Maths for Data Scientists? Slightly more deeper and covering topics on numerical optimization,infinite series etc but not in the typical classical math textbook format.

Paul Orland

I don’t, but I am trying to convince one of my friends to write such a book! One of the challenges is including enough relevant example to make the book interesting. Will keep you posted!

Alexey Grigorev

Hi Paul!
Which learning plan would you recommend for software engineers who want to get into machine learning? What kind of math do they need to focus on - to make the learning most effective? And would your book be enough to cover the math fundamentals?

Paul Orland

Alexey Grigorev good question! I think Math for Programmers has a lot of math necessary for ML – namely linear algebra and multivariable calculus. The main topic not included in my book which is necessary for ML is probability. I suggest buying my book (obviously 😇 ) and taking Andrew Ng’s free coursera course on ML . If you work thorough the exercises in my book and this ML course, you should be prepped to do a deeper dive in any area of ML you want

Alexey Grigorev

Thanks! Andrew Ng’s course is awesome!
In your opinion, how a programmer should approach learning probability and stats? You mentioned you might write a sequel for your current book - I guess you already thought about this question

Paul Orland

I would say, try to learn whatever you want to do in ML or elsewhere, and read about anything unfamiliar. A lot of what I wrote about in Math for Programmers is stuff I learned for some application (e.g. Physics). having a goal/application in mind is a great way to motivate yourself to learn something, and focus on the most important topics.

Paul Orland

I wish I had a good enough 50,000ft view of probability to give more specific advice. This is part of why I’d like to research and put together a book on it.

Alexey Grigorev

Makes sense, thank you!

Vladimir Finkelshtein

What’s your favorite example, that shows importance of understanding math behind ML? Most of the examples I can think of don’t really justify a deep dive…

Paul Orland

I am kind of a novice, but I think gradient descent is very important!

Paul Orland

It is good to think of learning as an optimization problem, and gradient descent is one optimization algorithm you can use pretty widely

Vladimir Finkelshtein

I agree that it is important to learn what an optimization problem is and to frame machine learning as one. But it seems like the focus of machine learning is on what to optimize, rather than how.
To me gradient descend feels kind of “academic”. I imagine that not many ever write their own optimizer for machine learning. Probably for most people reading two nontechnical paragraphs explaining the intuition behind gradient descent will be more than enough.

Paul Orland

Yeah, I guess it’s a matter of opinion. I think deriving the backpropagation formulas for a MLP (using gradient descent) and implementing them is a worthwhile exercise, because it demystifies machine learning. I totally agree that ML in practice is more about deciding what to optimize.

Doink

Paul Orland How is this book different from Think Stats?

Paul Orland

I don’t know that book, but presumably the difference is that it covers stats while my book does not 🙂

Ben Wilson

Paul Orland I have absolutely and thoroughly enjoyed reading your book. Not only are the progressions throughout the examples highly engaging and approachable to a wide audience, but the accompanying explanations are very clever and entertaining. I’m curious to know if you’re planning on ever applying your teaching style and examples to the world of geospatial processing (2D and 3D) algorithms? I think you’d do a rather great job at making a topic such as that approachable to the rapidly growing community of practitioners that are entering that specific space.

Paul Orland

Glad you liked it! I don’t know much about geospatial algorithms, but sounds like it could be a cool application for 2D and 3D geometry. Can you recommend any good references for me to get started?

Wendy Mak

Ben Wilson do you mean projection algorithms? or stuff like spatial indexes, spatial search and so on?

Ben Wilson

great circles intersection, polygonal collision, distance measurements with z-components, et. al. I think that with your presentation style you could write an effective primer to basically GIS ( 🙂 ) http://wiki.gis.com/wiki/index.php/New_to_GIS#Related_links

Wendy Mak

nice :)) I used to do a lot of spatial stuff (postgis mainly but also a bit of python). Would be nice to have a deeper dive into some of the maths definitely

Alexey Grigorev

I know great developers who want to get into machine learning, but they are scared of math. The moment they see a formula, their mind goes blank.
What would you recommend them to do? How can they overcome this fear?

Alexey Grigorev

I think the fear comes from school/university when teachers just force math down our throat without really explaining why we should learn it

Roman G

this may help to manage fear

Evren Unal

Alexey Grigorev same problem goes for me

Roman G

It was the same for me, but if you take your time to break a complicated formula to parts and dig into each of them, then after a couple of iterations it won’t be that scary

Evren Unal

I usually learn difficult topics by finding good explanations

Paul Orland

Roman G I have found there is a delicate tradeoff between lowering inhibition and keeping ones mental faculties intact with the method you propose 🙂

Alexey Grigorev

This one? https://xkcd.com/323/

Paul Orland

I like this question because it is a problem I still have – sometimes I find myself looking at a page in a math textbook and thinking to myself this looks hopelessly complex.

Paul Orland

Alexey Grigorev yes exactly!

Paul Orland

I would say, start by writing down the formulas you do know or drawing diagrams (related to the topic), without looking at a book or other resources. That should show you where the holes in your understanding are. Then go back to the book and try to fill these holes as needed. Over time, you should get some more confidence!

Alexey Grigorev

Makes sense, thank you!

Paul Orland

I would say, start by writing down the formulas you do know or drawing diagrams (related to the topic), without looking at a book or other resources. That should show you where the holes in your understanding are. Then go back to the book and try to fill these holes as needed. Over time, you should get some more confidence!

Alexey Grigorev

Why knowing math is a good idea for programmers? Might it be useful for developers even if they don’t need it at work?

Ennio M.A.

I would say yes, I believe that algorithms are basically about breaking mathematical constructs into simple step by step processes or approximations, at school too much emphasis is given to paper math, I think more emphasis should be put into computational thinking in all engineering degrees not only computer science.

Paul Orland

A lot of ideas transfer directly from math to computer programming: logic, functions, sets, etc. I’m a strong believer that math skills help you think more rigorously about software (of any kind) that you build

Alexey Grigorev

Also I’m curious what you think about the way math is taught at schools and universities. Is there something you’d change?

Paul Orland

Yes, I would change some things! I think math classrooms should be flipped, meaning record lectures so students can consume the content at their own pace, independently. Then save class time for exploration and problem solving. I would also say that most people who take math in college are not going to become mathematicians, so there should be a greater emphasis on applied math and using technology to solve math problems (e.g. Python or even Excel)

Alexey Grigorev

Nice! How would you motivate students to watch the content at their own pace before the classes?

Alexey Grigorev

That’s a problem I also have when teaching adults =)

Paul Orland

Obviously some students are more self-motivated than others, but I think this would increase the quality of the learning experience and have most people more engaged overall.

Alexey Grigorev

Yes, makes sense! Thank you!

To take part in the book of the week event:

  • Register in our Slack
  • Join the #book-of-the-week channel
  • Ask as many questions as you'd like
  • The book authors answer questions from Monday till Thursday
  • On Friday, the authors decide who wins free copies of their book

To see other books, check the the book of the week page.

Subscribe to our weekly newsletter and join our Slack.
We'll keep you informed about our events, articles, courses, and everything else happening in the Club.


DataTalks.Club. Hosted on GitHub Pages. We use cookies.