Live data from Hacker News

How much math you need for programming (2014)

lispmachine.wordpress.com

141–150 of 187 posts

Re: How much math you need for programming (2014)

#141

As usual, the answer to the eternal question of “how much formal math training do you need for X” turns out to be “right around the amount the author of the argument has had.” Why is it that we always have to prove the instrumental value of maths education? You’re a lot more likely to “need” your maths in the “real world” than your Shakespeare, but few have much energy for fighting the idea that literature should be…

I think the “problem” here is that there are so many useful things you can do with math that we spend all of our time in school learning the useful things first, with much less emphasis on the enjoyment aspect.

It’s a shame, too. As an undergraduate I had a very small amount of exposure to some papers in theoretical computer science. I presume they were fairly typical for the world of mathematics - trying to establish boundaries on how small something can be. And not much application in the real world. But I remember having my mind blown at the way the authors could take one problem, convert it to some completely different domain, and use previous work in that domain to prove things about the original problem. It was very beautiful, and I think even that very limited exposure has changed the way I see the world.

Then the real world came knocking and I haven’t been back since.

Re: How much math you need for programming (2014)

#142
I would say 'studying maths teachs you how to abstract problems' or 'computer science usually cares for the results, not the method' but that has been said a lot in other comments (and it's not exactly right).

Instead I will point an interesting fact I've noticed myself among my computer science classmates (from my second degree, I first did mathematics).

When you stumble around 'maths' (which in classes it's pretty common, to explain things using mathematical formulas, but in the real world it's also common to have some explanations even in stack overflow using math expressions), in that situation other computer science students usually see them as something 'strange', something to be afraid of or reject by searching alternatives; whether myself and other math/physics-students just don't care, we are used to it (and most times it's just a function)

My opinion is: you don't need maths (99.99% of the time), but you also don't need to be afraid of them and knowledge is very good for that.

Re: How much math you need for programming (2014)

#143
post #28

> Now what does does a mathematician do? He tries to understand nature and uses mathematics as a language to do that. I would argue that this is wrong. That's what physicists do, not mathematicians. Mathematics is about abstract ideas, which can live regardless of nature or application. Physics instead is about understanding nature. Most physicists use mathematics to do that, but that's just for practical reasons. Th…

> I would argue that this is wrong. That's what physicists do, not mathematicians. Mathematics is about abstract ideas, which can live regardless of nature or application. Physics instead is about understanding nature. I would disagree. They both are the study of nature just different aspects of it. Mathematics is the study of the some of the more universal formal causes, while Physics also involves the particular ma…

[deleted]

Re: How much math you need for programming (2014)

#144

As usual, the answer to the eternal question of “how much formal math training do you need for X” turns out to be “right around the amount the author of the argument has had.” Why is it that we always have to prove the instrumental value of maths education? You’re a lot more likely to “need” your maths in the “real world” than your Shakespeare, but few have much energy for fighting the idea that literature should be…

I think the “problem” here is that there are so many useful things you can do with math that we spend all of our time in school learning the useful things first, with much less emphasis on the enjoyment aspect. It’s a shame, too. As an undergraduate I had a very small amount of exposure to some papers in theoretical computer science. I presume they were fairly typical for the world of mathematics - trying to establis…

I would have been happy with useful.

Most of college was proving everything.

Okay, I get this is important for high level math.

I want to do “something” with it.

I did a lot of basic robotics programming for pay in early college. Taught myself a lot of math to get the job done. Later I hit Trigonometry. Wow that would have been handy in that role.

Re: How much math you need for programming (2014)

#145
post #78

When working with CSS/design I used subtraction, multiplication and division. When working with e-commerce/finance I used algebra. When making a 2d game I used geometry. When making a 3d engine I needed to learn about vector, matrices, etc. When working with weather forecasting there where formulas involving sin,cos,atan etc. So while you do not need math to get started in programming/development, you will definitely…

Reminds me of a buddy of mine working on a computer game. Gravity needed to be simulated -- easy enough, the formula is as basic as it gets. Results looked wrong to him though and he ended up using some trigonometric function instead ;-}

Most games don't use 9.8 for g. There's also the bit about how Mario violates Newton's First Law when he changes direction mid-air, but don't let physics get in the way of fun.

Re: How much math you need for programming (2014)

#148
The most critical thing a programmer needs is a sense of order-of-magnitude, to know when the thing he/she is building or implementing is going to break. And a sense of how likely such a thing is to break, again, within order of magnitude common sense-driven probability.

From loops to architecture, this is applicable. Of course, you can apply this deeper, to processing efficiency, fetch times, etc. etc.

I think most other fancy equations or theorems can be learned as needed. But sense checking your math with skepticism about your own assumptions, and knowledge of orders of magnitude, is key.

Re: How much math you need for programming (2014)

#149

There are two different problems actually : what you write, and the quantitative aspects of your code. What you write may or may not have a strong maths component ( game engine vs crud app say, or PDE solver vs typical 'plumbing' app). However, the moment you start having performance issues (and this is everywhere), maths comes in very handy : big o, back of the envelope calculations, orders of magnitude, etc. You ma…

I'm self-taught with minimal maths and this is something I've used. I started re-learning some basic math for fun and now I find it helpful now to visualize mathematical models of some basic runtime characteristics of my programs. A simple example is that I will visualize X number of users firing Y number of requests, and I'll actually imagine this as a live system with various statistical properties (% of errors and…

Indeed! I very much agree with the model vs sequence opposition.

Another useful side of the model / math approach is that it allows you to formalize your problem and derive hard bounds, ie know in advance what's achievable and what's not (the 'let' s derive a bound' approach being another standard method in maths).

Re: How much math you need for programming (2014)

#150
Over the many years, I've taken over 25 university math courses. There are a handful that I feel I would not have missed as a programmer. I've been a computer scientist and software engineer for over 45 years, here are the mathematical subjects I've taken college classes in divided into two groups:

Useful for at least some programming or work I've done in the past:

* Linear Algebra

* Geometry

* Calculus and Vector Calculus

* Differential Equations, Partial Differential Equations, and Control Theory

* Logic

* Combinatorics and Graph Theory

* Number Theory

* Fourier Analysis and Laplace Transforms

* Operations Research

* Discrete Math

* Computability

* Probability

* Statistics

* Numerical Methods

Classes that I haven't needed for programming yet:

* higher levels of Abstract Algebra, Non-Commutative Ring Theory

* Real Analysis, Complex Analysis, Measure Theory

* General Topology (I suppose some concepts are useful in category theory and perhaps kernel transformations in machine learning are superficially similar to the subjects covered in Topology)

The world is full of programs so some don't require much math, but mathematical sophistication is needed for advanced programming and young programmers should do their best in school to learn math well.

Post reply on HN