<p>I see this sentiment a lot - that software engineering doesn’t actually use anything from discrete math. Despite the many well-intentioned people who try to convince me otherwise, it remains my firm opinion that writing computer programs is inherently an exercise in the very sort of discrete mathematics you’ve already admitted is “higher” than Calculus. Following is the short, short version of my arguments in favor of this (apparently unorthodox) position.</p>
<p>Mathematics and Computer Science are essentially the same thing. Both rely on axioms and systems of logic to produce theorems. Software engineering is an application of Computer Science in the same way that Electrical Engineering is an application of Physics.</p>
<p>The process of doing Mathematics is fundamentally similar to the process of doing Programming. Mathematics assumes truths (axioms), imposes a system to reason about truths (logic), and develops new contingent truths (theorems) based on these. Programming assumes truths (a machine), imposes a system to reason about truths (programming languages), and develops new contingent truths (programs) based on these.</p>
<p>A computer program is a word in a formal language. Writing a valid (it compiles) program in this formal language requires some understanding of programming language syntax, an area of discrete mathematics.</p>
<p>A valid computer program can be executed by some machine. Writing a correct (it works) program for this machine requires some understanding of programming language semantics, an area of discrete mathematics.</p>
<p>Most computer programs contain some conditional execution. Conditional execution requires the definition of conditions, and requires some understanding of (Boolean, etc.) logic, an area of discrete mathematics.</p>
<p>Many computer programs contain some repetition. Repetition requires recursion or iteration, and requires some understanding of enumerating sets (recursive functions, induction, etc.), a topic usually considered part of discrete mathematics.</p>
<p>When you write a program, do you have any reason to think that it will work? If so, why? Likely, it’s because you wrote the program in such a way that it’s easy for you to understand why it works, i.e., you have sketched a proof in your head. Proving things (the act of proving itself, not necessarily the things) is part of discrete mathematics.</p>
<p>Do you ever write regular expressions? Do you ever read and process file or user input data? Processing strings is an application of formal language and/or automata theory.</p>
<p>I mean, the list goes on. Here are some pitfalls I think people fall into that give them the impression I’m hoping to dispel in you:</p>
<p>(1) That something is trivial does not necessarily imply that it’s not the proper subject matter of some discipline. For example, using long-division to prove that 99/3 = 33 is an exercise in applied number theory… albeit a very easy one.</p>
<p>(2) Things are not always exactly what they appear to be. Given distance and time, and knowing that velocity is distance over time, computing the velocity is a problem of mathematics, not of physics. If you didn’t know the relationship between the three variables, that would be a problem of physics.</p>
<p>(3) You don’t necessarily have to be conscious that you’re doing something, or necessarily even trained in something, to be able to do it. The first people to do it certainly didn’t know how. Nobody knew about relativity before Einstein published it… but that doesn’t mean it wasn’t physics.</p>
<p>These sorts of arguments don’t typically work, so don’t be too distressed if you’re not entirely convinced.</p>