Mathematics and programming


Mathematics and programming

Mathematics a major subject in the world and without it, many theories are just a waste and computer and computer programming also a most trending subject from few decades. These two things have any relation? The answer is yes. Someone said Programming is Mathematics.

mathematics and programming
Mathematics and programming

History of Computer Science

If we review the history of the computer, the first machine related to the technology was the abacus. It was also created for calculations the whole computer science and computer programming are based on mathematics.


Programming for Mathematics

Programming is a thing which makes mathematics easy, and we can perform huge calculations in minimum time. If a good mathematician solves a problem in one minute, then a simple calculator solves the same problem in Neon or Picosecond.

Every computer program is based on calculations. Now where a super computer is busy with calculations, can execute a trillion of calculations within a second, then how can we separate these two fields? They are interrelated and made for each other.

As I said, they are made for each other; then you can understand this quote. While in programming, there are many stages where you need mathematics. While solving a simple problem like when you need to sort out even numbers, then you should apply some mathematics. Same is the case with mathematics while solving problems sometimes the problem is so huge that you need some program which takes it as input and gives you some output in return.

In almost every programming language, there is a special mathematics library which has almost all the famous functions and formulas of mathematics like sin, cos, pi, tan, etc.


Mathematician is a Programmer

A good mathematician is a good programmer. If we take a look at a simple animated game like angry birds, there is mathematics behind this game which makes an angle of the thrown object. There must be a good mathematician behind this game. A programmer can make his logic, and sometimes it’s beneficial for him in a way he is solving some mathematical problem, and he gets the solution of another problem.

To become a good programmer, you need to know mathematics very well because computer programming came from mathematics. As we take a look at our academic systems if you are in software engineering field, you must have to learn many mathematic courses like linear algebra, statistics, calculus, etc. Just to solve your problems mathematically.


Why we need mathematics in programming and why should we learn it?

To become a good programmer, we need to learn mathematics because without the understanding of mathematical rules; you’ll have only a basic understanding of programming, and its syntax, but you can’t solve huge problems without the advanced knowledge of mathematics. Mathematics teaches us an abstract problem solving, which we need to be good in programming.

  • We need abstract things because every developer needs this skill to solve and think about problems and problem solving.
  • We have to learn mathematics because programming is based on the mathematical concepts and logics.
  • Many search engines use Vector Calculus for searching data.
  • Matrix Factorization can be used for a lot of stuff like Sentiment Analysis.
  • You need to know Calculus to calculate the complexity of code that you write.
  • Probability is heavily used in search queries.
  • From a programmer perspective, Mathematics is a subset of programming.


Programming without mathematics:

If we take out the mathematics from programming, then just think for a while if we are printing a statement in the mid of the screen, then there is no other way to tell the computer it’s mid in other words 50% x-axis and same for the y-axis.

Let’s take another example while using HTML we use to put x and y-axis point in it to tell it how to draw things on the screen. Simple is that you can’t draw a single dot (.) on the screen without mathematics.

If we take just a simple method of programming. Let suppose, for a loop; we need some mathematical operator to handle a loop. We can’t tell a computer that how many times the loop should repeat itself without programming.