Ask HN: What is calculus used for in Computer Science?
Hello HN,
This might sound like a stupid simple question to most of you, but I'm currently learning computer science theory and Calculus comes up very often. I was wondering why it is and what is the relationship between algebra and computer science in general. (I'd like to develop a broader vision of the field)
Thanks in advance
EDIT typo.
11 comments
[ 3.2 ms ] story [ 26.4 ms ] threadI know, I haven't answered your question yet. I have used Calculus, even much more advanced calculus, in computer science applications such as using it to calculate the salient region of interest in a photograph, for example. But in reality, I rarely use it. That being said, studying calculus and higher forms of mathematics have given me a broader sense of how to best solve problems. They give me the ability to see a problem and realize that brute force isn't the only answer to the problem. Mathematics shows that solutions can be nuanced and beautiful. Calculus is a good start in seeing that. Applying that ability to look at a problem and find nuanced and beautiful solutions is key to good software development.
Again, I am not sure that actually answers your question. But I find calculus to be mind expanding. I hope you'll enjoy it as much as I have.
Now if you'd like to see an actual application of calculus being used in computer science you might want to read about Richard Feynman at Thinking Machines Corporation: http://longnow.org/essays/richard-feynman-connection-machine... . One of the quotes from the article always makes me smile: "By the end of that summer of 1983, Richard had completed his analysis of the behavior of the router, and much to our surprise and amusement, he presented his answer in the form of a set of partial differential equations."
There is also a rather funny urban legend/joke about teaching Calculus in the US versus other countries:
"A certain well known mathematical from the USSR, we'll call him Professor P.T. (these are not his initials...), upon his arrival at Harvard University, was scheduled to teach Math 1a (the first semester of freshman calculus.) He asked his fellow faculty members what he was supposed to teach in this course, and they told him: limits, continuity, differentiability, and a little bit of indefinite integration.
The next day he came back and asked, 'What am I supposed to cover in the second lecture?'"
Enjoy learning Calculus!
The vast majority of computer science THEORY involves discrete math, at least at the undergraduate level. There are numerous APPLICATIONS that use calculus and some of them have already been mentioned. Initially I thought it odd that we were required to complete multi-variable calculus for our degree, which seemed to have little to do with the 'discrete' math world and more with 'continuous' math topics. However as time went on I encountered topics in advanced courses where you were expected to be familiar calculus at that level. The notable exception to the lack of calculus in computer science 'theory' that I recall relates to Probability, as it is used in algorithm analysis. Hope I didn't misunderstand your question completely.
"By the end of that summer of 1983, Richard had completed his analysis of the behavior of the router, and much to our surprise and amusement, he presented his answer in the form of a set of partial differential equations. To a physicist this may seem natural, but to a computer designer, treating a set of boolean circuits as a continuous, differentiable system is a bit strange. Feynman's router equations were in terms of variables representing continuous quantities such as "the average number of 1 bits in a message address." I was much more accustomed to seeing analysis in terms of inductive proof and case analysis than taking the derivative of "the number of 1's" with respect to time. Our discrete analysis said we needed seven buffers per chip; Feynman's equations suggested that we only needed five. We decided to play it safe and ignore Feynman.
The decision to ignore Feynman's analysis was made in September, but by next spring we were up against a wall. The chips that we had designed were slightly too big to manufacture and the only way to solve the problem was to cut the number of buffers per chip back to five. Since Feynman's equations claimed we could do this safely, his unconventional methods of analysis started looking better and better to us. We decided to go ahead and make the chips with the smaller number of buffers. Fortunately, he was right. When we put together the chips the machine worked. The first program run on the machine in April of 1985 was Conway's game of Life."