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. 

Wednesday, December 4, 2013

Writing a program : The systematic approach

              It is not about writing a program in a particular language that we are dealing with, its more like making use of our logical sense to come up with a common solution for a problem that we have faced. Getting wild after facing a problem never provides us any optimum solution rather pushes us deeper into more tensed situations.
              As a beginner, it is quite obvious that the first program will appear to be written in some sort of martian language and going forward with just a program will fetch nothing but just a temporary solution of getting acquainted with a particular way of writing a program and just a single way for solving that particular problem whereas there could be a huge number of logical possibilities for solving that very problem.
              Today, we will go through certain steps which a beginner should follow while facing a problem and then during solving it. So, here goes the 6 major steps for writing a program :

  STEP 1 : Investigation of Problem and collection of information.
  STEP 2 : Figuring out the logical approach to solve the problem.
  STEP 3 : Making an algorithm.
  STEP 4 : Drawing a flowchart.
  STEP 5 : Writing the Pseudo code.
  STEP 6 : FINALLY CODING!!!!!!

               It is advised to follow these steps very strictly because it provides the beginner ample time to think about the problem by different perspectives. The beginner has enough information about variables, looping logic, conditions and so on before they actually move on for writing the code. The ultimate notion is to make the beginner think before they actually know about any of the programming languages. After all, we do every single work of our lives in a systematic way and providing a solution to a problem is also nothing but figuring out a systematic way of solving the same problem. We derive the way and accomplish our tasks and that is the sole reason for introducing this steps to the beginners.

   We will deal with each of the steps in the upcoming posts. So, STAY TUNED.........................................

Saturday, November 30, 2013

Initial thought process : Diving inside the learner

The first thing that can be done to assess the logical reasoning of your student is entirely based on what we generally do in our daily lives. To begin with, we might look out for a question like,

  • "What can be the necessary steps and conditions for opening an umbrella when you move out of your house??"  
or maybe 
  • "What all routes can be taken care for reaching a particular destination??"
or lets say
  • "What are the possible techniques for cheating in an examination??"
       Whatever the question is, it should be fun because the more generalized we can make a beginner think, the more deeper we can penetrate them through their answers. The algorithm or step-wise representation of these generalized topics often offers us with a brief knowledge about the person who has written the same.
        For convenience, let us move to the first problem that we have here about the necessary steps and conditions involved for opening an umbrella. One might say that,"we move out, if it is raining, we open the umbrella!", another might crop up with a notion that,"I enjoy getting wet in rain but hate going out in a sunny morning and I do require an umbrella in a sunny day!", but then someone might say that,"We will open umbrella either if it is raining or if it is a sunny day!!" whereas someone might just think about a system which can automatically ask the user a question while encountering either of the situations(raining or being in a sunny day) and opens the umbrella if the user desires to do so!!" and so on......... We call this last guy as extra-ordinary and do not expect such answers generally from a beginner and being a programmer one has to consider that the learner will evolve with not even a single answer which is possibly the worst case scenario available here.
        
       The challenge is not about teaching the programmer about how to code in a particular language. It is more about making the learner matured enough to think in a generalized way while writing a program and confident about relating a given problem with similar kind of problems that we face in our day-to-day lives. The upcoming blogs will help us to dive in deeper into the beginner's mind and we will come across certain activities that can be done to enhance the logical sense of the beginner.

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

Friday, November 29, 2013

Introduction : The compiled curtain raiser

Teaching a beginner how to program can be as interesting as programming if the teacher starts reading the mind of the learner as the programmer tries to estimate the probable worst case entry of an user. Things can be relatively easy but interesting and at the same time challenging too. This blog will take us through my personal experiences as a teacher of programming and will lay more stress on logic development instead of a particular language. Any facts, comments & views regarding my observations, facts or any posts is highly appreciated and will be looking forward towards them..........................