Friday, July 10, 2015

What Does Mathematics Have To Do With Programming?

The title of this post is actually a question headline on the stackexchange site found here. I felt i should say something about it over here and I’m going to answer the question by sharing some personal experience.

Years ago, when I began my journey as a programmer, a lot of articles, opinions and search results suggests one of the important quality of being a successful software programmer or as i prefer calling it, software developer is having Mathematics as a tool, they refer to it as a very important skill that is worth having. In fact one of those articles described it as a ‘language’ that should be learnt first. That was great news, i believe at least maths is not an issue so i moved on, I continued learning C++, switching back and forth from C occasionally.

One thing all these articles, books, search results and so on failed to set out straight is how mathematics as a subject can really be of use in the real world when it comes to programming softwares, apart from the scenes where you are asked to write a program that solves a quadratic equation, that determines the 1000th fibonacci number or one of those questions found on the Project Euler site, there’s no real instance where they tell you this is how mathematics can actually be implemented in a real life application that does this or that.

Most especially, if you are a self taught programmer or coder that didn’t care or did not even hear about data structures, algorithm design and so on. All you just do is solve a ‘complex’ maths question using one of your favorite programming language and then send a screenshot of the console box to your favorite social network.

I continued this long and interesting journey of claiming I’m a programmer that knows a lot of maths until finally i came across PHP and got exposed to Web Applications, thats UX and Backend. I began doing researches, lengthy and shorter ones to find out how google as a search engine, can give results to answers that bugs our daily lives in fractions of seconds, and then there’s the image search, recommendation engines, such as the one used in facebook and Twitter and numerous others.

All these curiosity led me to discover what programming is all about. Its not just about writing codes and fixing bugs, it’s not about providing solutions that’s been solved over a million times in the same dialect. I got introduced to algorithms and data structures. And with full confidence, i began sourcing for learning materials. One of my favorites was the book by T Cormens, Introduction To Algorithms.
It was a favorite because it made me realize ‘Programming is about formulating solutions to problems that exists without solutions’. 

Well, it took me so many months of sitting around a library of maths materials, why? because in the process of deriving solutions to unsolved problems, you have to model that problem. And mathematics is all about modelling. Modelling real life situations and expressing them with numbers that are easy to quantify and interpret.

This models are expressed in form of algorithms which makes them easy to translate into programming languages.
Every single thing we do with our computers, be it software or hardware related were all modelled, and expressed in numbers before been translated into programs.
When we begin to learn a language as a beginner, we only use a ‘simple function’ such as the ‘sum’ operator to add up numbers, just like in a normal algebra class. What we fail to realize is that the bulk of the work has been done for us by formulating algorithms which is fully based upon mathematics.

That didn’t stop there, my curiosity about interactive and intelligent applications brought me across the subject of Machine learning and that’s where i learnt the real lesson.

Artificial Intelligence and Intelligent Machines are completely built on the foundation of mathematics spanning areas like, vectorial calculus, numerical analysis, Statistics and probability theory, and so many numerous others.
It presented the fact that mathematics has a lot to do with programming, in fact it is an area of study that’s completely built on the foundation of mathematics. Without it, there wouldn’t be anything like twitter or facebook, because what makes them special is their ability to predict you, and know what you’ld love to have and what you’ld hate to see, all of which is based upon the science of prediction as mathematics is usually called.

Well, i guess i learnt my lesson the hard way, but one thing I’ld always say to guys like me and those that aren’t like me is that, there’s actually no mathematics behind anything, It is only a language that we use to describe everything, most especially when it comes to intelligent systems and task automation. Keep on learning to program but don’t forget to make mathematics your most important priority if you really want to make it far in this field.