*By Emmanuel Schanzer, **Bootstrap*

Recent calls to bring Computer Science to K-12 schools have reached a fever pitch. Groups like Code.org and Girls Who Code have become household names, having raised tens of millions in funding from Silicon Valley luminaries and small donors alike. In February of 2016, President Obama announced the “CSforAll” initiative, and asked for $4 billion of funding from Congress to pay for it. Even in today’s divided climate, this initiative found bipartisan support, and mayors and governors from coast to coast have made sweeping commitments to bring CS Education to all students.

This effort has serious consequences for math education. Adding a new subject is easier said than done: recruiting, training, hiring and retaining tens of thousands of new CS Teachers will take decades and cost billions, and the finite number of hours in the school day and rooms in the school building make it difficult to find space for these courses. To meet these commitments, many schools and districts have employed three strategies: (1) take time out of existing math classes for CS, (2) take math classes out of a teacher’s schedule, and instead have them teach a CS class, and/or (3) have CS classes count as a math credit [1]. All of this is done because there’s a widespread misconception that “computer science is just like math”, and that skills from one will transfer to the other. Unfortunately, most of the programming languages being taught in these classes have little to do with mathematics, and embrace concepts that are explicitly *math-hostile.* In this article, I will discuss some of the challenges and opportunities faced by K-12 mathematics educators in our efforts to develop an authentic incorporation of CS into the K-12 curriculum.

**Some Challenges**

A core example of a challenge facing math teachers is that numbers themselves behave differently in most programming languages. Math places no limit on how small or large a number can be, yet programming languages frequently truncate values without warning, leading to unpredictable results. Any 5th grader should know that 2 ÷ 4 equals ½… but in Java the teacher will have to explain why the same expression evaluates to zero!

Making matters worse, programming languages like Java, JavaScript, Python, Scratch and Alice all rely on the concept of *assignment*. Assignment means that a value is “stored in a box”, and that the value in that box can be changed. Here’s a simple JavaScript program that demonstrates this:

x = 10

x = x + 2

The first line of code *assigns* the value 10 into a box named “x”. The second line reads the value back out, adds 2, and assigns the new value back into x. When the program finishes, x contains the value 12. Unfortunately, the semantics and syntax are completely incompatible with mathematics! In math, names are given to *values*, not boxes. In fact, there’s no notion of “boxes” in algebra (or “assigning” values into them) at all! Moreover, the written syntax of “x= x + 2” translates to a statement that is mathematically wrong. Adding insult to injury, computer scientists refer to x as a *variable*, despite the fact that it behaves nothing like a variable in math. The problem is made even worse when it comes to *functions*. In most programming languages, functions can (and often do) fail the vertical line test, producing different values for the same input or perhaps *no *value for *any* input. Students typically struggle with the concepts of function and variable when they get to algebra. Now, they are confronted with incompatible definitions of the same terms – in a class taught by a math teacher, for math credit.

It should come as no surprise that there is little evidence supporting the proposition that programming leads to higher performance in critical classes like algebra. Asking math teachers to cut back on math to make room for programming is problematic in and of itself. When numbers, variables and functions behave contradictory ways, all in the context of a “math-credit class”, the problems are far greater.

**Some Opportunities**

While the risks of bad integration are significant, the opportunities for an *authentic* integration are tremendous. I would argue that an “authentic integration” between math and programming has three characteristics:

*Tools*– The language itself must include (and enforce) basic mathematical concepts like Numbers, Variables, and Functions. At the very least, we need to get our tools right (within reasonable limits).*Curriculum*– The curriculum offered alongside the tools must be aligned to national and/or state standards for*mathematics*, with a clear scope and sequence that addresses the needs of a mainstream math teacher. It should include homework assignments, rubrics, assessments, and handouts that address mathematical concepts. Demanding that a math teacher find the time to figure out the alignment and make these resources on their own is a non-starter.*Pedagogy*– There is more to great teaching than having a great curriculum. A CS course that aims to address math content must also address pedagogical techniques that matter in a math class. How is an activity differentiated? How is a concept scaffolded? How should student break down a word problem broken down? The answers to all of these questions (and more) must be explicit, and must also fit within recognized best-practices for math instruction.

I firmly believe there are ways to do it right, and there’s tremendous potential for teachers who are able to do so. Authentic alignment of mathematics and computer science requires significant time to develop materials and integrate them with existing math curricula, and significant intersectional experience between computer science, mathematics, math instruction, curriculum development, software engineering, and teacher professional development. And while there are almost certainly multiple pathways to get here, I can speak from experience about one of them.

I’m a former math teacher, math-ed researcher, and the co-director of an organization that has spent nearly a decade researching this challenge and developing evidence-based solutions. Bootstrap (http://www.BootstrapWorld.org) is a research project at Brown University that offers a series of curricular modules built around *purely mathematical programming*. Our introductory module is carefully aligned to standard algebra, and after a decade of research has been shown to significantly improve students’ performance on standard, pencil-and-paper algebra tasks (http://www.BootstrapWorld.org/impact). The win for students is twofold: they’re learning real algebra, and they’re doing it in a way that is 100% hands-on and applied. Bootstrap gives math teachers a chance to teach algebra in a new way, and to makes their experience teaching math an asset rather than a liability when it comes to teaching programming. By leveraging the experience math teachers already have, Bootstrap makes it possible for math teachers to deliver rigorous programming education without years of re-training. And since every student takes algebra, it allows schools to bring computer science to *every child *without having to find room in the budget for a new teacher or room in the schedule for a new class.

**Conclusion**

Computer Science is coming, most likely in a form that finds its way into math classes across the country. As members of the math-ed community, we have a responsibility to make sure this integration happens authentically, and in a way that supports math instruction instead of undermining it. Doing this takes careful attention to the tools we use, the curricula we teach, and the pedagogical techniques we employ. If we withdraw from this conversation, it will happen without us – and recent history shows that it is likely to happen in a way that risks harming math education. If we are active participants in the conversation, the enthusiasm and energy surrounding CS education bring enormous potential to math classrooms everywhere.

[1] – Kentucky counts CS as a math credit, Georgia counts CS as a math credit, Pennsylvania counts CS as a math credit

C-STEM from UC Davis offers Common Core-approved Math Courses using a variation of C software. Professor H. Cheng is exceptional.

Great article. I liked the most “some challenges” part in your post.

Information and Communication Technology (ICT) is now an important part of every academic discipline. I believe that it is narrow thinking to focus just on what Computer Science can be taught in a Math course, such as an algebra course.

Readers might enjoy my new free book, The 4th R. I define the 4th R to be Reasoning/computational thinking. I recommend that it be integrated into all curriculum areas,starting at the earliest grade levels, much in the same way that we focus on and integrate the first three Rs (reading, writing, arithmetic).

See my free 80 page book:

Moursund, D. (12/23/2016). The Fourth R. Eugene, OR: Information Age Education. Download the Microsoft Word file from http://i-a-e.org/downloads/free-ebooks-by-dave-moursund/289-the-fourth-r/file.html. Download the PDF file from http://i-a-e.org/downloads/free-ebooks-by-dave-moursund/290-the-fourth-r-1/file.html. Access the book online at http://iae-pedia.org/The_Fourth_R.

Great article, we face the same problems when we start teaching Computer Science to students who had math in high school. The problems are indeed there but they are not as severe as it may seem. For example, 14 / 4 = 3 in Java is not something weird, it just goes back to the beginning of the elementary school when young kids learn division BEFORE they start on fractions. If we have 14 apples and 4 students, then each student gets 3 apples and 2 apples remain: this is exactly what Java says 14 / 4 = 3 and 14 % 4 = 2.

Equality sign as assignment is definitely confusing, maybe not as confusing in Java itself since in Java, equality is not described by the equal sign but rather by a special symbol ==, but it is confusing since it can be (and often is) confused by students as an equal sign. To our students, we say that x = x + 2 simply means that the value at the next moment of time is equal to the value at the previous moment of time + 2, i.e., that x(t+1) = x(t) + 2, which is now an absolutely correct mathematical statement. This may be a way to clarify, since by the time students at school learn basics of programming, they already have some idea about functions or at least about the fact that some quantities change with time.

Purely mathematical programming is the way to go!

In Queensland Australia, we have been teaching Computer Science (of which programming is a large part) in Grades 9 and 10 for years. Students study a full time maths curriculum and Computer Science is offered as an optional subject (as is Home Economics, etc).

I have never experienced any maths problems because kids do CS. The programming languages I’ve taught include decimals. In many programming languages, the statement x = x + 2 is written as x := x + 2 which reads as “x is assigned the value of x + 2”, which is ok. In languages that just use x = x + 2, the ‘=’ sign means ‘is assigned the value of’, which kids understand.

Overall, the students that choose Computer Science really enjoy it, and it is a wonderful class to teach.