Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Possible Duplicate:
What degree of mathematical knowledge should a programmer have?
Where should I start learning math with regards to programming

I need an advice.

Im a web developer and currently working in an IT Company. PHP is my language of choice. But i dont want to become just a PHP Programmer i want to learn new things i want to learn also Game Programming and Other programming languages that uses Math skills. Im not good in math and honestly forgot important math concepts but im willing to learn it from the scratch. Maybe its takes time month,or years but i want to be (good,better,best) at it. My problem is that i dont know where i should start. I want to know what kind of math i need to know to accomplished this goal. I want to start from the very first if necessary in order for me to know all the things that will be needed in programming that uses math.

Please help and thanks..

share|improve this question
A CS degree, or at least taking some of its classes, is off the table? –  ZJR Mar 15 '12 at 1:21
MIT OpenCourseWare - The world is your oyster my friend: ocw.mit.edu/courses/electrical-engineering-and-computer-science –  PhillipKregg Mar 15 '12 at 2:10
add comment

marked as duplicate by mattnz, gnat, Doc Brown, ChrisF Mar 15 '12 at 10:13

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

6 Answers

When you talk about "math to increase programming skills", I think aside from the very specific kind of geometry-type-stuff required in game programming, you're basically asking how best to start educating yourself in computer science.

I have to say that the single best introduction to computer science I've read is Structure and Interpretation of Computer Programs - full text is available online. It introduces basic concepts of computer science and programming in an amazingly clear way, but does proceed to get pretty difficult later on.

Don't worry too much about doing all of the exercises or getting into all of the deeper stuff, but try to at least read through the first couple chapters and later on come back to the chapter on writing your own interpreter. Seeing how simple it is to write your own interpreter for a full-fledged programming language (and a very powerful one, at that), is definitely what gave me my "ah ha!" moment and got me hooked on computation and CS. And that's after I'd already been programming for 15 years!

I recommend DrRacket as the programming environment to run the sample code in.

Another possibility is How to Design Programs (the second edition is still a work in progress). This another Scheme-based introduction to programming, algorithms, computer science, and general design. This is probably a bit more accessible than SICP, and definitely worth a read whether or not you check out the other book.

share|improve this answer
SICP is really, really brilliant. I heartily second your recommendation. –  Tikhon Jelvis Mar 15 '12 at 6:35
add comment

IMHO, math skills and computer skills are pretty much unrelated. I have had so little use of all the stuff I was thought during high school, bachelor and master programmes, that it makes me cringe how much time could have been spent on learning how to use SOLID, TDD, abstractions, templates, effective containers, how to write maintainable code, etc. Even for hands on programming exercises! No wonder some Mg.comp.sc. people can't write a FizzBuzz application.

IMHO, math was a TOTAL waste of time with all the theorems, proofs, second order integrals, and so on. Haven't touched any of that stuff in 10 years.

There is a part of math that I learned very well, though, before it was thought in the university. And that part I learned the opposite way. When I did the computer graphics stuff, I learned the linear algebra and vectorial geometry from programmers stand point, tutorials, experimenting, (dooh, it was so damn easy and simple without all the theorems and proofs), I could visualise stuff in my head by the time the actual math lessons started. And after understanding how the containers use memory, you can translate them to BigO notation super easy as well, learning that stuff from math side stinks.

share|improve this answer
I respectfully but strongly disagree with the premise that math and programming skills are unrelated. In fact, I think any meaningful separation of them is impossible. As a quick example, consider the "L" in your SOLID, which comes straight out of first order logic via Hoare logic. Pretty much everything else you list has its roots in some form of discrete math or another as well. (Though your point about some fresh CS graduates failing FizzBuzz is accurate enough, in my experience) –  Erik Dietrich Mar 15 '12 at 6:08
Yes, but while you can find a mathematical law for every single transformation and op in programming, it's perfectly viable route to learn programming without ever opening the math book, EVER! You see, that L example, while there is a mathematical notation behind it, you can just learn what the substitution principle in code is, and never ever bother with formulas and proofs. Why would you? It's a matter of preference to enjoy mathematical or cs approach, but mathematical approach is not mandatory. It's not about fresh CS graduates, it's about CS Masters who have been studying CS for 10 years. –  Coder Mar 15 '12 at 6:26
add comment

When I was a c# programmer I thought math learned in high school or college is not a necessity for real world programming. I found I was wrong when I meet functional programming languages( Haskell, lisp). These languages are math by itself and require nontrivial math or logic skill to learn and most importantly, the spirit of functional programming is becoming very popular in the real world engineering. It can even helps you to write better php programs. You can start learning Functional Programming by the book Structure and Intepretation of Computer Programs and it accompanied open video course at MIT.

share|improve this answer
add comment

Being a self-taught hacker type, I've always had this struggle myself.

Math is abstract, meaning that it's not bound to a single language. You can do the same operations in PHP that you can in Javascript, C++, Haskell, Matlab and so on. Of course, the implementations may look different, but the actual math is the same throughout.

First and foremost: Figure out what branch of mathematics you need to learn. To do that, figure out what you want to do. Mathematics is an insanely large topic so it's best to focus your efforts.

For example, game programming math usage will differ from stock analysis, which will also differ from writing graphics such as Photoshop, Gimp, etc.

Game programming itself can differ slightly depending on what branch of game programming you want to specialize in (i.e. rendering, AI, etc).

My suggestion would be to brush up on your late high school math (geometry, trigonometry) and then become decently proficient with linear algebra (a subset of anyway). A lot of game programming professional (again, depending on what you focus on) don't employ a wide range of linear algebra topics on a daily basis. As long as you understand basic concepts such as 3d coordinate systems and vector operations (dot product, cross product, etc) in order to do things like moving actors around in 3d space, camera rotations, etc. you'll be well on your way. Note that this doesn't mean that you're guaranteed to get a job as a game engineer, but you'll at least understand some of the concepts that are employed in the code.

However, if you want to get a broader range of knowledge (which it sounds like you might be wanting to do), I might just start getting as much literature as I possibly can:



I'd also suggest taking a look at http://www.khanacademy.org/. They have a ton of short, easily digestible lecture videos on a wide range of mathematics as well as quizzes where you can test yourself on your new-found knowledge.

If you're not a total math nerd, don't give up. It can be particularly trying. Use resources such as math.SE if you find yourself stuck. If you have a friend who's a math geek, use them.

Also, understanding symbols used in math literature is pretty much a necessity, or you'll be hitting sections that really feel like you're looking at something written in Greek (unless you're Greek, then it's in another language ;)): http://en.wikipedia.org/wiki/List_of_mathematical_symbols (cheat sheet).

Good luck. You're in for fun if you enjoy challenges.

Edit: For core software engineering concepts, you might also want to check out http://www.udacity.com/.

share|improve this answer
add comment

Have you spent any time at the Khan Academy? The approach there is to help you learn what you like in small bites, practice what you've learned, and later review the things you've learned in the past to help reinforce the ideas. The web site will keep track of what you've done and suggest related topics to try next. Topics range from the simplest ideas such as counting, telling time, and number lines to calculus, differential equations, linear algebra, and more. If you're serious about improving your math skills, this would be a very good starting point.

share|improve this answer
add comment

Which particular branch(es) of mathematics are useful to you in your work as a programmer is going to depend heavily on your problem domain. If you're doing heavy graphical work (as in 3D fx kind of stuff, there is a lot of calculus. If you're going to be doing/modeling games for apps (e.g. poker), you'll need to know about probability. If you plan to work with cryptography, you need to know a lot discrete math principles. Robotics will require matrix theory. And so on and so forth.

So, the first thing you might do is figure out what kinds of programs and problem domains interest you most. From there, figure out what kind of math applies to them and where your skill level stands at that math. That will provide a good starting point.

If you just want general math for programming, I would suggest studying set theory and algorithm runtimes (O-notation). Almost any programmer will use some kind of collection or another, and, likewise, almost any programmer should have a basic understanding of the impact that his or her design choices are likely to have on application performance.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.