Sunday, November 24, 2013

Artificial Intelligence: Probabilistic Reasoning

Human intelligence is based on constant learning and past experience. We use our prior knowledge and use it in one or the other way to do things. In more or less same manner, we can have machines with intelligence. Machines (no, not those military machines) i.e. computers can be fed intelligence to assist us with various tasks. The branch of Computer Science that deals with the study of machine intelligence is termed as Artificial Intelligence and its roots are dated as early as in the year 1956.

Artificial Intelligence is useful in numerous areas. Over the period of 50 plus years many techniques and tools have been developed to solve a variety of difficult problems. Neural networks, Probabilistic methods for uncertain reasoning, Statistical learning methods and Intelligent search and optimization are some of  the tools/techniques used to solve problems in domains where Artificial Intelligence is useful. Let's understand how Probabilistic methods for uncertain reasoning works. 

Probabilistic Inference
Consider for example, an application where we want to have a system that can help us diagnose a disease for a given patient (This is called as Probabilistic Inference). The end result would certainly be a probability value. The system will more or less acts as a Doctor. Now, what set of inputs does this system take? We might have inputs like different symptoms patient has, results of medical test(s) and possibly patient's habits (e.g drinking, smoking etc). The set of inputs really depend upon the type of diagnostic system we want to develop. The set of  inputs are expressed in terms of probability values. The system being developed goes through 3 phases: Representation, Inference and Learning.

Each of these individual inputs are related to other inputs and they kind of influence one another. The interaction of all these inputs is captured via a graphical model, which is constructed using either a Bayesian network or a Markov network - Representation. Each node in the graphical model corresponds to one of the inputs. So for example, when we have that patient is a chain smoker, the probability that patient exposes a chance of a certain type of cancer goes up - Inference. So, using the information available to us (information fed to the system), we eventually come to a conclusion based on the interaction we have in our graphical model.

But, before we can do inference from the system we have to train the system with some prior data - Learning. This type of data is termed as the training set. This training data helps us understand correlations between inputs . This kind of system helps us deal with uncertainty that lies within these type of applications and gives us results in terms of probabilities. 

Few other examples where these technique is useful are: Robot navigation, Text analysis, Speech recognition (we answer probabilistic-ally about what word it might be) and Gene regulatory networks.  I am working in the same area (called Probabilistic Graphical Model) for my master's project (CS 298).

Saturday, November 16, 2013

Computer Science: Historical Perspective

Today's modern age computers are a result of years of thorough research and innovation. This is not the end. Computers are going to get more powerful and innovative in years to come. It's interesting to know how computers were evolved the way they are today. 

Computers are meant to do computing, taking place of "human computers". The time when computers didn't exist, humans did computations (e.g mathematical) by hand. The first person to envision machines doing computation was Charles Babbage in 1830s. He is often called as "Father of the computers". His simple work for arithmetic machine computing proved to be so important that many more complex machines were designed later on based on his work. This eventually gave birth to computers after 1950s. Charles Babbage's machine was referred to as "Analytical Engine", a very first representation of the modern age computer.

Years later, several advancements were made in various computer parts(around 1950s). Grace Murray Hopper developed a notion of compiler, John Backus developed the first programming language - FORTRAN and Jack kilby & Robert Noyce invented integrated circuit. Computer networks also saw advancement such as ARPAnet, which proved to be a precursor to today's Internet. Other areas such as Operating systems, Theory of databases and Computer architecture also saw an advancement over the span of subsequent twenty years. 


IBM's personal computer


These advancements eventually ended up with an introduction of personal computers which hit the market for the very fist time during 1974 to 1977. Scelbi & Mark-8 Altair, IBM 5100 and RadioShack's TRS-80 were some of the computers launched during this period. Steve Jobs and Steve Wozniak introduced Apple computer in 1976.

The term "PC - Personal Computer" originated when IBM released their first personal computer named "Acron" in 1981 (shown in the picture above) running Microsoft MS-DOS operating system. Following the release of Apple's first computer with GUI, Microsoft responded with the release of Windows operating system. Since then the war has continued and many gradual advancements were made to computers. As a result, today computers are an integral part of every possible engineering, medical and science field. It has brought revolution in each of this field and have made our life much easier and safer.

Saturday, November 9, 2013

File Sharing: The Cloud Way

Internet is constantly changing the way people communicate and collaborate for various purposes. There was a time, I remember when files were shared using E-mails, USB drive, CD drives and even Floppy disks. There were many limitations of using such medias for communication. It was difficult for people in different part of globe to share files using physical media and e-mails only supported file size till 25 MB. Obviously, there were other options too but were more or less inconvenient, peer-to-peer file sharing for example (BitTorrent Protocol).

Today, the way people communicate and collaborate over the internet has completely changed. People cannot only share files using the internet, but can also collaborate to create and edit various types of documents such as word, power point presentations and spreadsheets. There are a numerous number of such file hosting services that runs in the cloud and provides an easy way of sharing files with other users. 

Take Data With You!
Such file sharing systems are based on cloud storage. Cloud storage is a form of distributed computing where a large number of storage and computing devices are inter-connected with high-speed network to provide high speed access to data and data is replicated across the globe. Cloud storage basically offers storing data online instead of users storing it locally on their machine. There are many great advantages such as below.

1. Files are always accessible from a browser from any machine around the globe with an internet connection.
2. Users can browse and upload files from their mobile devices such as phone and tablets. 
3. User files are always backed up at different locations (data centers) around the globe. It's way safe to keep important files in cloud and never lose them.
4. Files can be shared with others instantly with just few clicks.
5. Users can collaborate over the internet to create and edit various types of documents.
6. There is no practical limit on a single file size when stored in cloud.

Some popular file sharing services are Dropbox, Google Drive, Amazon Cloud Drive, Microsoft Sky Drive and Apple iCloud

Friday, November 1, 2013

Data Structures: Hashes

Computers store data in a data structure. Computer scientists write algorithms to access data from a data structure. It's good practice to use relevant data structure based on your need. It's good to have a wide perspective on variety of data structures in order to choose an appropriate data structure for your need. Inappropriate selection of data structure tends to increase data access time, no matter how powerful computer you might have!

Array, Lists, Tree and Hash are some of the basic data structure commonly used. Each of these are suitable for one or the other purpose. Stack, queue and graph can be termed as Abstract data types since underlying implementation can use from any suitable basic data structure. For example, Stack can be based upon an Array or a Linked List. 

Hash: Key - value


Hash becomes handy when it is required to have frequent and quick data access and when data modification/deletion is not so frequent. The idea behind hash is to have [ key : value ] pairs stored in a data structure. Multiple values can be stored for each key in a hash. Let's look at how data is stored and accessed from a hash.

Hash takes two values: 1) input data 2) input value. First, hash function converts "Input data" to a key. The generated key than indicates the location to store corresponding "input value". These locations are often called as "buckets". Multiple "input data" can fall into same buckets and hence one key can have multiple associated values.

For accessing data from a hash, we again provide "input data" to get corresponding "input value" stored in a hash. Given an "input data", hash applies the hash function which returns the key indicating the location where corresponding value was stored. Hash than accesses that bucket location and returns the corresponding stored value. In case when multiple values are stored for a given key, a comparison function has to be used in order to get right "input value" for given "input data".

Hash operations are quite efficient and provides O(1) access time for read/write/delete for best case and O(n) access time for worst case where "n" refers to number of items in a hash.

An example where hash can be used is as below:
Consider an application which wants to retrieve a person's phone number in no time given a name. A hash can be generated for [ name : phone-number ] pairs where name is a key and phone-number is a corresponding value. Now whenever we want to find a person's phone number, we can feed in that person's name to application returning his/her phone-number immediately, if found in O(1) time. This can be useful when say we data for millions of people in our database and we want a quick access to give person's phone-number.

Click here to watch an excellent video on Hash data structure.

Sunday, October 27, 2013

Hacking - Hackers and Crackers

Hack. A bad thing for good guys and a good thing for bad guys. Hacking a computer means gaining unauthorized access to a computer's data. As every coin has two sides, hackers can be seen from two perspectives: Hackers and Crackers. Term "Hacker" is largely misunderstood. It could mean either: Good hacker or bad hacker. Good hackers have no intention to exploit system vulnerability while bad hackers do. However, term Cracker always refers to those trying to exploit system vulnerabilities. 

Hacking into computers have been around for quite a long. In earlier days of computers, there was a little connectivity between computers around the globe. However, hacking computers over a network started as early as in 1987 exploiting vulnerabilities of a network to which computers are attached. Today, almost all devices (Laptops, Desktops, Mobiles or Tablet devices) are somehow connected to Internet and with an advancement in technologies attacks have also been improved. It is very much important that computer systems are properly secured and protects systems from at least known computer attacks.

Hackers (and not Crackers) are those who breaks in to the system for good reasons. These people are also referred to as Computer Security experts. Their aim is to identify vulnerabilities of the computer system. The system could be for example a desktop software, a website or a corporate network. Big corporations are an easy target for Crackers since gaining confidential data/information from such corporations can make their businesses loose millions of dollar. There are various techniques used by Hackers/Computer security experts to find vulnerabilities in computer networks. Some of these methods include: Penetration attacks, Vulnerability assessment, Denial of Service attacks and Social engineering attacks. 

Hackers and Crackers


Crackers (yes, those bad guys) are those who tries to exploit system vulnerabilities in a bad way. Their intentions could be anything: profit, a challenge or revenge. Breaking into a computer is not so easy task, at least today. The advancement in technology prevents breaking easily in to computer systems with known attacks till date. There are numerous number of attacks in computer history. I got a chance to understand some of the famous large scale computer attacks in CS 265 class last Fall. Those attacks were very sophisticated and exploited as many systems as they could in a little amount of time. Some attacks that I have studied includes: Password Cracking (passwords are very vulnerable for gaining computer access), Packet sniffing, Malware,  Computer viruses, Key loggers, Trojan Horse, Denial of Service attacks and Men in the Middle attack.

It can be argued that the war between Hackers (good guys) and Crackers (bad guys) can never end. No matter how computer systems get more secured, Crackers finds another way to attack computer systems. However, this also helps in a good way in which computer experts design solutions to protect systems against these unseen computer attacks. 

Based on my experience and observations, below tips will help stay protected:
1. Do not use one single password across all accounts held.
2. Try not to generate password from your personal details. 
3. Do not click random websites and immediately close such websites where content look malicious.
4. Do not install software from an untrustworthy or suspicious publisher.
5. Check for a valid SSL certificate for popular websites. (e.g Facebook, Gmail, Bank websites)
6. Try not to give personal information on each website registered.
7. Have a complex password for your online bank accounts, since you know why!

Sunday, October 13, 2013

Open Source: Why it's "Free"?

Getting something without paying a dollar - "Free" is awesome. The "Free" label attracts nearly every human being on earth, which is expected behavior.

Computers are everywhere - in engineering field, medical, education, art and communication fields to name a few. What powers computer? It's software. It's Obvious that the real power comes from hardware on top of which software runs, but for end-users it doesn't matter. The real interaction with computer happens through software. 

Building a computer software requires a language and set of other supporting tools and software.  Developers build software and there are hundreds of languages and tools that they can choose from. Now what if those tools and languages required a price to pay for using them to build a software? If that was the case today, computers would have not seen the advancement and innovation that we see today. What could be the reason? It's simple. There will be a smaller audience interested in paying for a software and using it than a larger audience willing to use it for free towards a good cause.

Open Source Software


"2 hands are better than 1". This also applies to computer software. Computer software are prone to errors and requires careful development and testing. The more number of eyes sees the source code and carries out testing, the more stable and reliable it becomes. This is exactly the case with Open Source software. 

Open Source software are licensed under "free license" and can be redistributed and are allowed to be modified/improved. The source code for the Open Source software is available to public for use and/or modification. I believe there are several advantages of making a software Open Source. I list some of them as per my opinion.

1) It improves the original release of source code and helps remove bugs and other problems.

2) People from around the world can make a contribution towards the betterment of software and helps a wider audience to connect with each other. This also promotes networking opportunity with a community for the Open Source software.

3) It provides ample of learning opportunities. Contributing in an Open Source software helps an individual learn new technologies which certainly helps towards their career growth.

4) People can get recognized for their contribution towards Open Source software.

5) It brings innovation and advancement as different minded people with different background and experience works on Open Source software.

Lastly, the most important advantage that I believe is:
Open Source software have at least the same number of functionality as their Proprietary counter part software. Most of the people requiring the use of such software do not need advanced features provided by proprietary software and only needs a number of basic features which Open Source software provides. It doesn't make sense to buy a costly proprietary software for some number of basic features. Also, if users feel the need of using advanced features, based on the experience with Open Source software they can always buy the full-featured software (which can be a closed source software).

The most successful example of keeping a software/platform Open Source is Linux. It is the best example of open source software collaboration. Other such popular platform is Android and is no doubt very popular mobile operating system around the globe.

As software program developer, I would recommend making the best out of Open Source software, both as a user and contributor. Presently, I personally am using language R (statistical analysis) and I am glad I get nearly all features of MATLAB via Open Source package R without paying a dollar (MATLAB full version costs hundred of dollars). List of Open Source software can be found here.

Sunday, October 6, 2013

Introduction to Agile Software Development

There are many software development methods or approaches in existence such as waterfall method, spiral method, incremental approach, rapid application development and iterative methods. This methods work as a framework which controls how the project is developed and maintained. There method lacks in or the other aspect of project development. With Agile software development, projects can be developed with more flexibility and pace as product releases requires faster time-to-market. 

Agile methodology is also a software development methodology/framework. It is an incremental and iterative software development approach. Agile software development is nothing but a different way of developing and maintaining software. As the name suggests, it is very flexible methodology and provides agility in many aspects of project development and maintenance. Some aspects are listed below:
1) It promotes adaptive planning
2) A time bounded iterative approach to development
3) Flexible to project requirements and changes
4) Rapid response to changing project requirement and changes

Agile development should give values or importance to below mentioned four things as referenced here:
1) Individuals and interactions over processes and tools
2) Working software over comprehensive documentations
3) Customer collaboration over contract negotiations
4) Responding to changes over following a plan

This four items, if given values/importance over their counter parts on right, will enable rapid software development.

As mentioned above, Agile software development is a framework or methodology towards software development. Many such agile methodology or framework exists: Extreme Programming (XP), Scrum and Dynamic Systems Development Method. Let us talk briefly about Scrum, which I experienced at my previous company.

Agile Software Development


Scrum is a framework built upon Agile software development principles with a focus on how to manage tasks within a team based development environment. Scrum has three core roles namely Product owner ( individual who works with customers directly and is accountable for delivery of a product ), Development team or team members ( develops the product and ships it after every sprint )  and Scrum master ( Ensure that scrum process is followed and is a facilitator for the team).

Sprint is a part of Scrum development and is time bounded. It could range between one week to one month. (Team at my previous company had two weeks per sprint). Sprint ensures that a part of product is delivered after each period(this facilitates time bounded iterative approach to development as mentioned above). Apart from periodic sprint meetings, daily scrums are held to discuss about what work was carried out the day before and what work is planned to finish the same day. Each team member typically takes a minute or two to report their daily status and may put issues/blockers faced in front of the team. Daily scrums help entire team know the status of others and how the overall project is progressing.

Some advantages of Scrum Agile development are as below:
1) Agility
2) Immediate feedback to each team members during daily scrum & sprint planning meeting
3) Issues & blockers are immediately addressed
4) Helps measure each individual's productivity
5) Time bounded development with flexibility in customer requirements
6) Defects will be identified at the earliest, as product is delivered after each sprint phase

There are various tools available in market to support Scrum framework. They can be found here.