Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (549)
Games in Android Showcase (135)
games submitted by our members
Games in WIP (593)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  How much math do I need to know to be a good programer?  (Read 6866 times)
0 Members and 2 Guests are viewing this topic.
Offline benc1213

Senior Newbie

« Posted 2011-04-09 04:55:54 »

How high of a level of math do I need to be a good programer? Would I need to know calculus I would expect?
Offline loom_weaver

JGO Coder

Medals: 17

« Reply #1 - Posted 2011-04-09 05:31:03 »

Programming requires strong analytical and problem solving skills.  A methodical and meticulous approach is often quite useful and people with these traits are often good at mathematics as well.

That being said I have personally found calculus, matrix algebra, and discrete mathematics very useful during my career in programming so far.  These are 1st and 2nd year university courses.  Numerical analysis and linear programming, 3rd-4th year courses in my particular degree have contributed a lot as well.  There was a heated discussion in a recent thread about precision.  Without naming any names, it was pretty clear who had a strong background in numerical analysis and who didn't.

The theory of computation involving mathematical proofs (3rd year course) was difficult for me to understand but helped establish a strong foundation in computer science.  Logical proofs and theory from a philosophy course was insanely useful.  Heck, even statistics can be crucial depending on what problem domain you're in.

In summary, the more mathematics the better.  You don't need all this math to program but in my opinion, mathematics is a key element in the foundation of a 'good' programmer.
Offline benc1213

Senior Newbie

« Reply #2 - Posted 2011-04-09 05:47:14 »

Ok thanks I will learn as much math then. I am a freshmen in highschool so it will be a while.  Grin
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline loom_weaver

JGO Coder

Medals: 17

« Reply #3 - Posted 2011-04-09 06:02:39 »

Let me add a few examples on how all this math can be useful for programming games.

Matrix algebra - an absolute necessity for 3D transformations i.e. think graphics, OpenGL, etc.
Calculus - Want to work on/with a physics engine?  How is distance, velocity, and acceleration related?
Graph theory - guess where the A* pathfinding algorithm came from.
Theory of computation - state machines combined with some graph theory gives you behavior trees--on the cutting edge of game AI

Notice how a lot of the 'hard' problems in writing games fall into these categories.

Good luck with your studies!
Offline ra4king

JGO Kernel

Medals: 362
Projects: 3
Exp: 5 years

I'm the King!

« Reply #4 - Posted 2011-04-09 06:28:58 »

Hey ben,
I'm a sophomore in High School and for 2D games you really only need to know basic arithmetics, trigonometry and geometry (for drawing, collision detection, etc...).

Like loom_weaver said, you only need to know advanced mathematics (11-12th grade math basically) for 3D, physics, and really smart AI.

I don't think you have taken trig yet as a freshman but that is only necessary for finding angles and side lengths in triangles.

Hope that helped Grin

Offline pitbuller
« Reply #5 - Posted 2011-04-09 08:09:38 »

You definetly need basic understand of boolean algebra.
Offline JL235

JGO Coder

Medals: 10

« Reply #6 - Posted 2011-04-09 12:23:54 »

It really depends on your definition of 'maths' and on what you are programming. When people talk about maths they typically imagine working on paper with large proofs and endless formulas in a pure mathematical world. There are parts of programming where this is required, but most programming is _MUCH_ less formal.

Further although search algorithms and hashing techniques can be backed up with pure mathematical models, again in practice you rarely need to look at them. Even at university you are rarely taught them in this way and instead they often try to teach at a more algorithmic level. You can take that further, but usually that's up to you to explore that (such as optional modules, a post-graduate course or studying in your own time).

For most programming, I'd actually argue you require very little explicit mathematical knowledge. For example building an elegant menu system in your game, you need to use some maths to help with any animations but you certainly don't need to go that in depth about what you are building. A few sketches on a piece of paper is as formal as it gets.

Finally a friend of mine at university was terrible at maths; he barely passed his A-level maths (for non-UK people that is the qualification before degree level in the UK). He went on to graduate with a 1st and he easily understood the cryptography, graph theory, search algorithms and other mathematical sections taught on our course. I also know a guy who programs a whole (small) game every week. He is both terrible at maths and terrible at programming, but he often gets more done in a week then I usually do in a month!

Better yourself: definitely! But don't get too wrapped up in if your good or bad at programming and maths!

Offline aazimon
« Reply #7 - Posted 2011-04-11 01:46:36 »

I agree with much of what as been said, but if you are just talking about being a good programmer: I've been programming professionally for eight plus years, and haven't need to do any math, related to my work. But if you are are talking about being a good game programmer then you will need some knowledge of math, for figuring out the mechanics of the game.
Offline ddyer
« Reply #8 - Posted 2011-04-11 05:36:02 »

The general maths that are really useful are basic algebra, trig, probability, number theory and matrix
algebra.  Don't overlook classes in numerical methods that are tailored to programming.  More advanced
math including calculus is not generally relevant or useful.

Offline philfrei
« Reply #9 - Posted 2011-04-11 05:39:40 »

Yes to all the above. There is programming and there is programming. I mean, a LOT of people who are programming are doing things that do not require much math at all, beyond basic algebra. I haven't used much math writing Access database applications for various offices and corporate departments. (Though it helps to have a good head for basic set theory. Not everyone "gets" table structure.) A lot of PHP & web programming, AJAX type stuff, I don't think one needs much math. Writing html for a browser takes a lot less background in math than creating a more efficient browser. A lot of folks who jumped into programming by picking up html in an earlier tech boom ended up going back to serving cappucino's because the work they did required relatively little training and they didn't know how to do anything else in the programming world when the boom went bust--it was kind of the equivalent of a McProgramming job.

But I am really dismayed at how I am basically shut out of doing any audio processing via computer (beyond really really simple stuff) because of my lack of math. I'd like to write code for things like digital filtering, or other simple transforms of data streams of audio, to do "easy things" like speed up or slow down notes without changing pitch (or even WITH changing pitch). Create my own VST's. Forget it. I "ONLY" have two semesters of calculus, rudiments of matrix algebra & probability & sequences & series, basic trigonometry, basic physics. Not going to cut it. There's like another two years of coursework that would be really beneficial if I could make time for it, building up to things like differential equations and such. And what I have won't cut it for 3D programming either without a lot more self-education.

"It's after the end of the world! Don't you know that yet?"
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline philfrei
« Reply #10 - Posted 2011-04-11 05:44:41 »

I would contend that while calculus is not used directly, very often, in programming, it is an important gateway to learning maths that are.

"It's after the end of the world! Don't you know that yet?"
Offline Sinuath

Junior Devvie

Medals: 2

« Reply #11 - Posted 2011-04-11 07:15:10 »

philfrei  i find your post fascinating as i'm currently in my first semester of calculus. In fact i'm taking a break from a problem right now.  Please elaborate, what is calculus a gateway for?

Hey [you][/you], you should totally check out my boring Site ~
Offline cylab

JGO Ninja

Medals: 57

« Reply #12 - Posted 2011-04-11 07:56:18 »

If you want to programm any kind of game, learn vector and matrix math - even only for 2D. It will REASONABLE reduce hair pulling if you try to make something involving any of directions, speed, accelleration, collisions etc.

Create my own VST's. Forget it.

Actually it's not that hard. For almost any problem there are formulas and libraries you can leverage without understanding anything but the input and output values. You'll need a fourier transformation for most of it (to transform your "2D" [time,value] input to a "3D" [time,frequency,value] output), but there are also ready to use formulas for hi, low and bandpass filters. Google should turn up with some good resources.

Mathias - I Know What [you] Did Last Summer!
Offline Roquen
« Reply #13 - Posted 2011-04-11 08:58:12 »

In an ideal world:
  Q: How much math should I know?
  A: more.

For real life, my answer would be (the classic response to most questions): It depends.  In this case depending on where you are and where you want to go.  My list of "useful" forms of mathematics for game programming would be very very long.

WRT: Signal processing.  If you want to learn "how" and "why", I'd suggest starting with image processing instead.  The eye is much more forgiving than the ear.

WRT: Calculus.  Yeah it's at least useful for de-blackboxing lots of stuff.  For other "stuff" it's required.  (Like my precision?)

So, to the OP.  Everything you'll learn in HS classrooms are important building blocks to other stuff (even that complex algebra).
Offline delt0r

JGO Knight

Medals: 30
Exp: 18 years

Computers can do that?

« Reply #14 - Posted 2011-04-11 10:15:05 »

As someone who use to hire programmers (and fire), I can tell you that the average programmer has far too little math (aka none IME). In the end at one company we started advertising and hiring math and physics graduates rather than CS grads. It worked out really well. Far to few CS majors bother with serious level math and it can be serious impediment to getting the job done. Don't forget it not so much what you learned, but what you can now pick up and how quickly. Without foundation, it just won't happen.

It kinda funny that you ask with respect to games. In the business world you really don't need much raw math. It is all compound interest formula type stuff. But you end up needing to know basic algorithms and need to have a idea about big O notation. The number of times someone has done a O(n^2) algo when it should be O(ln(n)) when n can be bigger than a million is rather silly.

While for games knowing about vectors and matrices is a must IMO. General calculus is also needed really, and even coordinate spaces (aka tangent spaces for normal/bump mapping). So more is better.   

I have no special talents. I am only passionately curious.--Albert Einstein
Offline Roquen
« Reply #15 - Posted 2011-04-11 10:30:04 »

Calculus is similar to the algebra of reals.  It's a basic buidling block that closes lots of doors if you don't know it.  Note I disagree about not "needed" at least sound numerical analy skills in the business world.  So few programmers understand it that we'll probably see floating decimal hardware because they don't understand, for instance, that 1/10 is irrational in binary.
Offline pjt33
« Reply #16 - Posted 2011-04-11 10:46:42 »

The number of times someone has done a O(n^2) algo when it should be O(ln(n)) when n can be bigger than a million is rather silly.
Is that a deliberate error to see who's awake?
Offline delt0r

JGO Knight

Medals: 30
Exp: 18 years

Computers can do that?

« Reply #17 - Posted 2011-04-11 11:39:45 »

I don't see anything wrong. Unless you are going to be pedantic about up to a constant and n>1000000. In real algos the size of n really matters compared to the constant. Not many constants are the order of 1000000000000.

Perhaps you don't see that i use ln for the natural log , rather than log, which is still logarithmic up to a constant.

I have no special talents. I am only passionately curious.--Albert Einstein
Offline Roquen
« Reply #18 - Posted 2011-04-11 12:28:13 »

I guess you could know that you'll never hit worst case performance and that the n^2 has a better average case.  But since you explicitly said "should have been"..that's sorta eliminated.
Offline pjt33
« Reply #19 - Posted 2011-04-11 21:27:57 »

I don't see anything wrong.
An algorithm which is O(log n) can't read all the input.

philfrei, there's a page on DSP which I've only skim-read - I'd like to go back and study it properly at some point - but which I suspect you'd find interesting.
Offline philfrei
« Reply #20 - Posted 2011-04-11 22:03:11 »

Thank you pjt33! I have printed out the tutorial and will be reading it on my commute to work tonight!

Sinuath, maybe this is a good illustrations as to how Calculus is a gateway drug...errr, gateway course:

Note, Math 1B (2nd semester calculus) is needed for courses like 53 & 54 which are in turn needed for the first round of upper division courses, such as 114 "Introduction(!) to Applied Mathematics".

There IS a lot of programming work for people without math background, but it comes and goes, has a very dicey "business cycle".
1) Something valuable can only be done with great difficulty.
2) Someone makes a tool so lots of people can do this valuable thing -- often leads to lots of new programming hires.
3) Someone figures out how to automate this valuable thing -- leading to lots of same new McProgrammers getting laid off.

"It's after the end of the world! Don't you know that yet?"
Offline Nate

« JGO Bitwise Duke »

Medals: 159
Projects: 4
Exp: 14 years

Esoteric Software

« Reply #21 - Posted 2011-04-12 06:11:59 »

You don't need any math at all to be a pro gamer.

Offline Mads

JGO Ninja

Medals: 26
Projects: 3
Exp: 6 years

One for all!

« Reply #22 - Posted 2011-04-12 06:40:38 »

I'd say you can come a long way with the most basic math, and a nice working brain.. Ofcourse your collisions will be home-made and not so realistic, but it can work  Smiley

Offline delt0r

JGO Knight

Medals: 30
Exp: 18 years

Computers can do that?

« Reply #23 - Posted 2011-04-12 08:24:40 »

pjt33, finding something in a sorted list with random access does not need to read all the input. It just one example of true O(log(n)). Also picking something that may have "good" average case  compared to an alternative that has this complexity as a worse case is not better by any stretch of the imagination.

Why do so many CompSci majors beat quick sort to death I will never know.

I have no special talents. I am only passionately curious.--Albert Einstein
Offline pjt33
« Reply #24 - Posted 2011-04-12 11:03:43 »

pjt33, finding something in a sorted list with random access does not need to read all the input.
Fair point.

(You've seen people using an O(n^2) search through a sorted list?! Ouch)
Offline Roquen
« Reply #25 - Posted 2011-04-12 14:09:05 »

Big-O is a very important metric but it isn't a gleaming sword.  Were that the case many methods would never see the light of day.  A trival example: the splay tree.  Worst case = n, average case = ln(n).  However with the right kind of temporal access patterns searches will approach constant time.
Offline delt0r

JGO Knight

Medals: 30
Exp: 18 years

Computers can do that?

« Reply #26 - Posted 2011-04-12 14:59:02 »

This illustrates my point really well. There are a lot of CS majors that are now lost as to what we are talking about. Personally having some idea is IMO mandatory. You don't really need to know what NP=P means, but you need to understand big O little o and real world performance scaling issues. More importantly you  should know that "common problem X" can be solved with "algo Y" in O(splat) complexity.

I have no special talents. I am only passionately curious.--Albert Einstein
Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.


Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Robo11 (12 views)
2015-01-25 06:14:26

basil_ (26 views)
2015-01-17 22:29:32

wxwsk8er (21 views)
2015-01-16 21:42:21

wxwsk8er (20 views)
2015-01-16 20:44:20

basil_ (25 views)
2015-01-14 09:46:59

basil_ (21 views)
2015-01-14 09:46:52

wxwsk8er (31 views)
2015-01-13 20:42:16

wxwsk8er (34 views)
2015-01-13 03:23:59

vctt (54 views)
2015-01-12 03:21:07

wxwsk8er (31 views)
2015-01-12 03:11:59
2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21

Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!