Live data from Hacker News

Math For Programmers

steve-yegge.blogspot.com

41–50 of 51 posts

Re: Math For Programmers

#41
post #7
post #3

The last times this post was here: http://news.ycombinator.com/item?id=87393 http://news.ycombinator.com/item?id=16006 http://news.ycombinator.com/item?id=1450483

I actually needed to read this again... and perfect timing, too. Hmm... a feed sprinkled with systematic reposts of things that you enjoy, that motivate you, or that you don't want to forget. Has anyone tried that?

Thoughtback would let you do something like that: http://thoughtback.com/

Re: Math For Programmers

#42
post #35

Earlier quoted context omitted.

How is probability theory decidedly non-discrete? As far as I know as long as the number of possible outcomes is discrete (and in CS applications this is the common case) the integration of density functions turns into simple summations and there is a vast body of results and research limited to just this area of probability theory.

Combinatorics deals with discrete structures, the kind encountered in programming, while probability concerns itself with determining the likelihood of a given event. The former is clearly more relevant to general programming. Probability does use some tools from combinatorics and vice versa, but the two subjects have vastly different goals.

Yes, I understand combinatorics is different from probability theory and yes, he is somewhat mistaken in not distinguishing combinatorics from probability theory, but on the other hand the article is clearly meant to be informal, it isn't a dissertation on the division of (highly overlapping) sciences. Above all else, I find the statement from the critique above that "probability is decidedly non-discrete" wrong much more clearly then any statements from the original posting.

Similarly I find it highly questionable whether combinatorics is "clearly more relevant to general programming". In fact, what is "general programming"? Probability theory pervades all of Computer Science - from probabilistic algorithms (QuickSort), through cryptography, optimization algorithms (genetic algorithms, simulated annealing), networking (information theory, queuing theory), machine learning, the list goes on and on. For business programming, statistics (based on probablity theory) is crucial. Some of those applications include combinatorics, but I find it harder to find such a long list of applications of combinatorics being used without probability theory - it is a more specialized field.

Re: Math For Programmers

#43

I've never found any really good resource to learn Math from. The problem I get is that whenever I see a big equation I tend to see a few greek symbols that I have never seen before and I have literally no idea whatsoever what they mean. At least when looking at some unfamiliar code etc I can usually tell from function and variable names approximately what something is supposed to be. Wikipedia is hopeless for learni…

Amen.

Mathematical notation is optimized for symbol manipulation using a pen and paper, not communication of information. Even to us programmers, it's a slew of one-letter variable names that very rarely seem to have the same meaning.

Furthermore, those single-letters are not from a character set that has been stuffed into our heads since we were 3 years old, so there's an amount of translation going on, similar to the process of learning a foreign language (hear spanish -> translation to english -> process thought -> generate response in english -> translate to spanish -> speak spanish vs. hear spanish -> process throughout -> speak spanish).

Bret Victor's project seems to be attempting this a little bit: http://worrydream.com/KillMath/

Re: Math For Programmers

#44

I've never found any really good resource to learn Math from. The problem I get is that whenever I see a big equation I tend to see a few greek symbols that I have never seen before and I have literally no idea whatsoever what they mean. At least when looking at some unfamiliar code etc I can usually tell from function and variable names approximately what something is supposed to be. Wikipedia is hopeless for learni…

I really like "Concrete Mathematics". It has nice, interesting problems, a very readable style, and introduces all notation used. It also has well written solutions to all of the problems.

That said, I read the book after I had a math degree, so while it seems very accessible (more so than most undergrad discrete math books), perhaps someone who read it as an undergrad can comment.

Re: Math For Programmers

#45
post #4

I think that in this article Steve discounts the effect of actually doing the math for yourself. It's comparatively easy to read about something and think that you've understood it. It's another thing entirely to be able to do that math on paper and get the 'correct' answer without needing help.

There's actually a place slightly beyond "able to do it on paper" at which you grok the maths so well that you can apply it in non-obvious situations without any conscious effort. I'm not sure how to get there in general, but I've noticed that I'm more likely to be able to do this for subjects that I learned in proof-heavy classes.

"In mathematics you don't understand things. You just get used to them" - John von Neumann

Re: Math For Programmers

#46

I've never found any really good resource to learn Math from. The problem I get is that whenever I see a big equation I tend to see a few greek symbols that I have never seen before and I have literally no idea whatsoever what they mean. At least when looking at some unfamiliar code etc I can usually tell from function and variable names approximately what something is supposed to be. Wikipedia is hopeless for learni…

I got my BS in engineering (electrical), managed to scrape my way through all the hard math classes, but never really had a firm grasp on any of it. A bit later on in the real world, doing some signal processing work, some of it started to snap together. But then I read the Structure and Interpretation of Computer Programs. Which I found to be more math heavy than any other prob books I'd read previously. But the way everything was describe, and laid out in the context of programming, all my past math just came streaming back, and suddenly made sense. It was like that "a-ha" moment, times 1000.

I don't know what the point of my ramblings are. I guess math finally made sense after learning programming first, much like yegge proposes in his post. But I had the basics down first, and I was at least familiar with the concepts.

Re: Math For Programmers

#47
post #38

I've never found any really good resource to learn Math from. The problem I get is that whenever I see a big equation I tend to see a few greek symbols that I have never seen before and I have literally no idea whatsoever what they mean. At least when looking at some unfamiliar code etc I can usually tell from function and variable names approximately what something is supposed to be. Wikipedia is hopeless for learni…

Shameless plug, but I try to explain math concepts on my blog. Here's an example for e, which eluded me for a while: http://betterexplained.com/articles/an-intuitive-guide-to-ex... My goal is to explain ideas as I wish they were shared with me: informally, with the primary focus on intuition (there are plenty of places to practice the mechanics). Hopefully it can come in useful for you.

I just wanted to say that your explanation for e is excellently done. I found it incredibly helpful - it was exactly the kind of intuitive, step-by-step explanation I was looking for. I hope that you're planning on releasing more content.

Re: Math For Programmers

#48
post #35
post #23

> For programmers, the most useful branch of discrete math is probability theory. ... What's probability theory, you ask? Why, it's counting. ... That paragraph made my left eye twitch a little. Not a big mistake, perhaps, but what he calls probability theory is actually combinatorics. Probability theory is decidedly non-discrete (integration of density functions?) and involves only two integers: 0 and 1. (A joke). M…

How is probability theory decidedly non-discrete? As far as I know as long as the number of possible outcomes is discrete (and in CS applications this is the common case) the integration of density functions turns into simple summations and there is a vast body of results and research limited to just this area of probability theory.

I guess it might have been better to say there's a Venn diagram of "probability" and "discrete structures" and there's plenty of non-overlap in both directions.

But, it's important to appreciate that, even for probabilities on finite or countable sets, you get pulled into continuous math. I don't think we disagree here, but maybe some examples would be worthwhile, just for definiteness.

Expectations (means, variances) of discrete variables will be real-valued. There are continuous processes that are intimately connected to what you thought were purely discrete outcomes (e.g., the relationship between Poisson counts and exponential waiting times). There will be limiting processes of discrete structures that bring in continuous probabilities (the Binomial -> normal limit, and all its generalizations) and provide considerable insight. The Stirling formula, which is key to insight about factorials, comes from calculus.

Finally, generating functions are one of the main tools for solving the discrete summations you mention, and these are continuous, and pull you straight into complex analysis. ("Who changed the subject here? I was just trying to add some binomial coefficients and now we're talking about derivatives of analytic functions at zero?")

Or, as my edition of Concrete Mathematics says (sec 5.4): "We come now to the most important idea in this whole book, the notion of a generating function."

Re: Math For Programmers

#49
I recently decided to start learning maths again. I stopped it after my penultimate year of secondary school because I found it such a joyless subject. I remember friends from the 'advanced maths' class lording it over me saying they were doing 'matrices' (no idea what they were) and 'second order differentiation' (differentiation was hard enough, so that must be way too tough, right?).

I figure i've really only missed out on a couple years of math education compared to the people I know who I consider 'good' at maths. And to my advantage I did do some statistics at university. With all the improved learning materials available to me, plus an alliance with programming, and my improved bullshit-detector for bad teaching and studying practices, it should be a breeze to catch up.

One problem I still have though is that maths just gets so incredibly boring... at least classes do. I used iTunes U and Khan Academy to study calculus and linear algebra. I had to start skipping past some of the really mechanical parts, because as the article said, as a programmer you just think 'put that in a function and never worry about it again.'

Breadth not depth is definitely what I'm after, although I do worry that it's the equivalent of being a musician who knows lots of diverse harmonic theories but still hasn't mastered some scales that would let him/her jam with other musicians.

Re: Math For Programmers

#50

I've never found any really good resource to learn Math from. The problem I get is that whenever I see a big equation I tend to see a few greek symbols that I have never seen before and I have literally no idea whatsoever what they mean. At least when looking at some unfamiliar code etc I can usually tell from function and variable names approximately what something is supposed to be. Wikipedia is hopeless for learni…

This was true for me, and partly out of frustration of this I picked up a major in math in addition to comp sci so I could get through more math heavy computer science books. It depends what you are reading, but a good discrete math textbook provides a lot of groundwork for mathematics commonly used in computer science, but expects little in terms of prerequisites, so notation is usually explained. At some level, lea…

I wouldn't say that it is just higher math. As a high school student, here is my path of e^ix.

Physics 1 Advanced, Simple Harmonic Motion is being taught. When told to find a case where the second derivative of a function is a negative constant times the function, I think e^ix. The answer is sin(x), but Euler's equation now makes sense. The most beautiful equation now makes sense.

A month later, glancing in a book of useful mathematical equations, I see sin(x) = (e^ix - e^-ix)/2i. Hyperbolic trig suddenly makes sense, which is useful over a year after finishing it. The weird equation for the normal curve from statistics starts to make more sense, because e^(-xx)=(e^(ix))^ix, which helps explain the 1/sqrt(2pi) weirdness. I start to understand why the most beautiful equation has its name.

I think that most math is cumulative, but only some parts are hard enough to make you notice it.

Post reply on HN