Back in 2010 at TED talks, **Conrad Wolfram** spoke about math in schools, and teaching kids real math with the help of using computers (Conrad Wolfram: Teaching kids real math with computers) this video was to me very interesting, so I decided to do some study, and also decided to write this article to present some of my findings, ideas and results.

**Teaching math in school**

Mathematics in school is simple when you first time start doing math and learning it. However, as you grow older, in school you also study higher levels of math, and these levels become challenging in some cases. There are three factors that impact the way you learn math, these are:

**Note:** Above I only included three factors, but there are a lot more factors that impact the way we learn math.

**Math levels**

The math is divided in levels, and each level is unique. Basic level is where we all start, and that is obvious, nobody can start at the last level, even Albert Einstein had to start from basic level.

- Basic Math
- Pre-Algebra
- Algebra
- Geometry
- Algebra 2
- Geometry 2
- Trigonometry
- Pre-Calculus
- Calculus
- Advanced Calculus

There are probably a few more levels I haven’t included here.

**Computers are great calculators**

Personal Computers (PCs) are great calculators and are some of the fastest calculators in the world; of course a modern calculator uses the same technology, the **Central Process Unit (CPU)**, one modern and much known CPU is the Intel^{®} processor. The **Arithmetic Logic Unit (ALU)** is one of the essential and key features in a CPU, which allows the CPU to perform arithmetic operations Addition, Subtraction and so one. Beside the arithmetic operations, the ALU allows the CPU to perform basic logical operations such as **AND**, **OR**, **NOT**, **XOR (exclusive or)** and so one.

Humans have created a set of CPU instructions that can be used to tell the CPU what to do; this language is called **Assembly (ASM)**. ASM has been around for a long-time, and is common in many areas in the software world. ASM is still used to build boot loaders in **Operating System (OS)**development. However, the computer sees everything in **1** and **0** or in binary form, but I would like to demonstrate how a CPU-instruction in ASM will add two numbers, I will be using C++ programming and perform inline ASM.

I will be using the x86 (32-bit) CPU registers to store data. The **EAX, EBX, ECX** and **EDX** are the four general registers. I will keep this very basic, with a lot of details.

This code may seem advanced, but is quite easy to understand, okay, I’ll explain. Let’s examine what really happens, we jump to the int declaration.

**i.** I start by declaring three int variables they get a default value zero.

int valueA, valueB, result = 0;

**ii.** Jumping one line, valueA equals 5 and valueB equals 10.

valueA = 5; valueB = 10;

**iii.** Then we enter the inline code of x86 CPU assembly instructions, we use the **MOV** instruction to move data from valueA to **EAX**, and we move data from valueB to **EDX **(**Figure A** explains the first move).

**Figure A:** The MOV instruction makes EAX as the destination for the data variable valueA contains. This is exactly the way the MOV instruction moves data, which can be defined like this: **MOV destination, data**.

**iv.** Then we perform addition, by using **add eax, ebx** which means **EAX = EAX + EDX** so we store the end result in EAX register.

**v.** Next, we store the data which EAX contains in the **result** variable, and finally we **XOR** (clear) the EAX and EDX registers.

This is another example of how a CPU performs arithmetic calculations. I am glad I was able to provide a demonstration and explanation regarding this.

**Programming helps understanding and learning math better**

Mathematics appears to be a great subject, but as you move further and begin learning and experimenting with higher levels of mathematics things can get really messy. When equations and formulas including different theories and rules are involved in mathematics, this will directly make things harder for anybody. However, a key solution to better learning math rules, theories, equations, and formulas is by learning basic programming. If every child started learning basic programming at the age of 10 we would never experience math issues in school, no matter how advanced and complex the math would become at least 90% percent or more of all the students would hopefully pass the test, all this thanks to programming. Children **do not need to learn** **Object Oriented Programming (OOP)**, they only need the basics (understanding code, data-types, and logic if-else statements), and to learn how to program the application so it can receive **input** (argument) and provide **output** (print to the screen) nothing else.

Here’s how programming helps students understand and learn math faster and better. If you know programming, you can make a function in your program that calculates for example the slope of a line. But to make this function you have to learn and understand the formula, the rules and how it is used correctly the mathematical way. However, I will provide two examples, one which is very basic and the other one which is a bit complex, but yet easy as well.

**Programming example 1:
**Build a program that calculates total price per mile a taxi driver, drives a person. Remember: The taxi company has a fixed price which every customer has to pay the

**fixed price (f) which equals to $20 USD**is added to the

**price $4 USD / mile**.

We have three things to keep in mind:

- Price per mile.
- How much a customer has to pay?
- Remember that 1 Mile equals 10 km

Now this is going to be very simple. But it will allow any student to better remember and understand how this works.

This is the equation or formula which I have setup:

**Variables:**

**T = Total cost.
P = Price
F = Fixed price
X = Mile(s)**

**Calculation by either hand on paper or writing it in word like this may seem like a long calculation, but is very short.**

T(x) = f + px

T(5) = 20 + (4 * 5)

T(5) = 20 + 20

T(5) = 40

Here’s the code in C++:

int T(int x); //$4 USD per mile. int p = 4; //$20 USD. const int f = 20; void main() { int Total = 0; Total = T(5); //5 miles = 50 km. cout << "The customer has to pay: $" << Total << " USD" << endl; cout << "" << endl; system("pause"); } int T(int x) { return f + (p * x); }

**Figure B:** The computer did the calculation, but I had to program the software so it can do what I want it to do. This allows me to learn more about the rules, and allows me to determine whether my equation or formula works.

**Programming example 2:
**In this second programming example, we will be looking at the linear equation, slope and m interception with the Y-axis.

We have two things to keep in mind:

- Remember the equation: y = mx + b
- Remember that b = y-axis intercept.

**Variables:**

M = slope

B = Y-axis intercept

Y = The total value

Find M-value:

**m = y2-y1/x2-x1
m = (3-2)/(2-1)
m = 1**

**y = 1x + b
y = 1x + 1
y = (1 * 2) + 1
y = 3**

**Test our calculation:**

3 = (1 * 2) + 1

Here’s the code in C++:

double Slope(double y1, double y2, double x1, double x2); int Y(double m, int x, int b); double m = 0; int x, y, b = 0; void main() { cout << "Find the Y-axis interception value: "; cin >> b ; cout << "\n" << endl; cout << "Calculating..." << endl; m = Slope(2, 3, 1, 2); y = Y(m, 2, b); cout << "Y = " << y << endl; cout << "" << endl; system("pause"); } //Note: Slope function works only when two known points are passed in, //single point is not supported by this function. double Slope(double y1, double y2, double x1, double x2) { y2 = y2 - y1; x2 = x2 - x1; if(y2 == 0 || x2 == 0) { return y2; } else{ return y2 / x2; } } int Y(double m, int x, int b) { return (m * x) + b; }

**Figure C:** Our program calculating the slope and the Y for us.

**Conclusions**

I personally think that the nation that first applies “teaching programming” in school, and I mean children start doing basic programming at the age of 10 will increase their economy and produce a lot of smart people. However, this is one of the reasons governments all over the world shall demand that this becomes a reality, because programming covers math, logic thinking and much more. Mathematics has not been an easy subject in school, and that is because of the levels and each individual’s ability to play with numbers, to understand equations etc. But for the coming future, I think programming will play a key role in combating the math problem we see in schools in many parts of the world. The time to change is now, so demand for this change today, for a better tomorrow.

**Additional information and resources:**

Albert Einstein Biography: http://nobelprize.org/nobel_prizes/physics/laureates/1921/einstein-bio.html

The Arithmetic Logic Unit: http://www.windowsnetworking.com/articles_tutorials/arithmetic-logic-unit.html

Linear Equation: http://mathworld.wolfram.com/LinearEquation.html

Slope: http://mathworld.wolfram.com/Slope.html

Slope-Intercept Form: http://mathworld.wolfram.com/Slope-InterceptForm.html