62

There are several answers: Answer 1: Not all CS programs First, not all CS programs require calculus in order to get a bachelor's degree. The Bachelor of Arts (BA) program at Mills College, where I teach, does not require calculus. Instead, we require two semesters of discrete mathematics, which we consider far more useful to computer scientists, because ...


45

It's certainly of little use in CS fields which centre on databases, OSes, general PC applications, and anything like that. It's somewhat important in CS fields relating to data transmission. Whilst this is mostly centred on OSI layers and the like, there is theoretical work by Nyquist and Shannon which underpins it, and the theory is ongoing. However ...


23

While it's true that today not all CS programs require calculus, I believe the answer to this question will change due to trends in Machine Learning and Data Science. First, many topics in Machine Learning -- such as neural networks -- require knowledge of derivatives to really understand common algorithms like gradient descent. Familiarity with vector ...


22

In addition to good answers given, some others. Plenty of computer scientists do use calculus, and other important math. It's good general mathematical training, which is helpful to learn to think rigorously about other topics later on. Building on the above, it's helpful for understanding (not just learning to write down, but understanding) some CS topics ...


20

I actually cover this idea in my very first lesson in AP Computer Science, because I have found that students find the different uses of = to be confusing, indeed. I run a unit based on Tom Roger's unit, Java Ain't Algebra, and I also talk about it a little here. I do this right at the beginning because, if mutability is not made explicit, students do not ...


16

When I have taught this, I have said that = in programming is just a different thing to = in maths. It's unfortunate that someone (I say "some idiot", you might not want to use such language) decided to re-use = for assignment in programming, but now we are stuck with it. Programming, while it looks like maths, is more like a series of instructions. x=5 ...


14

Much of the material one learns in school has no direct utility in one's job as a software engineer. Conversely, much of the working knowledge one needs as an industry practitioner is not gained in school. What school is supposed to do is provide some basic knowledge and a basic framework for learning, out of which an individual is going to actively retain a ...


11

If your students are coming from a math background, teach them that in most programming languages, all variables have a hidden subscript on them corresponding to a time/step-number (i.e. they're functions of time), and something like: $x = x^2$ really means something like: [Let] $x_{t+1} = x_t^2$ You might clarify that such a rule for $x_{t+1}$ only ...


11

This isn't really an answer, but I'd like to say a few things about calculus. I think that what is needed by a CS major from that realm and what is needed by a math major are very different. As such, I think that if calculus is taught to CS majors, and to history majors, for that matter, the needs imply that it might be a different sort of course than that ...


7

A specific example that I've used the mod operator before for (and have seen it used in production code this way) is to represent a higher dimensional array (usually 2D, but higher is possible) as a one dimensional array, and then use some modular arithmetic to retrieve the higher dimensional structure. The reason one might want to do this is if your array ...


7

This might be an interesting way to do it, but here goes. Give your students a blank sheet of paper. Have them write out "3". Then have them write out $2^{10^{1000}}$. Most will probably stare at you blankly. A few clever/sassy ones will just write out the exponential notation. Tell them that just as they write out numbers a little differently depending on ...


7

When and how should the differences be pointed out to students? When: As soon as you introduce one of those operators... On the "how" - I'd try to not beat around the bush, so to speak, but to point out straight away that only because we use the same symbol, they still have completely different meanings. Are there examples producing unexpected results ...


7

I'm going to explore an orthogonal concept that sheds light on the question at hand: What is a variable? In mathematics a variable is a representative for some value, a name. It may be a name for something we know or don't (abstraction comes in here). In an equation, the variable is sometimes called an "unknown". But that isn't precisely true. An equation ...


6

All of the below is meant to be thoughts/analogies/illustrations to help explain the difference (meant to be said to students) but in reality, this is all dependent on the level of your students. The expression x == x**2 in python is a "test" - is it true, or is it not? Much like when defining a set, you have $\{x|x>2\}$ (i.e., x is only included iff $x&...


5

I don't teach CS in any official capacity but I have tutored a number of friends and colleagues on the basics. I find that differentiating the language I use when describing the different concepts helps a lot, for instance: Mathematical x=x*x = "X equals X squared" Assignment x=x*x = "X is made equal to X squared" Comparison x==x*x= "Test if X is equal to X ...


5

Actually, your tree explanation is fine, except that it is the low precedence operators closer to the root. In Java, the "." operator is the strongest/highest and the assignment operators are the lowest precedence. The arithmetic operators are all higher precedence (bind tighter) than the booleans, with && having higher precedence than || A semi-...


5

This answer addresses something very different from the other answer I posted on this question, which is why it merits its own answer: Almost every field in computer science is built on some mathematical theory (this sentence is the only overlap between answers): The most basic: the number of options that an $n$ long binary number is $2^n$, and that's ...


5

There are many good answers here, but ultimately your question comes down to, "Why does A require X, when my dad was B for many years." Software engineering is not a field that only seeks out computer scientists. I work in software engineering right now having graduated CS, but I work along side of other software engineers from various engineering degree ...


5

Focus on the idea that the sets can be finite. They don't need to be defined by a formula. Any set of ordered pairs is a relation. If there is a unique second element for any given first element then it is a function. For example, the set of pairs {(5,2), (5,4)} is not a function, since the value associated with 5 is not unique. This is a relation: a set of ...


4

I've not tried the following, so I'm unable to vouch for their effectiveness, but if you're looking for suggestions: Avoid assigning variables directly (i.e. x = y) Hide the implementation in functions that have semantically clear names (e.g. x.Assign(y) ), although this assumes an object-oriented approach. Something like: x = Int.Create(y) uses assignment ...


4

You can use an analogy of priority queues (maybe a hospital, if it isn't too gruesome; perhaps a queue for ordering work tasks) A nurse doesn't need a patient to have some indicator that they are supposed to be treated before some other patients (these indicators are the parenthesis). There's simply a known treatment order, based on the urgency of the ...


4

They should be taught first and foremost to be computer scientists. This is a bit like asking Should biologists be taught first and foremost to be physicists or chemists? Neither. Biology has some physics and chemistry, but it also has some stuff all its own. Ditto for computer science - there's science and there's math. (Plus, if you're being really ...


4

CS is neither Maths nor Science. Therefore teaching them as if one or the other is probably misplaced. Maths are about understanding and advancing certain logical mental models. It uses abstraction a lot and so does computing. But those are useful mental tools in most fields. That doesn't make History a subfield of Maths. The Sciences on the other hand ...


4

Given all the answers, I'm kind of surprised I didn't see anyone mention this, but... Back in the 80's when I was taking CS (and likely somewhat in the vicinity of when your father took it), Accredited Computer Science was still fairly new as a degree. Very few colleges offered it as its own stand-alone school. For most, it was a department in either their ...


4

Actually they are not the same thing at all. In mathematics a function consists of a univalent map between a domain and a range this is a subset of a cartesian product or just as you have described, a table. The continuous case is an extension to infinate domains and ranges, usually over the real numbers. Functions in computing do not always behave this way....


3

How far should modular arithmetic be taken in the CS classes that are early enough along in the curriculum that they still focus on programming? I view the mod or modulus operator as any other operator that is new to the students. Even though mod is used more often when programming because it results in an integer value which is much more friendly to ...


3

Your general plan seems good: Do a lot of exercises. An old proverb (Chinese, but maybe more general) is that you don't know something until you've practiced it ten thousand times. (Rule of 10,000). I've found wikipedia to be quite good, but not perfect, for questions on mathematics. Be a little skeptical if anything seems a bit strange in an article there....


3

If your students are mathematically inclined, you could simply think of the variable type as a constraint on the value contained inside of it. For example: int represents $x \in \mathbb{Z}$ (and depending on your type's size, $-2^n \leq x < 2^n$ for a signed integer and $0 \leq x < 2^n$ for an unsigned integer) The set of values that may be held by a ...


3

1st remind pupils of BIDMAS, they learn this is arithmetic class, around the age of 11years old. Though in programming it is usually BIMDAS. Though this only makes a difference when there are rounding errors. When teaching boolean algebra, use a+b (or), a.b (and), as opposed to a∨b (or), a∧b (and). The second makes much more sense when relating boolean ...


Only top voted, non community-wiki answers of a minimum length are eligible