Live data from Hacker News

Poll: What level of math is programming roughly analogous to?

news.ycombinator.com

71–80 of 165 posts

Re: Poll: What level of math is programming roughly analogous to?

#71

Programming isn't analogous to math, programming is a communication language with really strict rules that uses math of all stages. Different tasks involve different math. I'll give some common examples for laymen, but they may seem obvious in hindsight: Programming a very rudimentary "snake" computer game is [using] using Algebra. If your son (or anyone) understands variables, assignment and adding them together, th…

To add:

Programming a first person shooter requires linear algebra. Programming crypto-algorithms require discrete math.

Re: Poll: What level of math is programming roughly analogous to?

#73
Anecdotally, but it started programming games when I was 11, using gamemaker 4, and it's GML scripting language. I breezed through maths for the next couple of years, as I fundamentally understood primary/early-highschool algebra.

The problem arises, in that I adored maths, and had amazing teachers , and my father is an engineer and would sit me down every week and teach me more about maths, so how much can be attributed to programming, is hard to say. All I know is that variables introduced in the classroom made the class look at me funny when I pointed out how they worked when programming, in grade 6!

Re: Poll: What level of math is programming roughly analogous to?

#74
I had to understand trigonometry to write a good motion function. So you have to have at least the understanding of trig to write that program. But having a language to abstract away the complexity meant I didn't have to know more than trig, which I would have had to if I wanted to write the program more effectively or in pure math.

Re: Poll: What level of math is programming roughly analogous to?

#75

Programming isn't analogous to math, programming is a communication language with really strict rules that uses math of all stages. Different tasks involve different math. I'll give some common examples for laymen, but they may seem obvious in hindsight: Programming a very rudimentary "snake" computer game is [using] using Algebra. If your son (or anyone) understands variables, assignment and adding them together, th…

"Programming isn't analogous to math"

I think it's analogous to math in the sense that a programming language is a formal system, just like any logical system. The syntax is defined by formal rules, it semantics if not defined formally is strictly defined by the compiler implementation or hardware.

Actually, the link between programming and proving as been characterized by the "curry-howard isomorphism" that says that a program is a proof of his type. In that sense, programming = writing a proof.

For instance, in ML : the program "fun (x,y) -> x" is a proof of the proposition "A and B => A". This idea can be extended to more complex types/propositions (see the Coq proof assistant for instance).

That being said, writing programs usually require different set of skills than doing mathematics. The best programmers are not always the best mathematicians and conversely. To me difference shows especially for big complex software, rather than smart algorithms in programming contests for instance.

Re: Poll: What level of math is programming roughly analogous to?

#77
Since I'm not from the US and we don't have 'levels' of math where I live (you take math in high school and get some or all of the above combined), can someone explain to me what each level entails?

While I know the definitions of each term, I'm unclear on what exactly 'Pre Calculus' would be in this case. Also, is Trigonometry higher than Algebra or Algebra 2, if that question even makes much sense? Finally, what are the differences between Algebra and Algebra 2, and Geometry and Geometry 2?

Re: Poll: What level of math is programming roughly analogous to?

#80
There are really two different ways in which programming and math match up.

At a basic level, programming and algebra have a few key things in common (variables most notably), and more generally you'll probably end up using math to solve some common problems that come up in programming; that won't really rise to the level of advanced mathematics, though, beyond roughly algebra plus linear algebra.

More importantly, though, math and programming are both heavily about learning, seeing, and applying patterns. Algebra, trigonometry, geometry, calculus, discrete math, and linear algebra all give you a toolbox of patterns to apply. Likewise, the more you learn about programming (or more generally CS), the more you have a toolbox of patterns to apply. Both heavily involve analytical reasoning and fast pattern matching against a vast set of possibilities. In other words, both of them bend your brain in many of the same ways, and they cross-train incredibly well.

Post reply on HN