Hello, I'm currently a physics major but am thinking about changing to math with a minor in computer science. I've always been interested in areas of computer science that required a lot of math such as cryptography but mainly computer graphics. The math degree is very lenient in the sense that I can pick most of the upper division courses. I tried googling which maths would be of the most use in computer science in general but usually the results I found were just "trig, linear algebra, calculus" etc which isn't what I'm looking for. I'm posting in computer graphics because I figured this would be the most mathheavy programming section.
Currently for math I have calculus 13, linear algebra, differential equations, and a course in discrete math.
Here are my questions:(gear 3 and 4 towards computer graphics/simulations, I suppose):
1) Do different branches of computer science require vastly different branches of math or is it all similar?
2) For computer graphics/simulations. Would I be better off doing math or physics for this assuming equal amount of programming for both?
3) A 2semester sequence that I have to choose between is:
Survey of Multivariable Calculus (More advanced vector calculus, more max/min geometry stuff, complex functions etc)
and
Survey of Partial Differential Equations (Just all PDEs and orthogonal functions and stuff)
OR
Real Analysis 1
and
Real analysis 2
I'm not sure how useful the more advanced calculus stuff is compared to the proof based courses like Real Analysis. Any ideas?
4) Lastly, which of these undergrad courses are the most important?
Numerical Analysis 1 & 2
Combinatorics 1 & 2
Complex Variables 1 & 2
Topology 1 & 2
Game Theory
Cryptography
Another discrete math course
Advanced Linear Algebra (probably a lot of proofs)
Abstract Algebra
Probability Theory
Advanced Geometry (Hilbert postulates, Lobachevskian geometries etc)
Statistical inference
Theory of Numbers 1 & 2 (The Euclidean algorithm and unique factorization; arithmetical functions; congruences, reduced residue systems; primitive roots; certain diophantine equations.)
Correct me if I'm wrong but I'm thinking numerical analysis, combinatorics, and another discrete math should definitely be taken for any branch. But what else?
Math related to 3D graphics/simulations
Page 1 of 14 Replies  281 Views  Last Post: 18 July 2014  03:23 PM
Replies To: Math related to 3D graphics/simulations
#2
Re: Math related to 3D graphics/simulations
Posted 18 July 2014  08:58 AM
Maybe some of the mathmaticians here can answer how theoretical math applies to computer science. Trig is the highest math course I've complete in college. But I've worked for several Fortune 100 companies in Information Technology as a network admin, programmer, and database administrator. NONE of that required any math beyond middle school algebra, ever. Most business computer jobs require no college level math whatsoever.
Obviously, if you're a programmer for engineering software, that's another matter entirely. So, there are areas in the industry that might require a tremendous amount of math, but not 98% of the jobs out there.
As an amateur game programmer hobbiest, I can vouch that game programming actually does use mathematics. It's the only place in computer programming where I've been able to put my trig to use. I sometimes regret that I don't know calculus because physics programming can really benefit from a knowledge of calculus. I'm not sure it's actually a requirement though. I do physics stuff with just trig and algebra. My college physics text book has no calculus in it whatsoever, although it's first year college physics. It's all trig and algebra. You probably know better then I do how you benefit from Calculus when you're working with constantly changing systems. Algebra falls a little short there, but I think most of the computer code is still going to be more along the lines of algebra then calculus. The place where it bothers me the most is that when I go to read physics books to learn more; funny enough, the game programming physics books have far more calculus in them then the actual college physics books. I have difficulty reading game programming physics books because I don't understand calculus notation. In a lot of cases, I actually understand the actual physics. In many cases, it's laughable because I can write an algebra equation that describes the law of physics that they are trying to overly complicate by writing it out in calculus notation. Still, I really do wish I knew calculus. It might also be great for working with electronics.
Outside of physics, the only math I've seen useful for game programming is algebra, trig, and linear algebra in that order. Those all come up a lot.
I've never taken linear algebra. The linear algebra in game programming is a fairly small subset of what you would learn in a linear algebra class. My knowledge of vectors from trig class and also from using them in programming, is more then sufficient. I mean, it's largely a trig subject, but they kind of blow through it really quick as an introduction; it doesn't really hurt your grade if you do poorly during that week or two when they're covering them. But pretty much everything you need to know about vectors for game programming was covered in my trig class. It's mostly vector dot and cross products and maybe the perpendicular dot product. If you've got that, you're golden.
Matrix algebra is the big thing that is so huge in game programming, other then vectors, from linear algebra. But here especially, you are using a very limited subset of matrix algebra.
Almost all of your matrices are 4 by 4 matrices that eventually get applied to a 4D vector (4D primarily so that it can be multiplied by a 4 by 4 matrix). You might on occasion see a 3 by 3 matrix. But that's pretty much it.
And your matrix operations are very limited also. Quite frankly, I can't think of any use for matrix addition and subtraction in computer programming, off the top of my head. The only thing you ever do with matrices is multiply them with each other and with vectors that have been converted to matrices.
If you've learned matrix multiplication, you've pretty much learned all you need to learn of matrix algebra for game programming. It's more important to understand the jobs assigned to matrices rather then the math that goes on with them. If you simply know that multiplying two matrices combines the data in them and that multiplying a matrix times a vector gives a vector that is modified by the matrix, you really don't even need to understand matrix algebra at all. You could be great with this stuff and not have a clue how the math actually works as long as you understand when and how to apply the matrices. That's primarily because the computer does all of the math for you. You don't have to know anything about how to multiply two matrices together. It's like multiplying two numbers together using a calculator; you tell the computer to do it and it does it.
There are builtin libraries to handle all of the matrix algebra stuff for you, and even if there were not, you could copy and paste the code for it off the internet. I tell people to forget learning matrix algebra and treat matrices as a "black box" that you load formulas in, combine them by multiplying, and send the results as a matrix to the graphics card. That's the way I think of them. I knew matrix algebra at one point because someone convinced me you needed to know it in order to program games. But over the years as I actual program game stuff, I forget it because I never use it beyond telling two matrices to multiply.
You really need to know the special case uses of a world/transform matrix, a view matrix, and a projection matrix. I don't think they teach that in a math class. But that's basicaly 99.9% of how matrix algebra applies to graphics programming. You have methods to load all of these matrices for you. So, again, you really don't need to understand the math if you know how to call the methods that load them with the proper data, understand that multiplying them combines the data, and know how to apply them. On the other hand, it helps if you understand matrix multiplication at a mathematical level if you really want to get good with them and understand how they work "under the hood". But like a car, you don't need to know how to build an engine to drive it.
And that's pretty much it. We use unit quaternions for some specialized stuff. I see them a lot in annimation programming. I'm not sure what math class they teach them in. But again, it's more about knowing when and how to apply them rather then understanding how they actually do their magic. I have no idea how quaternions relate to anything in the real world or in computer graphics. I can tell you that, again, it's a special case and a subset of the mathematics. Only unit quaternions are used and they are used along with matrix algebra. Unit quaternions are a small subset of quaternions. I do have a "fair" idea of what a unit quaternions does internally and how to apply them to transformations in computer graphics. But again, I tend to treat them as a "black box" because there are functions to load them, you multiply them to combine their data, and then I know where and how to apply the result.
So, I guess the bottom line is, you're already way mathematically over qualified for any computer job unless you're sending robots to Mars with your code or something along those lines.
Obviously, if you're a programmer for engineering software, that's another matter entirely. So, there are areas in the industry that might require a tremendous amount of math, but not 98% of the jobs out there.
As an amateur game programmer hobbiest, I can vouch that game programming actually does use mathematics. It's the only place in computer programming where I've been able to put my trig to use. I sometimes regret that I don't know calculus because physics programming can really benefit from a knowledge of calculus. I'm not sure it's actually a requirement though. I do physics stuff with just trig and algebra. My college physics text book has no calculus in it whatsoever, although it's first year college physics. It's all trig and algebra. You probably know better then I do how you benefit from Calculus when you're working with constantly changing systems. Algebra falls a little short there, but I think most of the computer code is still going to be more along the lines of algebra then calculus. The place where it bothers me the most is that when I go to read physics books to learn more; funny enough, the game programming physics books have far more calculus in them then the actual college physics books. I have difficulty reading game programming physics books because I don't understand calculus notation. In a lot of cases, I actually understand the actual physics. In many cases, it's laughable because I can write an algebra equation that describes the law of physics that they are trying to overly complicate by writing it out in calculus notation. Still, I really do wish I knew calculus. It might also be great for working with electronics.
Outside of physics, the only math I've seen useful for game programming is algebra, trig, and linear algebra in that order. Those all come up a lot.
I've never taken linear algebra. The linear algebra in game programming is a fairly small subset of what you would learn in a linear algebra class. My knowledge of vectors from trig class and also from using them in programming, is more then sufficient. I mean, it's largely a trig subject, but they kind of blow through it really quick as an introduction; it doesn't really hurt your grade if you do poorly during that week or two when they're covering them. But pretty much everything you need to know about vectors for game programming was covered in my trig class. It's mostly vector dot and cross products and maybe the perpendicular dot product. If you've got that, you're golden.
Matrix algebra is the big thing that is so huge in game programming, other then vectors, from linear algebra. But here especially, you are using a very limited subset of matrix algebra.
Almost all of your matrices are 4 by 4 matrices that eventually get applied to a 4D vector (4D primarily so that it can be multiplied by a 4 by 4 matrix). You might on occasion see a 3 by 3 matrix. But that's pretty much it.
And your matrix operations are very limited also. Quite frankly, I can't think of any use for matrix addition and subtraction in computer programming, off the top of my head. The only thing you ever do with matrices is multiply them with each other and with vectors that have been converted to matrices.
If you've learned matrix multiplication, you've pretty much learned all you need to learn of matrix algebra for game programming. It's more important to understand the jobs assigned to matrices rather then the math that goes on with them. If you simply know that multiplying two matrices combines the data in them and that multiplying a matrix times a vector gives a vector that is modified by the matrix, you really don't even need to understand matrix algebra at all. You could be great with this stuff and not have a clue how the math actually works as long as you understand when and how to apply the matrices. That's primarily because the computer does all of the math for you. You don't have to know anything about how to multiply two matrices together. It's like multiplying two numbers together using a calculator; you tell the computer to do it and it does it.
There are builtin libraries to handle all of the matrix algebra stuff for you, and even if there were not, you could copy and paste the code for it off the internet. I tell people to forget learning matrix algebra and treat matrices as a "black box" that you load formulas in, combine them by multiplying, and send the results as a matrix to the graphics card. That's the way I think of them. I knew matrix algebra at one point because someone convinced me you needed to know it in order to program games. But over the years as I actual program game stuff, I forget it because I never use it beyond telling two matrices to multiply.
You really need to know the special case uses of a world/transform matrix, a view matrix, and a projection matrix. I don't think they teach that in a math class. But that's basicaly 99.9% of how matrix algebra applies to graphics programming. You have methods to load all of these matrices for you. So, again, you really don't need to understand the math if you know how to call the methods that load them with the proper data, understand that multiplying them combines the data, and know how to apply them. On the other hand, it helps if you understand matrix multiplication at a mathematical level if you really want to get good with them and understand how they work "under the hood". But like a car, you don't need to know how to build an engine to drive it.
And that's pretty much it. We use unit quaternions for some specialized stuff. I see them a lot in annimation programming. I'm not sure what math class they teach them in. But again, it's more about knowing when and how to apply them rather then understanding how they actually do their magic. I have no idea how quaternions relate to anything in the real world or in computer graphics. I can tell you that, again, it's a special case and a subset of the mathematics. Only unit quaternions are used and they are used along with matrix algebra. Unit quaternions are a small subset of quaternions. I do have a "fair" idea of what a unit quaternions does internally and how to apply them to transformations in computer graphics. But again, I tend to treat them as a "black box" because there are functions to load them, you multiply them to combine their data, and then I know where and how to apply the result.
So, I guess the bottom line is, you're already way mathematically over qualified for any computer job unless you're sending robots to Mars with your code or something along those lines.
This post has been edited by BBeck: 18 July 2014  09:02 AM
#3
Re: Math related to 3D graphics/simulations
Posted 18 July 2014  12:20 PM
I agree that most of the math classes teach methods of solving problems which aren't actually used in computer science. I'd say most of the benefit is just intuition. Like in calculus, having the intuition behind rate of change has been very helpful.
I'm wondering now which major between math or physics, would a game development company prefer more. I know it doesn't really matter as long as you have a good portfolio, but let's say two people had equal portfolios but one a math major and the other a physics major, would the degree be negligible?
Also, kind of off topic but if anyone here knows, is it possible to go from a math or physics bachelors to a graduate program in computer science? I'm confident I could obtain the required knowledge(I spend a lot of free time on learning programming) but I'm not sure if that's even allowed. And if so, would both majors be about equal usefulness for something like artificial intelligence? I was guessing math but I'm not sure.
I'm wondering now which major between math or physics, would a game development company prefer more. I know it doesn't really matter as long as you have a good portfolio, but let's say two people had equal portfolios but one a math major and the other a physics major, would the degree be negligible?
Also, kind of off topic but if anyone here knows, is it possible to go from a math or physics bachelors to a graduate program in computer science? I'm confident I could obtain the required knowledge(I spend a lot of free time on learning programming) but I'm not sure if that's even allowed. And if so, would both majors be about equal usefulness for something like artificial intelligence? I was guessing math but I'm not sure.
#4
Re: Math related to 3D graphics/simulations
Posted 18 July 2014  12:33 PM
These hypothetical are getting a little out of hand, and quickly spiraling out of control. Dial it back.
There are too many variables to give you a certain answer. Do they need someone to do ragdoll/havok work? Do they need help with piplines? Where are they weak in, top heavy, or generally view?
I would imagine the schools will not stop you  assuming you can pass the GRE general or subject matter tests... have recommendations.. a good application.. etc.
Think about it... get your head out of the hypothetical weeds. Would a physics degree be more hands on applicable to any of the various fields in AI?
Quote
I'm wondering now which major between math or physics, would a game development company prefer more. I know it doesn't really matter as long as you have a good portfolio, but let's say two people had equal portfolios but one a math major and the other a physics major, would the degree be negligible?
There are too many variables to give you a certain answer. Do they need someone to do ragdoll/havok work? Do they need help with piplines? Where are they weak in, top heavy, or generally view?
Quote
is it possible to go from a math or physics bachelors to a graduate program in computer science?
I would imagine the schools will not stop you  assuming you can pass the GRE general or subject matter tests... have recommendations.. a good application.. etc.
Quote
ould both majors be about equal usefulness for something like artificial intelligence?
Think about it... get your head out of the hypothetical weeds. Would a physics degree be more hands on applicable to any of the various fields in AI?
#5
Re: Math related to 3D graphics/simulations
Posted 18 July 2014  03:23 PM
Quote
1) Do different branches of computer science require vastly different branches of math or is it all similar?
Depends on what you're doing. Theoretical CS is largely graph theory, combinatorics, number theory, automaton theory, formal languages, and such. You might use some linear and abstract algebra as well. If you're doing numerical analysis and scientific computing, you would need more specialized math. If you're doing computational geometry, then you have to know some advanced geometry and topology. Some analysis wouldn't hurt either if that's where you want to go.
Quote
2) For computer graphics/simulations. Would I be better off doing math or physics for this assuming equal amount of programming for both?
It's always easier to pick up another field than it is to pick up on the math. Physics is going to start out harder than math at the undergraduate levels. However, at the junior/senior and graduate levels, the math becomes increasingly important.
Quote
3) A 2semester sequence that I have to choose between is:
Survey of Multivariable Calculus (More advanced vector calculus, more max/min geometry stuff, complex functions etc)
and
Survey of Partial Differential Equations (Just all PDEs and orthogonal functions and stuff)
OR
Real Analysis 1
and
Real analysis 2
Survey of Multivariable Calculus (More advanced vector calculus, more max/min geometry stuff, complex functions etc)
and
Survey of Partial Differential Equations (Just all PDEs and orthogonal functions and stuff)
OR
Real Analysis 1
and
Real analysis 2
If you want to do grad school for math, you will need Real Analysis 12 + Abstract Algebra. Generally, you have a 3000 Advanced Calculus or Introductory Analysis course, which serves as a prerequisite for Real Analysis. I will warn you that Real Analysis is the toughest sequence you will take as an undergraduate, unless you stick it out in Physics and take Quantum. I spent easily 1520 hours per week alone on Real Analysis homework my first semester. The second semester, I spent 810 hours per week. The material is tough. It's where you prove calculus. Aside from that, it's also the course where they force you to become ready for grad school in terms of proof writing. You would absolutely benefit from this sequence, but just be prepared to put in the work. The Multivariable Calc/PDEs sequence is more practical for applied math. Neither are going to be super important for graphics, but the former would be better for simulation and modeling.
Quote
4) Lastly, which of these undergrad courses are the most important?
Aside from Crypto, Numerical Analysis, and possibly Game Theory, everything you will be doing at the 30004000 level will involve significant amounts of proof writing. If you like graphics, I'd suggest Advanced Linear Algebra, Topology, and Geometry. Abstract Algebra would be a nice to have, as it will help you with algebraic topology and algebraic geometry material as you need it. Though I would advocate taking a couple HCI classes in CS before committing to the computer graphics plan. You may find graphics aren't your thing.
If you want to go the applied discrete route, I would look at number theory, combinatorics, crypto, abstract algebra, linear algebra, and game theory. Emphasis on number theory and combinatorics. The rest, pick from your interests. The discrete courses are more relevant to AI; and if that's your end goal, I'd advocate strongly for a statistics course as well.
Page 1 of 1
