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.

Sunday, May 10, 2015

Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning, but without beauty in its so-called 'better-idiots'
Just like every other forms of art, Coding isn't just about getting things done! Although it is very paramount that you code meaning, logic, execution speed into your programs, it is just as important to make your programs look beautiful, i mean beautiful as in the opposite of ugly.
The ability to write a Beautiful program that gets the job done is what truly makes you a developer, a designer or more specifically and truthfully: a programmer.
Just like artists learn how to use the drawing pad and ink to compose their work, so also does coding a program involves learning, Learning not just to get the job done but to express yourself to others as a coder that appreciates art, beauty and colors.
Most times when i code, i prefer to use a text-editor or an IDE that heavily uses syntax-highlighting and color-differentiation, it does not only control the way i express the logic of what I'm doing to the machine I'm instructing but it also express my appreciation of beauty, simplicity and a sublime environment. Most especially for open-source enthusiasts just like myself, our codes will be read and parsed by people interested in learning from it, your ability to write un-minified programs, readable source codes and beautiful ones is what makes it stand down and the download meter count higher.

Wednesday, April 29, 2015

Maths Is Difficult!

In 2005, an American psychologist, Gallup Stroustroup conducted a poll that asked students to name the school subject they considered to be the most difficult. Not surprisingly as you’d expect, mathematics came out on top of the difficulty chart. So what is it about math that makes it difficult? Have you ever wondered?
Dictionary.com defines the word ‘difficult’ as “Not easily or readily done; requiring much labour, skill or planning to be performed successfully”. This definition gets to the crux of the problem when it comes to math – specifically the statement that a difficult task is one that is not “readily done”. The thing that makes math difficult for many students is that it takes patience and persistence. For many students, math is not something that comes intuitively or automatically – it takes plenty of effort. It is a subject that sometimes requires students to devote lots and lots of time and energy.
This means, for many, the has little to do with brainpower; it is mostly a matter of ‘staying power’ and since students don’t make their own timelines when It comes to ‘getting it’ thy can run out of time as the teacher moves on to the next topic.
YOUR BRAIN TYPE
But there is also an element of brain style in the big picture, according to many scientists. There will always be opposing views on any topic, and the process of human learning is subject to ongoing debate, just like any other topic.  But many theorists believe that people are wired with different math comprehension skills.
According to some brains science scholars, logical left-brain thinkers tend to understand things in sequential bits, while artistic, intuitive, right-brainers are more global. They take in a lot of information at one time and let it “sink in”. So left-brain dominant students may grasp concepts quickly while right-brain dominant students don’t. To the right-brain dominant student, that time lapse can make them feel confused and behind.
But in busy classrooms with too many students – extra time just isn’t going to happen. So we move on, ready or not.
MAKING MATH LESS DIFFICULT
I have established a few things when it comes to math and difficulty:
1.       Math seems difficult because it takes time and energy.
2.       Many people don’t experience sufficient time to “get” math lessons and they fall behind as the teacher moves on.
3.       Many move on to study more complex concepts with a shaky foundation
4.       We often end up with a weak structure that is doomed to collapse at some point.
Although this may sound like bad news, it is really good news, I promise. The fix is pretty easy, if we’re patient enough.
No matter where you are in your math studies, you can excel if you backtrack far enough to reinforce your foundation. You must full in the holes with a deep understanding of the basic concepts you encountered in your early math studies.
è If you are in junior secondary school right now, do not attempt to move on until you understand pre-algebra concepts fully. Make your parents/Guardian hire a tutor if necessary.
è If you are in Senior Secondary School and struggling with math, download the junior school math syllabus or hire a tutor. Make sure you understand every single concept and activity that is covered in junior secondary school
è If you are currently in any higher institution of learning, backtrack all the way to basic math and work forward. This wait takes as long as it sounds. You can work forward through years of math in a week or two.
No matter where you start and where you struggle, you must make sure you acknowledge any weak spots in your foundation and fill, fill, fill the holes with practice and understanding of the fact that mathematics is “not a mere tool used by scientists to make the world more complex in the bid to simplify it”.


The Evolution Of Mathematics As A Scientific Discipline

For the most part, Mathematics remains behind the scenes. We use the end results without really thinking about the complexity underlying the technology in our lives. We never wonder how it came to be so - we only know that is is so and use it because the 'big boys' says so. But the phenomenal advances in technology over the last 100 years parallel the rise of mathematics as an independent scientific discipline.
For so many years (about 4 centuries ago), mathematics was thought of as a discipline encompassing majorly arithmetic, algebra and geometry. It was virtually indistinguishable from science and philosophy. History tells that the above major branches (arithmetic, algebra and geometry) was developed by the ancient Greeks. It was maintained by the Islamic Scholars and was passed on by Christian Monks in the middle ages. Mathematics finally became a field in its own right with the advent and discovery of calculus by the English Mathematician and Physicist, Sir. Isaac Newton and German philosopher and mathematician Gottfried Wilhelm Leibniz during the 17th century. Until the 19th century, however, mathematics was used mainly by physicists, chemists and engineers.
In the late 1800s, scientific researchers began probing the limits of observation, investigating the parts of the atom, and the nature of light. Scientists discovered the electron in 1897. They had learned that light consisted of electromagnetic waves in the 1860s, but physicist Albert Einstein showed in 1905 that light could also behave as particles. These discoveries, along with the inquiries into the wavelike nature of matter, led in turn to the rise of theoretical physics and to the creation of complex mathematical models that demonstrated physical laws. Einstein demonstrated the equivalence of mass and energy, summarized by the famous equation  e = mc squared, in his special theory of relativity in 1905. Later, Einstein's general theory of relativity extended special relativity to accelerated systems and showed gravity to be an effect of acceleration. These mathematical models marked the creation of modern physics. Their success in predicting new physical phenomenon, such as black holes and antimatter, led to an explosion of mathematical analysis. Areas in pure mathematics - that is, theory as opposed to applied, or practical mathematics became particularly active.
A similar explosion of activity began in applied mathematics after the invention of the electronic computer, the ENIAC (Electronic Numerical Integrator and Calculator) in 1946. Initially built to calculate the trajectory of artillery shells, prediction, and wind-tunnel design. Computers aided the development of efficient numerical methods for solving complex mathematical systems.
"Without mathematics, we might be living in a world with beautiful art, literature and philosophy, but no technology" - Pilant, Micheal, S., B.S., M.S., Ph.D., Professor of mathematics Texas A & M University. (These statements may have been true some 50 years ago but currently, it is a mathematical heresy, a common fallacy as you would soon see). Even the medical advances of the last 50 years might not have occurred, Science and technology; in their turn, have provided many of the problems that motivated progress in mathematics. Such problems include the behaviour of weather systems, the motion of subatomic particles, and the creation of faster and smaller computers that can perform multiple tasks simultaneously.
With all these disciplines in which mathematics has contributed as a 'soul mate' to make simple, a problem of great difficulty, no wonder it is termed 'The Language of Science'.

Tuesday, April 28, 2015

What Really Is Mathematics?

Over the ages, Mathematics has been seen as a way of describing relationships between numbers and other measurable quantities. Most often, it is seen as a science that can express simple equations as well as interactions among the smallest particles and the farthest objects in the known universe - planet earth.
Truly, Mathematics allows scientists to communicate ideas using universally accepted terminology, it is truly the language of science; it a form of art, a different way of thinking, Mathematics is not all about proofs, conjectures, lemmas and every other form of 'mathematical laws'. It is about seeing the beauty in the world through it's microscope.
Have you ever imagined how beautiful the world is? From patterns of 7's (7 days makes a week) to patterns of 12's down to 24's and so on, Mathematics has interconnected nature, this is a scientific idea, it is the artistic beauty of nature as expressed fortunately, by what others claim is  a scientific branch of knowledge.
We benefit from the results of mathematics research everyday. The fiber-optic network carrying our telephone conversation was designed with the help of mathematics, our computers are the result of millions of hours of mathematical analysis, Weather prediction, the design of fuel-efficient automobiles and airplanes, traffic control and medical imaging all depend upon mathematical analysis and that is all we see the subject as, a tool scientist use; not as an art that exists naturally.

Mathematics is a beautiful subject. Beauties, which over the years due to negligence and less-of-paying-attention has almost gone extinct. Most people (most of us) has seen nature as a 'thing' that exists only because 'the scientists' says its because 'A and B combined to give us C'. We have forsaken the fact that its a 'let there be' that made it so. A fact that is closer to the arts, than it is to the sciences. The 'Let There Be' of nature is extraordinarily full of beauty, neglecting the fact that 1 + 1 = 2 but not denying the truth of it.

Having spent most of my life using mathematics, I am still conscious of the fact that I do not understand much of the notation used by mathematicians. And even when I feel that I understand a type of notation, I still ask myself “Do I really understand its meaning?”. For instance, I was very familiar with the fact that  i =√−1, not until i found out that there is something like i raised to the power of i which is pretty much a very complex fact to comprehend.  This hole in my knowledge makes me feel uncomfortable, but I suppose it is reassuring to learn that some of our greatest mathematicians have had problems understanding some of their own inventions.
As much as Mathematics is a very beautiful subject, in it's attempt to make the world we live in  a predictable and a better place, it became much more complex. This complexity has made the statement 'Maths is not my thing' or 'I was not born to know maths' become a story, a slang or a common saying amidst us.
Forgetting to talk about the 'why' of vectors, differentiation, combinatorics, interpolation, vectorial calculus and other numerous branches of  mathematics is what makes it unclear, look unsolvable and very irritating.
There is no fun in just writing down numbers, memorizing theories, conjectures and formulas without knowing why or how it can be of use.


Mathematics is not a fairy tale, but when we begin to see it as one, then we'll begin to think like the great Aristotle, Euler, Fermat, Newton and so many numerous others.