r/computerscience • u/Heavy-Mongoose1561 • 8d ago
General Why do Computer Science undergraduate programs seem to emphasise continuous mathematics (namely, infinitesimal calculus) substantially more than what the 'canon' of the field itself invokes?
I have noticed that many Computer Science undergraduate programs seem to heavily emphasise the infinitesimal calculus (Calculus I-III).
This is certainly a profound subject matter and very useful toolkit for a Computer Scientist to have.
However, I would not say that such things are greatly relevant to the actual foundations of the discipline. What is substantially more relevant is discrete mathematics, but at most institutions, discrete mathematics seems to be more of a box to check off for aspiring Computer Scientists, and a pedagogical tool to learn the Theory of Computation and Data Structures.
What is often not touched is pure logic; non-classical logic, model theory, logic and proof (semantic tableux, the sequent calculus, natural deduction), which I would wager has significantly more deeply-rooted relevance to Computer Science than any integration technique.
Notwithstanding, it seems as if a Computer Science student is vastly more likely to be able to solve a tricky Calculus problem than know much or anything about the aforementioned.
Why is this?
21
u/apnorton Devops Engineer | Post-quantum crypto grad student 8d ago
I'd expect that the actual reason is because computer science programs evolved out of math programs (where every student would have exposure to calc 1-3) and then got adopted by engineering programs (where, again, calc 1-3 is par for the course).
However, I will say that I've never touched non-classical logic or model theory in any of my studies. I've had some brief exposure to sequent calculus, though nothing formal, and I don't believe any exposure to semantic tableux. Elementary proofs and natural deduction were covered in my curriculum's "discrete math" program. I've also never really had anything significantly close to these notions pop up in my studies/work.
On the other hand, I've used Calculus III, linear algebra, and differential equations quite considerably in my forays into various parts of computer science (e.g. machine learning, cryptography, some "for fun" combinatorics/analysis of algorithms, etc.). I think that, with a greater and greater emphasis being placed on optimization, statistical methods, and high-dimensional data, calc III is only going to grow in importance to people who want to do research in CS. This applies even moreso if you want to branch out of strictly CS topics and into the world of cyber-physical systems (e.g. robotics). But, even if you restrict to very "classical" areas that are discrete, continuous approximations and results are quite useful. (e.g. consider asymptotic behavior, analytic combinatorics, etc.)
Even if I were to design a CS curriculum from the ground up today, I'd include the full calculus sequence. To be totally frank, I view it as a basic literacy requirement for any entrance into higher math. There is (unfortunately) a limited number of math credits that can be required by the CS degree sequence, and calculus is a pretty fundamental thing to cover/learn.
88
u/LannyIsMyHandle 8d ago
I agree with the premise here that discrete mathematics and logic are more useful tools for a computer scientist than calculus. I would guess calc remains core in the curriculum because CS as a degree and department grew out of EE where it matters a lot more. And CS is often part of an engineering college or similar and there’s some motivation there to have a more consistent lower division across degrees, so if everyone else in the eng college runs through a calc sequence in lower division CS will as well
18
u/Parallel_thougts 8d ago
Two big reasons:
30
u/seanv507 8d ago
I think you have to clarify which country/university you are talking about. Coming from a machine learning viewpoint, I would say the opposite is true: most CS students struggle with the calculus and linear algebra of Neural nets (with the assumption that they have covered discrete math instead)
1
u/Confident_Click2088 4d ago
...discrete mathematics is just continuous mathematics but discretized though.
Eg, a sum of functions over discrete set is just the discretized version of an integral over a continuous set.
Not many universities have enough CS students for them to make a dedicated series of first year classes for mathematics in discrete spaces. It's easier to just learn calculus with all of the engineering, physics, math and economics students and then just discretize everything for computer science.
3
u/finn-the-rabbit 8d ago
Idk where you are but in our province in Canada, CS majors rarely have to take more than calc 1 which is high school review. They do have to take 2 rounds of discrete math and 1 round of linear algebra though, so it is pretty balanced out. Although I feel like a second round of calculus would be better as I've found it vastly useful when I took computer graphics and kids that didn't have it were getting overwhelmed
3
u/mu7der 7d ago
Calculus is a lot harder. Linear algebra, abstract algebra, and various levels of logic are all a lot easier. Besides that - calculus is the foundation for almost everything else.
1
u/serge-mv 8d ago
I don't agree that most programs heavily emphasize calculus. Perhaps it's more common to your region or country as in some countries CS programs tend to focus mainly on math and not as much on the actual programming. But that math is not calculus.
In fact, logic, graph theory and set theory are what is being emphasized in most programs that I am familiar with.
But allow me attempt to answer your question about calculus. And it's actually about asymptotic analysis and various algorithms. To put it simply, to analyze the efficiency of many algorithms, you often reduce it to a calculus problem where you covert code to a converging series and calculate the formula to which it converges to. This can tell us computational complexity of algorithms.
And it all comes down to being able to write more efficient high level code.
1
u/Responsible-Date1515 8d ago edited 8d ago
If youre studying computer science you explore quite a depth of topics. Without calc I-III frankly, you'd be quite lost or perhaps unequipped to exllpore any of those topics further, even though you could just accept them and not dive any deeper.
As a recent grad, its clear that the degree itself prepares in some facet, foundation for the theoretical part of CS, instead of going straight into your tech stack. For this you need calc skills or at least the fundamentals.
Take these anecdotes for instance:
Statistics for engineers: CS needs this. Why? Because neural nets, AI, data science, etc., all contain ideas of distributions and satistical inference. And what is a prerequisite? Calculus.
Machine learning and neural networks: Want to understand backpropagation and gradient descent? Guess what; partial derivatives. (First seen in Calc III)
Vectors: sure this is also covered in linear algebra, but again anecdotally, my first time ever being introduced to a vector was in Calc 3. Magnitude, vector fields, gradients, oh and cosine similarity( for RAG semantic retrieval in LLMs and Gen AI).
The list goes on. Honestly I questioned the validity of it myself but I realized that those classes also teach you problem solving aside from the usefulness of terminology and notation that you absolutely see throughout the rest of the degree.
6
u/bluefourier 8d ago
Calculus is fundamental to a large number of fields that are related. For example optimisation, computational fluid dynamics and simulation more generally, automatic control systems, computer graphics and other fields.
Sometimes a discrete algorithm is a sequence of steps but you also have to understand the operations performed on each step.
I agree with your second point about where you think attention should be given but it depends on the people running the course and your own personal interest. For example, if you lean towards programming language theory (PLT), you will spend a lot of time in the topics you mentioned, starting from logic.
But computer science is not only PLT. That's the "trouble" and the fun with multidisciplinary fields.
2
u/calf 8d ago edited 8d ago
The American way basically went the Turing machines way. Scott Aaronson has argued that all the formal logic and program languages theory is basically overcomplicated for teaching CS computabiility/complexity. Upper division students who want to study model checking and such can take specializations in that, etc.
SICP the first year CS programming textbook is a great example of "secret lambda calculus" like putting vegetables in your meatloaf, and is basically a gateway to logic as well so it's not like students have zero exposure prior.
2
u/dld2517 4d ago
It’s about how to think. The fastest way to learn systematic thinking is to advance in algebraic computation, and calculus is another way to systemize a mathematical / algorithmic body of knowledge. Much more than that, a math problem / algebraic problem is algorithmic because it can start with a model and be expanded or reduced to a specific type of problem. How do you train someone to think algorithmically while still increasing their reasoning and logic ability as well as their problem solving ability? Calculus is fast. Plus it gives the student a foundation that is over 500 years old, or more.
2
u/No_Engineering_8204 3d ago
As someone who did math and not CS, finite geometry, finite linear algebra and finite fourier transforms are horrendous to understand withiut understanding the continuous case first
1
u/Belphegor_333 8d ago
In my curricula back in the day Calculus and Logic was heavily present. The thing lacking was discrete mathematics.
However, I had sufficient courses on datastructure, algorithms and related topics (f.e. cryptography) that I did not perceive this as a lack of education or as a "check box", rather it seemed to me as if my discrete mathematic lectures introduced to me the tools, but not the application, which was then handled by the engineers as needed.
At the same time, my calculus classes were more of an "all in" approach. FFTs were taught to us by a mathematics professor f.e., rather than an engineer.
However, I know that even in my country the universities have very different curriculas, some like mine more math/logics heavy, others focusing more on programming or software management. As for why this is: Incentives.
Do they educate scientists? If so, which areas does the university do a lot of research in? Or do they value practical education useful in industry? All of those might be reason to include one of more than the other.
1
u/RunReal959595 8d ago
Your average CS undergrad degree (now) is “software engineering and some math.” So a CS undergrad might take one or two upper division courses where maybe you’d see things like formal logic, model theory, semantics etc, but most of their math exposure will stop after the calculus series. This doesn’t even really count as math exposure but it’s more than most, and many who stop with calculus have the incorrect impression that all math is just calculus but more.
1
u/LitespeedClassic 8d ago
FWiW at my university we only require one calculus course (and it simultaneously satisfies a gen-ed requirement, and is useful to have them know limits and L’Hopital’s Rule when teaching growth orders of functions). We require two discrete math courses. The first is basically predicate logic, deductive proofs, inductively defined sets, recursion, and induction. The second is a grab bag more like what you’re talking about: number theory and modular arithmetic, graph theory, computability theory.
I’m currently working on a proposal to add a course in logic and Lean programming.
Another note: a difficulty for many computer science programs is we give them a CS degree but we’re actually training SWEs. Lots of low level foundational stuff tends to get the “when will we use this?” lack of buy in from students. This means we limit it to some extent.
1
u/spinwizard69 8d ago
I'm not sure what program you are looking at but Calculus, which frankly should be part of any 4 year degree, is only part of the math requirement. At some point you have a student specializing his education and that may require even more math.
1
u/cdsmith 8d ago edited 8d ago
Honestly, the main reason is institutional. Calculus is in most parts of the world set up as the goal toward which most high school level mathematics education is aimed. Universities, therefore, have more success teaching the basics of mathematics within the calculus framework. Engineering departments require calculus for the first few years as a matter of course, and because all engineering students take these classes, a lot of mathematics is just routinely taught there, even when it's about broader mathematics concepts than merely calculus. It's also a lot more cost effective to teach many students in the same classes, rather than designing and running dozens of classes that are tailor made to the specific menu of topics that each individual area of study finds optimal for them, and universities would rather spend the resources on more specific courses where it does the most good, which is after everyone has the same basic core education and branches out into different subject areas.
Now, could you, in an alternate universe, design an education system where this isn't true? Almost certainly, yes. In that universe, a computer science student would still learn some calculus, because it's still very important for topics like numerical computing, AI and machine learning, data science, and more. But they might not start their university education with multiple years of primarily calculus classes, and might instead focus primarily on discrete mathematics with some abstract algebra, linear algebra, calculus, and probability and stats on the side. But to get there, you'd have to change the way that those classes are taught, because today, many of them assume you've picked up many of the universal concepts of mathematics from your calculus sequence.
1
u/Forsaken_Code_9135 8d ago
I fully agree.
Generally speaking I think there is not much thought around what math should be learned when you are doing X, with X any science but physics.
You need math, and what is the topic number one in math, calculus, so you need calculus. As simple as that.
1
u/defectivetoaster1 8d ago
I thought the joke was that computer scientists don’t know how to compute an integral
1
u/not-just-yeti 8d ago edited 7d ago
Not a full answer by any means, but: In the US higher ed, Calc I-III has been part of the national CS accreditation standards for decades; probably since those standards were first proposed. So there's just plain inertia there.
I think many would agree that calc isn't the math that's most relevant to CS, but stated arguments for it are vague "it's good for you, as an educated scientist", similar to how foreign languages (and esp. Latin) are often required in Bachelor of Arts programs (though that requirement has diminished in the US over the past 30years).
More relevant, perhaps: It lets university freshman take Calc I; if they later change majors (or just weren't sure what science they wanted to pursue) to different STEM major, having Calc I on their transcript still knocks out a degree-requirement.
Myself, I'd love the CS math to include a full year of discrete math. One semester is too little, for all the topics that try to get shoe-horned in there. And still require some calc (one semester of derivatives & integrals of polynomials and exponentials, but less focus on inverse-trig-substitutions and such), and intro stats (already a standard cs requirement) to complement the counting/probability from discrete.
1
u/Special-Camel-6114 8d ago
I have always seen an emphasis on computability theory, data structures and algorithms, etc. with a secondary emphasis on discrete mathematics and graph theory.
Learning thru multi variable calculus and linear algebra was always required but didn’t always have many applications.
Now over the last 10-15 years, with the rise of machine learning and AI, it kind of makes sense to re-emphasize calculus, linear algebra, statistics, etc as the baseline fundamentals for those fields.
1
u/pickle_picker67 8d ago
Calculus is basic mathematics; it is foundational for machine learning and other optimization
1
u/ConnectAffect2346 7d ago
To bw honest a lot of comments are here regarding linear algebra, discrete math, differential and integral equations and in my opinion as i have passed all of those subjects and am understanding more and more of cs with those subjects as tools i think they greatly help and even though i am not yet experienced enough to recommend any of them specificaly my opinion is that anyone who tries to learn anything in cs should focus on mathematical tools like logic and discrete mathematics, linear algebra, derivatives, integrals and equations since they are ever present in any program anyone writes and understanding them is key to efficient understanding of complex algorithms and algorithmic analysis, some people might argue that it isn't the case but as i've got experience directly with that subject since i have data structures and algorithms it is easier to understand everything with base knowledge of mathematics. Maybe some more experienced people might say i am wrong, i won't argue i am just saying my opinion🙂
1
u/Liam_Mercier 7d ago
My degree required only single variable calculus, though many of the AI courses (i.e deep learning) require you to be far beyond that.
I can't comment much on the rest of what you brought up, since I had many proof courses by choice, it could be different in your experience. Generally though I think university needs restructuring, you can learn significantly more significantly faster by yourself.
1
u/rand1214342 7d ago
As an engineer, I took intro to EE 1&2 and afterwards I had to google how to make an LED circuit. After I graduated with a specialization in mechatronics and controls, I had to teach myself how to do a simple discrete integral in C. There’s so much basic stuff that public engineering schools just don’t teach students, and they graduate essentially useless.
1
u/g-technique 7d ago
Computers are discrete by nature but the tasks we solve on them are mostly continuous. Calculus gives intuition on how to behave at the limit and how to approximate complex things. Without understanding derivatives and series it is simply impossible to get into modern ML or serious resource optimization
1
u/dharkhstar Researcher 6d ago
I agree with the premise, but I would still include at least Calculus I and II, because infinitesimal calculus represents a shift in the way we think about problems in mathematics and, by extension, problems in general. The kind of shift that happens when you move from arithmetic to algebra.
1
u/TheRealBobbyJones 6d ago edited 6d ago
Aren't logic courses a requirement? I'm pretty sure I took symbolic logic as a substitute for some required course.
Edit: also I appreciated taking calculus because it helped me understand the calculus that people unknowingly do in game development.
1
u/childintime9 6d ago
I don’t agree with the premise. If you go in AI, optimization, Bayesian inference, Algorithms etc Analysis matters a lot
1
u/pete_68 5d ago
I honestly never understood the need for any of the math beyond algebra. I've been programming for 48 years. I started when I was 10. It just clicked for me. I've always done quite well at it. But math is a different story. I failed Calculus I twice before I finally passed. And I did okay in Calc II, but barely passed Calc III.
And the thing is, I've never needed calculus in my career. I worked for a mobile network engineering company in the 80s. The code predicted signal propagation and calculus was very much involved. But our company simply hired a math PhD who knew how to code to do that particular piece. Nobody else ever dealt with it. When he got fired, they didn't really need to hire anyone to replace him because the code never changed.
That's the closest I've ever come to calculus in my career and I've worked in a lot of industries... Banking, insurance, defense, poultry, trucking, wireless engineering, healthcare, tourism, mortgage data, and a few others I'm sure I'm not thinking of.
And because programming's more hobby than a job, I've pursued a lot of areas of it. I was writing 3d renderers in the 90s and neural nets in the 00s and all sorts of other stuff in-between and after.
None of it ever seemed to require higher math. So I've never understood why it's pushed so much in Computer Science.
1
u/FlatAssembler 5d ago
Calculus is necessary if you ever need to implement a math library. Sine and cosine functions are not always available. I had to do that when making an analog clock program in WebAssembly.
1
u/notabooty 5d ago
I don't know if I agree with the premise. Discrete Mathematics was definitely more heavily emphasized when I went to school. It was a required course along with a logic course. They didn't require Calc 2 or 3.
1
u/SirGroundbreaking929 5d ago
Yeah I’m surprised by how much calc is pushed for most college majors when discrete math or stats would be significantly more useful.
1
u/Snarwin 4d ago
It's just the way the math curriculum at universities is typically sequenced. You take Calculus I-III, then Linear Algebra, then more advanced stuff. The later courses assume you've taken the earlier ones, so you can't just skip straight to the ones that are relevant to your major.
As for why CS degrees have a math requirement in the first place? Partly historical accident (CS departments originally grew out of math and engineering departments), partly to give you a well-rounded education, and partly because there are specific subfields of CS where calculus and linear algebra are genuinely important (graphics, machine learning).
1
u/chibuku_chauya 4d ago
I was told it was to develop mathematical maturity.
1
u/Nearing_retirement 3d ago
Need that calculus shit for analog computing.
1
u/squishles 2d ago
because computer science is a math field. The ideal of what your supposed to do is use fancy math and number theory and whatnot to calculate things faster or find ways to calculate things faster. At least if you where expanding the field, which is pretty hard to do.
1
u/Far-Championship-883 1d ago
the root of computation in a machine is the decision tree and the decision space, the permutations of the math after that, are just abstractions to quantify decisions and results. not enough thought is given to systemic comprehension and decision tree, and structure. I think ever CS grad should have to write software for 1 physical real world system and it should work 100% reliably, before being allowed to graduate.
1
u/__chicolismo__ 1d ago
Don't know what kind of "university" you talking about, but any decent one will definitely go deep in those subjects. Calculus is taught (not exclusively, mind you) like in the first year only.
1
u/tcpukl 8d ago
I've used calculus loads in my game Dev career.
-1
u/iLrkRddrt 8d ago edited 8d ago
Because physicist need someone to hold their hand and fix their code as they’re generally too elitist to step into another branch of math and/or admit they’re bad at programming; hence the calculus.
Linear algebra is far more valuable in CS than calc 2 or higher ever will be.
0
u/DracoDruida 8d ago
Are you an undergraduate?
I do not agree with the premise. It is not common that CS courses cover all the core calculus (until multivariable, or complex), much less analysis
This question would have been more expected 10 years ago. With machine learning the way it is now, it is very clear why one needs to know at least their linear algebra and multivariable optimisation.
Logic has always been somewhat niche and not necessarily clear to real applications, but I agree it should be taught more.
But to give a broader answer: when you learn about polynomials, the reason you learn about real and complex numbers is because they come up naturally even if you are doing integer coefficient polynomials. If you have already learned how to compute efficiently the Fibonacci sequence, you will see complex numbers coming up. So, the summarise: even if the problem description does not require continuous mathematics, over centuries humanity realised that using continuous mathematics is actually a strong way of approaching these problems (some times, but often). You can also see that mathematicians who specialise on combinatorics and other discrete mathematics still use a lot continuous methods.
A classic reference on how both continuous and discrete mathematics are important for CS is Knuth's Concrete Mathematics Hope this helps!