
Math For Programmers  - sayemm
http://steve-yegge.blogspot.com/2006/03/math-for-programmers.html
======
jiggy2011
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 learning because the math articles seem to be more
interested in being complete and accurate than being accessible. When I hit a
math page on something on wikipedia it tends to link off to a whole bunch of
other pages on increasingly abstract parts of Math leaving me more confused
than when I started.

I'd never have time to go through all of these topics and learn them properly,
if I was going to do that I'd have become a mathematician.

Khan Academy is good, but seems to focus more on the mechanical skill of doing
math rather than explaining concepts.

~~~
kalid
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...](http://betterexplained.com/articles/an-intuitive-guide-to-exponential-
functions-e/)

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.

~~~
dantheman0207
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.

~~~
kalid
Thanks, really glad it was helpful. I'm planning on going back and covering
all the math I thought I'd learned in school :).

------
nagrom
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.

~~~
anonymoushn
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.

~~~
dagw
I have a Masters in math and the applying things in non-obvious situations is
one of the things that I really gained from it. Several times I've been in
situations where someone is struggling with a problem, and where I can quickly
spot a simple mathematical approach to solve it. Many times the mathematics
itself is quite simple advanced high school or early college stuff, stuff the
person struggling with problem has also studied.

The difference is that to them linear algebra (for example) is something
abstract you use to solve linear algebra problems, while to someone with a
more deep and solid understanding of math, linear algebra is a simple and
general tool that can be applied in all manners of situations.

------
cmetlab
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>

~~~
ix_
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?

~~~
vollmond
If upvotes were public (or at least available to you when logged in), it could
just trawl HN's history at some set interval (one year past?) and feed you
anything you upvoted that day.

edit: or rather, a few intervals to allow for reposts even after that year
period

------
defrost
What is kind of weird is seeing Information Theory and Kolmogorov Complexity
being described as "kind of new".

I guess in some sense it is, but for myself in 2012 I recall first hearing
about the work of both Claude Shannon and Andrey Kolmogorov as a university
student in 1982 in a first year maths / CS bridging lecture called
computational mathematics or some such.

Pretty much everything to do with signals, compression, error correction, etc.
happened post the invention of the telegraph - you had Gray Codes (patented
Frank Gray ~ 1945ish) popping up in recreational mathematics in the 1880s and
being applied to the telegraph by Émile Baudot, from that time forward we see
the unfolding of much of what is CS / computational mathematics today.

I guess everything last century is "kind of new" but it is starting to feel as
though it's all been around for a while now.

~~~
derleth
Think of it this way: The mathematical capstone of most undergrad non-math-
major courseloads is Calculus II, which focuses on mathematics largely
developed by Newton and Leibniz, as modified by Riemann.

That takes you all the way to the mid 19th Century for what little of
Riemann's work the course focuses on, with the bulk (Newton's and Leibniz's
contributions) coming from almost two centuries earlier.

~~~
stiff
This is a rather simplistic account. Newton and Leibniz neither started nor
finished the development of calculus, they just happened to make the
connection between differentiation and integration which opened up the way for
the spectacular development of the subject in later years and Leibniz invented
some of the notation we still use, but there was lots of progress before and
lots of progress since then, especially regarding logical foundations of the
subject and a big part of it is now incorporated in the undergraduate
curriculum. Linear-algebra based multi-variate calculus is pretty common in
universities now too and it wasn't well developed before the 20th century.

------
peteretep
I learned maths by attending:

<http://www.cs.ox.ac.uk/softeng/subjects/SEM.html>

Which is open to anybody willing to pay ~$2k for a week and get their ass to
Oxford - you don't need to be enrolled as a student.

If you don't have that kind of money to spend (or can't get to Oxford), the
course is essentially the first few chapters of: <http://www.usingz.com/>
which is available for free.

~~~
arethuza
That looks excellent, but a very narrowly defined course around the concepts
used by Z. The CS course I did had 3 years of maths and then I did
postgraduate work with Control Engineers and I realised that, compared to
them, I hardly knew anything (good fun learning as much as I could though).

However long you spend learning maths, probably more than any other subject,
you are only going to end up knowing an awful lot about less and less (the
usual curse/joy of academic specialization).

------
__Joker
Given the post was 5~6 years back, I would be interested on Steve Yegge's
reflection on the post. I would be interested to ask question like 1. How much
did he progress mathematically ? 2. How it helped him ?

Would be interesting if Steve Yegge can do an AMA on reddit.

------
Tycho
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.

------
guscost
One big pet peeve from math class: circular functions are taught in
"Trigonometry" while imaginary numbers and vectors are lumped together with
basic "Calculus" meaning Euler's formula seems like terrifying voodoo for
_years_ after it is first described!

~~~
derleth
Yes, but if we introduced Euler's work that early trigonometry would be
reduced to the study of a single equation!

~~~
xyzzyz
But in fact there's not much more in trigonometry. I always wondered how
American schools can spend whole semester on single, simple subject.

~~~
mjw
Yeah trigonometry does become pretty trivial if you're prepared to use complex
numbers and some calculus. Here in the UK we were introduced to this approach
later on at A-level, but still had to tackle an incredible number of "solve
for the missing length/angle/area" triangle problems first.

(One thing the endless triangle problems do provide is practice at converting
geometric problems into algebraic ones. But yes, too much of them I'd say.)

I guess teachers consider complex numbers an abstraction too far in order to
teach applications to geometric problems. They don't want to field endless
'woah that blows my mind' type questions about i at that stage. The downside
then being that you have to memorise (or read off a cheat sheet) a lot more
identities in order to manipulate things algebraically. And to convince
yourself of the truth of those identities you need to rely on geometric
proofs, which come more naturally to some than others. Probably makes the
subject more intimidating than it should be.

------
jakobe
It's a bit short sighted to claim that trigonometry and calculus are 'only
necessary for scientists'.

For example, if you write code for some user interface, you'll have a very
hard time to get smooth animations if you don't understand derivatives.

------
tehwalrus
lots of physicists commenting on the article, getting annoyed that the author
doesn't dig calculus.

As a physicist (turned programmer turned physicist again) I'd just like to say
that I quite like the idea of a liberal arts mathematics course - I would be
much better at it if I had an overview of the field, and thus knew where to
look for my solutions (like I do when debugging a program under X environment
or framework).

------
mattdeboard
Yes, yes, yes. Discrete math is useful every single day as a programmer,
unless you see absolutely no need to ever think about what's happening under
the hood. Sets, combinatorics, matrices, and on and on. Everything I learned
in my "discrete computational structures" course is directly applicable in my
day-to-day programming life.

~~~
dnissley
Could you recommend a book or an online course? Or anything really? As more of
a self-taught programmer, I'd love to be more acquainted with the mathematics
that go along with computer science, but I'm really not sure where to start.
I've been waiting for khan academy's offering on the subject but it's been
years and it seems like they'll never get around to it.

~~~
oskarkv
I think this book is very good. Lots of exercises and very clear.
[http://www.amazon.com/Discrete-Mathematics-Norman-L-
Biggs/dp...](http://www.amazon.com/Discrete-Mathematics-Norman-L-
Biggs/dp/0198507178)

------
Muzza
> 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).

Many people are introduced to combinatorics in the context of probability
theory. It (combinatorics) can be used to compute various probabilities, but
still. You wouldn't call trigonometry calculus just because a course in
calculus might involve the derivative of sine and cosine, so don't confuse
probability theory and combinatorics.

~~~
stiff
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.

~~~
nocipher
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.

~~~
stiff
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.

