Monday, January 20, 2014

Algorithm : Its definitive study

ALGORITHM = LOGIC + CONTROL
stated by Kowalski in 1979

       The logic component expresses axioms that may be used in computation.
       The control component determines the way in which deduction is applied to the axioms or logic or syntax.

Some common definitions for algorithm :
  • An algorithm is a procedure to accomplish(perform) any specific task.
  • An algorithm is a detailed sequence of simple steps to solve a problem.
  • An algorithm is a procedure that takes away the possible input and transforms it into desired output.

NOTE : Each of the above definitions are almost similar to each other.


Characteristics of an algorithm :
  • Finiteness(consists of finite set of instructions)
  • Definiteness
  • Input
  • Output
  • Effectiveness


We will move on to some more daily life examples and a few programming problems which we will be solving by laying down some suitable algorithms in the next blog.



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

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...............................

Happy New Year

Before beginning with our next topic of this blog, I would like to wish each of my readers "A VERY HAPPY NEW YEAR 2014 and I do hope that each one of you will have a fine year ahead".

I have been a bit busy and hence this blog has been out of posts for quite a while. But I promise to come up with more frequent posts from now on.