Friday, 18 October 2013

Advent of Intelligent Machines !


We all have watched the movie Terminator. It revolves around intelligent machines from the future called Terminators, who are sent to eliminate Sarah (and John) Connor so that they couldn't save mankind from the impending doom(Judgement Day).

As you are reading this, I may assume that you have wondered if such machines are possible in reality. 

Yes, they are ! Not now, but sometime sure in the future !

Now, you may wonder how intelligent today's machines are. Frankly speaking their intelligence is not even close to the intelligence level of the stupidiest person on the earth

So, what characteristics should be present in an ideal "intelligent" machine ?

Analysing the premise of the question in terms of how we humans think, perceive and understand; we can safely point out four "has-to-be" properties that can make a machine intelligent. These four properties were laid out by the celebrated Computer-Science pioneer, Alan Turing, some 63 years ago, and is called the Turing test.

  • Processing Languages: The machine should be able to communicate in the complex natural languages that humans have developed. At least a human should be able to communicate freely with the machine in a language that he/she speaks.
  • Knowledge Retention: The machine should be able to store the information that it receives either by visual perception(through a camera) or by hearing (by an audio-detecting device).
  • Response: The machine should be able to give an automated response to different situations in a rational manner. It must also include reflex actions which require no/minimal thinking.
  •  Adaptation: The machine should be able to adapt to new situations that it is exposed to and must reach conclusions, that would have been reached by any other sane-human on being subjected to same situation. Also, it must solve problems on the basis of given facts and should have the ability to decide whether a particular problem is solvable or not.
Again, lots of research is going on reaching this feats. For ex: Neural networks that try to mimic human-brain, have become an interest area for many.

Also, you may ask whether an "intelligent" machine should behave exactly like a human or take a rational approach. Or whether it should have the ability to feel boredom like many intelligent animal do ?

Majority of people involved with Artificial-Intelligence (AI) believe that a rational approach rather than a human-like approach, is more feasible and acceptable. Reasons are again clear for that: much less knowledge is available about human thinking, which has been developed by still largely unknown evolution.

So, you can say that AI is quite exciting. It is still a baby-science and lot has to be done in it. 

But, its certain that intelligent machines (which may even surpass humans) will walk on this earth.

Will a John Connor be needed ? Or humans will reach even greater feats with machines that can think ?

Who knows ?

Only future will tell.
      



Wednesday, 25 September 2013

Factoring: number of ways to factorize a number.

It happens that you learn a new thing or two everyday. Today, I learned how to find the number of ways to factorize a number where order of divisors is not important (4 X 2 is same as 2 X 4).

Let's think about a the problem :

Suppose your number is n. Also, n can be factorized as n = a x b. So, the number of ways to factorize n will be equal to 1 + no. of ways to factorize b !

So, we need a recursive approach. Here's a code in C++ for doing such that:




//This code finds the no. of ways to factorise a number.
//It is based on a recursve code.
//Order is not important i.e; 2 X 4 is same as 4 X 2.
#include <cstdio>
#include <iostream>
using namespace std;

int countWays(int n,int factor)
{
   int i;
   int count=0; //This variable will contain the number of ways
  for(i=factor;i*i<=n;i++)
    if(n%i==0)
     count += countWays(n/i,i) + 1;
 return count;    
}  
int main()
{
    int n,t;
 scanf("%d",&t); //Test cases.
 while(t--)
 {
  scanf("%d",&n);
  printf("%d\n",countWays(n,2));
 }
 return 0;
}

Try to understand it ..its very simple !

Monday, 29 July 2013

Computer Science: A Beginning

So, here you are !
You are reading this either because you are a Computer Science student or want to be one.
Great...so, here I go.

First about computers. Computers make our job easier.
But, how ?

You will explore only this question in the fantastic realm of Computer Science !

But, becoming a good Computer scientist requires immense efforts. Also, you have to become good in the following things.

First and foremost,  you have to develop a sequential thinking pattern (Computers are sequential machines, they execute in discrete steps. They are not like you :- you have a brain which acts as a parallel machine).

Second, you have to get a good grip on a particular computer language which will be your tool for instructing computers what to do.

Third, you have to learn programming and know how some real world problems are solved on computers. The area is vast, but you still have to know some of the basic ideas.

Fourth, practice.... lots and lots of practice. Browse problems, read articles, discuss with your friends and most importantly, remain excited about computers !

Only this much for now. I will expand it if I feel the need to. Till then , good luck !