views:

634

answers:

19

I'm not looking for a general discussion on if math is important or not for programming.

Instead I'm looking for real world scenarios where you have actually used some branch of math to solve some particular problem during your career as a software developer.

In particular, I'm looking for concrete examples.

+2  A: 

Discrete math for everything, linear algebra for 3D, analysis for physics especially for calculating mass properties.

M. Utku ALTINKAYA
+1  A: 

Computing sizes of caches to optimize performance. Not as simple as it sounds when this is your critical path, and you have to go back and work out the times saved by using the cache relative to its size.

Elie
+3  A: 

Linear algebra for 3D rendering and also for financial tools. Regression analysis for the same financial tools, like correlations between financial instruments and indices, and such.

ckarmann
+5  A: 

I frequently find myself using De Morgan's theorem when as well as general Boolean algebra when trying to simplify conditionals

I've also occasionally written out truth tables to verify changes, as in the example below (found during a recent code review)

(showAll and s.ShowToUser are both of type bool.)

// Before
(showAll ? (s.ShowToUser || s.ShowToUser == false) : s.ShowToUser)

// After!
showAll || s.ShowToUser

I also used some basic right-angle trigonometry a few years ago when working on some simple graphics - I had to rotate and centre a text string along a line that could be at any angle.

Not revolutionary...but certainly maths.

Richard Ev
+1  A: 

I used a analytic geometry for simple 3d engine in opengl in hobby project on high school. Some geometry computation i had used for dynamic printing reports, where was another 90° angle layout than. A year ago I used some derivatives and integrals for store analysis (product item movement in store).

Bot all the computation can be found on internet or high-school book.

TcKs
I think you mean derivatives and integrals?
Mitch Wheat
Yes, you are right :)
TcKs
+1  A: 

I'm in medical imaging, and I use mostly linear algebra and basic geometry for anything related to 3D display, anatomical measurements, etc...

I also use numerical analysis for handling real-world noisy data, and a good deal of statistics to prove algorithms, design support tools for clinical trials, etc...

Kena
+3  A: 

Statistics, I had to write several methods to get statistical values, like the F Probability Distribution, the Pearson product moment coeficient, and some Linear Algebra correlations, interpolations and extrapolations for implementing the Arbitrage pricing theory for asset pricing and stocks.

CMS
+1  A: 

Games with trigonometry and AI with graph theory in my case.

Robert Gould
+2  A: 
  • [Linear algebra for everything]
  • Projective geometry for camera calibration
  • Identification of time series / statistical filtering for sound & image processing
  • (I guess) basic mechanics and hence calculus for game programming
Federico Ramponi
+1  A: 

Graph theory to create a weighted graph to represent all possible paths between two points and then find the shortest or most efficient path.

tloach
+1  A: 

Also statistics for plotting graphs and risk calculations. I used both Normal distribution and cumulative normal distribution calculations. Pretty commonly used functions in Excel I would guess but I actully had to write them myself since there is no built-in support in the .NET libraries. Sadly the built in Math support in .NET seem pretty basic.

TT
+1  A: 

I've used trigonometry the most and also a small amount a calculus, working on overlays for GIS (mapping) software, comparing objects in 3D space, and converting between coordinate systems.

A general mathematical understanding is very useful if you're using 3rd party libraries to do calculations for you, as you ofter need to appreciate their limitations.

John Sibly
+1  A: 

i often use math and programming together, but the goal of my work IS the math so use software to achive that. as for the math i use; mostly Calculus (FFT's analysing continuous and discrete signals) with a slash of linar algebra (CORDIC) to do trig on a MCU with no floating point chip.

+1  A: 

Statistics mean, standard-deviation, for our analysts.

Linear algebra - particularly gauss-jordan elimination and

Calculus - derivatives in the form of difference tables for generating polynomials from a table of (x, f(x))

EvilTeach
+1  A: 

Linear algebra and complex analysis in electronic engineering.

Statistics in analysing data and translating it into other units (different project).

+1  A: 

I used probability and log odds (log of the ratio of two probabilities) to classify incoming emails into multiple categories. Most of the heavy lifting was done by my colleague Fidelis Assis.

Norman Ramsey
+1  A: 

Real world scenarios: better rostering of staff, more efficient scheduling of flights, shortest paths in road networks, optimal facility/resource locations.

Branch of maths: Operations Research. Vague definition: construct a mathematical model of a (normally complex) real world business problem, and then use mathematical tools (e.g. optimisation, statistics/probability, queuing theory, graph theory) to interrogate this model to aid in the making of effective decisions (e.g. minimise cost, maximise efficency, predict outcomes etc).

luapyad
+1  A: 

Statistics for scientific data analyses such as:

  • calculation of distributions, z-standardisation
  • Fishers Z
  • Reliability (Alpha, Kappa, Cohen)
  • Discriminance analyses
  • scale aggregation, poling, etc.
tharkun
+1  A: 

In actual software development I've only really used quite trivial linear algebra, geometry and trigonometry. Certainly nothing more advanced than the first college course in each subject.

I have however written lots of programs to solve really quite hard math problems, using some very advanced math. But I wouldn't call any of that software development since I wasn't actually developing software. By that I mean that the end result wasn't the program itself, it was an answer. Basically someone would ask me what is essentially a math question and I'd write a program that answered that question. Sure I’d keep the code around for when I get asked the question again, and sometimes I’d send the code to someone so that they could answer the question themselves, but that still doesn’t count as software development in my mind. Occasionally someone would take that code and re-implement it in an application, but then they're the ones doing the software development and I'm the one doing the math.

(Hopefully this new job I’ve started will actually let me to both, so we’ll see how that works out)