Fog Creek Software
Discussion Board


I think I posted long ago that my degree is in linguistics, not CS. I didn't have to take a lot of math in college or graduate school, except for a couple of courses like statistics. This hasn't made any difference in working on web database applications, but maybe a project will come along some day where some kind of math is required. I also thought that knowing math might help me get ideas for projects, although I doubt it. But aside from any practical concerns, if I knew math at least I might know whether or not I been missing something. Also it's good exercise for your brain.
Over the years I have read math books now and then so I am not completely ignorant. If I want to give myself a basic education in math, without spending 10 years on it (maybe one year of evenings) what topics should I try to cover? As far as I know discrete math is the most relevant to CS, and I guess you have to know calculus for graphics.
What topics are considered most important for CS majors, and what text books do you recommend?

Tuesday, January 14, 2003

Business Math, Algebra.  Graphics and computer programming in general do not necessarily use calculus.  I guess it depends on what you are doing.  3D graphics rely heavily on things like Quaternions, Vector and Matrix Algebra.  The events you are trying to model may in fact require knowledge of calculus.

Tuesday, January 14, 2003

I would say learn trigonometry and then calculus. There are so many real world problems that can be solved with trig and calculus that you will almost certainly increase your proeblem-solving skills by becomming familiar with both disciplines (especially if you ever plan on doing any low-level graphics programming or physics simulation programming).

I wouldn't bother to study discrete math too much. I didn't find it very rewarding. From my perspective, discrete math is just an amalgam of a bunch of stuff you already know, formalized into a discipline with some new notation here and there. Discrete math consists of some very basic set theory (which you probably already know intuitively), some formal logic (which you also probably know intuitively), combinatorials and probabilities (which you probably learned already in an algebra class somewhere along the way), and some simple statistics (which are easy to pick up elsewhere). The one really useful thing that I learned when I studied discrete math was modular arithmetic. I can't fathom when I'll ever need to do a Chinese Remainder Theorem problem, but I can confidently say that I know how it works.

Even if you do study trig and calc, though, I wouldn't count on it stimulating you to come up with any new ideas for software. If you're _really_ clever, you might devise some new, more efficient graphics algorithms or something. But don't be too hopeful. At this low level, mathematics courses are merely for understanding ideas that have been around for centuries, not for synthesizing new ideas.

Benji Smith
Tuesday, January 14, 2003

"some formal logic (which you also probably know intuitively)"

It must have been so long since you learned formal logic, that you consider it intuitive. However, formal logic is a man made invention. And a fairly recent one in the scope of human existence.

But the original poster is working in the computer business and most likely already trained fairly well in logic :-)

Practical Geezer
Tuesday, January 14, 2003

I know logic and statistics well enough, I think. I have a basic grasp of discrete topics like set theory, etc. I haven't studied algebra or trigonometry since high school, and never took calculus but read a couple of intro books. Right now I'm reading a text book called "For all Practical Purposes" which is a math course based on a TV series. It's supposed to give you a general idea of the major contemporary topics. It covers, for example:

management science
game theory
computer science
computer grahics

If I can get an intro level grasp of the major topics, and then go into a little more depth in one or two of them, maybe that's enough.

This project would take time away from the continual struggle to keep up with advances in software development, so I'm not sure it's a practical idea. But lack of practicality has never stopped me from doing something I imagine is worthwhile.

Tuesday, January 14, 2003

I've been looking at Game Theory recently.  I'm not sure what it will do for me professionally, but I don't expect to lose many games of NIM in the future.

Tuesday, January 14, 2003

I've found Graph Theory to be very useful.  An algorithms class/book covers a lot of the same stuff.

Tuesday, January 14, 2003

I have recently bought a book called "Discerete Mathematics and its Applications" by Kenneth H. Rosen. ISBN - 0 -07-116756-0

It's introductory Math for CS, and written by somebody from At & T. I'm now looking for an introduction to the High School calculus and algebra I've forgotten, so that I have the basis to study Rosen's book which is the basis for studying algorithm books, which are the basis for studying database applications! C'est la vie!

Stephen Jones
Tuesday, January 14, 2003

The best way to start out may be to learn about the background of different fields within math. With knowledge of the historical context and scope of various topics you can then make the decision to narrow your focus.

For someone in this position, easily the best book I've seen would be "Mathematics for the Non-Mathematician" by Morris Kline. Although this book is fairly dense, Kline's writing style makes it a remarkably enjoyable read. Each field of math is introduced by the historical events that led to its discovery, and this is subsequently followed up by a rigorous overview of the formal math behind the topic.

If you’re looking for a math reference, undoubtedly the best book to date is “Mathematics: From the Birth of Numbers” by Jan Gullberg. This book is simply amazing; over 1200 covering everything from Trigonometry to Topology and Fractal Geometry. Essentially, if you’re only going to buy one math book, ever, this is what you want. You don’t need to take my word for it though; ask Martin Gardner.

If you want to become really proficient in math, you have to work on problems. If you are sufficiently motivated you might be able to do this through self-study, or alternatively, through some sort of distance education program through a University. For some people it can be difficult to learn math from only a book, so you might want to look into night classes.

The most important thing to remember is that math is not something you can simply wake up one day and "get." The amount knowledge you gain from it will be directly related to the amount of effort you put in.

Matt Kennedy
Tuesday, January 14, 2003

A couple of general thoughts:

1) Danil - you will likely find game theory very useful in certain kinds of simulations. It's used, for example, in combat simulations used by the military.

2) In terms of overall enrichment, I heard a quote once whose author I don't recall, something to the effect that until you can model a phenomenon in mathematics, you don't truly understand it. Hmm. Interesting thought...might even be true.

3) It does seem to me, though, given a bit of background with simulations of various types, that really, it's math that's the universal modeling language, after all.

Tuesday, January 14, 2003

It's true that once I learned statistics my whole view of the world changed, and now I wonder how I understood life at all without knowing statistics. So this may be true of other fields of mathematics -- I don't even know how much I don't understand because of not knowing them.
But, on a more realistic note, it's our fate as human beings in the 21st century to be eternally frustrated because of all the things we don't have time to learn.

Tuesday, January 14, 2003

In English we say "maths" which is short for "mathematics" ;-)

Joel Python
Tuesday, January 14, 2003

I know. Here (USA) we say "math," which is easier to say I think than "maths."

Tuesday, January 14, 2003

Study Calc.  It really helps to understand how things are related.

Vital for understanding physics.

Really helpful for understanding business equasions.

You need it to understand advnaced matrix work as well.

There is a reason it is required for all Science and Engineering majors in their irst year.  Every thing else referes to Calc.

Adam Young
Tuesday, January 14, 2003


It really depends on what project you might be working with. For 3D graphics, you will need a lot of linear algebra. Calculus is not really a must unless you do animation. For security, you will need number theory, modular arithmetics, etc.. For translators (parsers, compilers, assemblers), you will need formal language, finite-state machines. For simulations, you will need calculus, DE, statistics, Monte Carlo methods, etc.. And there is probabily a package out there doing exactly what you want do. Unless you do research you don't really need to study the inner workings.

There are already too much to learn in CS. I don't even need to make a list. For other job-related knowledge, I guess accounting, banking will definitely help more for work than calculus.

My sis got an MBA a couple of years ago and the "hardest" math question she asked me was how to change the base of logarithm. No darn calculus or complex variables. I am still waiting for the day when my boss ask me to prove (a^2 +b^2) = n(1+ab) => n is a perfect square if a, b and n are positive integers.

Good luck.

Tuesday, January 14, 2003

Adam has a very good point about most sciences requiring math.

The main reason why math helps, is in fact that Math is very much like computer programming. It is a abstraction of concepts on a paper.

Often people learning how to program computers ask

CurTaxRate = .07

The person will ask, how does the computer know that it is the tax rate?

Well, it is does not. Nor does your calculator know you are doing taxes, or counting lemons!

Thus, the basic concepts of giving meaning to a expression is exactly the same in computers as it is in math. A person who has done a lot of math will not ask how does the computer know that the above means the tax rate. In fact, this “barrier” to computers is often the same barrier that people have when trying to learn and understand math.

I answered a question yesterday as to how to display a number as binary? Well, I typed in the following code:

Function BinaryStr(intNum As Long)

  Dim oneBit    As Long
  Dim i          As Integer
  For i = 0 To 15
      oneBit = intNum And 2 ^ i
      If oneBit > 0 Then
        BinaryStr = "1" & BinaryStr
        BinaryStr = "0" & BinaryStr
      End If
  Next i

End Function

Thus, if you go
? binarystr(255)

I not going to say that the above is a good solution. However, I do think that my math background helped me here. I also suspect the fact that I have written stuff in assembler also helped. I typed the above in as air code, and it ran the first time. Was it my math background that really helped here? Hum…I would like to think so!

Albert D. Kallal
Edmonton, Alberta, Canada

I am sure there are million ways to the above

Albert D. Kallal
Tuesday, January 14, 2003

For programming in general, developing a mathematical way of thinking is more important than the actual mathematical knowledge learned.  Most Computer Science degrees require not one but two semesters of Calculus, plus a number of other math courses such as graph theory.  But by 5+ years of graduation, most people forget 95%+ of whatever they've learned above basic algebra.

It is more the mathematical way of thinking that helps you as a programmer, because like the above poster said, programming ultimately boils down to mathematics in one way or another.  Mathematics works much of the same "muscles" in the brain as programming, and that explains why people with math or philosophy degrees frequently also make good programmers.

Having said that, there are a few specific things that you should find useful in a practical way:

- Big-Oh complexity.  Know what things like O(nlogn) mean  and how to analyze code or algorithms to evaluate it.  It can mean orders of magnitude in the performance of your programs.

- Non-base-10 arithmetic and notation, especially hexadecimal and binary.  Know how to convert between bases.

- Proof by induction and recursion.  Not that you'll actually have to do the proofs, but understanding it helps you to get a better grip on recursion and know or prove that your recursive algorithm will really work.

Beyond that, the specific concepts and formulae will depend on the actual types of applications you will be developing.  But having a good general math background will help greatly in learning the specific math that is required for your application domain.  Somebody who never did math beyond basic algebra will have hell trying to understand the trigonometry and matrix manipulations for 3D graphics, especially when they have to understand it fast enough to write a program that is due yesterday.

T. Norman
Tuesday, January 14, 2003

If you are looking for a challenge in math that will expand your understanding of computer science then look no further then Concrete Mathematics by Ronald Graham, Donald Knuth and Oren Patashnik.  It is not an easy book nor for the faint of heart but it does cover all the math necessary to master D. E. Knuth’s other work:  The Art of Computer Programming. 
I believe and no one has yet proven to me other wise that computer science at its root is a form of Mathematics.  The electronics in a computer can only act on discrete systems. This means the computer can only do functions that are finite in nature. The true art and science of the computer is finding discrete patterns that can solve complex issues.
I feel that most of the problems we have in software development is a desire to forget our hardware and solve issues in a soft abstract manner.  By doing this we add needless layers of complexity on a solution that might be fixed easier at a lower level.
I will get off my high horse now, before I fall.


A Software Build Guy
Tuesday, January 14, 2003

I heartily second Matt Kennedy's recommendation of Gullberg's "Mathematics: From the Birth of Numbers". If you can only get one book, get this one. Interestingly enough, Gullberg is a physician, not a mathematician and the book is better for having been written by an "amateur" who is passionate about his subject.

I studied mathematics and computer science at university. In my career of 18+ years I have used very little maths beyond basic algebra and boolean logic. Beyond this, I've found topics such as trigonometry, probability, and matrix algebra to be the most useful.

Tuesday, January 14, 2003

I have a math and CS degree and agree with the poster above, beyond algebra, probability, and linear algebra, I have almost never used math on the job.  However, I've been recently re-teaching myself all the math I have forgotton.

one good way to keep on track, is to check out the harvard extension school math department web site:

I've had good luck using the syllabi and homework for various courses to re-teach myself stuff. They also have online courses, if you are inclined to spend money and like being graded.

Tuesday, January 14, 2003

Coming from linguistics you already know far more grammar/language theory than the average CS graduate so picking up new programming languages will be straightforward.

Linear programming is useful, used in Operations Research, it gives you ways of solving pathing and attendance problems.  Essentially simultaneous equations made simple.

Statistical analysis, eponential forms, smoothing formulae.  They have a great many applications, not simply business systems, but managing streams of data, error correcting (a touch of binomial theorem), cryptography.

Its worth going back to the original work of Shannon, Nyquist et al if you have to do anything that requires filtering data, recognising it, discarding noise, either in streams or blocks of data.

Least squares functions, pattern matching shapes that kind of brain twisting stuff.

I've not needed calculus at any time, in games I've used sin/cosin tables and in fractals matrix algebra.  Actually fractals was about the only application I could get my head around to test the Fortran compilers compliance in using complex numbers.

Maths was the bane of my fractured school life, I use it like a cookbook.  It means I have to figuratively count on my fingers as I pick up what a particular recipe means but I get there in the end.

Simon Lucy
Wednesday, January 15, 2003

wasn't it the late Dijsktra who said that computation is as much about computers as astronomy is about telescopes?

Also see iverson's writings at J is a rejuvenated apl.

Wednesday, January 15, 2003

*  Recent Topics

*  Fog Creek Home