Monday, January 13, 2014

Algorithm : The everyday life

We concluded our last topic of "Writing a program : The systematic approach" with a simple notion that we will have a follow up on each of the 6 important steps involved during writing a program. But in due course we solved another problem!

ANOTHER PROBLEM???? 
Yes!! We solved a problem for "writing a program". 

HOW???? WHAT DID WE DO???? WHAT IS THE SOLUTION THEN????

           Before we answer this, let us peep into our daily lives. Whatever we do right from "making a simple cup of tea" to "finishing a portion of physics syllabus" to "making excuses infront parents in order to meet our boyfriend/girlfriend successfully(definitely without getting caught)" has certain amount of steps involved within them. There is always a plan ie., a stepwise model, laid out before doing a particular work. The ultimate motive here is to pick out the importance of planning before performing a task. I have already mentioned that programming is nothing but an implementation of our day-to-day tasks into logical lines of codes framed in a technical way. Now, let us see why!
            By taking the examples of our day to day life, lets take a look at something that can relate our daily activities with the typical lines of codes, "ALGORITHM". It is nothing but a stepwise solution to a problem. Infact, one doesn't have to know a programming language inorder to write an algorithm to solve a particular problem. One doesn't have to know any of the programming languages inorder to write down all the steps involved in opening an umbrella during rainy season.
             Now, we are quite clear about why it was mentioned that the solution for writing a program is already obtained. It was said so because we already had the steps involved for writing a program and following them sequentially certainly leads us to the completion of the program. We have written down all the steps for solving the problem and that is nothing but the algorithm for "writing a program"!! 

THAT's IT????
YEAH THAT's IT.....!!!!

CAN'T WE SOLVE PROBLEMS LIKE THIS??
YES, YOU CAN. Think about problems from daily life(a possible bus journey, cooking a particular dish and so on........) and note down all the steps and conditions involved in solving the problem and again THAT"S IT!!!!!


        Now, for those who need some task before diving deeper with algorithm, it is suggested that one can take up the daily life problems and try to write down all the necessary steps and conditions involved in overcoming that problem which will automatically point out those conditions that won't help in solving the problem and at the same time will enhance your logical reasoning abilities as one might just obtain more conditions which obstructs a particular problem from being solved successfully. As Benjamin Franklin said,"I didn't fail the test, I just found 100 ways to do it wrong". This way one can become acquainted with the fact of Worst Case(to be described later) determination.

We will read more about algorithm and its characteristics in the next post. 


STAY TUNED...............................

No comments:

Post a Comment