
The Importance of Mathematics Courses in Computer Science Education - j2kun
http://devlinsangle.blogspot.com/2015/04/the-importance-of-mathematics-courses.html
======
jeffreyrogers
My issue with this article is the author's conflation of his own like and
dislikes with what works for students. 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.
Very few (but definitely some!) go into computer science because they want to
know about Turing Machines, or the Curry-Howard isomorphism, etc. Currently CS
education serves the latter group very well, while neglecting the former
group. This is a shame, because plenty of people who find math frustrating can
become great programmers and find great satisfaction in understanding
programming and computer science better. Many of the most interesting fields
of computer science aren't very mathematical.

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.

~~~
yodsanklai
> Many people go into computer science because they want to know how computers
> work .. Very few (but definitely some!) go into computer science because
> they want to know about Turing Machines

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.

~~~
j2kun
For what it's worth, the education that Devlin is suggesting is not
theoretical computer science or type theory. It's the more traditional
mathematics courses.

~~~
eli_gottlieb
Once you add the topology section to the Curry-Howard Isomorphism via homotopy
type theory it all starts to merge anyway!

------
jcranmer
I once heard someone opine that computer science education plays a cruel joke
on its students, and this blog post is perpetuating that joke. Computer
science is often treated as an offshoot of mathematics when, in reality, you
need to do far, far more writing than advanced math. Most students are going
to be leaving school and working on professional programming, where they'll
largely work with a group of people jointly maintaining systems. And these
systems require good writing skills to effectively write documentation for the
code, as well as writing the design documentation.

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.

~~~
cbgb
When I was in college, I was once not allowed to join a Complex Analysis
course because there were 15 students in the class. College guidelines advise
against more than 12 students in a writing-intensive course, and because this
was an upper-level Mathematics course, the professor took that to heart (he
thought 15 was too much, but some needed the course to graduate).

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.

~~~
jbergens
I'm not sure that type of writing is anywhere near what you need to do in
common programming jobs. As you wrote, it was "4 - 7 pages of mathematical
prose...". I interpreted writing as writing text to others, including non-
programmers.

------
nateabele
First of all, I want to say that this industry could do with a much higher
level of mathematical rigor, and that a lot of the systemic problems are owing
to the lack of it. But to me, this:

> _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.

------
ExpiredLink
Mathematics is used in education (schools, ..., universities) to weed out
people. For those who perform this selection the ability to grok mathematical
problems often is the only way to categorize human capacities. A self-
fulfilling prophecy.

~~~
epistasis
I can't agree with the "mathematics used to weed out" terminology, the weeding
out may be an incidental part, but I've never encountered a place where
mathematics was used to diminish the number of people following a pursuit.
Certainly not the way that Organic Chemistry is used to weed out premed
students.

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.

~~~
BrainInAJar
Calculus is a requirement for all undergrad science degrees in most places,
and a biologist has about as much use for integral calculus as a fish does
with a bicycle. They're much better served by statistics, which is not, a
majority of the time, an undegrad requirement for all majors.

~~~
gohrt
A really good way to be awful at Statistics is to not understand integral
calculus.

~~~
BrainInAJar
A really good way to be awful at calculus is to not understand real analysis
but you have to draw a line at some point. (heh)

------
rgawdzik
The University of Waterloo's unique by putting their Computer Science program
in our Faculty of Mathematics (the first in North America, the largest in the
world).

By studying a significant amount of Math, it definitely improved my logical
and reasoning skills at least ten fold.

------
super_mario
Computer science is a branch of mathematics. If you mean engineering and
programming, then you can get by without any math, but I don't expect you to
be writing compilers, operating systems, database engines either without solid
CS education.

~~~
jeffreyrogers
Compilers don't require much math. Nothing difficult at least. (I guess if
you're interested in compilers for functional languages this might not be as
true). Same for operating systems, as far as I know. I have no experience with
database engines. CS theory on the other hand is very mathematical, as are
some more applied subfields such as cryptography or graphics.

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.

~~~
yodsanklai
> Compilers don't require much math.

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.

~~~
mtviewdave
>It really depends what is meant by "math".

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.

------
zxcvvcxz
A practical math topic I think all computer science (and engineering, really)
students should take is convex optimization.

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...](http://papers.nips.cc/paper/2979-efficient-sparse-coding-
algorithms.pdf)

Resources:

[http://stanford.edu/class/ee364a/lectures/examples.pdf](http://stanford.edu/class/ee364a/lectures/examples.pdf)
[http://stanford.edu/class/ee364a/lectures.html](http://stanford.edu/class/ee364a/lectures.html)
[https://www.youtube.com/watch?v=McLq1hEq3UY&list=PL7A3953FD9...](https://www.youtube.com/watch?v=McLq1hEq3UY&list=PL7A3953FD9E6F4912)

~~~
kxyvr
Not that you stated to the contrary, but the reality is that the theory and
algorithms for convex optimization doesn't really differ that much from the
theory of general nonlinear optimization. Basically, we get different
guarantees, but we're still largely applying the same algorithms (Newton based
methods combined with things like projection, active set, or interior point
methods for inequalities.) Though, I very strongly agree that knowing convex
optimization tricks helps this process immensely. If you're going to formulate
a problem, please, dear god, choose the convex one if given a choice.

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.

------
thibauts
The author conflates abstract and immaterial. Computer programs don't have to
be abstract, and often are not. And that's precisly what makes them more
approachable than mathematics: you manipulate actual structures, see the
results in real time and get to see how the actual process is carried out
without language ambiguity. In short you get a concrete feeling of things that
you can build a mental representation of that's closer to the senses.

Now some software engineer should explain to the author how programming is
central to his understanding of mathematics and see how things develop.

~~~
yodsanklai
Computer programs are formal objects, just like let say Euclidean geometry is.
Their syntax and semantics is entirely abstract and mathematics, even though
they can be run on a machine that gives you a concrete feeling.

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.

~~~
gohrt
Perl and Javascript programs are not formal objects, anymore than an essay is.
Any language where "the implementation is the spec" is not a formal object.

------
nadam
"Once you realize that computing is all about constructing, manipulating, and
reasoning about abstractions, it becomes clear that an important prerequisite
for writing (good) computer programs is an ability to handle abstractions in a
precise manner. Now that, as it happens, is something that we humans have been
doing successfully for over three thousand years. We call it mathematics. This
suggests that learning and doing mathematics might play an important role in
educating future computer professionals. "

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).

~~~
brational
His words: This suggests that learning and doing mathematics might play an
important role in educating future computer professionals.

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.

~~~
jbergens
But if programming (computings as he writes) is handling abstractions and math
is handling abstractions then programming is math and the argument that we
need to do more math is unclear. We could just do programming, he wrote that
it basically is math. He needs to be clearer in what kind of math he thinks
would be helpful to programmers and why it would help more than "normal"
programming/computing courses.

~~~
brational
> He needs to be clearer in what kind of math he thinks would be helpful to
> programmers and why it would help more than "normal" programming/computing
> courses.

Agreed.

------
pdeuchler
Here's a crazy idea... let's stop treating curriculums like silver bullets and
realize that no matter what we do we're not going to succeed with the current
system of "hope your innate talents match up with the current education model
du jour".

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.

------
ihm
> Some of the computer scientists, however, instinctively interpreted the
> statement “Let x be such that P(x)” as a variable declaration. This led them
> to give an “incorrect” answer to a question

"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.

------
jordigh
This is a quibble, but there are cases when the physics of the computer cannot
be disregarded and must be considered. Two of my favourite examples are cosmic
rays flipping bits [1] and printers jamming. [2]

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/](http://lwn.net/Articles/219983/)

[2]
[http://nedbatchelder.com/blog/200811/print_this_file_your_pr...](http://nedbatchelder.com/blog/200811/print_this_file_your_printer_will_jam.html)

------
carlmcqueen
I really enjoyed this article and the comments so far. I struggled with math
heavily in high school and in college and believed I wasn't fit for
programming despite being a 'computer head' since I was a kid.

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.

------
d33d33
i started a degree in cs last year and i noticed: most cs people i met @ my
university have BIG problems with getting their hands dirty by writing some
code. excellent in math, but not able to write some simple for-loops.
finishing university without being able to code is kind of poor... but i agree
- abstraction is very important to handle complexity.

------
stevebot
Guy who started out in math and ended up with a blended math and CS degree
here. Their definitely were some parallels, but even in a program where they
tried to combine the two, it didn't always mesh. I felt more like upper level
math was a springboard for algorithms and proofs, so that by the time I got
into algorithms I could say "hey I already have been doing combinatorics
proofs very similar to this."

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.

------
james1071
My comment is:

No-comp sci is not a branch of maths. Yes-you do need to know some maths to
study it.

------
douche
Programming != Math.

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.

~~~
sjolsen
>Programming != Math.

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.

~~~
riskable
It would be interesting to see a university degree where the running theme is,
"We don't teach computer science we teach programming!"

~~~
worklogin
It's called "Software Engineering" and many schools have separate tracks for
those interested.

[http://www.depts.ttu.edu/officialpublications/catalog/ENGR_C...](http://www.depts.ttu.edu/officialpublications/catalog/ENGR_CS.php#Grad)

~~~
sergiosgc
Naturally, it depends on the school, but the Software Engineering degree I
have is heavy on Engineering, then progressing towards software. Lots of
physics and math in the first two years, then two years mostly focused on
modeling, covering compilers, relational algebra and similar core
architectural subjects, progressing towards a final year focused on team
management. Boundaries aren't as clear cut as I describe, but this is the
progression. It is engineering, which happens to focus on software
development.

