Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Ask HN: Math for hackers.
102 points by RiderOfGiraffes on June 24, 2009 | hide | past | favorite | 56 comments
After the large number of posts I've seen asking about reading math, returning to study, wanting to know more about foundations, etc, I've decided to make some of my writings and masterclass material available on the web. There's a lot of it, and it needs work, so I'd appreciate some comments about what you'd like to see first.

I'm intending to create an undirected graph of topics, so you can start where you want, then go forward once you get the idea, or back if you're struggling. Then you can concentrate on the bits you're most interested in.

But what should I start with? I've read what people have advised others to read, and I'm looking for a start point.

Oddly enough, I will start with "Adding Fractions" and basic algebra (expanding, factoring and simplifying), but where then? I will eventually cover O(..) notation, basic calculus, infinities, series, convergence, combinatorics, graphs (vertices and edges) and more, but what do you want to see first?

It will also be on a wiki-like system so you can contribute later if you want, although not at first while I get it running.

Comments, thoughts, suggestions welcome.



It will also be on a wiki-like system so you can contribute later if you want, although not at first while I get it running.

Don't.

There is already Wikipedia and Wolfram Mathworld. I have no interest in another system where math geeks compete to put the biggest knowledge dumps and most obscure references into a great big technopeacock tail.

You know all that stuff about usability and simplification that Apple/Microsoft get and Linux/OSS don't? You want to help a lot of people? Be more like betterexplained.com and less like a math entry on wikipedia.

(You're pretty much helping people who know and like maths and can make sense of mathworld, or people who haven't done anything mathematical for years or decades).

(Also, including a mental pronunciation guide would be interesting. How do you pronounce equations in your head?)


The intention is explicitly to provide a commentry, overview and connections between topics. It would not be good use of anyone's time to duplicate a lot of work that's already out there.

Specifically, I'll be looking to create skims of topics with insight, then point to deeper treatments elsewhere, then provide some examples for people to get their teeth into to confirm their understanding. It's the links, and the dependencies, that I'll be covering.

Thanks for this comment - it's resonated with my thoughts. Being wiki-like, though, I think can be made to work. There will be controls.

Work to be done on that aspect, which is why it won't simply be a wiki from the start.


Basic linear algebra is extremely important in conjuncture with rudimentary matrix manipulation. I am always astounded by the number of college graduates who can't perform simple matrix multiplications, cross-products, dot-products, L-U factorization, etc without references.

Without these basics, it becomes increasing difficult to grasp more advanced subjects such as (non)linear optimization, calculating computation complexity, numerical methods, root finding, game theory, and so on. The importance of calculus and combinatorics, as mentioned, should not be undermined either.

EDIT: How could I have forgotten about Eigen Decompositions! I never fully understood its significance until the last two years of college when all fragmented subjects I had learned (in terms of CS, Engineering, and Control Theory) finally fell into place.


Additionally, touch on a few other really useful methods for approximating solutions and decompositions, namely: partial pivoting, Householder reflections, Givens rotations, and of course, the Power Method.

Additionally, SVD.

We covered these pretty thoroughly in the Calculus 3 for Computer Science class here at Georgia Tech, and they're relatively easy to learn and are fairly useful.


Never having taken a Linear Algebra course, this is the math I've been working the hardest at learning, and absolutely agree it is indispensable for understanding many things (in my case, machine learning). Anything that makes this easier to learn or remember I welcome with open arms.


This would be absolutely awesome. I'm 14 and going into 9th grade. I'm taking algebra 2 / trig next year but I hate how they teach it so I use the internet to teach me. This would be a really cool idea, I'd definitely use it.


Here is the thing I wish someone had told me my freshman year of high school.

If you're interested in computer science, study topics in discrete mathematics, real algebra (the algebra where you compute with symbols instead of numbers, look into "rings", "groups", and "fields"), and some statistics. And if you have to scale back on something to make room, scale back on trigonometry.

Discrete is a subset of math that was barely touched on in my school, and it was a massive culture-shock to get to college and never have seen many of the staple discrete problems. Statistics is useful in real-time problem solving and analysis and is at the core of some of the neatest modern algorithms, including those in cryptography. Trig, on the other hand, is something that you will likely have pre-written libraries to support and is just not as important to most computer work. It's useful, but unless you're going into computer graphics and games it's maybe not as necessary.

These days, I can tell you the area of a triangle from its vertices but I still get thrown easily in a crypto discussion. If I had high school to do over, that's what I'd do differently.


Aw, but triangles and circles are such a huge part of everyday life, one should understand them well for that reason alone.

From as practical as hammering wood together to as abstract as noticing the sine curves of the seasons.

And without Pythagorous, you can't grok Euler's Identity, which would be a real shame.

Finally, trig is the gateway to Euclidian Geometry, which is the first taste of realish math most people get in High School...


Don't forget that trig pops up everywhere in more advanced math as well. Fourier/Laplace transforms anyone?


I disagree with you on trig. Trig is the study of straight lines and what you can do with them. The important part of calculus is the fact that you can approximate curves by straight lines [1]. A folk theorem in applied math is that 90% of the time, an approximation by straight lines is good enough (another 9% of the time, you'll need a parabola).

You can drop some of the petty stuff (x,y,(180-x-y) triangles), but don't skip the basics.

I'd also suggest skipping rings/fields since most of the algebra important to CS involves structures weaker than groups (semigroups and monoids). Also add graphs/combinatorics to your list.

[1] This fundamental fact is briefly mentioned in a subsection called "differentials", and otherwise ignored by textbooks.


I think you may forget what is taught as "trig" in school. Yes, knowing what sin, cos, and tan are is important. No, wasting weeks on pointless identities and digging into the minutia of lines and triangles well beyond what you will ever need, even in the course of getting a degree in mathematics, is not a sensible use of time. The only reason it is done is "that is how things are done".

When people argue about the math curriculum, they almost always argue the wrong question. The question is not, "Should we cover X?", because in isolation the answer is always yes! Should we cover trig? Yes! Should we cover set theory? Yes! Should we cover graph theory? Yes! etc. etc. The question is, "Given our limited time to allocate to math education, what are the best topics to focus on?", and once you consider the wealth of incredibly valuable topics neglected (elementary economics, elementary discrete math, actual algebra, game theory, computer programming, anything remotely resembling actual mathematical practices rather than memorized formulas stripped of all motivation and history), you'll find that spending umpteen weeks on trig is really shortchanging the students. The opportunity cost of trig is too high.


I freely admit I have no idea what goes into a trig class. I dropped out before trig was taught.

You are probably right: when I teach calculus, there does seem to be an assumption that students know way too much petty nonsense. But some basics are necessary, even if the computer knows how to compute sin and cos. Students must understand angles and straight lines.

As for tradeoffs, I completely agree. I just think the value of basic trig is ridiculously high.


I used a lot of trig in my physics classes - yes, including identities. You may be falling into the trap that because it wasn't useful to you, then it's useful to no one.


And you may be falling into the trap that because it's useful to you, it's useful to lots of people. Again, it's not about "is it valuable", it's about opportunity costs! While you're fiddling with trig you're not learning other more useful things.

Let it be learned when it's actually useful. If you use it in physics, fine, learn it there, when you have context. Not in some abstracted "trig" course.

To be honest, I'm not sure I believe you anyhow. I took a lot of physics, as much as anyone not majoring in it will take, and I did not make heavy use of trig identities, nor did anybody else, nor do I recall a huge number of problems where they would have come in useful, and what problems they might have been useful in were textbook problems anyhow. (In the real world, inclined planes are not all at 30 and 45 degrees.) I think you might just be saying that to score rhetorical points.


But what are the more useful things? That depends heavily on what, exactly, you go into. For many people, most of the math they took is never used. But that's not known at the high school level, so a high school education tries to serve as a foundation for further learning. You're assuming discrete math would be more useful to more students than trig. I doubt this is true.

If I had to learn trig my freshmen and sophomore year of college, when I was taking my introductory physics classes, I never would have kept up with the physics. My course assumed a solid foundation in trig and calculus.

I distinctly remember having to use various properties of triangles to solve many of my introductory mechanics problems.


This looks like a place to joke about finding a spanning basis to build a curriculum.


Trig class in grade school (or high school) sucks, in a major way.

However, I worked as a math tutor for 4 years in college. I tutored both college students and in an after school program for east african immigrants.

What I observed in that experience was that people with good trig backgrounds did very well with the mechanical formula manipulation stuff in Calc. They were mostly having issues with proof structure, etc.

The students who had a sketchy trig background had problems with proof structure and also had a lot of issues simply doing mechanical symbol manipulation problems.

I majored in math and focused on abstract algebra. I don't think rings, groups and fields are very useful to general programming or even computer science. I actually have the exact opposite opinion on the matter. Unless you're going into crypto algorithm research you don't need to know that stuff, you just use a pre-existing library. On the other hand, trig establishes a foundation for stuff like robotics, DSP, computer graphics, computational physics and so forth. Almost anything falling into the traditional "applied math" bin requires you to have gotten trig down cold at some point.

However, arguing this is sort of a moot point because I can't think of any elementary or secondary school math sequence where you just skip over trig and take group theory instead. Trig is usually required somewhere along the way and abstract algebra is usually not available in high school unless you're going to a specialized math and science school. Indeed, it's usually not even available in college unless you're a math major.

If you have a sketchy trig background and need more practice and inspiration, I recommend:

Trigonometric Delights by Eli Maor, for inspiration.

Trigonometry Refresher by A. Albert Klaf for practice problems

Advanced Trigonometry by C.V. Durell and A.Robson for examples of advanced applications

Statistics is very important and totally overlooked by most hackers and even math majors (including myself.) If you have the opportunity to take a good stats class in high school or university, do so. I do not have any good recommendations on self study, but it seems like books on things like Biostatistics often lay the basics out more clearly than general stats textbooks.



MIT Opencourseware is really good. They have almost every class they teach on there.

http://ocw.mit.edu/


The amount of math resources available today online is amazing. I congratulate you on your efforts to teach yourself what you don't feel you're getting in school. When I was in high school around 1999, I found myself in situation like yours, but was unable to find quality (and free) resources available online.


my advice for math would be:

learn to teach yourself math. I'd recommend getting a copy of mathematica and then find some good books on math subjects you're interested in and just get your learn on.

if you're getting into advanced algebra I'd recommend a bit of review of number theory and abstract algebra first, as that will make it much more interesting.


Instead of starting your own, why not contribute to Wikibooks? It's already an established site with a fair number of users, but there are several sections (especially technical areas) that are incomplete or haven't been updated in years. Plus, everyone else would be able to start contributing NOW.

http://en.wikibooks.org/wiki/Wikibooks:Mathematics_bookshelf

http://en.wikibooks.org/wiki/Wikibooks:Computer_science_book...


Simple reason is that they don't achieve what I think is important - namely clear progressions and dependencies from topic to topic, and a high level overview, and more, I don't think they can be made to do that.

They are fantastic resources, and I hope people continue, or restart, work on them, but I think they are resources for the system I'm envisaging, not a replacement, or starting point.


As a really high level overview of math, I like The Princeton Companion to Mathematics (or the ~1/4 I've made my way through so far). It's a bit too abstract though - it covers an immense amount of material so they have to be - but I still feel like something is missing.

My 'overview of math' is probably The Road to Reality (which is ostensibly about Physics, but really spends just as much time talking about math) - which is a little bit more hands on and concrete. It makes a bit tougher to get through (difficulty, and quantity), but I think it's worth it.


I'm working my way through the Princeton Companion to Mathematics too.

I like it because each topic is written in small digestable chunks by different authors. The change in writing style and view points keeps it refreshing.

Although it's a bit high level, it gives you a taste for a lot of different areas in mathematics -- kind of a mathematical buffet.


Oddly enough, I will start with "Adding Fractions" and basic algebra (expanding, factoring and simplifying)

It's not odd at all to start with adding fractions. I've seen multiple questions on Usenet over the years from programmers about how to write a generalized routine for adding fractions. Many people don't learn the simple algorithm for that

http://math.berkeley.edu/~wu/fractions2.pdf

http://math.berkeley.edu/~wu/AE3.pdf

http://math.berkeley.edu/~wu/EMI2a.pdf

and it is good to look at the common site of all the links I've just posted for more links with tips on teaching the most fundamental math concepts.


Whoah, if you include the first part of that monograph you have a 230 page explanation of how to add two fractions together.

I'm really enjoying the writing so even though I already understand how to add fractions (at least I think so!), I'm going to try to read it all.


Great find - thank you. I have long held that fractions are a critical point in mathematical development, and these papers are much clearer and more eloquent than I've ever managed.


I like this idea. Have you seen HyperPhysics? It's a physics version of what you are suggesting.

http://hyperphysics.phy-astr.gsu.edu/hbase/HFrame.html


Very similar to the basic idea, although I have a different visualisation. It's close enough to give the idea.

Too bad the description of GPS is wrong.


Allowing your site's users to create and share their own graphs through the content would be a useful tool.

People absorb concepts differently so you won't know beforehand the best way to present the material. This feature would allow say, another experienced math teacher, to create their version of the best journey through Mathematics.

You can then keep track of the most popular graphs (through voting or usage).

This feature would also help with your "but where then?" question. If a graph creator thinks "basic number theory" should go between fractions and algebra but, there's no article about "basic number theory" then just putting it into their graph will create a stub article.

Keeping track of stub articles would then let you know what topics are needed the most.

Can't wait to see what you come up with.


May I suggest a couple of books?

How to Solve It by George Pólya's 1945 http://www.amazon.com/How-Solve-Aspect-Mathematical-Method/d...

and

The Art of Doing Science and Engineering Learning to Learn by Richard W.Hamming http://www.amazon.com/gp/product/9056995014/ref=olp_product_...

Great books, and they will introduce you to learn the mathematical thinking, so you can deduce the patterns yourself. Great for math and hack I think.


The price for a used copy of TAODSE is a bit high ($1200 + $3.99 for shipping?), which makes the kindle version at $17.57 pretty attractive.


>> I'm intending to create an undirected graph of topics...

Hah, awesome. <Requisite joke about network flow or something>.

The two topics I found most helpful to becoming a good computer scientist were O() notation and graph theory. Another idea, if you felt like covering it, would be the computery side of topics like linear algebra. I was forced to take linear in school and hated it, but I was getting linear for math people, not linear for CS people, so I didn't learn any of the graphics applications or neat things you can do with Markov chains and all that.


During college, I must admit that I would kind of space out whenever math discussion entered a CS class, and would regain my attention once the professor said "and here's how that looks in code" because I would end up thinking of the math the same way I thought of code anyways. It would be neat if you expressed some of the concepts in source code examples in some sufficiently high-level and clean-syntax language of your choosing.


I think the math/cs book by Aho and Ullman does a good job of introducing basic math concepts backed up with plenty of code and examples. Plus: it is available online for free.

http://infolab.stanford.edu/~ullman/focs.html


I think that "math for hackers" have to be math rewriten in the object oriented manner. For example: Matrix as a abstract class with suitable methods and members and pure virtual method which is a chracteristics of field abave what specific matrix i constructed, probability space as abstract class and random variables as instances. "Math for hackers" have to be "The object oriented theory of infinity".


This would be awesome - I got sick of the traditional methods of teaching math. Not so much the rote repetition but the uninspired and dull methods of teaching.

At the moment I have been shoring up my math skills with a College Algebra text book, the book "Mathematics for the Non Mathematician" (highly recommended - it is the book that has re-inspired me to learn more math), and a tutor that meets with me for one hour once a week.

The tutor is an excellent resource - even though I don't remember everything I learn from him because my time is short and I can't always practice problems outside of our session; I still pick up tid-bits here and there.

Having an online resource geared specifically for hackers would be absolutely awesome - to sort of compliment everything we do for ourselves already, having a resource built by a hacker for hackers is very exciting.


Start with some of the notation that is commonly taken for granted later in pure Mathematics. That way the tools to approach everything else formally will be available.


Knuth, "Concrete Mathematics". It covers a lot of ground, in a fun (for me, at least) way.


In the basic CS/Math classes at my school, trees are usually covered early in the course, usually along with proofs by induction.

I think this might be a useful approach to carry over to your site. Once someone understands trees well, I think it allows them to understand graphs better when they learn that a tree is a just a type of graph.


There are already plenty of materials for self-study, but what I would really like to see is just the graph itself. What topics do I need to understand to study X? If I want to implement a skeletal animation system, it might tell me I need to know about quaternions and so on.


Of all the math I learned in HS + college, I think basic calculus has been the most valuable. Even a conversational understanding of a derivative or an integral can be a useful mental tool in day-to-day decision making.


And I assume you've seen Dr. Math? (for the basics, algebra and the like)

http://mathforum.org/dr.math/


I'd recommend using this book as a rough guide:

http://tinyurl.com/nfe3gv

Don't let the title fool you. It's really a guide to advanced applied mathematics.

I'd also suggest the material be supplimented with a good bit of statistics. In my experience, statistical reasoning (particularly as it applies to noise, perturbation, and system reliability) tends to be weakness with hackers.


using tinyurl to hide your amazon referral url... nice


none ref link for those inclined to make a purchase

http://www.amazon.com/Road-Reality-Complete-Guide-Universe/d...



I would like to suggest the following books from

http://www.artofproblemsolving.com/Books/AoPS_B_Texts_FAQ.ph...

Start with following two books

the Art of Problem Solving, Volume 1: the Basics

the Art of Problem Solving, Volume 2: and Beyond

These will give you a solid grounding in mathematical problem solving.


I think it's needed, and I'd be for it. Should have quick references to algorithms, and some vector math, and intro physics for the people wanting to do game dev.

Check out http://mathworld.wolfram.com/ for some pretty good math resources (I've been really enjoying it).


I'm one of those programmers returning to study math after all these years. (Mostly so I can write some DSP code for my own amusement.) Currently reading a bit about complex numbers, planning on re-learning some trig next.

Statistics is in my to-do list too. Kind of unavoidable if you want to work on machine learning.


complex math is beautiful and it does relate to trig nicely (sum of exponentials)

but i'm not sure if complex is useful in stats. in all my stats courses i didn't see any complex, maybe simply because all observations are of real number (height, age, stock price, etc)

oh wait, maybe in the stochastic (cyclostationary process, etc) ... my memory betrays me. oh well, dsp is fun ;)


I would like to see statistics first only because I would start to use it.

Will your project include samples and practice problems to make sure readers understand concepts?


This sounds great. I am always looking for ways to implement my math homework into code. This would be a great resource.


I'm very interested in this - hopefully you'll announce it on HN when it ready?


Cool! Looking forward to your website.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: