Subj : Re: Good math skills a requirement? To : comp.programming From : websnarf Date : Wed Aug 03 2005 04:27 pm James C. wrote: > This question is probably asked often, but can someone be a decent > programmer without any advanced math skills? Sure, but then you'd be a narrow programmer. For example, you probably would be writing a whole heck of a lot of code in Maple/Mathematica or Mathcad. > [...] To be more specific, can someone get by in programming with simple > arithmetic (i.e. addition, substraction, multiplication, and division)? Yeah sure. Do you like databases? > I don't see how a programmer would need anything beyond simple arithmetic > to write an email client in a programming langauage such as Delphi. You don't. But having some understanding of math can help. For example, suppose your pop3 mailbox is full, and the connection between you and your ISP is unreliable. The pop3 protocol says that your "deletes" are not performed until you successfully quit -- but if your ISP cuts you off before you can perform the quit command, then how can you free up space on your account? You could just read and delete message one connection at a time, but your ISP may also impose a quote of "number of pop3 connections per hour" or something. So it might take all day to read your mail. With a mathematically oriented mind, its not hard to see how to write a solution to this -- if you get cut off, gather statistics on the average cut off time, and retry, reading your mail in blocks that are, say, half as many as the number before you expect to be cut off. If you get cut off again, how should you adjust your block size downward? Well the statistics gathering should be such that each successful block download is actually the same as being cut off at the current running average, and you adjust downward by simply averaging in this new cut off count observation. Assuming it works, you still gain the main benefit of minimizing connection overhead (up to roughly a constant of 2x) relative to the messages you download and you have a hopefully reliable way of draining your mailbox to the maximum degree possible (again, possibly doing about 2x as bad as could have been done theoretically). Its all elementary mathematics, but the key is having a mathematically oriented thinking to understand that what you are trying to do is maximize your draining rate, and roughly how you are supposed to do that. Its a way of getting more reliability out of somewhat unreliable systems. Think about Ethernet's "random exponential backoff" or the fact that discs today all use "error correcting codes" to make sure they don't lose data even if something goes wrong physically (like a power loss during a write.) This is where mathematics, I think, has the most to offer to regular programming projects. This is especially true going forward, as distributed programming starts becoming more important. > [...] How in the heck is geometry, trig, calculus, etc. going to aid in > this type of project? They don't. Statistics, and optimization does aid though. -- Paul Hsieh http://www.pobox.com/~qed/ http://bstring.sf.net/ .