Live data from Hacker News

Parallels Between Math and Software Engineering

beta.oreilly.com

51–60 of 97 posts

Re: Parallels Between Math and Software Engineering

#51
post #20

Well said. Advanced math is mostly about working with properties higher up the chain of abstraction, and then seeing what happens when you bring the insights learned up there back down to more concrete examples. From an OO point of view, the real numbers inherit almost every useful trait: they're a field, they have a topology, they have a measure. Studying the parent classes, so to speak, gives you abstract algebra,…

"Well said. Advanced math is mostly about working with properties higher up the chain of abstraction, and then seeing what happens when you bring the insights learned up there back down to more concrete examples."

I came here to say the same thing. I went through a lesser known engineering discipline, "Mathematics and Enigneering" [0] and found that the type of thinking one learns doing pure math proofs has served me well in my eventual career in aerospace systems engineering. I find that the thought process in considering a proof as a high level whole/black box or being able to drill down to the finest detail while still keeping the big picture in mind has translated quite well to my day to day traversal up and down the abstraction ladder at work.

[0] http://www.mast.queensu.ca/meng/undergrad/info.php

Re: Parallels Between Math and Software Engineering

#52
At the end of the article, the author mentions how we could possibly find other designs of mathematics. Well, some people already have!

Some mathematicians did not like the law of excluded middle, which states that for any proposition A, either A is true or A is false. So they invented intuitionistic logic, which is normal logic without the excluded middle, and started rewriting mathematical proofs in this new system. Turns out there's a lot of stuff you can prove in intuitionistic logic.

Some mathematicians did not like the axiom of choice. One of the consequences of this axiom is that every subset of the real numbers has a least element according to some ordering. Think about it, what is the least element of {1/n : n >= 1} ? Who knows! So what did they do? Some people found it so weird they either replaced it with a weaker axiom or a contradictory one.

There's even syntax arguments in mathematics! What's the derivative of a function f? is it f'(x) or df/dx ? Is multiplication represented by a dot (.) or a cross (x) or by a juxtaposition of expressions?

Sometimes we use big existing proofs in the middle of a proof to save time. And sometimes we use the big proof to prove something far simpler than the big proof. This creates a big dependency and some people dislike hate these dependencies because the reader of the new proof will have trouble understanding the proof completely. It's like dropping in some magic in the middle of the proof and saying: "if you want to understand this proof completely, go read this other 50 page article" Sound familiar? Some mathematicians hate this so much they insist on proving things from the ground up whenever possible so that the proof is as comprehensible as possible. This is the mathematical equivalent of dependency management.

Re: Parallels Between Math and Software Engineering

#53

I have, on multiple occasions, looked at math equations in CS paper and been like, "WTF?" But when I look at the implementation in code it's so obvious what's going on.

Can you give us some examples? I can't fathom how someone who cannot understand the math formula can understand the code.

Not surprising at all. If someone is not familiar with the notation it can certainly get in the way. Furthermore math notation is very context sensitive, so possibility of confusion abounds.

Re: Parallels Between Math and Software Engineering

#54

Earlier quoted context omitted.

> And just like mathematics, adding an another "axiom" to the law has far, far-reaching consequences. Actually mathematicians virtually never do this. Almost all of mathematics (from arithmetic to calculus to category theory) operates in the confines of ZFC[1] and adds no further axioms. All of these fields may add definitions , but these are just shorthand; the are conservative and have no actual consequences. It is…

>Actually mathematicians virtually never do this. Almost all of mathematics (from arithmetic to calculus to category theory) operates in the confines of ZFC[1] and adds no further axioms. Except for all the non-ZFC foundations, like type theory or category-theoretic foundations.

Relatively speaking, there are very few mathematicians using those systems to discover new mathematics as opposed to studying them for their foundational interest.

Re: Parallels Between Math and Software Engineering

#55
post #42
post #4

Very nicely put. I'm a big fan of linear algebra because it's the best example of why learning math is useful. Sure knowing about equation and calculus come in handy, but linear algebra is pure modelling superpowers and a much more valuable tool overall. Related: An awesome LA introductory lecture by Prof. Strang: http://ocw.mit.edu/courses/mathematics/18-06-linear-algebra-... Related 2: A short tutorial on LA that I…

I don't think you can say of any topic in mathematics that it's the best example of why learning math is useful. What about calculus? It's an immensely powerful tool that, by harnessing the power of the infinite and the infinitesimal, unlocks a massive body of practical applications in nearly every field of quantitative knowledge. And what about discrete math? Without it there would be no such thing as a computer. Di…

> What about calculus [...and...] differential equations ?

I agree that calculus and diff. equations techniques are important, but if you look closely, you'll see they are only "necessary" for engineers and physicists, and other "hard" sciences, and not so essential for non-science studies.

Imagine "pitching" the benefits of learning university-level math to a class of Arts students. Can you honestly say their lives will be improved if they were to learn about a bunch of techniques of integration?

On the other hand, I wouldn't hesitate to recommend learning LA to them. Thinking about operators, vector spaces, dimensions, etc. is applicable much more widely. (I speak from experience here, because I've been "finishing up" the applications chapter in my LA book and I keep finding new applications to cover: balancing chemical equations, electric currents and other network flows, nutrition, least squares approximations, linear programming, cryptography, network coding, error correcting codes, Fourier analysis, prob. theory, and quantum mechanics. The LA party just don't stop ;)

Re: Parallels Between Math and Software Engineering

#56

At the end of the article, the author mentions how we could possibly find other designs of mathematics. Well, some people already have! Some mathematicians did not like the law of excluded middle, which states that for any proposition A, either A is true or A is false. So they invented intuitionistic logic, which is normal logic without the excluded middle, and started rewriting mathematical proofs in this new system…

[deleted]

Re: Parallels Between Math and Software Engineering

#57
post #4

Very nicely put. I'm a big fan of linear algebra because it's the best example of why learning math is useful. Sure knowing about equation and calculus come in handy, but linear algebra is pure modelling superpowers and a much more valuable tool overall. Related: An awesome LA introductory lecture by Prof. Strang: http://ocw.mit.edu/courses/mathematics/18-06-linear-algebra-... Related 2: A short tutorial on LA that I…

I definitely think linear algebra has a lot of practical applications, but I'm not sure I would necessarily call it the "best" nor the "most valuable tool overall". It certainly provides the most bang for your buck if you are doing certain kinds of modeling, but even just within modeling which tool will be the most useful will depend a ton on what you are doing. For example, for dynamical systems you may be using lin…

Agreed. The "best" in my comment was entirely in the bang-for-your-buck sense.

Re: Parallels Between Math and Software Engineering

#58
post #10

It is also interesting that there are many parallels between software engineering and the design of mathematical proofs (or theoretical CS proofs, which I am more familiar with). In theoretical CS, people talk of catching and fixing "bugs" in proofs, namely, mistakes that make the proof fail but can hopefully be fixed while sticking to essentially the same idea. One can "refactor" proofs, in superficial ways (e.g., r…

If you are writing programs in Coq or another dependently typed programming language, these parallels between math and programming are not just incidental; they are one and the same. Theorems are stated as functions, whose type signatures reflect the theorem being proven. Even the gap that you mention at the end of your post is bridged, since the type checker will verify that your proof is correct (modulo the trust i…

You are, of course, correct. It's strange no one brought up https://en.wikipedia.org/wiki/Curry%E2%80%93Howard_correspon... yet. In a very real sense, programmers are creating mathematical proofs!

Re: Parallels Between Math and Software Engineering

#59

I have, on multiple occasions, looked at math equations in CS paper and been like, "WTF?" But when I look at the implementation in code it's so obvious what's going on.

Can you give us some examples? I can't fathom how someone who cannot understand the math formula can understand the code.

For me it's Path finding (A) I can understand the code, but not the mathematical equation https://en.wikipedia.org/wiki/A*_search_algorithm#Properties
Post reply on HN