Live data from Hacker News

Why there is no Hitchhiker’s Guide to Mathematics for Programmers

jeremykun.com

61–70 of 76 posts

Re: Why there is no Hitchhiker’s Guide to Mathematics for Programmers

#61
post #28

There's a lot of interesting and valuable stuff in this post (enthusiastically upvoted!), but I think there are a lot of errors, too. First of all, let's acknowledge that many (the great majority of?) programmers have little or no use for math, and know it, and are correct. That's totally fine. I think danso's comment captures this well, with references to UI design, domain knowledge, engineering practices, etc, and…

"Secundus, after acknowledging the insanely annoying tendency of math papers to make up their own notation without ever defining it"

"The math case is hard because someone failed to tell you what you need to know, and no one wrote it down anywhere."

I agree with a lot of what you're saying but I don't agree with these two assertions.

I'm working developer and have been for 6 years (Ruby, JavaScript). About a year ago I wanted to learn a bit more about how math (logic in particular) gets used to prove interesting things about programming languages. It was a very short search for books/material on the subject that were approachable for me and contained plenty of fully explained notation (eg, inference rules in Pierce's Types and Programming Languages).

After convincing myself the math was nothing to be afraid of, approaching papers was difficult but not at all impossible. It really boiled down to putting in the time to fill in the gaps in my knowledge through reading referenced papers and taking notes. I have yet to come across a paper that does not provide, through references or explicit notation semantics, all the information necessary to understand the content.

Is doing the reference reading easy? No, it's very time consuming. That doesn't mean that these papers are deliberately evasive in their definitions.

[edit] If it's not clear I'm reading CS papers mostly to do with type theory. It may be that things are very different for pure mathematics papers.

Re: Why there is no Hitchhiker’s Guide to Mathematics for Programmers

#62
post #49

Earlier quoted context omitted.

> if you don't do proofs you won't get any better at understanding mathematics There is a vast world of mathematical understanding available to programmers who don't like proofs. I think there is some miscommunication here about what constitutes mathematics. Mathematicians tend to think of the art of proving things, whereas engineers (and programmers, and scientists) think of equations and how to solve them. I think…

It seems you're under the impression that real analysis is the foundation of mathematics (I certainly wouldn't consider Cantor sets or Banach spaces in there). Let's say you invent a new machine learning algorithm, how can you know how well it does? If you invent an algorithm to do anything, how can you be sure it's correct? Well you can always test it some things, but if it's really a new algorithm, then you need to…

I agree with you that if you want to prove the correctness of a new algorithm, you need to prove the correctness of that new algorithm. You're gonna want some proving skills there.

How often are programmers developing new algorithms? I guess it depends on where you draw the line for "algorithm", but let me propose two possible places for the line. On the one hand, you might use existing techniques in a new function. In this case, the proving technique you need is the theory of invariants and so on, as Dijkstra ranted about. You're not gonna need a lot of practice with higher-level math proofs for that. That's even assuming you care about "proving that it does what you say it does in all possible cases", which of course we all know is done by roughly 0% of programmers, especially with emphasis on the "in all possible".

On the other hand, you might make a bigger development, that requires more mathematical expertise. I suggest for your consideration that the correct description of a person doing this latter work is not "programmer", but "professor" (or grad student), and that this is relatively rare, and if this is what you meant all along, you've been using misleading language. I think you have it absolutely backwards when you say "this is an extremely rare case"; I think the case where you need real mathematical proof techniques is the extremely rare case, even in relatively math-heavy areas, e.g. numeric simulation. What you need, as I've said before, are techniques of calculation.

Also, my ML knowledge is weak, but from my modest knowledge, I don't think any of it works provably. It works probably. :) Seems a weird example to choose.

At this point, btw, I acknowledge that I'm thoroughly into "quibble" territory. =]

Re: Why there is no Hitchhiker’s Guide to Mathematics for Programmers

#63
post #28

There's a lot of interesting and valuable stuff in this post (enthusiastically upvoted!), but I think there are a lot of errors, too. First of all, let's acknowledge that many (the great majority of?) programmers have little or no use for math, and know it, and are correct. That's totally fine. I think danso's comment captures this well, with references to UI design, domain knowledge, engineering practices, etc, and…

Majority of mathematics isn't at all concerned with calculation techniques, this is a fundamental misunderstanding many people get from school, mathematics is the study of concepts and relationships between them. If you do not understand the proofs, you do not understand the concepts and you will not be able to apply them. People who learn mathematics as calculation are the ones that most often claim that have no use for mathematics, where in fact they did not really learn any. Proofs are also crucial in Computer Science, for example you do not really understand recursion until you see how it is related to an inductive proof. The widest areas of fruitful application of mathematics do not arise simply from "calculation techniques", whatever that would mean.

Re: Why there is no Hitchhiker’s Guide to Mathematics for Programmers

#64
post #40

Earlier quoted context omitted.

OP here. My point was that if you want to be better at math, then you need to get comfortable with proofs. There are lots of instances of using math for useful things, but if you don't do proofs you won't get any better at understanding mathematics. There are a lot of times when people want to know more about a particular mathematical fact (they genuinely want to understand why it is the way it is) but the minute you…

> if you don't do proofs you won't get any better at understanding mathematics There is a vast world of mathematical understanding available to programmers who don't like proofs. I think there is some miscommunication here about what constitutes mathematics. Mathematicians tend to think of the art of proving things, whereas engineers (and programmers, and scientists) think of equations and how to solve them. I think…

> There is a vast world of mathematical understanding available to programmers who don't like proofs.

Mathematics is a deep net of knowledge, you can not just somehow study "interesting functions" in isolation, only by systematically exploring the relevant areas and understanding the concepts you can apply it, and calculation is the easiest part most of the time. If you understand something clearly, you can prove it. If you can't prove it, you don't really understand it. It's that simple.

Don't equate proofs with epsilon/deltas and Cantor sets. There are very practical theories developed formally that you can only study fruitfully if you are not afraid of proofs. Algorithms, probability theory, statistics, machine learning are all full of proofs, there is not much to calculate until a very late stage and it is very practical right from the start. A formal approach does not necessarily imply highly abstract concepts.

Re: Why there is no Hitchhiker’s Guide to Mathematics for Programmers

#65
post #12

I've come up against this recently and I think a lot of imperative programmers will. For me, the basic pattern, starting from a career based on perl/php/java was this series of realizations: - EECS circuit design is based on a conceit that gives chips a speed limit - as a result, chips aren't getting much faster and that multi-cores are happening instead - parallel programming will become more and more essential to m…

Message passing is an ancient and well-understood mechanism for producing parallel, scalable, mutable-state imperative programs. Feel free to continue to not learn math :)

But that's not as much fun. :-)

Re: Why there is no Hitchhiker’s Guide to Mathematics for Programmers

#66
post #28

There's a lot of interesting and valuable stuff in this post (enthusiastically upvoted!), but I think there are a lot of errors, too. First of all, let's acknowledge that many (the great majority of?) programmers have little or no use for math, and know it, and are correct. That's totally fine. I think danso's comment captures this well, with references to UI design, domain knowledge, engineering practices, etc, and…

"Secundus, after acknowledging the insanely annoying tendency of math papers to make up their own notation without ever defining it" "The math case is hard because someone failed to tell you what you need to know, and no one wrote it down anywhere." I agree with a lot of what you're saying but I don't agree with these two assertions. I'm working developer and have been for 6 years (Ruby, JavaScript). About a year ago…

I agree with what you said, except I'm not totally thrilled with how you took one and a half sentences I wrote out of context, incorrectly claimed they were in error, and then wrote a bunch of unrelated stuff that had no bearing on them, as if it was a disagreement.

But, yeah. Textbooks are far clearer for a novice than papers are, and hard work is more effective than whining. That's right!

Re: Why there is no Hitchhiker’s Guide to Mathematics for Programmers

#67

I've come up against this recently and I think a lot of imperative programmers will. For me, the basic pattern, starting from a career based on perl/php/java was this series of realizations: - EECS circuit design is based on a conceit that gives chips a speed limit - as a result, chips aren't getting much faster and that multi-cores are happening instead - parallel programming will become more and more essential to m…

> I would like to work more with actual mathematical proofs but I'm finding that tough to get into myself.

A professor at my CS dept. started using the Coq proof assistant[0] to teach some (functional) programming concepts and techniques. It has had a side effect of making the students more in to proofs.

Personally I think it's great - it shows that proving things is just programming.

I think the Software Foundations book[1] (or tuturial?) is a good place to start. There is also another good tutorial, but I can't remember its name. It's more about "getting work done" so I don't think it's as good as a starter.

[0]: http://coq.inria.fr/ [1]: http://www.cis.upenn.edu/~bcpierce/sf/

Re: Why there is no Hitchhiker’s Guide to Mathematics for Programmers

#68
post #55

Re: the original post IMHO, I find it has many logical flaws and while it is trying to draw attention to the fact that programmers need to learn math it may end up scaring people away. Background: I have a BS in EE from IIT Bombay, An MS in Applied Math from USC and an almost PhD(everything but thesis) in Pure Math. I also loved teaching math as a TA and was able to teach engineers multivariable calculus and differen…

I certainly don't think programmers need to learn math. The vast majority of programming requires no math, and there are tons of out of the box theorems and algorithms that can be used successfully by programmers to do wonderful things. I am just pointing out why math can scare programmers away. The first step in overcoming that fear is to identify it. And the fact is that programmers do need to tweak the algorithms…

> The basic four methods of proof is quite a low bar

+1.

Am just a programmer, but have always regretted my falling out with math during my college...

Have never heard of proof by contrapositive, and looking up, i am still baffled as to significance or point of separating it from proof by contradiction.

I look forward to more posts and hope you decide to write about basic methods of proof sometime in the future.

Re: Why there is no Hitchhiker’s Guide to Mathematics for Programmers

#69
The Hitch-Hiker's Guide to the Galaxy already parodies Maths:

http://hhgproject.org/entries/bistromathics.html

Clearly, Douglas Adams spent a lot of time in Bistros, as the second review on this site echoes his sentiments about the odd behaviour of waiters and nonabsolute numbers such as time of arrival:

http://www.yelp.co.uk/biz/giannis-italian-bistro-san-ramon

Re: Why there is no Hitchhiker’s Guide to Mathematics for Programmers

#70
post #51
post #16

If this is intended as a defense of Math culture, I think it falls short. He does a good job of pointing out the corresponding problems in the state of programming: Indeed, the opposite problems are familiar to a beginning programmer when they aren’t in a group of active programmers. Why is it that people give up or don’t enjoy programming? Is it because they have a hard time getting honest help from rudely abrupt mo…

I certainly agree that communication can be improved (and this is one of the main reasons I spend so much of my time improving my technical communication skills via blogging). But I stand by my defense of the need for flexibility. It's extremely hard to explain why without delving into technical details, but there are some times when abuses of notation are honestly much more helpful than they are hurtful. Usually the…

Changing the notation is fine. Changing it without explaining what the new notation means is where the problem lies.

Maybe it would help if we put papers online with the ability for anyone to annotate and add explanations, or links to other papers for context.

Post reply on HN