I am currently learning mathematics and physics along with programming. Some of it is definitely useful for my programming related projects, especially the (hobby) games that I make, but not all. What are the most important topics which are necessary for a programmer?
As much as you need. If you'r developing something to do physics calculations then you should know the physics and the math, likewise for mathmatics software.
Otherwise I think that High School math/physics should get you most of what you need.
The area of Discrete Mathematics was taught in my Computer Science degree. This has served me well over my programming career.
From that article:
Discrete mathematics includes the following topics:
- Logic - a study of reasoning
- Set theory - a study of collections of elements
- Number theory
- Combinatorics, including
- Design theory
- Enumerative combinatorics
- Graph theory
- Algorithmics - a study of methods of calculation
- Information theory
- Digital geometry
- Computability and complexity theories - dealing with theoretical and practical limitations of algorithms
- Partially ordered sets
- Proofs
- Counting and relations
There are many more spcialised areas of mathematics that would be useful depending on what sort of software you are writing.
But overall I've the topics covered in Discrete mathematics to be core background knowledge for working with any programming language, relational database, algorithm design, testing and so on.
<------------------>
About that much.
Seriously though, in 'enterprise' programming where you are making some internal software for some company the answer is none, none at all. Most of the 'mathy' parts of software development are abstracted away from you these days anyway.
Mathematics
- Discrete mathematics - the basics of computer science
- Statistics - the workhorse of data analysis and interpretation
- Linear algebra - Vector spaces, analytic geometry
- Queueing theory - The study of queues, and queueing systems (think servers)
- Numerical analysis - Eg: systems of equations, used in many algorithms for problem solving
Physics
- Quantum mechanics - A possible future of computing, and applicable to fiber optics
As for math I would point you to this thread:
What are the core mathematical concepts a good developer should know?
For the physics part, I would say it depends on the area of development you're in: if you have to do a physics engine for a game, obviously there is a need for physics. Most of the time math will do though. Here my answer in the other thread:
Discrete Math, Linear Algebra, Combinatorics, Probability and Statistics, Graph Theory
and add mathematical logic.
This would give you a grip on most fields of CS. If you want to go into special fields, you have to dive into some areas especially:
Computer graphics -> Linear Algebra
Gaming -> Linear Algebra, Physics
Computer Linguistics -> Statistics, Graph Theory
AI -> Statistics, Stochastics, Logic, Graph Theory
As programming is mathematics at its core (lambda calculus), knowing the theory behind computing can help you a lot. Obviously, if you're just doing another boring CRUD app, then sure, you don't need to know much; but if you want to do anything that involves any formula at all, you should know why you're doing it, and what you're actually doing.
It really depends on what kind of programmer you want to be, but my advice is to take as much as you can. The math can come in really handy if you want to move from programming to research, or if you want to do something more than just develop applications (e.g. quantitative analysis at a bank, game programming, simulation, or even biotech). Also, the math will help a LOT if you ever decide you want to go to graduate school.
If you think you'll be happy programming, or if you think you'll move on to management instead of more advanced technical positions, you could stick with the course requirements for the degree, but there may come a day (as did with me) that you get bored of that. It's much easier to get the math in now while you're in school than later when you don't have the time and might have forgotten a lot of it!
Regardless of the kind of programmer that you are, you should learn as much logic and math as possible. If possible, take a graduate-level course in logic (either in the math or op philosophy dept), where you might learn to construct your own formal logic. Set theory and graph theory are the fundamental abstractions behind everything a programmer does. After all, a programming language is at the bottom a proof theory for that specifies the consequences of logical sentences.
Also, I would not underestimate the value of statistics. While statistics by definition is not deterministic, it is still valuable for a number of real world problems.
ADDITION: physics is valuable as an instance of a discipline that employs the scientific method. While you certainly could learn the scientific method by taking biology or chemistry, lower-division physics for science majors also has the advantage that it forces you to apply the calculus that you should be learning concurrently.
Math topics, which IMHO are necessary are discrete math, linear algebra, and probability. Calculus, multivariate calculus, and differential equations are useful too. Generally, the more math you know, the wider is the range of problems that you can solve. Not to mention that doing math sharpens your ability to see patterns and solve problems. Same with physics.
Speaking of physics, I just read a great joke on slashdot:
A pre-med student asked his physics professor: "Why do they make pre-med students take physics?" "To save lives," said the professor. "But how?" said the student? "By keeping idiots out of medical school," said the professor.
Of course it depends 100% on what type of programming you're going to be doing. If you plan on programming web apps with database back-ends, you may not need much beyond simple 2d geometry.
If you're doing anything with graphics, especially 3d.. you'll want a solid handle on linear algebra, vector math, matrices, trigonometry, and 2d and 3d geometry.
If you're getting into any kind of simulation or games, you want a solid foundation of physics as well.
If you're going to be getting deep into advanced algorithms, you may want a handle on combinatorics. Other fields.. like bioinformatics, perhaps, may call for good inderstanding of statistics and probablity theory.
If you don't know what type of software you're aiming for, your best bet is to have a good grasp on a wide set of fundamentals for college-level math and physics.. and try to learn necessary skills as you need them.
Maths can certainly help when designing numerical algorithms - most relevent here algebra. Breaking down larger problems into atomic functions and manipulating known quantities to calculate unkowns. Additionaly, at a quite basic level it can help you discern the operation order of larger functions leading into the logic side of mathematics perhaps helping you in implementation of conditionals.
In a number sense, mathematics and physics can help you understand the finer details of how a computer handles different number types (integers, reals etc), the strengths, weaknesses, appropriatness and interaction between each.
In a game perspective, depending what you focus on, you will ues calculus (game physics), matrices (transformations), geometry (user interfaces, 3D geometry) and perhaps even topics such as graph theory if you are going to do any network type stuff.
Having a physics background myself, I find I don't directly use a lot of what I learned at uni. However, I apply the principles and methods I picked up - problem solving, abstract thinking and researching. I also use some of my experimental experience to help me better analyse and test the things I develop.
What I've practically used:
- Discrete mathematics. This is a broad discipline, and Ash's answer covers things therein well. Much of this binds tightly to the fundamentals of computer science; if you're studying programming in terms of low-level theory, you'll be learning this whether you realize it or not.
- Physical mechanics. If you're going to do any sort of games programming, the application of basic laws of motion and mechanics is likely to come into play. Conceptualizing the movement and interaction of objects and forces in physical space; collision management; etc.
- Matrix transformations. This is must-have stuff if you're going to play with low-level 3D graphics. An understanding of how to work with matrices will be essential if you want to understand, rather than just use out-of-the-box, 3D graphics libraries.
- Advanced geometry. Another must if you're looking at working in graphics/games. A firm grasp of 2D geometric principles is a must if you're implementing graphics routines; familiarity with 3D space, and the concepts behind navigation and transformation thereof, is critical.
Well it's been established that you don't need to know how to use a slide rule.
My lecturer in quantum mechanics said (something like):
- "A future employer might well send you on a programming course, but he will probably not let you take quantum mechanics."
When I started my post-graduate studies, and expressed some concern that I had not taken all the basic courses for the subject, my professor said:
- "It doesn't matter what you did before, as long as it was hard."
My point being that basically any difficult subject that you have the opportunity to study and find interesting and enjoyable will help you, for the pure "brain-training" it offers.
I live by Richard Feynman's old rule, "Learn how to solve every problem that has been solved.".
I'm going to go against the general opinion here... and say that you probably don't need to worry about it much.
I know a bunch of developers who do maths & physics backgrounds (hell - I've got a half way decent background in both myself). I also know a bunch of developers who don't.
I don't see any correlation between being a good developer and having any particular background knowledge in another field.
Learn to be a good developer first.
I noticed no one mentioned aerospace or scientific careers. Those sorts of endeavors need programmers just as much as enterprises looking for a new MSRP system. And in my opinion it is generally really interesting work. I've done some work programming analytical simulations where the whole point is to model the physics accurately. It was some of the most fun work I've done in my career. So if you like that sort of thing taking physics and math will leave you well prepared to land those kinds of jobs. If you think physics is boring then I wouldn't sweat it there are lots of programming jobs that don't need a scientific or even much of a math background.
I don't see any correlation between being a good developer and having any particular background knowledge in another field.
If you do business software you probably don't need math. (except relational db theory and basic stuff)
However if you want to do some more interesting stuff, such as graphics, AI, simulations, etc you need quite a lot of math. For example:
http://www.idsoftware.com/business/jobs/index.php
Under requirements - Excellent math skills
I consider programming knowledge just a tool for putting theoretical concepts into practice. Certainly you must have some background knowledge from the field you are working on whether it be finance, mechanics, geology etc. and the mathematical skills that are used in the field.
For core programming/development, you need little education in maths/physics. Most useful would be:
- basic arithmetic (sounds silly but not everyone can do it)
- binary, hex bit-wise logic operations
- basic statistics (not much beyond mean average really)
- percentages
That's about it. Simple geometry is useful but you just look up "distance between 2 points" as you need it. Everything else is going to vary a lot based on what you work on.
Depends what kind of software you're going to be working on. If you're building simulation/modelling systems (in academia or business), or doing financial analsis then you'll need strong mathematics and/or physics. Similarly, if you are analysing algorithms then you'll need to understand computation theory etc.
But for 99% of commercial development work (desktop apps, web apps, etc.) you'll need nothing above high school level mathematics, and probably not even that. That kind of work just doesn't involve complex maths.
Maths and software development both require structured thinking and attention to detail, though. If a person (not the poster of the original question) struggles with high school level mathematics then, in my experience, that's often an indication that they will struggle as a developer - even if their work requires no mathematical knowledge.