The Importance of Mathematics Courses in Computer Science Education
devlinsangle.blogspot.com
devlinsangle.blogspot.com
When I came to school I hated math, despite being relatively good at it. By now, my interests have changed and I'll graduate with a minor in math and a major in computer science, but largely in spite of my experience with collegiate mathematics classes rather than because of them. The way to get people to appreciate math isn't to force them to take classes on something they don't find interesting. It's to give them opportunities to see how it can be interesting or relevant to them and let them come to it when they're ready.
For myself I became more interested in math when I wanted to learn about graphics programming and machine learning. The first requires linear algebra and the second requires a lot of probability and statistics, which themselves require a solid understanding of calculus. By coming to mathematics this way I was able to see it's relevance to me and my interest in it grew the more I learned. Previously, when I was forced to take the standard multivariable calculus -> linear algebra sequence I did just enough to get by, since I really didn't care about the material. Once I had this small positive exposure to math that was useful to me it was much easier for me to appreciate more abstract math as well. But the important part is that no one made me learn this stuff! Had this been part of the curriculum I would have hated it, but since I was allowed to learn it when I was ready for it I found it very beneficial.
I'll be a little provocative, but students don't necessarily know what is useful for them. It's like those kids that want to learn to play guitar solos like Eddie Van Halen but refuse to learn any music theory.
Besides, when you look at the recruiting process of some prestigious companies, it seems that industry values employees that can show good mathematical skills. It's not simply an academics thing.
Industry usually values going in-depth on algorithms, data structures, and not much else. I've occasionally worked at or interviewed with companies who consider knowledge of things like Curry-Howard or Turing machines interesting side diversions, and very rarely seen companies that actually use such theoretical knowledge (functional programming shops or compiler houses, usually). You'd think ML theory would be very useful, but much of the time, ML implementations are trained off-the-shelf to just fit a linear model of some kind to whatever-the-hell data you've got -- and if it can't fit a linear model, fuck it.
I have seen more discussions about CS theory questions in recruiting. And this is still only for a few jobs most companies only care about your programming skills (and soft skills like people skills which maths doesn't help at all).
So maybe what CS departments need is a class that surveys the higher-level courses, and motivates the foundational classes they will need to take for each subject.
Many people go into computer science because they want
to know how computers work or because they want to know
how to program that demo they just saw, or more applied
things along these lines.
Then they're in the wrong place. They should download a copy of SICP and a Lisp interpreter, and get busy hacking. Read open source software, contribute to a project that you like. Get a job, be productive.A music student doesn't go to university to learn how to play an instrument - he first becomes a musician, then he goes to university.
Of course, that's a huge simplification, and in reality there is huge overlap - mathematicians often perform the "modelling the real world" aspect, physicists often work with highly advanced abstract mathematics (general relativity anyone?), and engineers often do very fundamental research into physical phenomena.
A similar hierarchy can, and should (I believe) be applied to what I'll call the "computing sciences": Maths remains where it is, while computer science replaces physics, and software engineering replaces general engineering.
Under this model, it would seem ludicrous for someone to study computer science and complain that they were not being taught to build programming artefacts. A student studying physics would be laughed at if they complained that they weren't designing enough cars, or building enough bridges.
In contrast, you'll rarely need more than algebra, basic statistics, and maybe graph theory most of the time. All the advanced math stuff, such as SVM or Taylor expansions, are generally going to be found in the libraries that you'll use rather than code you'll write yourself. You may need math to understand what they're doing in detail, but with better writers on the documentation, you wouldn't need the advanced math to understand how to use them properly.
This is to say that proper abstract Mathematics courses should require the students to write many proofs. I'm sure that students in the aforementioned Complex Analysis course were writing 4 - 7 pages of mathematical prose for their weekly problem sets. This is a non-trivial amount of writing practice which is especially tuned toward accurately expressing the interplay of precisely-defined abstractions (which all documentation should strive for).
Even discrete mathematics courses (Combinatorics, Graph Theory) should eschew simple calculations of permutations/combinations and graph traversal algorithm steps in favor of writing proofs of more of the abstract concepts. In this way, students will be trained to write effectively about abstract concepts, which will prepare them for a career in programming as well.
Computer science is an offshoot of mathematics— or it was until everyone decided that "computer science" meant "software engineering."
> It was a good discussion, that highlighted the distinction between the currently accepted view of mathematics as primarily about properties and relations, and the pre-nineteenth century view that it was at heart procedural.
...does not follow. Programmers don't view mathematics as procedural because they studied mathematical history, but because the Von Neumann architecture, from which the semantics of almost all programming languages derive, is highly stateful and procedural.
As I see it, this is the core problem that must be solved before many of the tools of mathematics which would really help us today can be meaningfully exploited.
And certainly not in Computer Science, as mathematics is avoided in many cases where it would greatly aid in reasoning about systems, due to the quantity of people who dislike it.
And in Physics, mathematics isn't used to weed out people, but to train them on the theories that underpin the entire field.
I'd be interested in hearing where this happens, because it's certainly not been my experience.
PS: You did not get the downvote from me.
Computer science at Penn has been doing this especially. In the overview of mathematics course at Penn, any mention of algebra has been removed. They used to have a section on toy RSA--deleted. It seems like they want to remove all mathematical rigor here, just to turn out more people with a CS degree. People can hardly walk away doing a proof, like the showing how a greedy algorithm such as Kruschkal's can work. To see this for me is frustrating to say the least. So I must concur.
Side story. The other thing is, CS has nearly doubled since I attended, 4 years ago, and they have NOT hired faculty to keep up. Class sizes are getting ridiculous.
It was pretty well-known, and it was really obvious because at most schools, calculus is three semesters, while UTD condensed it down to two without reducing the material at all.
Quite a few competitive major programs where I got my degree required students to complete 1st year calculus (differential, integral, multivariate) and some or all of 1st year physics (mechanics, electromagnetism, waves, optics) before applying.
"MOOC education is survival of the fittest. Every student is just one insignificant datapoint while the course is running. Do well, do poorly, struggle, drop out – no one notices. But when the MOOC algorithm calculates the final ranking, the relatively few who score near the top become very, very visible. Globally, talent recruiting is a $130BN industry. It’s “Google search for people” in action."
From "The Darwinization of Higher Education": http://devlinsangle.blogspot.com/2012/12/the-darwinization-o...
In contrast, there are folks who look at how can we help more students succeed in math and physics (without dumbing the courses down and grade inflation). Wright State (and now many other universities) created a pre-calculus course that teaches the math in context with many engineering examples. 90% of students who took this course went on to pass Calculus, compared to 60% of those who didn't: http://cecs.wright.edu/community/engmath
That is inevitable if the object is to grant a prestigious qualification but do not screen at entry.
When it comes to scientific knowledge, it is very definitely better to serve in Heaven than to rule in Hell, so to speak.
By studying a significant amount of Math, it definitely improved my logical and reasoning skills at least ten fold.
Math is nice, and useful for some classes of problems, but it is certainly not needed for huge amounts of the programming done. Some people have this masochistic ideal of programming where if you're not solving problems that require the most sophisticated mathematical techniques then your problem isn't important. There are plenty of problems in programming that aren't particularly mathematical in nature and are very challenging. Compilers are one of these, as are many others.
It really depends what is meant by "math". Not everybody has the same perception of what maths are. I used to teach a language theory class where students had various backgrounds. CS students were bored because they don't like maths, and maths student were bored because it wasn't math to them.
Concerning compilers, they require non trivial maths. Parsing, type checking, code generation, register allocation and so on... The thing is that mostly you don't formally prove things like you would do in a maths class. But indirectly you use a lot of mathematical results.
To my own amusement, I've discovered that I tend to categorize as "math" those areas of mathematics which I struggled with, or am ignorant. Statistics? Differential equations? Math. Doing a DFS walk over a parse tree in order to do code-transformation optimizations? No math involved! Just some code.
Or, if those don't count as maths to you - look up the polyhedral model: linear algebra applied to loop tiling/parallelisation.
HN discussion: https://news.ycombinator.com/item?id=3928276
In general, it's not worth worrying about one downvote; that one person did not like your comment enough to downvote it is a rather weak signal. There are a lot of users on HN. Other users (such as me) are also likely to give you a corrective upvote. It's when you get multiple downvotes that the signal matters.
Often a problem in engineering or computer science can be phrased as minimizing a cost function over some data and/or variable constraints. Take SVM for example, or sparse signal denoising, or template matching. And far too often, people will apply "advanced state of the art techniques" to solve these problems, e.g. neural networks of some exotic kind, graphical models, etc. And while these are great techniques, they need not be applied to convex problems of a reasonable size.
In the examples I listed, I can almost guarantee that a knowledge of how to phrase the model as a convex optimization problem and throw it into an interior point solver is going to be much more effective than running stochastic gradient descent on some user-defined model with way too many (or too little) parameters.
Because when you say a problem is convex, what you are saying is that it can be solved globally in polynomial time (usually on the order of ~20 least-squares problems of size corresponding to number of variables and constraints). There is a sophisticated convergence theory as well. And if you understand the mathematical theory, you get to use this mature technology to solve exactly a whole class of problems you wouldn't think you could.
It's also worth mentioning that a lot of very hard non-convex problems can be approximated and solved well using these methods, and this is a rapidly growing field of research. Here's an example: http://papers.nips.cc/paper/2979-efficient-sparse-coding-alg...
Resources:
http://stanford.edu/class/ee364a/lectures/examples.pdf http://stanford.edu/class/ee364a/lectures.html https://www.youtube.com/watch?v=McLq1hEq3UY&list=PL7A3953FD9...
Mostly, this is a long way to say that if we're going to study optimization, we might as well study continuous optimization, which encompasses convex optimization and isn't that much more difficult.
And, yes, this stuff is incredibly useful with applications in most fields of study. I've made a nice career out of it.
Now some software engineer should explain to the author how programming is central to his understanding of mathematics and see how things develop.
But mathematics is not a sense, and neither is a program. These are the best conceptual constructions we have to represent our senses as humans collectively. They are both meant to be representations, models. This is something I continue to find difficult to understand, from both mathematical and computational perspectives, because computational and mathematical concepts are intuituve to me. However, I have the awareness that they shape how I naturally parse the raw data I get from my senses. That means it's important to let go of either model when it ceases to accurately represent reality.
I found this very relatable: http://en.m.wikipedia.org/wiki/Conway%27s_law
And conversely, most maths aren't that abstract. Mathematicians constantly draw diagrams, plot curves, and use various concrete representations of the object they manipulate. Geometric intuition is a very important tool. I wonder if it's not our best strength compared to machines.
That would fit with the whole gestalt theory and how our brains are really good at intuitively* finding shapes within shapes (literally).
* read: not with predefined conscious algorithms
How do you define "abstract" then? Looks like it's just a matter of degree, and one hacker's abstraction is another hacker's concreteness.
The conclusion is not good. The logical conclusion would be that if we define mathematics as 'handling abstractions in a precise manner' then programming is part of mathematics. In this case his conclusion becomes:
'learning and doing some classical parts of mathematics might play an important role in educating people who will do this another part of mathematics'
Which might be true to an extent, but this statement is very broad.
It is not a question that some amount of math is helpful. But after a while there are diminishing returns, because you simply learn different skills than what you need.
After having some very basic math knowledge the best strategy is to try to learn a lot of practical 'engineering' from very good books/courses, and only go back to math on-demand.
For example if you want to have some knowledge on machine learning or computer graphics, don't start to learn math for years first and then start learning about machine learning/3d graphics. Start to learn abut the engineering field first (take Andrew Ng's coursera class, or some equivalent in 3D graphics) and only go back to learn some linear algebra or very basic calculus after you see why it will be useful and to what degree you need it (you mostly don't need most of the theorems if you are learning the basics of these engineering fields).
Being an engineer is very different than being a mathematician. If you want to be a good engineer then mostly learn a lot from good engineers (or researchers in the engineering field) and learn some math along the way, but that will be secondary in my opinion. It's good to learn tons of math, but only if you learn even more engineering besides the math (to be a good engineer).
Your words: some amount of math is helpful.
Do you not see how these are the same idea, abstractly?
Also, "if we define mathematics as 'handling abstractions in a precise manner'"
That IS the definition of mathematics. The author is not arguing for more calculus. His background is mathematical logic which is a standard course before all "real" math (analysis, topology, abstract algebra). All of these subjects handle abstractions in a rigorously precise manner.
Agreed.
Education needs to be radically tailored to individual students or we're going to continually be trapped in this vicious cycle of "Current education paradigm X is broken, paradigm Y will solve all of our problems!" (where Y ∈ {"more math!", "more programming!", "more fundamentals!", "more application!", ...}).
Yes, highly customized education doesn't scale. Yes, it's very expensive. But sacrificing future generations on the altar of "efficiency" seems highly suspect to me, and the honest fact is if the incentives within the American (sorry non-US people!) education system were properly aligned we would be much farther along. Granted, that's a difficult task, but I didn't get into computers so I could spend my time working on easy problems.
"Let x be such that P(x)" is something like a variable declaration. It's the introduction of an argument to a function (think "function(x){ ... }"). I think the real conceptual problem lies in the fact that many mainstream programming languages allow subversion of the type system by allowing "uninitialized" variables, so that every type is automatically inhabited.
There is also the fact that a mathematician may just want some "x such that P(x)" rather than introducing a generic one, which I think the author mentions.
Regardless, I agree with his overall thesis: the machine is just a hunk of atoms with no meaning of its own. It is us who place a meaning on the machinations of the computer. Computer people have come to accept the abstractions of computer science as tangible and consider the abstractions of mathematics intangible. I think both abstractions are comparable. Both end up being interpreted and executed by humans and by computers, and it is merely the overwhelming prevalence of CS abstractions being executed by computers and mathematical abstractions being executed by humans that is causing this divide between the two tribes.
There is much that computer scientists can learn from remembering that the machine is just a represantion of abstractions, just like mathematicians can benefit from remembering that occasionally the physics of the machine are relevant.
----
[1] An entirealy reasonable explanation at times,
http://lwn.net/Articles/219983/
[2] http://nedbatchelder.com/blog/200811/print_this_file_your_pr...
I never struggled with statistics, I felt like it was the 'easy' math and now work in analytics at a large investment firm and do scripting and analysis with the big databases.
I don't think I'd excel at creating the databases I work with but I understand them and my ability with java and R and SAS and python have helped me be more efficient and a leader in the group.
My understanding of other math has come a long way since university with real tangible examples, I just don't learn from abstract examples I think.
I don't think there is a right answer here, I think there are enough opportunities in the field for there to be two branches of computer science much like there are two sides of business schools. The hardcore finance path and the businesss communication people tease so much.
This should not be conflated with hacking though and software development. You can do both of those without any strong background in mathematics. Alot of software development and hacking is just using things people with CS skills built. I do not have to understand quicksort to use the native library sort.
No-comp sci is not a branch of maths. Yes-you do need to know some maths to study it.
Logic is important, but that is mostly orthogonal to any course of math instruction I've ever been exposed to. Now, if your goal is to be an academic computer scientist, then yeah, you do have to know some advanced math, just because the frontiers of research are so far out there. If you're aspiring to be a software engineer/developer, then chances are, outside of a few specialties, you may go weeks without using any math that an elementary-schooler couldn't perform.
A developer who is overly mathematically-inclined is actually a small red flag for me, because I have seen too many people who are very good at math and seem to understand theory, but absolutely cannot write code.
Anecdotally, I have seen much better results from developers who have experience in hands-on trades like mechanics, plumbing, carpentry, etc. There's an element of visualizing the entire system and how the components interact that seems to map over well to programming.
I happen to agree a lot with the text. The best programmers, and most definitely the best system designers I know, excel at abstracting concepts.
Programming also isn't computer science.
>Logic is important, but that is mostly orthogonal to any course of math instruction I've ever been exposed to.
I think that's the issue the author intends to address: computer scientists not having been exposed to a mathematical treatment of logic.
>you may go weeks without using any math that an elementary-schooler couldn't perform
If by "math" you mean "arithmetic and basic algebra," yes. If in "math" you include logic, induction, abstract algebra, graph theory, combinatorics, etc., then you're using math every time you write any code at all, whether it's ensuring you don't write any cyclic dependencies, making sure you correctly handle all return values, or making sure an algorithm doesn't require quadratic time or worse before you implement it. You need math if you want to know that your custom comparators won't cause a sort routine to blow up, to recognize certain possible sources of bugs in unsafe languages, and most of all to recognize and assess the validity of potential optimizations.
I mean, one can program with just a basic grasp of boolean logic and high-school algebra, but they'll have a hell of a time of it.
> then you're using math every time you write any code at all, whether it's ensuring you don't write any cyclic dependencies, making sure you correctly handle all return values, or making sure an algorithm doesn't require quadratic time or worse before you implement it. You need math if you want to know that your custom comparators won't cause a sort routine to blow up, to recognize certain possible sources of bugs in unsafe languages, and most of all to recognize and assess the validity of potential optimizations.
For the most part, I view this as simple bookkeeping. Probably I've been doing this for too long and have just internalized it.
http://www.depts.ttu.edu/officialpublications/catalog/ENGR_C...