Live data from Hacker News

Ask HN: Which areas of math are practical to programming/algorithms and why?

news.ycombinator.com

71–80 of 101 posts

Re: Ask HN: Which areas of math are practical to programming/algorithms and why?

#71
Set theory is useful, as well as category theory (although I never formally studied category theory myself...maybe eventually I will).

Basic logic is also important - understanding symbolic logic, and methods of proof (direct inference, proof by contradiction, induction, etc.) also prove important.

I have had to use basic trigonometry in the past as well, and linear algebra (for CSS rotations/translations driven by JS).

Algorithmic number theory, closely related to algebraic number theory, drives cryptography.

Harmonic analysis drives audio.

Algebraic geometry powers facial recognition software.

The list goes far deeper, but I have been away from the math world for 6 years & have forgotten much.

Re: Ask HN: Which areas of math are practical to programming/algorithms and why?

#72
Lambda Calculus since it's a computer science field of study that makes math, in my opinion, useful for most situations in our field.

Math isn't majorly needed and you can learn what you need on the fly. For instance, if you want to get into game development you need to understand some fairly complex math concepts but nothing is stopping you from attacking the problem and either a) working around it with your understanding of the computing devices you are using or b) by learning what you need on the fly.

If you want to practice in a field that operates on computers, don't learn another field. That's like saying "what kind of philosophy most correctly correlates to learning about horticulture?" Just start to learn horticulture and as you need philosophy it will be tied in.

Re: Ask HN: Which areas of math are practical to programming/algorithms and why?

#73
post #21

Better question: what areas aren't?

Good question... Calculus? Of course it has a long history with computing, but I would say that probably less than 10% of programmers outside scientific fields use any calculus. There is calculus in machine learning but I think that counts as less than 10% of programmers, and it will probably become its own specialty separate from programming in the coming decades (to some extent it is already) From what I know of to…

Most programmers can forget the specifics of calculus, but the conceptual ideas of integration and differentiation are important. Many problems are better solved when you transform a series of changes into a whole (integration) and/or vice versa (differentiation).

Re: Ask HN: Which areas of math are practical to programming/algorithms and why?

#74
post #56
post #21

Earlier quoted context omitted.

Good question... Calculus? Of course it has a long history with computing, but I would say that probably less than 10% of programmers outside scientific fields use any calculus. There is calculus in machine learning but I think that counts as less than 10% of programmers, and it will probably become its own specialty separate from programming in the coming decades (to some extent it is already) From what I know of to…

Topology is useful in robotics and control to define the set of achievable states in a system and their connectivity.

On further reflection, it does seem pretty hard to find a subfield of math which isn't relevant to SOME subfield of computing. I was going to say non-Euclidean geometry, but that's very relevant if you're doing mapping software.

But that's a different thing than saying that a particular subfield of math is "practical to programmers".

I would say that programmers need the foundations of logic, algebra, and probability, and a bit of calculus (less than I was taught). And THEN they can learn topology, number theory, non-Euclidean geometry or advanced calculus if they need to, for their specific domain. You never know what you're going to end up doing 10 years down the road.

And of course that seems to be what happens in a good undergrad CS education, so apparently people better than us have thought about it :) Indeed college is supposed to give you the ability to learn how to learn, when new things come up, as they always do in programming. Quantum computing is basically a ton of linear algebra as far as I can tell.

Re: Ask HN: Which areas of math are practical to programming/algorithms and why?

#75

Lambda Calculus since it's a computer science field of study that makes math, in my opinion, useful for most situations in our field. Math isn't majorly needed and you can learn what you need on the fly. For instance, if you want to get into game development you need to understand some fairly complex math concepts but nothing is stopping you from attacking the problem and either a) working around it with your underst…

>Math isn't majorly needed and you can learn what you need on the fly.

I really, really hope that whatever you are doing does not involve cryptography.

Re: Ask HN: Which areas of math are practical to programming/algorithms and why?

#76

Lambda Calculus since it's a computer science field of study that makes math, in my opinion, useful for most situations in our field. Math isn't majorly needed and you can learn what you need on the fly. For instance, if you want to get into game development you need to understand some fairly complex math concepts but nothing is stopping you from attacking the problem and either a) working around it with your underst…

Have you tried interviewing at game development companies? Many will test the hell out of your 3D math concepts and will reject you if you don't already know it well. They don't accept that you can just 'learn it on the fly'.

Honestly I'm not sure if I'm be able to handle a modern graphics programming jobs unless I studied and practiced constantly for at least six months straight. And I've worked on a bunch of 2D games before (and one 3D game).

Re: Ask HN: Which areas of math are practical to programming/algorithms and why?

#77
Something I haven't seen anyone mention yet: the part of discrete math where proofs, particular proofs by induction.

It is a huge help to be able to think in terms of recursive algorithms in many applications, and proofs by induction both give you the tools for thinking this way and the framework for demonstrating that recursive algorithms are correct.

Re: Ask HN: Which areas of math are practical to programming/algorithms and why?

#78
post #28

I've been recently trying to make my way though Elements of Programming ( https://www.amazon.com/Elements-Programming-Alexander-Stepan... ) by Alexander Stepanov and Paul McJones and it makes me say abstract algebra. It's the first and only rigorous foundation of software engineering that I've seen. It basically maps abstract algebra to this somewhat simple subset of C++, introduces new algebraic objects (such as mem…

I just picked this up after having finished 'From Mathematics to Generic Programming' which is a ride in the park compared to what you're reading now. Looking forward to the task of slowly working my way through it. [Edit] Interested in Rust for the same reason, but I'm not attracted to Swift. It looks so much like Kotlin, I am not sure I understand the fuss over it other than it gives Apple devs a way out of ObjC. A…

Giving devs a way out of ObjC is a pretty big draw :).

Re: Ask HN: Which areas of math are practical to programming/algorithms and why?

#79

The CS departments in universities around the world have worked out good answers for this. Their thinking is summarized in the curricula they outline: which math courses they require as core subjects in the undergraduate CS degree program.

The math courses in most CS programs are not particularly useful, except as a weed-out function, and even there, I would argue that it's not particularly useful, since the Calc 1/2/3/Diff EQ sequence is not all that beneficial for anything I've ever encountered, in school or my career.

Re: Ask HN: Which areas of math are practical to programming/algorithms and why?

#80
post #21

Better question: what areas aren't?

Good question... Calculus? Of course it has a long history with computing, but I would say that probably less than 10% of programmers outside scientific fields use any calculus. There is calculus in machine learning but I think that counts as less than 10% of programmers, and it will probably become its own specialty separate from programming in the coming decades (to some extent it is already) From what I know of to…

Calculus (yes, continuous calculus) is pretty much the most important area of math you need to know to program well. In my books, if one can't integrate/differentiate a formula, they shouldn't be allowed to program a computer. Because that's how you end up with algorithms that take way too long to finish because the author couldn't bother to estimate how much computation the algorithm needs to perform at large inputs.
Post reply on HN