Saturday, August 22, 2009
Complexity In Simplicity Of Real World... A Programmer's View
Real world is so simple and yet so complex. We experience it daily without even realizing the complexity in realizing a world as simple as the one we live in. I was born and brought up in Hindu family, one thing we have been taught from beginning is that there is more to the world than what we see and live. Add to this the years of computer programming I've been doing (hmm... close to 19 yrs now since i touched the keyboard the first time), and you'll get a complicated mix of oriental and western thinking. Or is it simple but complex ! Like the Fractal curves, so amazing & may be perceived as complex (to the uninitiated) but yet so simple in its underlying principles.
Note: What you read below is just a record of my random thoughts. It'll be foolish to assume that these are my claims on how things work.... because frankly, I do not think there is an easy answer (or for that matter an single / absolute answer) to any of real world problems.
The UI + Model View - Look Beyond What You See.
In programming world, what the end user clicks, keys-in or views; are just the representation layer ,popularly known as the UI layer in the programming world. If you were to separate out the UI layer from an application, you'll see things but your clicks (or key inputs) will no longer bring the same results. Does this remind you of a dead body ? What you see may qualify the body to be of certain species, but no matter what you do (pinch, kick, talk ...) it wont react. The UI layer is important from the end user's interaction perspective, but its not sufficient by itself. There are different application architectures, but lets say we simplify them to a UI + Model architecture (in real implementation you'll need other modules like controller, and service manager). The Model is what your computer's processor works against. The Model drives the different stages & life cycle of the application. In sort, the Model "makes it happen for you". Ideally, a Model should be self-sufficient, it has all the necessary tools & knowledge to achieve its purpose. Also, the Model exposes certain channels ( APIs / methods and properties as we call them) for external clients (like the UI manager) to invoke different behaviors. These invocations usually results in change in the state of the Model which UI manger is made aware of & eventually results in change in UI. In a computer application, once you tie together a UI with a Model, the application comes to life ! It'll start responding to different inputs from end users.
Did God Create All The Species In This World ?
It is simple (and easy) to think that God is the creator of everything ... then what about evolution ? Does God let species evolve within certain set of rules and guidelines or He always intervenes & decide which new species should arrive & which ones should be gone ? Did God create only the first snap of the world with life sustaining infrastructure and few billions of amoeba & laid out the rules for cell combination, energy conservation etc.. etc... from there own the species were on their own ! Lets keep aside these question & take up a computer programming problem. The problem is similar to God's task of creating a universe, for simplicity sake lets say creation of Earth to start with. So, the problem is to write a program that simulates Earth (starting some point in time) & provide mechanisms for life to sustain, grow and evolve. Isn't this a daunting task ! God had a totally different level of challenge (Space, Time, Genes etc.) Luckily we have to do it in the virtual world of computers :). The world of Artificial Intelligence has progressed a lot [ofcourse no way close to what Nature can do ! ... but we humans made some humble progress :) ] & such simulation programs is not far fetched to be true. Here are few options:
Note: What you read below is just a record of my random thoughts. It'll be foolish to assume that these are my claims on how things work.... because frankly, I do not think there is an easy answer (or for that matter an single / absolute answer) to any of real world problems.
The UI + Model View - Look Beyond What You See.
In programming world, what the end user clicks, keys-in or views; are just the representation layer ,popularly known as the UI layer in the programming world. If you were to separate out the UI layer from an application, you'll see things but your clicks (or key inputs) will no longer bring the same results. Does this remind you of a dead body ? What you see may qualify the body to be of certain species, but no matter what you do (pinch, kick, talk ...) it wont react. The UI layer is important from the end user's interaction perspective, but its not sufficient by itself. There are different application architectures, but lets say we simplify them to a UI + Model architecture (in real implementation you'll need other modules like controller, and service manager). The Model is what your computer's processor works against. The Model drives the different stages & life cycle of the application. In sort, the Model "makes it happen for you". Ideally, a Model should be self-sufficient, it has all the necessary tools & knowledge to achieve its purpose. Also, the Model exposes certain channels ( APIs / methods and properties as we call them) for external clients (like the UI manager) to invoke different behaviors. These invocations usually results in change in the state of the Model which UI manger is made aware of & eventually results in change in UI. In a computer application, once you tie together a UI with a Model, the application comes to life ! It'll start responding to different inputs from end users.
Did God Create All The Species In This World ?
It is simple (and easy) to think that God is the creator of everything ... then what about evolution ? Does God let species evolve within certain set of rules and guidelines or He always intervenes & decide which new species should arrive & which ones should be gone ? Did God create only the first snap of the world with life sustaining infrastructure and few billions of amoeba & laid out the rules for cell combination, energy conservation etc.. etc... from there own the species were on their own ! Lets keep aside these question & take up a computer programming problem. The problem is similar to God's task of creating a universe, for simplicity sake lets say creation of Earth to start with. So, the problem is to write a program that simulates Earth (starting some point in time) & provide mechanisms for life to sustain, grow and evolve. Isn't this a daunting task ! God had a totally different level of challenge (Space, Time, Genes etc.) Luckily we have to do it in the virtual world of computers :). The world of Artificial Intelligence has progressed a lot [ofcourse no way close to what Nature can do ! ... but we humans made some humble progress :) ] & such simulation programs is not far fetched to be true. Here are few options:
- Mix of AI and Object Oriented Programming - Have a Entity definition model, evolution model (rules against how Entities can Create new Entities, Inheritance rules), Life/Survival rules. Attach a learning mechanism to each Entity (Genetic Algorithms !) ... that should be a good place to start with. Sounds difficult ? For the ones initiated in AI & OOPS, its not impossible. Ever played the game of Age of Empires :), assume the program we are talking about is similar, only that it runs autonomously without any players.
- Mathematical Models - An interesting model is of Conway's Game Of Life on Cellular Automation. You start with a initial state & the program takes on there ... you'll see cells combining, dying of hunger, splitting etc... all based on simple set of 4 rules !!!
Subscribe to Posts [Atom]
Post a Comment