Ask HN: Which areas of math are practical to programming/algorithms and why?
31–40 of 101 posts
Re: Ask HN: Which areas of math are practical to programming/algorithms and why?
#32Matrix multiplication is a must-have for any graphics programming and knowledge of them is very useful for learning neural networks. And on the more esoteric side of things, in Quantum Computing every logic gate is actually a Matrix Multiplication
Re: Ask HN: Which areas of math are practical to programming/algorithms and why?
#33Math is rarely necessary for software development. However, math is one way great engineers distinguish themselves from okay engineers. I work primarily on audio software. Linear algebra is most important, followed closely by signal processing. Those are sufficient to write good software. Great software requires statistics, calculus (mostly for optimization but also modeling), and discrete math (again mostly for opti…
I recently realized that math is not necessary for programming... if you want to be stuck doing boring stuff like webdev or CRUD apps.
Re: Ask HN: Which areas of math are practical to programming/algorithms and why?
#34Math is rarely necessary for software development. However, math is one way great engineers distinguish themselves from okay engineers. I work primarily on audio software. Linear algebra is most important, followed closely by signal processing. Those are sufficient to write good software. Great software requires statistics, calculus (mostly for optimization but also modeling), and discrete math (again mostly for opti…
> Math is rarely necessary for software development. However, math is one way great engineers distinguish themselves from okay engineers. I recently realized that math is not necessary for programming... if you want to be stuck doing boring stuff like webdev or CRUD apps.
Also, there are many kind of maths, the Europeans even get this right over the Americans by making it plural. Math is necessary is like saying things are necessary...which thing? It really depends on what you are doing, and experience with a known field of math might not be useful for some problems (beyond the abstract reasoning you need to write code at all).
Re: Ask HN: Which areas of math are practical to programming/algorithms and why?
#35It's a bit strange that nobody mentioned Boolean algebra: https://en.wikipedia.org/wiki/Boolean_algebra
Re: Ask HN: Which areas of math are practical to programming/algorithms and why?
#36I'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…
(0) The interface of an abstract data type (set, heap, etc.) is the signature of a variety in the universal algebra sense. Implementations are concrete algebras of this variety.
(1) Homomorphisms of varieties can be used to bootstrap abstract data types from simpler ones in a generic way. Chapter 10 of Okasaki's book “Purely Functional Data Structures” is entirely dedicated to this technique, although he doesn't make the connection to universal algebra.
But are also some differences:
(2) I'm using a functional programming language (Standard ML), rather than an imperative one (C++).
(3) I emphasize persistent data structures over ephemeral ones. I don't reject destructive updates that are compatible with persistence (e.g. laziness).
(4) I use algebraic data types to statically rule out unreachable code paths. Inexhaustive pattern matching is considered a bug. Raising an exception saying “this path was supposed to be unreachable” is also considered a bug. This would be at best very difficult to enforce in C++.
Re: Ask HN: Which areas of math are practical to programming/algorithms and why?
#37I'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 know Alexander Stepanov personally, and Paul McJones through him, and they are both interested in seeing the ideas in the book implemented in other languages. Rust is a particularly compelling candidate, because it allows you to specify type constraints on generic functions through traits. This is similar in some ways to "concepts" which Alex has been hoping to see implemented in C++ for a very long time but which keeps getting kicked down the road.
Re: Ask HN: Which areas of math are practical to programming/algorithms and why?
#38Basic algebra for the substitution model and basic calculus for high order functions and the notion of a transformation in general. Set theory is, probably, the most fundamental. Everything could be defined as a set or as a function. Lambda calculus, obviously. Some combinators. Basics of linear algebra. No category theory and other bullshit is needed. Sets will do. It is actually very important skill to avoid wastin…
Not to start a math war, but why is set theory okay but category theory bullshit? While they're both useful, I think category theory encompasses a bit more than set theory and it's only a little more abstract. I also like the more functional approach that a lot of category theory requires you to take; if you're used to imperative programming it's a pretty different and useful way to think about things and it's great…
Knowing where to stop in a heuristic-guided search is the most difficult part. In my opinion one should stop after realizing that the subject becomes too abstract and too academic and cease to be a tool of clarification.
Let's say that it has something to do with the pragmatism of Ayn Rand, Quality of Robert Pirsig, and to the general scientific method of removing bullshit, dogmas and nonsense in order to let the truth standing.
Re: Ask HN: Which areas of math are practical to programming/algorithms and why?
#39Basic algebra for the substitution model and basic calculus for high order functions and the notion of a transformation in general. Set theory is, probably, the most fundamental. Everything could be defined as a set or as a function. Lambda calculus, obviously. Some combinators. Basics of linear algebra. No category theory and other bullshit is needed. Sets will do. It is actually very important skill to avoid wastin…
Not to start a math war, but why is set theory okay but category theory bullshit? While they're both useful, I think category theory encompasses a bit more than set theory and it's only a little more abstract. I also like the more functional approach that a lot of category theory requires you to take; if you're used to imperative programming it's a pretty different and useful way to think about things and it's great…
Re: Ask HN: Which areas of math are practical to programming/algorithms and why?
#40It's a bit strange that nobody mentioned Boolean algebra: https://en.wikipedia.org/wiki/Boolean_algebra
Could you perhaps be a little more specific? Sure, we use OR, AND, and even XOR to deal with conditionals that map to T and F, but this seems like kind of a surface level use of booleans. When do we invoke the algebraic properties of the structure when coding?