Live data from Hacker News

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

news.ycombinator.com

41–50 of 165 posts

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

#41

Just yesterday I decided to begin reading a Calculus book (I never went to college). The very first thing covered was ƒ(x) which describes input being passed into a function. Needless to say, as a programmer I am very familiar with this concept. So far, my vote is for Calculus.

In my high school, I remember being introduced to functions of that type in Algebra II and at the very latest trigonometry (sines and cosines).

While a knowledge of functions is vital to understanding Calculus (the fundamental theorem of calculus depends on them), it's only a small component of the bigger picture. Calculus is mainly about how functions change with respect to some other variable (time is common) and the inverse of that operation.

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

#42

You will (probably) never pull out pencil and paper and do arithmetic (simple, with fractions, averaging, etc.), simplify an algebraic expression, convert to standard form, factor a quadratic, solve a system of linear equations, calculate the area of a polygon, prove something about triangles, solve an inequality, divide polynomials, take the slope of a line, etc. This is what "math" consists of in K12 and very littl…

Python also supports set operations (union, intersect, difference, issubset, issuperset, etc.). So set theory will help in that regard, too.

True, but the operations you just listed are intuitive. It certainly doesn't take a math class or pencil-and-paper practice to know how to use them.

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

#45
I think the way to answer this question is to imagine the universe of math students from age 8 to 21 and imagine which of them could learn 'bog standard journeyman CRUD programming' at the pace your son has.

I'm going to hazard a guess that you could teach it to most children his age although perhaps not as fast. I think the main obstacles being motivational and esoteric, not cognitive.

Not sure I like the structure of the poll choices either. Does anyone really think that trigonometry is at a higher cognitive level than the classes that are taken before it?

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

#46
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, they fundamentally understand Algebra.

Programming a the general parts of a diagramming library or a game with some physics is [using] Geometry and Trig.

Programming complex features of a diagramming library involve discrete math and graph theory.

Programming diagramming layouts can involve Masters level math understanding. (Sometimes, even when the algorithm is well known, it can take months to understand and implement, like planarity testing and embedding before 2004[1])

So it's roughly analogous to the difficulty and specificity of the task, which varies wildly.

~~~

[1] in 2004 there was a fast and "easier" to understand planarity testing and embedding algorithm, I suggest you skim it for an idea of the kind of math programmers can get into: http://jgaa.info/accepted/2004/BoyerMyrvold2004.8.3.pdf

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

#47

Despite what others are saying. This is a very good question. And extremely relevant. The answer depends on how great you want to become. Take as much math as possible to find the best solutions. I come from a background of the hard sciences, I never took programming in college and I was able to pick it up quite easily because of my strong foundation in mathematics, analytics and logic.

I agree 100% it is relevant.

I would put it into these terms, however, for simplification.

Coding simple programs is probably analogous to algebra/functional logic.

Having a 3-D model of workflow process with escalation loaded into your mind when you're working on an architecture is more akin to calculus. Add User Experience and network requirements into the mix and the skill is more akin to writing an Overture and the Opera. At this point you have a different animal than described above.

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

#48

Disclosure: I am a mathematics teacher. (I teach prealgebra to elementary-age pupils.) I am NOT a programmer. But I think the correct answer to the question is "it depends." In other words, even though you have specified a level of programming, "bog standard, journeymen, CRUD programming in Objective-C," and even though you have laid out the usual progression through the usual school mathematics topics in the English…

> In the countries that excel over the United States in mathematics instruction, proof is part of every mathematics course, not just part of geometry, for example. Can you expand on that? What do students do in other mathematical areas if they don't do proofs? I did all of my studies in France and I don't how much of a difference there is (though all my friends who have studied both in the US and in France found the…

What do students do in other mathematical areas if they don't do proofs?

The book I already mentioned, Knowing and Teaching Elementary Mathematics, will give much of the sad story. A really sad description of how mathematics textbooks are written in the United States[1] and a contrasting description of what kinds of problems are found in Russian textbooks[2] fill in more details.

It was on my second stay overseas (1998-2001), that I became especially aware of differences in primary mathematics education. I discovered that the textbooks used in Singapore, Taiwan (and some neighboring countries) are far better designed than mathematics textbooks in the United States. (During that same stay in Taiwan, I had access to the samples United States textbooks in the storeroom of a school for expatriates, but they were never of any use to my family. I pored over those and was appalled at how poorly designed those textbooks were.) I discovered that the mathematics gap between the United States and the top countries of the world was, if anything, deeper and wider than the second-language gap.

Now I put instructional methodologies to the test by teaching supplemental mathematics courses to elementary-age pupils willing to take on a prealgebra-level course at that age. My pupils' families come from multiple countries in Asia, Europe, Africa, and the Caribbean Islands. (Oh, families from all over the United States also enroll in my classes. See my user profile for more specifics.) Simply by benefit of a better-designed set of instructional materials (formerly English translations of Russian textbooks, with reference to the Singapore textbooks, and now the Prealgebra textbook from the Art of Problem Solving),[3] the pupils in my classes can make big jumps in mathematics level (as verified by various standardized tests they take in their schools of regular enrollment, and by their participation in the AMC mathematics tests) and gains in confidence and delight in solving unfamiliar problems. More schools in the United States could do this, if only they would.

[1] http://open.salon.com/blog/annie_keeghan/2012/02/17/afraid_o...

[2] http://www.de.ufpe.br/~toom/travel/sweden05/WP-SWEDEN-NEW.pd...

[3] http://www.artofproblemsolving.com/Store/viewitem.php?item=p...

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

#49

Disclosure: I am a mathematics teacher. (I teach prealgebra to elementary-age pupils.) I am NOT a programmer. But I think the correct answer to the question is "it depends." In other words, even though you have specified a level of programming, "bog standard, journeymen, CRUD programming in Objective-C," and even though you have laid out the usual progression through the usual school mathematics topics in the English…

Under the new "Common Core" standards for mathematics in the US, there's a lot more emphasis on proof in elementary-school mathematics than there was before. The terminology is usually more along the lines of "explain your reasoning", but the process is definitely proof-oriented. (Whether teachers will be able to incorporate those standards into their teaching, and whether students can live up to them, remains to be seen.)

Disclosure: I'm a full-time tutor for third and fourth grade mathematics in the inner city through the Denver Math Fellows program ( http://www.teachindenver.com/teachindenver/denver-fellows-pr... ).

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

#50
On some level, programming and math are the same thing. Algebras are programming languages for exploring mathematical structures. They just execute in the head of mathematicians (or in their computerized tools).

Many mathy programming languages exist in different dimensions of mathiness. To name a few: Haskell and/or F#, Lisp (specifically Clojure, in my opinion), Julia, R, J, Forth and/or Factor, or PostScript (the language of many printers) Logo, Erlang, etc. All mathy in different ways.

Any one -- Python or Clojure for example give you different sets of rules that you can use to manipulate the symbols of their language the same way different fields of mathematics give you different rules for manipulating the symbols of their language.

In general the better you are at understanding one the better you are at understanding the other.

They often collide more directly. Linear algebra is helpful in machine learning. Geometry and trig are helpful for ray tracing. Geometry is helpful for understanding multidimensional arrays in programming languages. Social sites like Facebook use graph theoretical algorithms to manage and mine their data for big bucks. The mathematical forumla of Bayes theorem figures prominently in many machine learning applications but also rationality, artificial intelligence, statistics, etc. You get the idea.

Most programming languages have a built in notion of a set which is fundamentally identical to the mathemtical concept of a set with the further restriction that the only types of objects you can put in a set are values of that language's data types and you have to refer to the null set as something else like nil or null.

Unless you're using Haskell (one of the most mathy of programming languages, being based directly on the mathematical field of Category Theory and having it's own official category called "Hask") where you have to understand something like the Maybe monad or the Either Monad or the List monad (and why that's largely equivalent to either of the others) in order to even think of not having a value. Of course understanding all of that is easier if you happen to understand what the mathematical concept of monad is. Which you probably don't unless you are a Category Theorist (or recreational Haskell dabbler).

With a deeper understanding of math you can more easily grok the power, elgance, grace and healing powers of things like Haskell and Lisp.

You need at least some understanding of basic math concepts to understand things like algorithmic complexity (i.e. "Big O" notation, amortized analysis, etc). Without this level of understanding you're in for a bad time trying to write anything more than a trivial program operating on a trivial data set.

It goes on. There's a lot to learn. But that's a big part of what I love about computer science. I can consume as much of the literature and concepts and ideas out there as I can as fast as I can and I will never run out of new things to learn, and on top of that, there's an ever expanding frontier full of new discoveries to make.

Anyway, none of this directly addresses your actual question which unfortunately I have no frame of reference for, but it's what I would want to know if I had a son who was interested in programming. And something I wish I understood earlier in my journey as a programmer.

Edited to add: And if I did run out of math/comp sci stuff somehow, it all translates to physics, cosmology, etc! :)

Post reply on HN