🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Programming and Higher Mathematics

Started by
58 comments, last by dr3w 5 years, 9 months ago

I've been wondering why universities require Computer Science students to take a lot of mathematics classes. What sort of things will higher mathematics such as trigonometry, calculus, etc. help me achieve with computer science? I'm especially interested in programming.

Advertisement

Well, from my perspective of 20 years which was mostly outside Game development:

  • Computer programs are Logic constructs which is actually Maths. In fact, having gone to Uni into Physics, my very first Programming course was showing us how it could be done entirely as a Maths construct.
  • Trignometry is essential in Games programming as a lot of what ends up as code are 2D and 3D calculations.
  • Probability, Statistics and Queue Theory are essential in figuring out things like how much load peak load can be on a system or things like the likelyhood of system failure given the likelyhood of failure of each redundant sub-system. By analysing these things one can make appropriate choices when designing a system in terms of how much error margin to add or how much effort to devote to dealing with recovering from certain kinds of failures.
  • A number of other Maths elements go into things like Neural Networks or Genetic Algortithms. Other complex AI techniques might involve Monte Carlo Simulations, which is a Numerical Analysis thing.
  • Further Numerical Analysis might be used in things like finding formulas that fit desired points so that you create a continous curve that matches a set of desired waypoints. Or at least in understanding how Bezier curves work.
  • Things like derivatives and integrals are used in simulating physical processes (so, in Game making also) as well as things like understanding how a discontinuity in the first order derivative on a surface curve would cause artifacts in specular illumination (usefull if for example you're doing mesh generation).
  • If you're doing games which are simulations you probably want to know about positive and negative feedback loops and maybe some of the basic stuff that relates to Economics. The maths that relates to Economics is also used in things like multiplayer games which have some kind of Economy.
  • For certain kinds of mesh/texture generation it might help to at least know what Chaos Theory is.
  • Beyond that, if you're doing Tech in business domains other than Games, certain disciplines often turn out to be useful in understanding the Business and making software for it (just like Trignometry and Calculus, for example, are very important in most Game development but not at all in most other programming areas).

More in general, to me personally it always worked well to be able to understand WHY and HOW things works rather than merely use other people's code, and for that it helps to have a deep groundwork of understanding in, amongst other things, Maths.

An observation I can add to what Aceticon has said is this: 
Higher level maths allow you to execute more effective code with less computing power.
Take the following example for instance, I want to know how much money I will have at the end of the year if I save $100 every month.  With the lowest level maths skill I can write the following code


JanuarySavings + FebruarySavings + MarchSavings + AprilSavings + MaySavings + JuneSavings + JulySavings + AugustSavings + SeptemberSavings + OctoberSavings + NovemberSavings + DecemberSavings = YearsSavings;

 With a just a touch more advanced math I could write


MonthlySavings * 12 = YearsSavings;

The illustration here being that multiplication is just a tad bit more abstract a concept as opposed to addition.  Now take into consideration all the other primitive operations you learned in highschool and apply them to your logical program and the speed and execution of your program will improve.

Advanced math is taking this same illustration to the next degree.  The more tools you have in your Mathematical Tool box the more effective and complex your programs can become.

5 hours ago, RidiculousName said:

IWhat sort of things will higher mathematics such as trigonometry, calculus, etc. help me achieve with computer science? I'm especially interested in programming.

All of it.

Stephen M. Webb
Professional Free Software Developer

6 hours ago, RidiculousName said:

I've been wondering why universities require Computer Science students to take a lot of mathematics classes.

Becouse computer is universal digits-mill. Computer able to  mill digits only. Illusion that computer able to do somethyng else comes from properly organized process of digits milling. To organize a digits-mill properly required to complitely describe mathematicaly this "something else". Really  on my first year at university we has more hours of mathemathic than any other engineering sciences students has during 5 university years, and  than we still has math hours during all 5 years.

 

6 hours ago, RidiculousName said:

What sort of things will higher mathematics such as trigonometry, calculus, etc. help me achieve with computer science

It just a basics required to study anything else and discover a fields of tasks that have to be implemented. Mathematic is universal language  of sciences. Any process can be described by set of differential equations. So calculus and linear algebra just a working horse required to study and discover anything else. 

 

6 hours ago, RidiculousName said:

I'm especially interested in programming.

Programming != coding. It is kind of engeenering. Coding is just a final part. Programing language is just something like pen intended to describe a way to solve a problem (aka algo) to computer. But to describe it by code you have to find it way first. It require to describe problem mathematically first.

#define if(a) if((a) && rand()%100)

6 hours ago, RidiculousName said:

I've been wondering why universities require Computer Science students to take a lot of mathematics classes. What sort of things will higher mathematics such as trigonometry, calculus, etc. help me achieve with computer science? I'm especially interested in programming.

As I'm sure you'll discover, trigonometry and calculus are not exactly higher mathematics. :D

Those requirements are usually come from a notion that studying that kind of thing will prepare you for the other, computer science-y math that you'll have to deal with. There's a certain assumption that going into your program, you're familiar with the notations that you would learn in those subjects, eg. sigma notation for summations. They expect you to have some amount of basic knowledge going in so they don't have to drag everyone up to standard in the first year.

A lot of the "theoretical" computer science classes will essentially be discrete mathematics courses. Those are the courses where you'll learn things like basic set theory, graphs, propositional logic, and complexity theory. In addition to that, most universities require CS students to take some amount of "actual" math and statistics, of course, though typically less so than physics or engineering students might and with more choice in what specific classes to take. For instance, differential equations were not required by my program - I took linear programming and number theory instead. At the time, I was a lot more interested in systems programming, programming language theory, and compiler construction than I was anything related to the stuff the engineering faculties were doing. Looking back, I wish I had taken more abstract math courses. Abstract algebra (group theory, rings, etc.) would have been more interesting and applicable than linear programming has turned out to be, and maybe then I would actually understand that "monads" thing in Haskell. :D

More "practical" CS courses won't be especially math heavy - my software engineering classes barely even required arithmetic! - but you'll still use the stuff you learned in the theoretical courses. Whether those math fields are useful in your professional life will be highly dependent on what kind of work you're doing. If you're doing graphics or gameplay programming, trigonometry and linear algebra will be indispensable. If you're doing physics, calculus will be very useful. If you're doing lower-level systems development, trigonometry won't be terribly helpful (when's the last time anyone here needed to know the arc-cosine of some number when implementing a memory allocator?), but complexity theory and number theory definitely will be.

54 minutes ago, Oberon_Command said:

Whether those math fields are useful in your professional life will be highly dependent on what kind of work you're doing.

Really only university studied coursee that i never used into real developdment is a operational calculus. But main concept of it - to transform task to basis/space where it easy to solve and than transform results back used very very often  

 

54 minutes ago, Oberon_Command said:

If you're doing graphics or gameplay programming, trigonometry and linear algebra will be indispensable.

If you have deal with robotics, CAD/CAM, physic process simulations or any other real-world related task you  will requilre it much more then for gameplay an graphics programming. Of cource theory of graph, theory of sets and many other theories required not less than calculus and lenear algebra.  And theory of complexity required anywere, becouse it applicable to any kind of tasks regardless where same algo works.

#define if(a) if((a) && rand()%100)

1 hour ago, Oberon_Command said:

At the time, I was a lot more interested in systems programming, programming language theory, and compiler construction than I was anything related to the stuff the engineering faculties were doing.

May be it language issue, but on slavic languages anything of it called engeenering. By other world anything related to any tech (not machinery or construction only) or ever chemistry and economy, that require to find way how to solve tasks and prove it solution by calculations/mathematical theories doing by persons that have qualification engeener of related field. For eхample engeeneer-programmer, engeneer-builder, engeneer-economist or ever engeneer-mathemathic and so on.

#define if(a) if((a) && rand()%100)

8 hours ago, RidiculousName said:

I've been wondering why universities require Computer Science students to take a lot of mathematics classes. What sort of things will higher mathematics such as trigonometry, calculus, etc. help me achieve with computer science? I'm especially interested in programming.

First of all, ... trigonomy, calculus, etc. are what we studies in high school here. It's not exactly higher level of math.

Secondly... Computer Science is a branch of mathematics. These subjects might be carried over from mathematics program. It might not help you to be a good computer scientist, but since computer scientist are also kind of mathematician so you're expected to know a little bit of them....

http://9tawan.net/en/

32 minutes ago, mr_tawan said:

calculus, etc. are what we studies in high school here. It's not exactly higher level of math.

Of course STEM classes of high schools here have basics of calculus like theory of limits, basics of  derivatives and integrals. But first university year studies it on much higher level than 2 years of high school. Trigonomerty really studied in secondary school  

#define if(a) if((a) && rand()%100)

This topic is closed to new replies.

Advertisement