Live data from Hacker News

Ask HN: Math for Programmers?

news.ycombinator.com

31–40 of 46 posts

Re: Ask HN: Math for Programmers?

#31

Earlier quoted context omitted.

I would agree, your typical dev writing CRUD apps needs an ok grasp of algebra, and that's about it.

What would you say they need the algebra for?

Let's suppose the business logic in your basic CRUD app needs to calculate some value based on one or several DB fields. You need to know enough algebra to convert that into a formula that you can use in code.

Re: Ask HN: Math for Programmers?

#33

Category theory has very hard definitions and not many theorems. Would not recommend. It has Grand Unified Theory vibes so pseudo intellectuals have a hard on for it. Don't waste your time trying to understand people who write to make themselves sound smart. You aren't missing out on anything. Here is a recent article from TOPLAS, imo a top programming language journal. No category theory here... https://dl.acm.org/d…

In my sole experience working at a company (startup) that embraced those who understood category theory, those types were not the ones producing any discernible value for the company. They instead attempted to browbeat certain thinking into others at the expense of their focus. I'm a fan of "sane FP," but the pseudo-intellects left a horrible taste in my mouth on the subject of the underlying math that I very likely will never recover from.

Re: Ask HN: Math for Programmers?

#34
post #13

I'm writing a book just for you :) It's called "Practical Math: A Tour of Mathematics in Production Software" ( https://pmfpbook.org points to an announcement and mailing list) The idea is to give a large swath of examples of math used to solve real problems, and collectively to give a good answer to your question. And to have the examples be appreciable by the average programmer, in the sense that they could reasona…

Perhaps the concepts of vector embedding and the attention mechanism could be explained. Also you could use some prompts for LLM to generate new content for your intended audience, mostly to classify them, so that your reader could copy your prompt and ask for further clarification.

Example: In chapter 5 here is a prompt that resembles the content of this chapter, to solve some of the exercises or clarify some points, your prompt would be along the lines ...

Just some ideas.

Re: Ask HN: Math for Programmers?

#35
post #10

The average programmer could probably get by with high school maths and just enough college-level statistics to know the difference between mean, median, percentile, and standard deviation.

Probably not required, but understanding the concept of a statistical distribution has come in handy many times for me when trying to improve the latency of systems. If you are unaware of distributions, you might measure latency multiple times and then calculate something like a mean or median. When thinking in terms of distributions you are more likely to draw something like https://matthiaslee.com/content/images/2017/05/bimodal_dist.... which contains much more information. That example tells you that you have at least two different kinds of latency. It could be 2 different use cases, 2 times of day, cache hit vs. cache miss, etc. It's enlightening to know that there are multiple factors and how much they differ!

Re: Ask HN: Math for Programmers?

#36
post #13

I'm writing a book just for you :) It's called "Practical Math: A Tour of Mathematics in Production Software" ( https://pmfpbook.org points to an announcement and mailing list) The idea is to give a large swath of examples of math used to solve real problems, and collectively to give a good answer to your question. And to have the examples be appreciable by the average programmer, in the sense that they could reasona…

The pimbook itself looks fantastic. As an aside, any recommendations on the inverse, a programming introduction for mathematicians.

I don't know about mathematicians, but everyone should read How to Design Programs book when they are starting out. Fantastic way of forming great mental models.

Re: Ask HN: Math for Programmers?

#37
My Personal Opinion.

If you can do real life tasks like balancing a checkbook or figuring out how to split a restaurant bill, you probably know enough math to be a pretty good or even elite programmer, except for specializations like working on 3D graphics.

Most programmers aren't inventing new calculus concepts from scratch as part of their problem-solving. Most are doing fairly simple order of operations (PEMDAS) types of math problems and glueing CRUD APIs together. The level of math required for that can be done by a solid middle-schooler.

Re: Ask HN: Math for Programmers?

#38
Getting started, algebra was enough for me. However, as I got slammed by algorithmic complexity problems like nested loops and needing to pick out the proper type of collection (data structure/sorting) for holding information, things like Big-O notation and Discrete math became more interesting. Once I started doing work with financial analysis and other optimization problems, calculus became quite useful, even if it was just to calculate an occasional slope. When I wanted to understand the underpinnings of deep learning, linear algebra concepts like working with vectors and matrices as well as more calculus was quite handy. Now, I'm really interested in quantum computing and having only scratched the surface of linear algebra, I need to go back to the books to build a foundation to move forward on. I suppose it's an individual choice for the direction you want to go in.

Re: Ask HN: Math for Programmers?

#39
Advanced math make my write faster code. My code always outperforms noobs' code by a factor of 10x-40000x, in single threaded pure python without numpy or so. And for some particular operations, my pure python implementation even outperforms numpy behind C and Rust.

Re: Ask HN: Math for Programmers?

#40

Category theory has very hard definitions and not many theorems. Would not recommend. It has Grand Unified Theory vibes so pseudo intellectuals have a hard on for it. Don't waste your time trying to understand people who write to make themselves sound smart. You aren't missing out on anything. Here is a recent article from TOPLAS, imo a top programming language journal. No category theory here... https://dl.acm.org/d…

I want to clarify, I am not trivializing the work of category theorist. It is a field of mathematics which provides a useful framework for algebraic geometers and algebraic topologists, and has even been fruitfully applied outside of math.

A personal favorite of CT generalizing an existing idea is in knot theory the khovanov homology detects the unknot, which is an amazing feat for a knot invariant. Bar Natan covers the construction well: https://arxiv.org/abs/math/0201043

However for some reason this particular field of math is a lightning rod for quacks. I don't really know why, but that is the way things are now.

Post reply on HN