Live data from Hacker News

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

news.ycombinator.com

111–120 of 165 posts

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

#111
post #68

Earlier quoted context omitted.

Mathematics is also a "communication language with really strict rules". In one sense, programming often uses math. And math often uses programming. But, in a deeper sense, programming is math and math is programming. They're just different views on the same underlying ideas. They're different fields of study mainly because the priorities are so different. Of course, this doesn't mean it makes sense to map Objective-…

Mathematics can easily be applied to anything from cooking to theoretical physics. That doesn't make any of these things math or the other way around. You can use math to solve a programming problem (perhaps to a greater extent than in cooking) and you can express many of the problems in mathematical terms, but in the end math is an abstract tool and programming is not.

I'm not sure there is such a difference between mathematics and an "algorithm". Time can be factored out of a process. A process can be represented as a sequence of objects. Take a function taking some arguments, one can describe this function in it's entirety by describing each sequence of objects generated by each possible input. Then if one wants to recreate the operation of the function one simply looks up the appropriate sequence of objects. A function then becomes a mathematical object in the abstract. In the same way some mathematical object can be described as the result of some process. Take the definition of the natural numbers, an object 0 is defined and a successor to this object to the next object is defined. This operation defined recursively sets up the whole natural numbers. The description of the natural numbers is the result of the evaluation of this function recursively applied, or the infinite application of this function. Since the study of mathematics is the study of these abstract objects and these objects encapsulate those objects which we can produce in the physical world through some process, mathematics by definition is a study of programming. Whether the mathematics explored by mainstream mathematics is the same mathematics explored by the code monkey is perhaps relevant. But the duality exists. In essence a study of physical reality is the study of those mathematical objects which can be constructed by the processes extant in that reality. So analysis of anything is mathematics, it just may not be the kind of mathematics we usually associate with the word.

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

#112
post #61

If you voted you don't understand math or programming. Programming is recipes for a computer to follow. In many cases there is Zero math involved. You can write plenty of Data Entry code and never use a single numeric function. Conversely you could write a single line of code that required all the math skills of a Quantum Physics Doctorate. Programming is not "math" it is recipe authoring. It is more analogous to hom…

... and yet the obvious answer to a poll like this lies on the bottom.

HN makes me sad these days

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

#113
I read the results on the survey that computer scientists should learn more of what math can offer them.

One premise of this survey is that math and cs are both "sequential" -- which is FALSE. And the survey assumes the Math and CS sequences can be placed in parallel. This is an artifact of the "grade" systems in school.

The two winners in the poll are "algebra" an HS subject and "discrete math" which is usually taught in college. And I am surprised to see how few people chose geometry :-(

In university, Engineering departments and physical sciences departments teach math to their own students in parallel with more abstract treatments in a math department.

I bought a copy of "Robot Vision" and it's basically multivariate calculus with awesome pictures!

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

#114
A kid programming an iPhone app could be programming at a high level and doing neat stuff, but you clearly indicated that he is doing plain vanilla programming, so I'm going with the Algebra level. That's not to say your son isn't advanced (making any kind of working app is far above the level of most 11 y/os), just that the actual math probably isn't complicated, it's the concentration and attention to detail and creativity and being able to work with APIs that he's really getting ahead in. I'll concede the point that certain projects require math skills in certain areas, and CompSci PhDs need to understand some obscure parts of the math world (lvl 20 if Calculus rates a 10), but making an icon move around a screen is more like writing a recipe on how to bake a cake than it is mathematics.

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

#115
post #68

Earlier quoted context omitted.

Mathematics is also a "communication language with really strict rules". In one sense, programming often uses math. And math often uses programming. But, in a deeper sense, programming is math and math is programming. They're just different views on the same underlying ideas. They're different fields of study mainly because the priorities are so different. Of course, this doesn't mean it makes sense to map Objective-…

Mathematics can easily be applied to anything from cooking to theoretical physics. That doesn't make any of these things math or the other way around. You can use math to solve a programming problem (perhaps to a greater extent than in cooking) and you can express many of the problems in mathematical terms, but in the end math is an abstract tool and programming is not.

Beg to differ:

http://www.amazon.com/Our-Mathematical-Universe-Ultimate-Rea...

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

#116

I always thought phrases like "algebra 2" were signs of somebody who doesn't know very much. Is there some intrinsic "twoness" of it? Does it mean anything that you have supposedly spent a year of it already, and now it is the second year? Would not the topics of the second year vary from school to school? Similarly, "pre"-calculus. It came before calculus. Does that then include the ability to tie my shoes? I learne…

Agreed. Really, middle/high school level algebra ought to be called "simplifying equations" or "solving for a variable" because real math majors know that a college level algebra course is worlds apart and middle/high school teachers should be shot for letting their students think that they are competent at anything more complicated than balancing a checkbook. Similarly, pre-calc ought to be "concepts that we think you ought to be familiar with before you take calculus because you need to have a fundamental understanding of these concepts before you can do anything useful in math because, trust us on this, it will be nice to have these tricks in your toolbox of knowledge," but I suppose that is just too long so they kept it at pre-calculus.

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

#117
The mathematics that programming -- program verification -- requires is unlike traditional mathematics. All programmers do this; all programmers will go through a process to reason why his programs are correct. This process might be formal or informal, conscious or subconscious, through or incomplete. The most relevant branch of mathematics would be formal logics.

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

#118

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…

Algebra, at least in the high-school algebra sense[1], is just really strict rules for communicating points on a (line, plane, etc). It is a bunch of operations for finding an equivalent way of stating the same thing, and some rules for reasoning about those points. For example, finding the roots of a function is nothing more than manipulating a statement until you find out where y = 0.

In a direct use way - any time you program with conditionals you are directly applying boolean algebra. There is no way around it - you have to understand how the basic rules of boolean algebra work. e.g. how does 'not' distribute, how do "AND" and "OR" work, etc. And it certainly helps with simplifying code if you can apply DeMorgan's law or distribute your conditions differently. There is a reason it's called refactoring code - it is just applying the algebra rules (usually the boolean ones) to program flow.

Similarly, but a bit more abstract, string primitive operations are an algebra for working with series of characters. They are equally strict, although not the exact same rules as those for points on a curve. For instance associativity doesn't apply to addition. Multiplication isn't defined for some languages, and there are different ways to define it for other languages (does it distribute, etc). This isn't even that abstract...

Given a string, solve for the character at position x. This is not really different than given a function, solve for the position at x.

Given a function, and value y, solve for x. Its the same as given string, find the indices for a character.

The operations are a bit different, but the reasoning between them is exactly the same: manipulate the givens with the rules that are defined. Use the rules to find properties of the target.

[1] there are other algebras - for example ring theory algebra. It has rules that are different (mostly generalizations of basic algebra rules, but that have weird and non-intuitive results if all you know is basic high-school algebra). This sentence from the wikipedia article explains it well:

"It follows that algebra, instead of being a true branch of mathematics, appears nowadays, to be a collection of branches sharing common methods."

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

#119
post #92

Earlier quoted context omitted.

No, the relationship between programming and mathematics is much deeper than that. In particular, it's not a relationship to the sort of mathematics you are thinking of--not the sort that you would use to solve a concrete problem or apply to physics or cooking. Rather, the relationship is between what a program is and the very foundations of mathematics--formal logic. In particular, a programming language is a formal…

This is philosophical mumbo-jumbo. When people program, they (usually) don't do math. And that's it. The fact that you can view a programming language as a formal system, and the fact that computer programs can be viewed as mathematical proofs of mostly totally uninteresting propositions, doesn't magically turn programmers into mathematicians, just as the fact that the brain can be viewed as a chemical and physical s…

> When people program, they (usually) don't do math. And that's it.

I disagree. Whenever you implement an algorithm, you build a proof of correctness in your mind. If you reasoned about your program and are convinced that it handles all corner cases properly, then it would only be a formality to write this proof down. If you can't easily do that, then you can't possibly be certain that your program has no bugs.

In practice, you don't bother with this kind of thing unless you are writing extremely complex algorithms, of course, but that doesn't change the underlying principle.

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

#120
If that's your 1-10 scale I'd say:-

| bog standard, journeymen, CRUD programming in Objective-C | = 3

But programming and maths aren't analogous but they're also not completely orthogonal, so my answer would be in the complex plane somewhere around:-

2.98 + 1/3i

| 2.98 + 1/3i | =~ 3

Post reply on HN