Sunday, December 15, 2013

Scientific Computing - Applications

Computational science deals with the use of computer to construct mathematical models to enable quantitative analysis to solve scientific problems. [1][2]. Computational science is also known as scientific computing.

We will have a look at the applications of computational science [2] [3]

1. Numerical Simulations – Numerical simulation is used in a variety of fields to accurately analyze problems and to find solutions of possible.
a) Engineering Design
b) Virtual Environments
c) Model verification

Examples are – Circuit Analysis, Electromagnetic analysis of packages, structural analysis of automobiles, Drag force analysis of Aircraft, Engine Thermal Analysis, Stock option pricing for hedge funds, Virtual Environment for computer games, Virtual surgery etc.

2. Model fitting and Data analysis [4] – Model fitting is a procedure that has three steps in it –
a) First one needs a function that will accept some data and give predicted results.
b) Next, one needs a function which will give the difference between the resulting data and the predicted data.
c) One needs to find conditions under which the difference between the predicted data and the analyzed data is the least.

Example use – To revise models so that they are better aligned with the observations.


Dynamics of a drum. [5]


3. Computational optimization (Mathematical Optimization) –
“In mathematics, computer science, or management science, mathematical optimization (alternatively, optimization or mathematical programming) is the selection of a best element (with regard to some criteria) from some set of available alternatives.” [2]
Computational Optimization is used in a variety of fields – Fluid dynamics, the Finance world etc.

References –
[1] - National Center for Computational Science, Oak Ridge National Laboratory. Retrieved 11 Nov 2012 Molecular dynamics
[2] - Wikipedia
[3] - White, Jacob, Jaime Peraire, Luca Daniel, Nicholas Hadjiconstantinou, and Anthony Patera. 6.336J Introduction to Numerical Simulation (SMA 5211), Fall 2003. (MIT OpenCourseWare: Massachusetts Institute of Technology),http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-336j-introduction-to-numerical-simulation-sma-5211-fall-2003 (Accessed 14 Dec, 2013). License: Creative Commons BY-NC-SA
[4] – Model Fitting, http://courses.washington.edu/matlab1/ModelFittin http://dspace.mit.edu/bitstream/handle/1721.1/39129/6-728Fall-2002/NR/rdonlyres/Global/7/7FC24744-676E-47D3-B74D-FA6D80BA99DB/0/chp_quantum_physics_wave_1.jpgg.html  (Image courtesy of National Energy Research Scientific Computing Center.)
[5] - Introduction to Scientific Computing, Simon G Shepherd ,http://engineering.dartmouth.edu/courses/10fall/engs020/

Sunday, December 8, 2013

Computer Graphics in Day to Day life

Computer Graphics have come a long way.

Anything and everything that is displayed on the Computer screen falls under the category of Computer Graphics. This includes but is not limited to Operating system interfaces to graphics in computer games. The journey that computer grahics have made is astonishing.


From Operating systems like : 

Old Windows
Old Windows


and games like :

ping pong
A primitive verison of the game Ping Pong when it was released



to Operating Systems like :

Win 7
Windows 7 
and games like :

New Games
Latest generation of games

which show incredible detail and are almost life like with minute details of the real world like textures being accurately displayed.

This has been mainly possible due to new technologies that keep cropping up making the graphics scene a hot one. In fact Computer Graphics is such a huge business that it has complete companies dedicated to it which develop technology to improve graphics. Companies like Nvdia and Intel have been researching and building completely dedicated components called as “Graphics card” which can be plugged into computers or onto systems to improve the performance drastically. These graphics cards have a stand alone CPU (or GPU) which does the various computations required to improve the quality of graphics. The down side of these is the power consumption and consequently the generation of heat.

Another area where Computer Graphics are used is in movies. Whenever there are any scenes in the movie which cannot actually be filmed (Lord of the Rings, Hobbit, Apollo 13, Transformers) or if the movie is to be completely animated (Toy Story, Shrek, Monsters Inc.) or just plain expensive to shoot, computer graphics come to the rescue. Computer graphics or CG as they are known in the movie industry are a major part of movies. It does a magnificent job too. After all who can deny the beauty of an aerial view of the army of soilders marching in to reinforce the good guys in Helms Deep. A complete treat for the eyes!!

Computer Graphics are present all around us, in Ads, in movies, in the games we play.

It plays an important role in our life.

Image references -
1. Windows Old - http://www.theoligarch.com/images/risc_os_30.gif
2. Old Ping pong - http://www.geekologie.com/2008/08/08/obama-pong.jpg

3. Games new -http://www.technobuffalo.com/wp-content/uploads/2012/04/FC3_PVP0412_screenshot_rebel_support_nologo.jpg

Sunday, December 1, 2013

Communications and Security - Past, Present, Future

The need for communication is very ancient. It includes being able to communicate over long distances without being eavesdropped. This is where security for communication comes in.

Julius Caeser  used a unique (for his time) method of encrypting his messages. He used what is today known as the Caeser Cipher.

Caeser cipher is a simple substitution type of encryption method in which the encrypting as well as the decrypting key is the alphabet shifted by a certain number of places(either backwards or forward). So if the key was the English alphabet shifted backwards by 3 places then every 'a' in the original message would be replaced with a 'x'.

Example - Original Message - " How do you do "
 Encrypted message- " ELT AL VLR AL "

The encrypted message will in itself be completely useless even if had been opened by unauthorized people.

The need for security while communicating is still paramount and in recent times even gained more importance. The importance of this can be gauged from the following.

During the Second World War the Germans had the engima machine which they used to communicate with each other. The British had broken this code by 1940 and used this to their advantage. The Germans eventually lost.

Since then encryption for communications has come a long way and can be divided into two major parts
1. Symmetric encryption
2. Asymmetric encryption

We will have a look at both of these briefly -

1. Symmetric encryption - In this type of encryption both the parties use the same key to encrypt and decrypt messages. These keys are decided using the Diffie - Hellman protocol. Example of such type of protocols are AES encryption, DES, Triple DES etc

2. Asymmetric encryption (Public key encryption) - In Asymmetric encryption in general there are two different keys which are used. For example in RSA there are two keys, a public key and a private key. The private key is kept secure by the server which uses this key to encrypt as well as decrypt messages while all other people who wish to communicate with the server need to use the public key to encrypt and decrypt data.


Asymmetric Encryption
Asymmetric encryption


The major difference between the two is that Asymmetric encryption or Public key encryption is costly in terms of computation as compared to symmetric key encryption.

Security in communications is here to stay and will continue to be important. As technology develops and computation power increases it will be easier to break existing protocols and hence there will be a need to come up with new protocol which will be more secure and attuned to the surrounding technology. The race between the good guys and bad guys is on. I'm happy so long as the good guys are one step ahead of the bad guys !!

Sunday, November 24, 2013

Artificial Intelligence: Rapid advancements and applications in the field of AI

"Artificial intelligence (AI) is a technology and a branch of computer science that studies and develops intelligent machines and software. Major AI researchers and textbooks define the field as the study and design of intelligent agents  "[1] 

Artificial Intelligence is a comparatively new field. Research in AI was practically non-existent / scarce in the early 90’s. Since then it has come a long way. Artificial intelligence today is used in all fields including but not limited to - 

1. Cell phones - “Siri” in iPhones, “S voice” in Samsung phones

2. Online advertising – Google and other online search engines as well as other tech bigwigs track all your activity including your online searches carried out on their domains as well as, in case of Google, which tracks your location too.This is done through the Google Maps app which has the permission to fetch your location at any point of time. Facebook, on the other hand, uses your page likes and your normal activity.

All this data is then fed to highly sophisticated AI algorithms which will then come up with suggestions for ads to be served to the user. The revenue from such advertisements forms a major chunk of the money that comes in.

3. Toys and games – The recently introduced “Furby” toy ( See edit ) incorporates AI. The toy is a blank slate with a few basic behaviors coded in. However as time progresses the personality of the toy changes and is shaped by the day to day interactions of the owner with the toy. This is due to the use of AI.
Also in a few games the adversary needs to respond to the actions of the user. This is achieved through the use of AI.

4. Robots – There have been many robots like the robotic dog from Honda, AIBO (Artificial Intelligence Robot) and ASIMO a humanoid robot, also from Honda, which can perform incredibly complex tasks usng Artificial Intelligence.

Here is a demonstration of ASIMO pouring himself a cup of juice.



The movie Terminator envisions a world controlled by “Skynet”, a highly advanced sentient artificial network. Such a network would have its origins in the research being carried out today. Let us hope that AI is developed in a responsible way so that we don’t run into a scenario as is depicted in the movie !!

EDIT - As Matthew Pronge rightly pointed out Furbys have been around since '98.

References –
[1] - Poole, Mackworth & Goebel,1998



Sunday, November 17, 2013

Computer Science – Heroes in the History of Computer Science


“Computer Science is no more about computers than astronomy is about telescopes.” - Edsger Dijkstra

As the quote above suggests, Computer Science is not a narrow field but encompasses a wide variety of topics, including, but not limited to, algorithms, data structures, databases, artificial intelligence, game theory, computer graphics and computer architecture. The ultimate aim of computer science is to study and understand problems and then harnessing this understanding to provide a workable solution.
Let’s take a look at the notable contributors to various fields in Computer Science –

Donald Knuth -
Donald Knuth
Donald Knuth

Donald Knuth’s contribution to Computer Science is humongous and has been recognized with an A.M Turing award, a prestigious award that is only given to people who have made significant and lasting contributions to the field of computer science. He made contributions in the field of analysis of algorithms, LR parsing and many other fields.

John von Neumann –
John von Neumann
John von Neumann
John von Neumann’s contribution to computer science is an architectural scheme which is as shown below. It consists a trio of memory, ALU and a control unit which work together operate on the given input to produce an output.

John von Neumann architecture


Alan Turing – 
Alan Turing
Alan Turing

Alan Turing is largely considered to be the father of computer science. his contributions include the Turing machine which is defined as -

“A Turing machine is a hypothetical device that manipulates symbols on a strip of tape according to a table of rules. Despite its simplicity, a Turing machine can be adapted to simulate the logic of any computer algorithm, and is particularly useful in explaining the functions of a CPU inside a computer” [2] 
His other notable contributions are in the field of cryptography where his work helped build the "Bombe" machine which was instrumental in breaking the enigma cipher.

References and Image References -
[1] - Turing Machine, http://mathworld.wolfram.com/TuringMachine.html
[2] - Wikipedia

Sunday, November 10, 2013

File Sharing


File sharing is defined as the ways and means to provide access to stored Digital content. This stored digital content can either be multi-media or documents.

There are many ways in which File sharing can be achieved. Following are some of the ways in which file sharing is simplified –

1. Detachable / removable devices like thumb drives / CD / DVD /memory cards

2. FTP protocol – (File transfer protocol) It is easy to share content over the same network by simply sharing the folder over the network, however when this is to be done over computers not in the same network, it is not advised to leave the folder open to sharing over the internet. Instead the File Transfer Protocol (FTP)  is used. FTP also enables transfers between different OS. A thing to understand in FTP is that the there is a central server which will provide the data to all other computers.

3. P2P networks (Peer to Peer Networks) – A peer to peer network is somewhat similar to FTP. The difference being that there is no centralized server. Every node in the network can either act as the server or the client depending on whether it is sending data or receiving data. Software such as Bit Torrent and µTorrent use the concept of p2p networks. With the advent of p2p networks sharing digital content became very easy.

However a down side to this was that the piracy of digital content became very simple. Since there is no central source to P2P networks it is very difficult to shutdown these networks.

File Sharing
File Sharing
Other ways in which File sharing is carried out is via software like Dropbox and Google Drive where the files are stored in the Cloud and then synced on to multiple devices including mobile phones.  Google Mail now allows attachments of up to 25 GB (using Google Drive).

Q:  How to decide which method to use for file sharing ?

- When a file needs to be downloaded again and again then it would bet better to have it stored over a central server so that it can be easily accessed. However the downside to this is that the server is the bottle neck. P2P networks can possibly help solve that.
- When a file needs to be transferred on one time basis (or less frequently) and over short distances removable  devices can be used.
- Whenever one needs to sync data across multiple devices options like Dropbox need to be explored.

Edit - After various comments here is my opinion on File sharing.
File sharing has been and always will be essential for team work. I personally use Google Docs to share and collaborate on documents, while I always use Dropbox to store all essential data on my laptop. In addition to having a safe copy of all my data in the Dropbox it also helps me share this data by simply sharing a link to the data on Dropbox (So it sort of works like an FTP). Back in India,I also used p2p networks to legally download a document for the sake of experimenting.
Thank you for reading !

Sunday, November 3, 2013

Data Structures: Building blocks to solve complex problems.

Data Structures are structures that are used to store / organize data and provide a way to operate on data that is contained within them.

Why are Data Structures so important?
- When the code base itself is small and the data on which it operates is small there isn't much of a difference but when it comes down to huge amounts of data the difference between using the right data structure (read best  suited) and a not so suited one can be substantial.

Take the example of a binary tree and a hash set to be used for searching –
Searching for a particular number in a binary tree has an average time complexity of O (log n) while the worst case is O (n).

As opposed to this, a hash set, will have an average case time complexity of O (1) meaning that each element can be accessed in constant time.

As can be seen from the time complexities, the time taken to search for an element will increase with increase in the amount of data with the array. In case of a hash set, this time complexity will not change due to the way a hash set is implemented.
Data Structures can be further sub divided as shown in the diagram - 

Data Structures classification
Data Structures - Primary classification.

Examples of Data Structures include and are not limited to – HashTables, HashMap, Array, LinkedList, ArrayList, Binary Tree, Trie etc.

Different types of data structures are suited to different needs.
  1. Array – When random access of elements is of essence.
  2. LinkedList – When growth of the memory space with minimum complexity for addition at the beginning or the end is required.
  3. HashTable – When constant search time is required.
  4. Priority Queues – Scheduling
  5. Heaps – For dynamic memory allocations
  6. Graph – Essential to store connected data, like with Social Networks.
As discussed earlier the use of the correct data structure can help a system scale without large changes in the implementation.


Image Courtesy -Unknown. 11/3/13, http://embeddedcareers-world.blogspot.com/
Read more: http://geeksgrave.blogspot.com/2013/05/auto-alt-tags-for-blogger.html#ixzz2eBblAAKc