3 ms·
>programming in general does not, to me, seem to be anything like doing math. Hi Colin, can you substantiate that? PhD in CS here and I've done some pretty har
by zeteo 14y ago
>programming in general does not, to me, seem to be anything like doing math.
Hi Colin, can you substantiate that? PhD in CS here and I've done some pretty hardcore math in my academic life.
After writing lots of proofs and lots of programs the two activities don't seem that dissimilar. They are very different "programming languages" indeed, but debugging, modularity, recursion are important for both activities. To give a more concrete example: for my thesis I've implemented at one point a geometric algorithm. Some of the computer code proved buggy so I went to the white board and simply increased the complexity of the math formulas, which allowed me to write less code. I don't see an immense difference between this and, say, combining C and Python code in the same project.
- ColinWright 14y ago>> programming in general does not, to me, >> seem to be anything like doing math. > Hi Colin, can you substantiate that? It's a statement about what I feel. As I say, I have a PhD in math (Pure Math: Graph Theory and Combinatorics). I have written many, many programs (both for money and not for money, both for myself and for others.) Coming up with proofs of things believed true but not yet proven does not feel to me to be at all, in any way, like programming. > After writing lots of proofs ... What sorts of proofs? Are these proofs of theorems, or are they calculations of formulas? > I went to the white board and simply increased > the complexity of the math formulas This feels to me like you are using "doing math" in a similar way to the way that someone "uses math" when adding up the grocery bill or dividing a restaurant check (but obviously insanely more complicated). I, too, have frequently stepped to the whiteboard to make more complex calculations, or derive more complex formulas, in order to simplify computations that must be done. That's not what I call "doing math." As I say, programming feels more to me like solving word problems, and I suspect that most of the divide and argument around this topic is caused by a lack of precision in the definition of "doing math". Which is ironic. Edits have been made for clarity.
- zeteo 14y ago>Are these proofs of theorems, or are they calculations or formulas? A calculation is a kind of proof, isn't it? Lots of papers contain theorems and lemmas of the form "f(x) = g(x)". I don't think proving such a formula is the same as applying some well-known algorithm (grocery / restaurant bill).
- ColinWright 14y agoAnd there's the difference. I do not think a calculation is necessarily a proof, but some proofs are accomplished by calculations. Some papers may contain a proof that "f(x)=g(x)" and proceed to prove the result by calculation, but that's not the only kind of proof, and it's not the only kind of calculation. And doing the kind of calculation that's in the intersection is not then programming. Sometimes in the act of programming you will do some math, but doing the math is enabling the programming. Doing the programming is not doing the math. It's a separate activity and a separate skill. Of course the boundaries are blurred, but I've honestly seen people write a program to take data from a database, present it nicely on the screen, and then assert that programming is just math. I doubt you're claiming that, but I've seen it claimed, and I think it's not only wrong, but misleading, and demeaning to both subjects. Sometimes you will use math in programming, and sometimes you will use programming in math. That doesn't mean that either is the other. And now I'm going to be controversial. And in case anyone else is still reading, here's a theorem: Theorem: A prime number can be written as the sum of two squares if and only if it is of the form 4k+1 . Just as there are many ways to write a program to accomplish a given task, there are many proofs of this theorem. If you're a programmer, and you think that programming is just math, then you should be able to come up with a proof for that theorem. The reason this is controversial is that many mathematicians couldn't come up with a proof quickly either. Here's another: Theorem: A number N is prime if and only if (N-1)!+1 is a multiple of N. And finally, one from my own area: Given a graph G=(V,E), a proper coloring is an assignment c:V->{1..n} of integers to vertices such that for every edge (u,v) in E, c(u) != c(v). (In words, color the vertices so that the endpoints of an edge are always colored differently). The "Chromatic Function" of a graph takes the number colors and returns the number of proper colorings. Theorem: For every graph, the Chromatic Function of G is a polynomial. People say that a good programmer can pick up a new language and/or library quite quickly and become productive in fairly short order. Most of the comments on HN about hiring practices say that you shouldn't test for knowledge of language or libraries or frameworks, but for actual ability to get things done. If programming is math, and someone is a programmer, shouldn't they be able to prove these theorems? ======== Disclaimer: This is a stronger position than I'm actually willing to defend, but I'm interested to hear people's views. ADDED IN EDIT: I've spent way too long on this and have things I must do. I'll return later to check for any replies. I'll also get a HN_Notify email if you do reply. Or email me directly.
- scott_s 14y agoPhD in CS here as well, and I've passed on doing a lot of hardcore math. If you're going to call what I do "math," then I feel you've stretched the definition of "math" to the point that it's meaningless. Also, one mathematician that I've worked with would object to calling CS math because he doesn't want it infecting his beautiful discipline!