Thursday, 24 July 2014

What Is An Algorithm?

If you have seen movies like "Transformers Extinction", "Jobs", and "the social network", you have probably heard the term algorithm. I have wondered, in my head,"what on earth is that?", for years, until just recently.

After visiting youtube.com and watching a video from the Garden City College official profile; I now understand this thing. By the way, the name of their video is, "Concepts of Algorithm, Flow chart, and c programming".

The following example are from my notes, taken directly from the lecture, read on.

Example of an Algorithm

Problem 1: Find the average of 3 integers

Step 1: Start

Step 2: Output "Average of 3 integers"

Step 3: Output "Input 3 integers"

Step 4: Input a,b,c

Step 5: Ave < (a+b+c)/3

Step 6: Output Average is ",Ave

Step7: Stop

How I am reading it:

In step 1 the algorithm begins to solve itself.

In step 2 the algorithm reads objective 1.

In step 3 the algorithm states objective 2, which must be completed before objective 1 can be completed.

In step 4 the letters or variables are being inputted into the equation.

In step 5 the equation that the algorithm is using to find the average is being shown.

In step 6 the the algorithm is showing us the answer of the problem or equation.

In step 7 the algorithm is telling us that it has solved the problem, and it has now stopped.

Clearly, the explanation of an algorithm is more complicated then the algorithm itself.

Now you know what an algorithm is. So if you know someone who refuses to flush the toilet after they use it, write them a simple algorithm, that simply teaches them how to.