Kuro5hin.org: technology and culture, from the trenches
create account | help/FAQ | contact | links | search | IRC | site news
[ Everything | Diaries | Technology | Science | Culture | Politics | Media | News | Internet | Op-Ed | Fiction | Meta | MLP ]
We need your support: buy an ad | premium membership

Hacker's Guides to Higher Math?

By avdi in Technology
Fri Feb 08, 2002 at 04:27:10 PM EST
Tags: Help! (Ask Kuro5hin) (all tags)
Help! (Ask Kuro5hin)

I'm a working hacker who wants to learn more about the computer science theory behind the coding I do every day. My introduction to programming has been completely practical, with no focus at all on mathematics and theory. With my obsessive interest in computer languages I've picked up a fair amount of theory second-hand; but I envy the CS majors who have had a formal theoretical education. Unfortunately, my work/family situation prevents me from going back to school anytime in the near future. Does anyone have any recommendations of classic CS-related math texts?

People always assume that since I'm a programmer, I'm a math whiz. Nothing could be further from the truth. I've always done miserably in math. The last math I took was Algebra 1 during my brief stint in community college before starting full-time work. I got a B, but I remember next to nothing, except for being all-but-mystified toward the end of the class. It's not that I don't have the mind for it, but as it was taught in that class, I was never given any framework in which to put the things I learned in perspective. I never understood the significance of what I was doing. It's not that I need practical applications; I just need to see the theoretical significance of something before I can grok it. For example, I understand you can derive things called "sines" and "cosines" from numbers by applying certain mathematical operations to them; but I don't know what those equations mean. Once I understand the conceptual significance of a given operation, I can comprehend it just fine.

I learn via books. Even in my college days, lecture was just down-time; I learned everything from the text books. I devour computer language manuals in much the same way I devour salt-and-vineger potato chips. I love to learn, and I particularly love to learn about computers, both application and theory. Lately my computer language obsession has lead me down the Functional Programing avenue, and I've run into a frustrating roadblock: much of the text on FP relies on a knowledge of certain areas of mathematics that I've never learned. I don't even understand the notation used for the math, or even the names of the disciplines I'm lacking. This has me nearly frantic with frustration at times. It's like the frustration of not being able to read.

Now I know that I can learn anything I put my mind to, given the right books. I am sure that clear, concise, canonical texts have been written on all the areas of mathematics that I'm missing. All I need is to know the right books to read, starting at a remedial algebra level and going right on up through calculus and whatever-the-heck-CS-graduates-have-to-learn. And I know that many of the readers here have a CS background.

So, will you help me? Can you tell me, first, what disciplines I need to learn, and then recommend books with which I may teach myself these disciplines? Help me, Obi-Wan Kuro5hin, you're my only hope!


Voxel dot net
o Managed Hosting
o VoxCAST Content Delivery
o Raw Infrastructure


Related Links
o Kuro5hin
o Also by avdi

Display: Sort:
Hacker's Guides to Higher Math? | 71 comments (57 topical, 14 editorial, 0 hidden)
If you're serious.. (4.28 / 7) (#5)
by wiredog on Fri Feb 08, 2002 at 11:17:21 AM EST

Numerical Recipes

Learn trigonometry, calculus is good as a foundation, to see where some of the equations come from. Statistics and probability. Set theory is a major plus. Linear algebra can be helpful.

Trig is a pre-requisite for the calculus. You should study stats before probability, as they're related. The more interesting probability studies have calc as a pre-req.

I was a math/cs double major until the last quarter of senior year, when I dropped the math to a minor. Honestly, I haven't used the calc since college, but it's a useful base. The stats and set theory get used regularly.

I went to college about an hour from the Nevada state line. Studying probability will cure you of casinos.

Peoples Front To Reunite Gondwanaland: "Stop the Laurasian Separatist Movement!"

Just a side note ... (3.00 / 1) (#9)
by Kalani on Fri Feb 08, 2002 at 11:33:37 AM EST

... although wiredog hasn't used Calculus very often since he left school, you *will* need Calculus (at least up to Calc 3) if you want to make graphics applications or computer games.

In fact, even if you don't get into making games, Calculus is great to learn because it's one of the most beautiful subsets of modern math.

Linear algebra will also be necessary for many areas of games/graphics programming (not necessarily if you're coding above the engine level ... but regardless of what layer your code is on, a deep understanding of the problem domain will increase the quality of your code).

"I [think] that ultimately physics will not require a mathematical statement; in the end the machinery will be revealed and the laws will turn out to be simple, like the checker board."
--Richard Feynman
[ Parent ]
Calculus is ugly (2.50 / 2) (#17)
by marx on Fri Feb 08, 2002 at 12:05:59 PM EST

Calculus is great to learn because it's one of the most beautiful subsets of modern math.

I would say that calculus had the potential to be beautiful, but it was ruined by those who made it into a religion. My principle has become "put the complexity in the data, not the theory". This is grossly violated by the calculus in use today. The strive to put the entire universe into a one-line equation is just plain idiocy.

The elementary calculus is very beautiful though, and useful.

Fortunately you don't need much calculus to understand computer science theory. You need logic and algebra, and a little bit of calculus.

Join me in the War on Torture: help eradicate torture from the world by holding torturers accountable.
[ Parent ]

Casinos! (4.00 / 2) (#16)
by slykens on Fri Feb 08, 2002 at 12:02:20 PM EST

Studying probability will cure you of casinos.

While is this almost always true, and many people don't realize quite how true, blackjack is the only casino game where the edge can be turned in the favor of the player. The house typically enjoys an edge of about 0.45%, based on a common 6-deck stand on soft-17 play against a basic strategy player. However, if you play with the proper strategy it is possible to turn the edge ever so slightly in the player's favor. Keep in mind that doing this is *very* difficult, both in remembering the precise play and having enough discipline to do it.

My first gambling experience with blackjack was in Vegas during the 1999-2000 New Year's Eve. (I was lucky that my company let me be 2000 miles away for Y2K) I knew basic strategy and was up $200 until my last day. I lost $150 on the trip, so that wasn't bad. I decided tho to learn more about blackjack and played in London over Thanksgiving. In one three hour session on 10 and 20 bets I won 200. (I was smart enough not to go back the next day and try to lose it too) My friend started with 200 and was up 400 but became too aggressive in his betting and lost all of it.

But to make this comment on topic... I originally started college as a physics major. I then decided to switch to EE and as a result I had to go through ordinary diff-e-q's. I can't really recommend an easy way to learn math. Math always just made sense to me. Obviously, with anything, don't just jump into the middle of things. I took an advanced physics class my junior year in high school when I took trig. The next year I took calc and the second advanced physics class. It was like night and day. Physics made so much more sense when I could approach it with calc. Find something that you can apply the math you are learning to. Like the above poster, maybe you could take some stat or prob classes, something that you can use the math in. Physics might be a little too much and too far unrelated unless you have an interest.

But the key, as you more or less mention, is to find something to apply the math to so as you learn you can use it, even it is isn't something very productive.

[ Parent ]

I have to ask... (3.00 / 2) (#22)
by dennis on Fri Feb 08, 2002 at 01:06:55 PM EST

...what is the proper strategy?

[ Parent ]
Basic strategy (4.50 / 2) (#34)
by Ludwig on Fri Feb 08, 2002 at 02:59:38 PM EST

It has to do with when to hit, stand, double, etc. based on your hand vs. what the dealer is showing. Specifics vary with different house rules, but you can generate a chart of basic strategy for any rules variations here.

[ Parent ]
More off-topic casino drivel and some advice (none / 0) (#45)
by KOTHP on Fri Feb 08, 2002 at 08:44:06 PM EST

The other chance you have to turn the odds in your favor is with poker. You don't play against the casino, they make their money by taking a percentage of of the winnings (or charging an hourly rate in many California locations). Thus your winnings (or losses) come (or go) to the other players at the table. There's a lot more skill to poker than most people realize, which plays heavily in your favor if you know how to play well.

Anyway, I will also make an on-topic reccomendation of an excellent on-line book on the topics of linear algebra and matrix theory, a very practical area of math when it comes to programming. Plus, it has the super bonus of being free.

[ Parent ]

Caveat with Numeric Recipes (4.00 / 3) (#26)
by blues is dead on Fri Feb 08, 2002 at 01:23:04 PM EST

Check out this link.

[ Parent ]
An old saying goes ... (1.00 / 1) (#49)
by gauze on Fri Feb 08, 2002 at 10:23:54 PM EST

The Lottery is a tax on people who don't understand mathematics. (sorry I dunno who said it and it's a slight paraphrase I believe)

There's nothing wrong with a PC that a little UNIX won't cure.
[ Parent ]
"Lotteries are a tax on people who suck at ma (none / 0) (#63)
by nstenz on Sun Feb 10, 2002 at 01:15:04 PM EST

[ Parent ]
Recommendations (4.00 / 1) (#6)
by czth on Fri Feb 08, 2002 at 11:25:44 AM EST

A good book (I think it's introductory enough, and it has "Introduction" in the title :>, but then again my complex analysis book was called Basic Complex Analysis) is Cormen, Lieserson, Rivest and Stein's Introduction to Algorithms. I think with a basic algebra/calculus background (first year university or even grade 12 highschool, depending on what they teach in your area) it's quite understandable. But I'm a math major and perhaps not the best person to say what's understandable and not ;).

On reviewing the article again it seems you also need some good calculus references... unfortuantely most of my first year courses used course notes booklets written by my profs, so I can't help too much there, unless you can get to my campus bookstore and pick up the texts ;). For algebra we did use Classical Algebra by Gilbert and Vanstone, which is decent. There are good sites on the web (e.g. MathWorld) but IMHO not a substitute for a good book. Michael Spivak's Calculus has a good reputation, but it's very big and very in-depth, perhaps better as a supplementary reference.

I commend you on wanting to broaden your horizons and learn the material. Like anything, it'll involve work and actually doing the examples and not just staring at them, but it'll make you a better programmer, at the very least, and probably a better thinker etc.

(I think for sines and cosines you're talking about the Taylor expansion, which is one of the most useful/interesting things I learned in math, basic though it is.)


Introduction to Algorithms (none / 0) (#19)
by marx on Fri Feb 08, 2002 at 12:21:00 PM EST

I can also recommend that book. Most of my other books were crappy, but that one was good. I would also recommend a book which explains the theory of Turing (Turing machines), that was important for me. That was covered in a book on automata theory I had, unfortunately it wasn't in English.

I also agree that the Taylor series is one of the most important things you can learn. If you understand that, then it's very easy to understand how the time complexity of an algorithm is classified.

Join me in the War on Torture: help eradicate torture from the world by holding torturers accountable.
[ Parent ]

waterloo grad? (none / 0) (#66)
by roju on Sun Feb 10, 2002 at 07:23:56 PM EST

Wow, I'm in my 1B term in math at UW, and we used Gilbert's book too for 1A algebra. How long ago did you take it?

[ Parent ]
Waterloo (none / 0) (#69)
by czth on Mon Feb 11, 2002 at 10:27:06 AM EST

Wow, I'm in my 1B term in math at UW, and we used Gilbert's book too for 1A algebra. How long ago did you take it?

I was in 1A in Fall 1996, graduated last year (BMath/CS, PMath minor). Nice to see another Waterloo person around :>.


[ Parent ]

Discrete (3.00 / 1) (#7)
by bobpence on Fri Feb 08, 2002 at 11:27:29 AM EST

Discrete Mathematics, sometimes called Discrete Structures, was a great course for me after working with software for a couple years and playing with it for much longer. I was always good at math, and I get hex and binary, but this course still gave me a lot of what I needed. Here was everything that I had been doing in my head, but named, explained, and sometimes, corrected.

A quick search at bn.com (work blocks Amazon, I try not to overuse Megaproxy) indicates that most of the books on the subject are textbooks (i.e. about $100). Better still, go to your local university's online course catalog, find this course, then go to their bookstore and pick up the materials they use.

My text was Johnsonbaugh's "Discrete Mathematics." It's a textbook, so it's not going to replace Huck Finn, but it was less dry than some other texts I've had.

This is a hard course, all the more if you are relying on the book alone without an instructor. While your on that website, look at the times the class is taught; math and computer science departments cater to us working folk better than some.


If you can buy only four books, (3.66 / 6) (#8)
by Kalani on Fri Feb 08, 2002 at 11:28:19 AM EST

Buy Concrete Mathematics and The Art of Computer Programming (a 3-book set).

Knuth covers a lot of ground in his TAoCP books, and "CMath" is necessary to understand the maths of TAoCP.

Also, if you can buy five books, make the fifth one Computer Graphics: Principles and Practice (the lessons learned are useful in contexts beyond CG).

Also, if you haven't learned Calculus or just need to brush up, check out the videos being sold at www.thinkwell.com. I got to review them for a class that a friend of mine is teaching and they're very entertaining. The lecturer, Dr. Edward Burger, has a great sense of humor and knows how to bring abstract maths down to Earth.

I hope this helps!

"I [think] that ultimately physics will not require a mathematical statement; in the end the machinery will be revealed and the laws will turn out to be simple, like the checker board."
--Richard Feynman
Couldn't have said it better (2.00 / 1) (#11)
by Jel on Fri Feb 08, 2002 at 11:43:16 AM EST

Just about everything you said applies to me too. In fact, I'm quite good at the small amount of math I know, with a good understanding of formulae, etc, but very little knowledge of higher math.

I quit school early due to a serious injury, and was always stuggling to keep up with some lessons because although I had the `knack' for math, I didn't know my multiplication tables off by heart, like most other kids did. People have often said that I'm a great programmer despite these shortcomings. It all goes to prove that programming is much more than just math.

I'll certainly be taking any advice given here on good books, and I'd like to doubly encourage you all to make suggestions if you have them.

...lend your voices only to sounds of freedom. No longer lend your strength to that which you wish to be free from. Fill your lives with love and bravery, and we shall lead a life uncommon
- Jewel, Life Uncommon
Math needed (2.00 / 2) (#13)
by Janir on Fri Feb 08, 2002 at 11:46:30 AM EST

(As an editorial note, this should be a diary, but I assume you'll read this comment even while this is in the queue, even if it gets dumped.)

You're gonna try to do this math by yourself? MAN, I WISH you luck! You mush have some good motivation to be able to do this.
My math background in order for a CS after Algebra. Some of this I had in highschool so one yr in HS = about one semester in college of same courseware.

Geometry -1 yr HS
Trigonometry w/ Adv Algebra -1 yr HS
Adv Trig -1 yr HS
Calculus -1 yr HS 1 or 2 semesters (depending on college)
Calc 2- Analytical Geometry -1 semester
Calc 3- Adv Analytical Geo, and Differential equations -1 semester (Usually diff eqs is a separate semester, but at my college it wasn't, but the calc classes were more credits per semester)

NOW the CS type stuff

Discrete Mathematics - 1 semester. This is generally dealing with sets and states. Sets: What is and isn't part of a given 'group' mathematically. States: math behind stateful programming. Some beginning Digital Logic is introduced.

Digital Logic - 1 semester. Math behind AND, OR, NOT binary logic. (electrical engineers will also have this too)

Random Variables - 1 semester. This class was basically using diff eqs. and statistics for modeling changes. ( also used by elec. engineers) Random variables can be taken after the cal courses. I'm assuming your previous algebra work introduced statistics to you. If not stick a statistics course before this one somewhere.

Those are the major courses I remember. I had others but they were more for my minor of electrical engineering, yet they were helpful for programming as well.

I hope this helps!

Recommendations: (2.00 / 2) (#14)
by seebs on Fri Feb 08, 2002 at 11:49:11 AM EST

Algebra: I read a bit of a book called _Algebra Unplugged_ which seemed to me to do a good job of showing Algebra *in context*, to make it a bit more useful.

Calculus: _E. McSquared's Calculus Primer_. I cannot imagine a better intro text.

You need those no matter what you end up doing. The next fun bits are linear algebra (a bit slow sometimes, but useful) and abstract algebra. Abstract is the really crucial one, IMHO. ;)

The one book... (3.50 / 2) (#23)
by Rocky on Fri Feb 08, 2002 at 01:08:33 PM EST

...for Abstract Algebra I recommend is:

Topics in Algebra by I.N. Herstein.

This book will bring to the full undergrad level in Abstract Algebra. You'll be seeing groups and rings in everything else you study.

It is not for the faint of heart, however. Read only after you've achieved some mathematical maturity.

Oh, and Strang's Linear Algebra is good for that topic, too. Much easier to get through.

If we knew what it was we were doing, it would not be called research, would it?
- Albert Einstein (1879 - 1955)
[ Parent ]
I would recommend learning math... (5.00 / 3) (#27)
by Delirium on Fri Feb 08, 2002 at 01:24:06 PM EST

...the normal way, from a math perspective, rather than looking for "math for CS majors" types of things. The latter tend to focus too much on specific applications and not enough on fundamental math concepts; better to learn the fundamentals and then apply them to the specifics yourself.

I believe math is better learned when applied (3.50 / 2) (#55)
by keenan on Sat Feb 09, 2002 at 06:19:46 AM EST

I've found that anyone math-averse, so to speak, just won't understand the concepts without some kind of application. It can be really hard when you're just looking at some arbitrary math concept to figure out how it could ever possibly be useful. For a lot of people (dare I say a majority), doing math for it's own sake just isn't fun or rewarding; when math is shown with potential applications it can make it much more interesting. Especially when doing computer graphics or artificial intelligence, for example.


[ Parent ]
Books (3.80 / 5) (#28)
by blues is dead on Fri Feb 08, 2002 at 01:38:01 PM EST

Here are some nice books everyone mentions. I'll save some people from aggravating carpal tunnel.

* Gdel Escher Bach, Hofstadter.
Some people deride this; most find it beautiful. I say get it. Many people were introduced to the field who otherwise found it dry.

* Introduction to the Theory of Computation, Sipser.
Intro has a good overview of set theory, graphs and notations. Intelligent author, especially if you read the preface.

* Structure and Interpretation of Computer Programs, by Abelson, Sussman, Sussman.
Especially if you like functional programming. There are a couple math problems, but big deal.

* Calculus, Spivak.
Dedicated to a yellow pig. You don't need this, but it's the first intro many people have to real proofs and analysis.

* The Art of Computer Programming, Knuth.
I dunno, most people have it sitting on their shelves mostly unread. Many prefer the Algorithms book by Cormen, t al, but whatever floats your boat.

Abstract algebra (none / 0) (#29)
by blues is dead on Fri Feb 08, 2002 at 01:40:15 PM EST

Oh yeah. My vote is on:

Abstract Algebra, by Dummit, Foote.

[ Parent ]
Probably not the place to start (4.50 / 2) (#37)
by bluetea on Fri Feb 08, 2002 at 06:30:02 PM EST

Abstract algebra is cool stuff to know (probably my favorite math subject in fact), but from a CS perspective, it's not a good starting point. You're not likely to find it useful in CS until you get to the MS/PhD level and even then a semester of it is probably overkill for most people.

For a CS person with little or no math background, start with discrete math and then move on to linear algebra, basic calc, or some basic automata theory depending on what you're interested in. For algorithm analysis, you'll need calc. For compilers or computational theory, you'll need automata theory. For graphics, neural networks, and a number of other things, you'll want to learn linear algebra. Discrete math is basic to everything. I think somebody mentioned "Discrete Mathematics" by Epp. I've got that book and I think it's pretty good, though I'm sure there are other good ones out there.

Also, I know from the original author's post that various things in his/her life made going back to school impractical, but my advice to anyone serious about learning this stuff is try to make it happen. It's much harder to really internalize mathematical concepts you learn from a book, so that they make sense to you on an intuitive level. There's just no substitute for a real, live human teacher.

[ Parent ]

Books vs. subject (4.00 / 1) (#40)
by blues is dead on Fri Feb 08, 2002 at 07:05:47 PM EST

I view things that books can be more important than the subject itself. For example, I probably wouldn't suggest C as a beginning language, except for the K&R book. Then C becomes an important tool for dealing with pointers, which often have a huge effect on even languages which try hiding them. (Which they can't hide, since it shows up in performance considerations.)

But I partially agree, and don't think this phenomenon happens all the time.

As for learning from books... some people learn far better from books, just as there are people who are the opposite. Teachers are often very serial, while books allow you to sit back and get lost in thought, while the book obediently waits. And plus, there's usenet.

[ Parent ]
Knuth: TAoCP, Vol 3 (none / 0) (#47)
by artemb on Fri Feb 08, 2002 at 09:21:34 PM EST

* The Art of Computer Programming, Knuth. I dunno, most people have it sitting on their shelves mostly unread. Many prefer the Algorithms book by Cormen, t al, but whatever floats your boat.

Volume 3: Sorting and Searching is a must. It's probably got more math than you really want, but it covers a lot of ground and provides solid analysis of the algorythms used. This book is worth reading at least once to avoid reinventing algorythms.

Other volumes could be occasionally useful too.

[ Parent ]

University Bookstore (4.50 / 4) (#30)
by r00t on Fri Feb 08, 2002 at 01:58:46 PM EST

Go to the local university bookstore and pick up the textbooks they use for first and second year math courses. It is probably a better idea to learn the math, then apply it to your programs.

-It's not so much what you have to learn if you accept weird theories, it's what you have to unlearn. - Isaac Asimov

not math in the sense of all numbers but ... (3.50 / 2) (#31)
by Ranma on Fri Feb 08, 2002 at 02:10:59 PM EST

One I enjoyed in college was Discrete Mathematics by Susan S. Epp. It was very very accessible and great historical commentary.

As another math moron.. (4.66 / 3) (#33)
by porkchop_d_clown on Fri Feb 08, 2002 at 02:55:43 PM EST

I hit my limit, hard, with basic calculus. I could (at one time) integrate and derive, but when you start talking about diff-eq it's all I can do to keep my head from bouncing off the table.

That said, CS math isn't "higher math" in the sense that quantum mechanics is. No field equations or anything like that. It's all set theory and boolean algebra. (Course, I graduated 15 years ago, so maybe things have changed since then...)

Analysis of performance is tricky because you have to be logical and thorough, but never involves math more complicated than powers or logs.

So, I don't think you need to be afraid of computer math; it ain't that hard.

Anyway, what are the topics and names you don't understand? Telling us what they are might help people recommend some specific texts for you.

I love working with computers. I mean, in what other line of business can you say the words "Gold-Plated Crimp-On Banana Plugs" with a straight face
What I meant was... (3.00 / 2) (#35)
by avdi on Fri Feb 08, 2002 at 03:24:02 PM EST

Anyway, what are the topics and names you don't understand?

That was a mis-statement on my part. What I meant was, I don't even know the names of the topics I don't understand. Thus I'm unable even to say something like "I need recomendations for books on Linear Quadratic Transubstantiation", because I don't even know all the names of the various math disciplines, the delineations between them, or their applicability.

This discussion has already helped me in that area. I'm coming to understand that I need Abstract Algebra, Linear Algebra (same thing?), Trig, Calculus, Discrete Mathematics, Statistics and Probability, Set Theory, and probably a bunch of others. Basicly I'm looking for good books on whatever math is required for a typical CS degree.

Now leave us, and take your fish with you. - Faramir
[ Parent ]

Clarifications (4.00 / 1) (#38)
by epepke on Fri Feb 08, 2002 at 06:38:59 PM EST

Abstract Algebra, Linear Algebra (same thing?),

Not same thing. Linear algebra is vectors, matrices, and tensors, used to solve linear equations and essential for computer graphics. Regular algebra is x's and y's, while linear algebra is X's and Y's. (You'll get the joke if you learn about it.) "Modern" algebra is ring systems--way hard and probably unneccessary.

Trig is necessary. Discrete math is very helpful but to some extent can be replaced by calculus. Differential equations are probably not too necessary, except in scientific computing and maybe not even there, because it usually deals with numerical solutions.

Basic set theory is highly recommended, but advanced set theory that deals with transfinites is merely amusing. Learn enough statistics and probability to know that they are not the same thing.

Also add information theory and optimization, such as the simplex method. And some good, solid automata theory. Have fun!

So, now you have the equivalent of about 9th grade through a Master's degree to learn.

The truth may be out there, but lies are inside your head.--Terry Pratchett

[ Parent ]
What these things are... (3.50 / 2) (#39)
by BlaisePascal on Fri Feb 08, 2002 at 06:46:40 PM EST

The order you should do those things:

Trig and analytic geometry
Trigonometry is the study of angles and the triangles they form. The basic relations crop up in surprising places, so they show up quite a lot. Analytic geometry is usually taught with trig, and deals with combining geometery, algebra, and trigonometry so that higher mathematics can be applied to them.

Intro calculus is a good place to learn basic concepts about thinking of functions abstractly. It deals with understanding change and how fast things change. It was created to deal with problems in physics (mechanics), so it is essential if you want to understand physics.

Discrete Math
Discrete is a catch-all for all non-continuous mathematics -- graph theory, set theory, number theory, combinatorics, etc all fall into discrete math. One major skill you will learn in discrete maths is how to do mathematical proofs. Of all the maths most applicable to most CS stuff, discrete is probably it.

Stats and Probability
Stats and Probability should be split into two courses, but it is usually taught as a unit, at least initially. The connection is that both tell you how likely something is, and how to interpret experimental results.

Linear Algebra
Linear Algebra takes regular algebra and extends it to more than one variable. In and of itself, this is relatively simple, but it goes beyond that and examines what happens when you assume certain restrictions on what you can do -- and what properties erupt. Problems in linear algebra crop up quite a lot in the real world, so this is a -very- important one for certain CS applications (like graphics).

Abstract Algebra
Abstract Algebra works by examining what happens with algebra (both regular and linear) and remove lots of rules. By eliminating rules, you extend the generality beyond numbers.

[ Parent ]

Wikipedia (4.50 / 2) (#41)
by blues is dead on Fri Feb 08, 2002 at 07:10:34 PM EST

You got two good replies, and I'll just add that you could visit Wikipedia's math section. One main contributor, Axel Boldt, is pretty good.

[ Parent ]
Re: As another math moron.. (none / 0) (#62)
by fonebone on Sun Feb 10, 2002 at 02:05:28 AM EST

No field equations or anything like that. It's all set theory and boolean algebra. (Course, I graduated 15 years ago, so maybe things have changed since then...)

nope. =)

PHP and Ajax Web Development
[ Parent ]

Avoid Calculus (3.40 / 5) (#36)
by linca on Fri Feb 08, 2002 at 05:29:29 PM EST

Though every CS degree usually requires some courses in Calculus, that branch of mathermatics is not that important in CS.

What is more fundamental is knowledge of Turing theory (calculability, automatas, set theory...), which is not related much to Calculus and applies very well to CS.

OTOH, if you want to compute the complexity of your algorithms, you'll need some Calculus, but not much.

Lastly, if you wanna make Computer Graphics, you'll have to learn a lot of math, both algebra and Calculus. Good luck.

I'm partly there, sort of. (4.33 / 3) (#43)
by spcmanspiff on Fri Feb 08, 2002 at 07:20:37 PM EST

And let me tell you: Nothing has improved my programming as much as learning more math has.

Well, let me amend that...

1) Learning more math, in and of itself, has really helped me learn to abstract-ize a concept and think about things in a bigger, more general way. The implications to software design are obvious, I hope. Good sign/bad sign: I've become a huge C++ junkie. I think it's directly related, since in C++ you can make everything as abstract as you like...

2) Actually implementing heavily mathmatical software has pushed every limit I had, both programming and math-wise. I used to think of a 'neat' application or utility and realize that I had no way to even conceptualize the most basic internals. Now I can get a good grasp on the problems involved, figure out the limits of my knowledge (and usually have a good idea about where to begin research), and start designing and coding.

Where I'm at right now:

I took calculus in high school and passed the AP test, which means I wsn't required to take a single math class in college. I didn't. :) My major was some wishy-washy design-your-own thing somewhere between journalism, fine arts, and liberal arts.

However, my junior year, I signed up for "Advanced Topics in Computer Science: Computer Graphics." Damn, was that course ever hard. Especially since it had a few years of math and computer science prerequisites that I conviently ignored. (Design-your-own-major programs are fun!)

That got me started on a long-term math kick. I've been learning on my own since, but still kind of a math beginner. However, I'm a bit further down the road than you... here's what I'd suggest:

  • Do computer graphics. Write computer graphics programs. Do it hand in hand with your math learning...

    Well, not necessarily computer graphics, but always aim to implement your neat new math skills into code. I've found that if I don't, then I may understand how to handle situation X on paper by following along with the example in the book, but that's as deep as my understanding goes. Writing code forces me to actually grok the underlying concepts and apply them in ways the examples don't touch. Graphics are good specifically for: Geometry and linear algebra. Also good for algorithms, since a lot of the neatest/hardest comp. sci algorithms apply to graphics. Finally, you get to see a nice pretty picture of your progress up on the screen. It's damned gratifying, even if it is a single, boring, line.

  • One step at a time, one foot in front of another, and the occasional giant leap. Incrementalism is great, and helps keep you from being overwhelmed, but I've found that, every now and then, it's good to jump into something way, way over my head. I probably won't 'get it', but after leaving the super-advanced-incomprehensible-stuff, I see everything else in a slightly different light that makes it easier to understand and apply.

    Hoo boy, I'm babbling. Watching this article with interest to see what sorts of resources turn up, since I'm still very much in the learning phase myself... sorry I can't recommend any good books (I've used the internet, mostly, plus ugly, dense texts borrowed from my physics PhD-student housemate)...

    A few sites I've found useful:

  • Mathworld. Covers a lot of stuff here, but fairly dense too.
  • Wikipedia has been very useful, believe it or not.
  • Flipcode. Mostly for game developers, but it's got a decent chunk of very practical computer graphics stuff in it. There's tons and tons of graphics-related things on the web.
  • I had a bunch more, but they're lost somewhere on my old computer ... there's lots o' good stuff out there, though.

    Okay, done rambling.

    p.s. About functional languages: They're probably talking about lambda calculus. I've got no idea what it is, but I know it underpins many functional-language ideas. I suggest you shitcan the theory books unless you want to understand the language well enough to, say, write a compiler/optimizer for it. "Scheme/Haskell/LISP/ML/etc for Dummies", combined with actually doing a decent bit of programming, is more than enough to learn to program well in a functional language. After that, maybe go back to theory books.

    p.p.s. Okay, really done rambling. Friday afternoon + strong coffee + strong desire to procrastinate ... :)

  • requested: Books on subject... (2.00 / 1) (#44)
    by TurboThy on Fri Feb 08, 2002 at 07:52:58 PM EST

    I took a course in "basic" math on college level some years ago. Here I was introduced to two great texts.

    The first, "Klassisk analyse og lineær algebra" by Arne Hole is a Norwegian text. While this is not accessible to most k5 regulars, those of you from Scandinavia might want to check out this book. It is very pedagogic while covering math from introducing integers and sets up to vector fields and fluxes.

    The second text, "Linear Algebra : Gateway to Mathematics" by Messer is more formal but also very concise and informative. The downside is that the price is on the order of $116(!)

    Disclaimer: Both of these books are textbooks on the subject of mathematics, and as such are not suited for leisure reading, except for deranged individuals like me.
    'Someone will sig this comment. They will. I know it.' [Egil Skallagrimson]
    Heh (2.00 / 1) (#46)
    by skim123 on Fri Feb 08, 2002 at 09:01:14 PM EST

    I envy the CS majors who have had a formal theoretical education

    Realize many CS majors would envy you! :-) I've always enjoyed the math/theory side of computer science, but if I had a nickel for every class mate and friend who bitched about it, who would rather take classes where they learned real, commonly used programming languages as opposed to all this math, well... I'd be pretty well off.

    I don't think you really need to know calculus to understand that math that computer scientists often use. Yes, that can be helpful, but computer scientists usually work with set/number theory topics on the theory side, and more linear algebra type stuff on the practical side.

    Perhaps the best option would be to enroll in a university's computer science program. In the first year or so, you'd get some stuff it sounds like you can do well already (basic imperative programming, doing classical programming problems, like creating binary trees, using recursion, searching/sorting arrays, etc.). But you'd also probably get a chance to take some discrete math courses, which are a good start on the math side. Also, as you progress, as you get into the upperclassmen-level classes, you'll soon see how the theory and actual programming meld together. You can see why, in mathematical terms, why one function is faster than another; you can answer future questions by having a solid repository of programming/math facts at hand that you can likely apply to the problem at hand.

    In any case, I wish you the best of luck in your endeavor for furthering your education.

    Money is in some respects like fire; it is a very excellent servant but a terrible master.
    PT Barnum

    Musings of the Illiterate (4.00 / 1) (#57)
    by iostream79 on Sat Feb 09, 2002 at 10:06:32 AM EST

    Perhaps the best option would be to enroll in a university's computer science program.

    I think the guy said that he *couldn't* attend university and that he would rather learn through books than lecture.

    Anyhow, I remember students bitching a lot about the uselessness of Descrete Math in our ciriculum freshman year, but as the years progressed, they started to see why it was important. So actually, if you don't have a hard-wired addiction to theory (and in fact enjoy the world of practical computing), I would pick up a book on advanced data structures. Neat solutions to practical problems, I think, and it's a practical way to get you wondering about more theoretical topics in Computer Science. After that, descrete math and then algorithms (very big topic here) and database and file storage systems. There are lots of other interesting and helpful topics like computational theory, cyptography, computer architecture, but for the time you'll put in, I think those four are the ones that give you the biggest return in your career.

  • I used this book for data structures; it's okay... Just okay. Lacking a little, IMHO.
  • Algorithms book. Bitch to read sometimes, but if you can only buy one book on algorithms, this should be it.
  • A VERY thin $100 Computational Theory book, but it's my favourite Comp Sci book.

    Also, I've only read about 50 pages of Knuth, but the 50 pages I read were damn interesting.

    [ Parent ]

  • You assume too much (1.00 / 1) (#59)
    by skim123 on Sat Feb 09, 2002 at 02:03:03 PM EST

    I think the guy said that he *couldn't* attend university and that he would rather learn through books than lecture

    He said that? Maybe he did. I guess I could go back and check, or I guess I could have read his complete writeup, but that would provide less time for me to share my thoughts on the matter. Come on, dear, I thought you knew me better than that! :-)

    Money is in some respects like fire; it is a very excellent servant but a terrible master.
    PT Barnum

    [ Parent ]
    Thinking... (3.00 / 1) (#48)
    by xriso on Fri Feb 08, 2002 at 09:47:57 PM EST

    I can't really vouch for any specific book, as I haven't seen the spectrum of math books. However, I do know of a site called PlanetMath where you can look for various concepts. It is only 1/10th the size of Mathworld, but it is growing. Also I'm sure that some people on Undernet/#math would be able to help you with your quest for books.
    *** Quits: xriso:#kuro5hin (Forever)
    Some books to get you started (5.00 / 2) (#50)
    by joshpurinton on Fri Feb 08, 2002 at 10:52:08 PM EST

    All of math, including computer science, can be derived from a few basic principles. To understand things this thoroughly, you need to learn the following:
    • Propositional logic, predicate logic, and basic discrete concepts, such as lists, trees, basic combinatorics, graphs. For these, there is nothing better than Gries and Schneider's A Logical Approach to Discrete Math.
    • Axiomatic set theory - see Enderton's Elements of Set Theory.
    • More advanced computer science concepts, such as languages, grammars, automata, regular expressions, Turing machines, and computability. For these, Kozen's Automata and Computability is the clearest introduction I've found.
    To see how it all fits together, take a look at the Journal of Formalized Mathematics, which features fully formalized proofs of many important theorems in computer science. These proofs are written in Mizar, a language for writing proofs that can be checked by computer (The checker runs under Windows and Linux). The proofs are hyper-linked, allowing you to drill down through the proofs and definitions until you reach the axioms.

    "What I cannot create, I do not understand" -- Richard Feynman.

    More on Discrete Math... (none / 0) (#70)
    by eli867 on Wed Feb 13, 2002 at 12:44:04 AM EST

    I just finished a Discrete Math class last semester and I rather liked the textbook: Discrete Math and Its Applications by Kenneth H Rosen. It's pretty concise with lots of clear examples -- I didn't even have to go to the lectures!

    [ Parent ]
    Rosen is good (none / 0) (#71)
    by leviramsey on Sun Mar 10, 2002 at 02:40:22 AM EST

    I'm taking this course in discrete math, and we're using Rosen's text. It seems quite good. Admittedly, being a textbook, it's quite expensive (Amazon has it for $121). He also wrote another book (on Amazon for only $100) titled Handbook of Discrete and Combinatorial Mathematics. This seems to be more of a reference work than an actual textbook.

    [ Parent ]
    tangential topics that can help (3.00 / 4) (#51)
    by adiffer on Fri Feb 08, 2002 at 11:23:54 PM EST

    Everyone else has offered good advice on books that relate directly to CS, so I won't duplicate them. Instead, I'll offer some ideas that may help round out the edges for you and offer you an insight you won't get if you stick strictly to the course plan.

    Get a math history book. You wouldn't need it for any particular class, but it helps provide meaning to some of the subject areas. You would read it like a manual where you search for a particular topic in the index, find the main pages, and then read them and a few before and after them. I use one called 'A History of Mathematics' by Carlk B Boyer and revised by Uta C Merzbach.

    Get a geometry book that gives you the highlights. Some of the niftiest things in geometry will draw people to your work even if you don't need them to write wonderful applications. I use 'The Penguin Dictionary of Curious and Interesting Geometry' by David Wells.

    If you ever want to understand how the analog branches like Calculus connect to the discrete branches of mathematics, get a book on Real Analysis. There are lots of them, but wait until you've learned about Linear Algebra and Calculus.

    Be aware that the standard way Linear Algebra is taught is not the only way to do it. Vectors, Matrices, Tensors and the whole lot form one tool set to do the work described in linear albegra problems. You could step up one rung and use geometric algebra to do the same work and connect to the world of geometry. Don't bother with this, though, unless you intend to get into scientific computing with physical simulators. Another term for geometric algebra is Clifford Algebra.

    You could spend more than a lifetime pursuing the subjects listed here and in other comments, so I'll stop here. Enjoy your study and share your enthusiasm. It's good for the people around you. 8)
    -Dream Big. --Grow Up.

    Yet more recommendations.... (5.00 / 1) (#52)
    by Carter Butts on Sat Feb 09, 2002 at 12:59:23 AM EST

    I would strongly recommend both combinatorics and graph theory, if you are not already familiar with these topic areas. An introductory text which deals with both (to a degree) is Tucker's Applied Combinatorics; frankly, I don't really care for it, but it's the only introductory combinatorics text with which I am familiar. (Combinatorics can come in handy for complexity analysis, not to mention probability theory (should you be interested in that as well).) For graph theory, West's Introduction to Graph Theory is a very nice text; little background is needed, although linear algebra always helps. If you are interested in further connections between graph theory and computer science, check out the field of combinatorial optimization: Cook et al.'s eponymous text, or Ahuja et al.'s Network Flows are good places to start.

    Finally, as a plug for overall introductory and popular texts (respectively), I vote for Eves's Foundations and Fundamental Concepts of Mathematics and Poundstone's Labyrinths of Reason. The former is a very nice (IMHO) "big picture" book (but very approachable), and the latter is a lot of fun (though be a bit skeptical -- Poundstone gets a few things wrong). I could keep going (statistical simulation! decision theory! game theory! Bayesian inference!) but I think I'll stop before this becomes a "my favorite math books" game.... ;-)

    And kudos to you, BTW, for seeking to further your mathematical knowledge. I'm a professional sociologist, and I have enough trouble getting some of my colleagues -- let alone students -- to understand the value of formalisms. Strive to learn a little each day, and keep true to your goal. Bit by bit, you'll learn more than you might have thought possible.


    The New Turing Omnibus (5.00 / 1) (#53)
    by Ordieth on Sat Feb 09, 2002 at 03:35:47 AM EST

    The New Turing Omnibus: Sixty-Six Excursions in Computer Science is a great introduction to the fundamentals of Computer Science, it covers everything from code theory, Turing Machines to Godel's Thorem and much more.

    Here's links to it at Barnes and Noble and Amazon.

    And if you google for it you'll find that it's used in many introductory CS courses.

    I've found it to be a great aid and guide to all of the things that I don't know about CS, as 90% of the computing that I do I've learnt on the job and so I missed out on the background that most CS students get.


    Good topics for study directly related to CS (4.33 / 3) (#54)
    by keenan on Sat Feb 09, 2002 at 06:04:15 AM EST

    I was a math major in University and I'm amazed at the topics some people are saying are a useful basis for computer science. Calculus? Linear Algebra? I even heard someone mention Ring Theory? Yikes -- that's going a bit overboard, eh?!?

    One of the most important things I learned in university with direct application to CS was O-notation. It allows you to approximate how good an algorithm is -- how long it will take when you have a lot of input. For example, O-notation shows very clearly why you almost never want to use a bubble sort. I find myself using this theory all the time at work when analyzing other people's code and also when trying to determine a solution with the best performance. It isn't perfect, but it can provide a decent guide to the scalability of an algorithm.Introduction to Algorithms is really the book to get -- we didn't use it in the courses I took, but when I started working I discovered how good a book it really is.

    I think if you studied some of the underlying language theory, you'd find that useful too. Though I haven't found much direct use from it (except for regular expressions), it provides some insight on what an algorithm can and can't do.

    Data structures are also a very important base. Knowledge of stacks, queues, linked-lists, binary trees, hash tables etc. are definitely good for being able to solve problems in a variety of ways. (The more ways you can solve a problem, the more likely you'll be able to find a great way to solve it.)

    Knowledge of database theory is really useful too when optimizing queries. Seems like if you have information these days that it's stored in a database somewhere. Can't really recommend much on this though because all my knowledge in this area has been from experience.

    One person recommended getting first-year math books from a local university. Based on how bad a lot of my books were, I'd have to say avoid that -- it's really hit or miss. Oftentimes the books you end up using are books written by the prof or a friend of his -- just because they're used by a university doesn't mean they're good.

    Oh and if you haven't noticed by now -- you can get a ton of information just off the web itself without buying a single book. (Problem is, it can be hard to figure out which sources are the good ones when you're new to a subject.) But as I said, if you're going to get one -- get Introduction to Algorithms.

    Oh, btw, about the functional programming thing. I love it -- it's pure, but the vast majority of the time just not that practical. I can't even remember the last time I did a 'car' or 'cdr'.

    Hope this helps --


    Calculus not so important... (3.50 / 2) (#56)
    by Skwirl on Sat Feb 09, 2002 at 07:38:37 AM EST

    I'm one class away from my BA in CS. That class is second semester calc and it's kicking my butt, so I feel the need to add to this discussion...

    A lot of calculus is not really necesary for what you're studying. Keep in mind, "lambda calculus" is not the same thing as what most people call calculus. Lambda calculus is a formal mathematical notation for describing algorithms (read: just another functional programming language). It seems to me that most university CS programs use functional programming languages like Scheme in their early courses because Scheme looks like algebra and everybody should have already taken algebra, therefore it's a good introduction to abstract computer programming. You're working backwards here, so you need to think of Scheme as just another programming language, except instead of a program tracing line-to-line, it traces from the innermost parenthesis outward. I would plug The Little Schemer by Daniel P. Friedman, but I've never read it. Plus, the one class I had with Friedman nearly destroyed me.

    My lack of understanding of differential and integral calculus hasn't hurt me much in other more CS-related classes. The only calculus questions you need to be able to answer are: What is a function? What is the domain and range of a function? Conceptually, what is the derivative of a function? Conceptually, what is the integral of a function? How do I plug a function into Maple (or your other favorite mathematical software suite) and find it's integral and derivative?

    The really important CS maths are discrete math and linear algebra. Neither of these require calculus. Although, discrete involves a lot of difficult proofs. The thing to grok in discrete is induction, and if you're anything like me, you'll want to go yell at your early math teachers for not drilling it into you sooner. Linear algebra is mostly a lot of matrix crunching.

    That being said, does anybody know a good integral calculus book that could help somebody who's forgotten 80% of everything leading up to it?

    "Nothing in the world is more distasteful to a man than to take the path that leads to himself." -- Herman Hesse
    i can let you know (none / 0) (#64)
    by evilpckls on Sun Feb 10, 2002 at 01:44:24 PM EST

    when i get back to school, i can tell you the name of the book im using...its business calc, but its really easy, i think....

    "This is proof that fish geeks are just weird. You look like you've wet your pants, and I have a fish in my coat." --nstenz
    [ Parent ]

    A possible solution... (4.00 / 2) (#58)
    by babyloon on Sat Feb 09, 2002 at 10:22:58 AM EST

    You can have access to some courses with video or ps/pdf medias here :


    and a more complete list here:


    Discrete Match, G. H. Hardy. (3.50 / 2) (#60)
    by phliar on Sat Feb 09, 2002 at 03:30:22 PM EST

    I'm sure this is just my prejudice but you can't go wrong with discrete math. Start with axiomatic set theory to get used to notation. (If math notation is not comfortable for you, you will find it very hard to appreciate anything.) Make sure that you work through the problems for each chapter, because you learn notation by doing, not reading.

    If you like to hack, definitely check out formal languages - that's what got me hooked on theory. The various automata (FSM, push-down automata, turing machines) and corresponding descriptions (regular expressions, context-free grammars etc.)

    Books I have liked in the past have been Lewis and Papadimitriou (for CS theory), Halmos (set theory), Herstein (abstract algebra) etc. However these are text books and might not be easy to read on your own. The thing to do would be to find out what text they're using for Discrete Structures [name may be slightly different] at your nearest undergrad CS institution.

    One of the stranger books I have is Teach Yourself Mathematical Groups by Tony Barnard. I guess it's part of some "teach yourself" series but it's an excellent book, well written and easy to read. I call it a strange book because it's so clearly of the "Idiots" and "Dummies" genre but it's actually a good book. (The book only covers group theory, so if you're not already interested in groups you don't need it.) Aside: Anyone know of good books I can use to get people started on number theory, on (vector) linear algebra, and on algebraic topology?

    Realise that what you want is not to just pick up a collection of mathematical facts, but to learn to approach things -- problems, life itself! -- a certain way. Once you get this "mathematical sensibility" it'll be easy to pick up a certain area of math when you need to. It's like learning how to write code without getting hung up on any particular programming language.

    One book I recommend to everyone interested in Math: G. H. Hardy, A Mathematician's Apology (with C. P. Snow). It's a very short book, and cheap - get it now, all of you!

    Faster, faster, until the thrill of...

    You need the time for it. (none / 0) (#61)
    by darthaya on Sat Feb 09, 2002 at 11:17:16 PM EST

    It is unlikely you will become better at math by self-studying if you can't even spare the time to go to school. Mathematics requires a lot of practicing, and simply understand the theory does not mean you can successfully apply it.

    Hmm... (none / 0) (#65)
    by m0rzo on Sun Feb 10, 2002 at 05:20:02 PM EST

    I'm being fastidious and I might be wrong but I believe the title of this story to be grammatically incorrect. Shouldn't `Hacker's Guides to Higher Math" read, "Hackers' Guides to Higher Math"?

    Presumably he is asking for the help of multiple hackers?

    Regardless, it confused me enough to click it.

    My last sig was just plain offensive.

    Point of view (5.00 / 1) (#68)
    by LordEq on Sun Feb 10, 2002 at 11:27:54 PM EST

    I think either of these would be appropriate.

    avdi is asking for help from multiple hackers, and would like a list of these "Hackers' Guides to Higher Math".

    avdi is seeking this help for himself, and will presumably use some of these guides to learn what he wants to know. The ones he uses in this manner will be this "Hacker's Guides to Higher Math".

    Did that make any sense, or do I need to go back to bed?


    "That's what K5's about. Hippies and narcs cavorting together." --panck
    [ Parent ]
    Book List (none / 0) (#67)
    by N0tOr1Ous1 on Sun Feb 10, 2002 at 09:33:34 PM EST

    First, those people out there who insist mathematics is not a integral part of CS and programming are ignorant, most likely from inexperience. Anyone who holds this idea has likely never written anything but web applications or GUIs. They definitely haven't written anything that's computationally complex. If they have, they most likely wrote some very poor and inefficient code for it. Mathematics are the foundation of most sciences, including CS. Unfortunately, mathematics are a little more difficult to learn from a textbook due to the notation, but it is possible.

    The best way to get a grasp of what textbooks to get is to compare various Universities' CS departmental website course listings. You can usually get a list of all the assigned texts from the syllabi of the respective course. Mind you textbooks are expensive, and there really isn't much out there that covers mathematical theory and it's applications other than textbooks. Applied computing books like those from O'Reilly are excellent resources, but they do not typically cover the underlying mathematical theory. Also keep in mind, this really isn't an easy task. Textbooks aren't exactly entertaining reading material and their terse content can act like an injection of sodium pentathol. However, short of enrolling in a CS program (which is most likely the best path), you're not going to learn this stuff anywhere else. Oh, and Devry and Chubb's and all those other technical schools don't teach anything along these lines, so don't waste your money.

    Hacker's Guides to Higher Math? | 71 comments (57 topical, 14 editorial, 0 hidden)
    Display: Sort:


    All trademarks and copyrights on this page are owned by their respective companies. The Rest 2000 - Present Kuro5hin.org Inc.
    See our legalese page for copyright policies. Please also read our Privacy Policy.
    Kuro5hin.org is powered by Free Software, including Apache, Perl, and Linux, The Scoop Engine that runs this site is freely available, under the terms of the GPL.
    Need some help? Email help@kuro5hin.org.
    My heart's the long stairs.

    Powered by Scoop create account | help/FAQ | mission | links | search | IRC | YOU choose the stories!