It is time that Math Teachers jump from P to NP

Yoni Nazarathy
5 min readJan 4, 2019

In this post I argue why math teachers must add computer programming abilities to their toolset. The alternative is to become irrelevant within a decade.

The P vs. NP problem is a critically famous unsolved mathematical problem, standing at the intersection of theoretical computer science and discrete mathematics. It has to do with what computers can efficiently compute and what they most probably cannot. For example, finding the shortest route between two points on the map can be efficiently solved by a computer. However finding the shortest path that travels through several towns, stopping in every town and returning back home is a difficult computational challenge. Treating P and NP as classes of computational challenges, the former challenge is in class P while the latter is in class NP. It may be that there is some magical way to solve NP challenges efficiently, however such a way hasn’t been found and many experts believe that for general NP problems it doesn’t exist.

However, my focus in this blog post is not on discrete mathematics or theoretical computer science, where P vs. NP stands for “Polynomial” vs. “Non-deterministic Polynomial”, see for example this introductory Art of the Problem video if this interests you more. Instead, I’d like to make a gross analogy by using these abbreviations differently.

Let P stand for “procedural” and NP for “non-procedural”.

After all, following a procedure is generally much easier than not. Most of us are capable of assembling an IKEA wardrobe, however designing the instructions for such an assembly is clearly a tougher challenge. Is it not? Hence, P vs. NP.

So now if you are a math teacher, ponder about this: How much of what you teach can be carried out procedurally by a computer? Such self inquiry may actually lead you to discover that you are mostly focusing on training students to build IKEA wardrobes. Perhaps it is because you are required teach to a curriculum with set goals, methods and plans. So it clearly isn’t all your fault. You are part of a system… Still, what can you do?

If all or most of what you are teaching is “how to do this”, “how to solve this”, or “how to find this”, then chances are that there is already software out there that carries out the procedure quickly and with perfect accuracy. See for example Wolfram Mathematica, Excel or even simple calculators. It isn’t bad to know (or teach) how to do things, but are you simply training your students for P? Is this their destiny? Is it yours? Why are you actually teaching mathematics? What are your students gaining?

Actually, I believe that if you are reading this post then you are probably going beyond standard P and are also teaching and training “problem solving”. You probably believe that by practicing the solution of mathematical problems, your students may also develop general logical thinking abilities that may later come useful in fields other than math. As a teacher, you probably cherish the moments where you see students doing NP. But why?

Indeed if the problems are complex enough, computers are still not able to tackle them without intermediate human translation. However, high school problems are typically quite repetitive in their nature and it is a matter of a few years until advances in (example based) machine learning and natural language processing will catch up.

Actually, there are already simple apps that take photos of equations and return their solutions. Similar apps that take photos of geometrical or word problems are also forthcoming. The technology is here and with enough example training sets it is a matter of time until all worded high school problems will be automatically solved by dedicated apps!

Deep artificial neural networks, invented in the 1950’s and 1960’s and popularised in the past decade, are integrated into many current applications and changing our world. Hence I am arguing that most high school type problem solving will also soon fall within P. Where is the math teacher in this equation?

Furthermore, what about programming? This isn’t a standard part of math curricula, still it fits in very naturally with mathematics. Importantly,

The act of programming a computer to carry out a procedure is not P!

While discussing general artificial intelligence is a hot topic, to date, we haven’t witnessed a breakthrough that will allow to teach a computer how to program itself. Certainly not for carrying out arbitrary tasks. Try and talk to a computer and ask it to write a program for you and it won’t. The technology isn’t there, not even close.

For example, if you were to communicate with IBM Watson: “Please write a computer program that takes as input a list of numbers, and sorts them based on the total sum of the base 10 representation of digits of each number”. Watson will fail. So will any other machine unless it was purpose built for that type of task. However, ask this of a 14 year old that has spent 3 months programming and they will succeed! How about you?

Hence, to date and in the conceivable near future, the act of programming is NP, “Non-procedural”. We humans can do it, computers cannot. Computers can only execute the program. We are smarter!

So now if you are a teacher, you may ask yourself: Do you exploit such human intelligence in your mathematics classroom?

I personally believe that due to the culture of testing and evaluation, educational bodies have been slow to reduce the importance of P in mathematics education. Much has been done in early and middle years education, as for example via YouCubed as well as the Global Math Project, but what about high school?

On the positive note, one activity that is sometimes carried out which is much more NP than P has to do with geometric proofs. However, not many students get to spend time on this. Hence, I believe that one of the best things that a mathematics teacher can do is to augment their lessons with CODE! However, many mathematics teachers don’t code. Many mathematics teachers are experts at algebra, geometry, calculus and statistics, but when it comes to implementing ideas using one programming language or another, many haven’t experienced this.

I believe that this state of affairs needs to be rectified. In some regions, regulatory bodies are working to rectify this, however in many others there is a detach between “coding” and “mathematics”. Perhaps, teachers themselves can take initiative and introduce (auxiliary) coding examples in the classroom. When I code “live” during my university lectures I’ve noticed that students find it engaging, exciting and enriching. Other university lecturers do it also, but many don’t and the same goes for high school teachers.

My first attempt at contributing to this is through One on Epsilon’s MATH TEACHERS CODE series. In this short 6 part series, I ran live YouTube sessions illustrating how coding examples using the Julia Language can be integrated in the classroom. Examples included number sequences, randomness, calculation of Pi, number bases, solution of equations and optimization.

Perhaps you wish to give it a try and follow these lessons or maybe find alternatives. I would love to know how you go.

--

--