My Dominant Hemisphere

The Official Weblog of 'The Basilic Insula'

Archive for the ‘Science’ Category

Meeting Ghosts In The Chase For Reality

leave a comment »


Sunrise (via faxpilot @ Flickr CC BY-NC-ND license)

Watching the morning sun beaming through the clouds during today’s morning jog, I was struck by an epiphany. What ultimately transpired was a streak of thoughts, that left me in a overwhelming sense of awe and humility for its profound implications.

Perhaps the rejuvenating air, the moist earth from the previous night’s rains and the scent of the fresh Golden Flamboyant trees lining my path made the sun’s splendor much more obvious to see. Like in a photograph coming to life, when objects elsewhere in the scene enhance the main subject’s impact.

As I gazed in its direction wondering about the sunspots that neither I nor anyone else around me could see (but that I knew were really there, from reading the work of astronomers), I began thinking about my own positional coordinates. So this was the East, I found. But how did I know that? Well as you might have guessed, from the age old phrase: “the sun rises in the East and sets in the West”. Known in Urdu as “سورج مشرق میں نکلتا ہے اور مغرب میں ڈوبتا ہے ” or in Hindi, “सूरज पूरव में निकलता है और पश्चिम में डूबता है” and indeed to be found in many other languages, we observe that man has come to form an interesting model to wrap his mind around this majestic phenomenon. Indeed, many religious scriptures and books of wisdom, from ancient history to the very present, find use of this phrase in their deep moral teachings.

But we’ve come to think that we know this model is not really “correct”, is it? We’ve come to develop this thinking with the benefit of hindsight (a relative term, given Einstein’s famous theory, by the way. One man’s hindsight could actually be another man’s foresight!). We’ve ventured beyond our usual abode and looked at our planet from a different vantage point – that of Space. From the Moon and satellites. The sun doesn’t actually rise or set. That experience occurs because of our peculiar vantage point – of relatively slow or immobile creatures grounded here on Earth. One could say that it is an interesting illusion. Indeed, you could sit on a plane and with the appropriate speed, chase that sliver of sunlight as the Sol (as it’s lovingly called by scientists) appears or disappears in the horizon, never letting it vanish from view and do so essentially indefinitely.

Notes In The Margin About Language

Coming back, for a moment, to this amusing English phrase that helped me gauge my position, I thought about how language itself can shape one’s thinking. A subject matter upon which I’ve reflected before. There really comes a point when our models of the world and the universe get locked within the phraseology of a language that can actually reach the limits of its power of expression fairly unexpectedly. Speak in English and your view is different from somebody who can speak in Math. Even within Math, the coming about of algebra expanded the language’s power of expression incredibly from its meager beginnings. New models get incorporated into the lexicon of a language and because we tend to feed off of such phrases to make sense of ourselves and our universe, there is the potential for an inertia to develop, whereby it becomes easy to stay put with our abstractions of reality and not move on to radically new ones – models that are beyond the power of expression of a language and that haven’t yet been captured in its lexicon. In a way we find that models influence languages and languages themselves influence models and ultimately there is this interesting potential for a peculiar steady state to be reached – which may or may not be such a good thing.

So when it comes to this phenomenon, we’ve moved from one model to another. We began with “primitive” maxims. Perhaps during a time when people used to think of the Earth as flat and stars as pin-point objects too. And then progressed to geocentrism and then heliocentrism, both of which were basically formulated by careful and detailed observations of the sky using telescopes, long before the luxury of satellites and space travel came into being. And now that we see the Earth from this improved vantage point – of Space – our model for understanding reality has been refined. And actually, really shifted in profound ways.

So what does this all mean? It looks like reality is one thing, that exists out there. And we as humans make sense of reality through abstractions or models. How accurate we are with our abstractions really depends on how much information we’ve been able to gather. New information (through ever more detailed experiments or observations and indeed as Godel and Poincare showed, sometimes by mere pontification), drives us to alter our existing models. Sometimes in radically different ways (a classic example is our model of matter: one minute particle, one minute wave). There is this continuous flux about how we make sense of the cosmos, and it will likely go on this way until the day mankind has been fully informed – which may never really happen if pondered upon objectively. There have been moments in the past where man has thought that this precipice had been finally reached, that he was at last fully informed, only to realize with utter embarrassment that this was not the case. Can man ever know, by himself, that he has finally reached such a point? Especially, given that this is like a student judging his performance at an exam without the benefit of an independent evaluator? The truth is that we may never know. Whether we think we will ever reach such a precipice really does depend on a leap of faith. And scientists and explorers who would like to make progress, depend on this faith – that either such a precipice will one day be reached or at least that their next observation or experiment will increase them in information on the path to such a glorious point. When at last, a gestalt vision of all of reality can be attained. It’s hard to stay motivated otherwise, you see. And you thought you heard that faith had nothing to do with science or vice versa!

It is indeed quite remarkable the extent to which we get stuck in this or that model and keep fooling ourselves about reality. No sooner do we realize that we’ve been had and move on from our old abstraction to a new one and one what we think is much better, are we struck with another blow. This actually reminds me of a favorite quote by a stalwart of modern Medicine:

And not only are the reactions themselves variable, but we, the doctors, are so fallible, ever beset with the common and fatal facility of reaching conclusions from superficial observations, and constantly misled by the ease with which our minds fall into the rut of one or two experiences.

William Osler in Counsels and Ideals

The World According To Anaximander

The World According To Anaximander (c. 610-546 BCE)

The phenomenon is really quite pervasive. The early cartographers who divided the world into various regions thought funny stuff by today’s standards. But you’ve got to understand that that’s how our forefathers modeled reality! And whether you like it or not someday many generations after our time, we will be looked upon with similar eyes.

Watching two interesting Royal Society lectures by Paul Nurse (The Great Ideas of Biology) and Eric Lander (Beyond The Human Genome Project: Medicine In The 21st Century) the other day, this thought kept coming back to me. Speaking about the advent of Genomic Medicine, Eric Lander (who trained as a mathematician, by the way) talked about the discovery of the EGFR gene and the realization that its mutations strongly increase the risk for a type of lung cancer called Adenocarcinoma. He mentioned how clinical trials of the drug Iressa – a drug whose mechanism of action scientists weren’t sure of yet but was nevertheless proposed as a viable option for lung adenocarcinomas – failed to show statistically significant differences from standard therapy. Well, that was because the trial’s subjects were members of the broad population of all lung adenocarcinoma cases. Many doctors realizing the lack of conclusive evidence of a greater benefit, felt no reason to choose Iressa over standard therapy and drastically shift their practice. Which is what Evidence-Based-Medical practice would have led them to do, really. But soon after the discovery of the EGFR gene, scientists decided to do a subgroup analysis using patients with EGFR mutations, and it was rapidly learned that Iressa did have a statistically significant effect in decreasing tumor progression and improving survival in this particular subgroup. A significant section of patients could now have hope for cure! And doctors suddenly began to prescribe Iressa as the therapy of choice for them.

As I was thinking about what Lander had said, I remembered that Probability Theory as a science, which forms the bedrock of such things as clinical trials and indeed many other scientific studies, had not even developed until the Middle Ages. At least, so far as we know. And modern probability theory really began much later, in the early 1900s.

Front page of "Doctrine of Chance – a method for calculating the probabilities of events in plays" by Abraham de Moivre, London, 1718

Abraham de Moivre's "Doctrine of Chances" published in 1718, was the first textbook on Probability Theory

You begin to realize what a quantum leap this was in our history. We now think of patterns and randomness very differently from ancient times. Which is pretty significant, given that for some reason our minds are drawn to looking for patterns even where there might not be any. Over the years, we’ve developed the understanding that clusters (patterns) of events or cases could occur in a random system just as in a non-random one. Indeed, such clusters (patterns) would be a fundamental defining characteristic of a random process. Absence of clusters would indicate that a process wasn’t truly random. Whether such clusters (patterns) would fit with a random process as opposed to a non-random one would depend on whether or not we find an even greater pattern of how these clusters are distributed. A cluster of cases (such as an epidemic of cholera) would be considered non-random if by hypothesis testing we found that the probability of such a cluster coming about by random chance was so small as to be negligible. And even when thinking about randomness, we’ve learned to ask ourselves if a random process could be pseudo-random as opposed to truly random – which can sometimes be a difficult thing to establish. So unlike our forefathers, we don’t immediately jump to conclusions about what look to our eyes as patterns. It’s all quite marvelous to think about, really. What’s even more fascinating, is that Probability Theory is in a state of flux and continues to evolve to this day, as mathematicians gather new information. So what does this mean for the validity of our models that depend on Probability Theory? If a model could be thought of as a chain, it is obvious that such a model would be as strong as the links with which it is made! So we find that statisticians keep finding errors in how old epidemiologic studies were conducted and interpreted. And the science of Epidemiology itself improves as Probability Theory is continuously polished. This goes to show the fact that the validity of our abstractions keeps shifting as the foundations upon which they are based themselves continue to transform. A truly intriguing idea when one thinks about it.

Some other examples of the shifting of abstractions with the gathering of new information come to mind.

Image from Andreas Vesalius's De humani corporis fabrica (1543), page 190.

An image from Vesalius's "De Humani Corporis Fabrica" (1543)

Like early cartographers, anatomists never really understood human anatomy very well back in the days of cutting open animals and extrapolating their findings to humans. There were these weird ideas that diseases were caused by a disturbance in the four humors. And then Vesalius came along and by stressing on the importance of dissecting cadavers, revolutionized how anatomy came to be understood and taught. But even then, our models for the human body were until recently plagued by ideas such as the concept that the seat of the soul lay in the pineal gland and some of the other stuff now popularly characterized as folk-medicine. In our models for disease causation, we’ve progressed over the years from looking at pure environmental factors to pure DNA factors and now to a multifactorial model that stresses on the idea that many diseases are caused by a mix of the two.

The Monty Hall paradox, about which I’ve written before is another good example. You’re presented with new information midway in the game and you use this new information to re-adjust the old model of reality that you had in your mind. The use of decision trees in genetic counseling, is yet another example. Given new information about a patient’s relatives and their genotype, your model for what is real and its accuracy improves. You become better at diagnosis with each bit of new information.

The phenomenon can often be found in how people understand Scripture too. Mathematician, Gary Miller has an interesting article that describes how some scholars examining the word Iram have gradually transformed their thinking based on new information gathered by archeological excavations.

So we see how abstractions play a fundamental role in our perceptions of reality.

One other peculiar thing to note is that sometimes, as we try to re-shape our abstractions to better congrue with any new information we get, there is the tendency to stick with the old as much as possible. A nick here or a nudge there is acceptable but at its heart we are usually loath to discard our old model entirely. There is a potential danger in this. Because it could be that we inherit flaws from our old model without even realizing it, thus constraining the new one in ways yet to be understood. Especially when we are unaware of what these flaws could be. A good example of abstractions feeding off of each other are the space-time fabric of relativity theory and the jitteriness of quantum mechanics. In our quest for a new model – a unified theory or abstraction – we are trying to mash these two abstractions together in curious ways, such that a serene space-time fabric exists when zoomed out, but when zoomed in we should expect to see it behave erratically with jitters all over the place. Our manner of dealing with such inertia when it comes to building new abstractions is basically to see if these mash-ups agree with experiments or observations much better than our old models. Which is an interesting way to go about doing things and could be something to think about.

Making Sense Of Reality Through The Looking Glass

Making Sense Of Reality Through The Looking Glass (via Jose @ Flickr, CC BY-SA-NC license)

Listening to Paul Nurse’s lecture I also learned how Mendel chose Pea plants for his studies on inheritance rather than other complicated vegetation because of the simplicity and clarity with which one could distinguish their phenotypes, making the experiment much easier to carry out. Depending on how one crossed them, one could trace the inheritance of traits – of color of fruit, height of plant, etc. very quickly and very accurately. It actually reminded me of something I learned a long time ago about the various kinds of data in statistics. That these data could be categorized into various types based on the amount of information they contain. The highest amount of information is seen in Ratio data. The lowest is seen in Nominal data. The implication of this is that the more your experiment or scientific study uses Ratio data rather than Nominal data, the more accurate will your inferences about reality be. The more information you throw out, the weaker will your model be. So we see that there is quite an important caveat when we build abstractions based on keeping it simple and stripping away intricacy. When we are stuck with having to use an ape thumb with a fine instrument. It’s primitive, but it often gets us ahead in understanding reality much faster. The cost we pay though, is that our abstraction congrues better with a simpler and more artificial version of the reality that we seek to understand. And reality usually is quite complex. So when we limit ourselves to examining a bunch of variables in say for example the clinical trial of a drug, and find that it has a treatment benefit, we can be a lot more certain that this would be the case in the real world too provided that we prescribe the drug to as similar a patient pool as in our experiment. Which rarely happens as you might have guessed! And that’s why you find so many cases of treatment failure and unpredictable disease outcomes. How the validity of an abstraction is influenced by the KISS principle is something to think about. Epidemiologists get sleepless nights when pondering over it sometimes. And a lot of time is spent in trying to eliminate selection bias (i.e. when errors of inference creep in because the pool of patients in the study doesn’t match to an acceptable degree, the kinds of patients doctors would interact with out in the real world). The goal is to make an abstraction agree with as much of reality as possible, but in doing so not to make it so far removed from the KISS principle that carrying out the experiment would be impractical or impossible. It’s such a delicate and fuzzy balance!

So again and again we find that abstractions define our experiences. Some people get so immersed and attached with their models of reality that they make them their lifeblood, refusing to move on. And some people actually wonder if life as we know it, is itself an abstraction :-D! I was struck by this when I came upon the idea of the Holographic principle in physics – that in reality we and our universe are bound by an enveloping surface and that our real existence is on this plane. That what we see, touch or smell in our common experience is simply a projection of what is actually happening on that surface. That these everyday experiences are essentially holograms :-D! Talk about getting wild, eh :-D?!

The thought that I ultimately came with at the end of my jog was that of maintaining humility in knowledge. For those of us in science, we find that it is very common for arrogance to creep in. When the fact is that there is so much about reality that we don’t know anything about and that our abstractions may never agree with it to full accuracy, ever! When pondered upon deeply this is a very profound and humbling thing to realize.

Even the arrogance in Newton melted away for a moment when he proclaimed:


Isaac Newton in a letter to rival Robert Hooke

Here’s to Isaac Newton for that spark of humility, even if it was rather fleeting :-). I’m guessing there must have been times when he might have had stray thoughts of cursing at himself for having said that :-)! Oh well, that’s how they all are …

Copyright Firas MR. All Rights Reserved.

“A mote of dust, suspended in a sunbeam.”

Search Blog For Tags: , , , , , ,


Written by Firas MR

November 16, 2010 at 12:18 am

Seeking Profundity In The Mundane

leave a comment »

seeking a new vision


The astronomer, Carl Sagan once said:


— in the Pale Blue Dot









Marcel Proust











— (CC BY license)






Copyright Firas MR. All Rights Reserved.

“A mote of dust, suspended in a sunbeam.”

Search Blog For Tags: , , , ,

Written by Firas MR

November 13, 2010 at 10:48 am

Contrasts In Nerdity & What We Gain By Interdisciplinary Thinking

leave a comment »

scientific fields and purity












Richard Feynman speaking with Horizon, BBC (1981)




an interdisciplinary web of a universe




Copyright Firas MR. All Rights Reserved.

“A mote of dust, suspended in a sunbeam.”

Search Blog For Tags: , , , , ,


Written by Firas MR

November 12, 2010 at 12:00 am

Revitalizing Science Education

with one comment



Brian Greene, in The Fabric of The Cosmos






Is There A Doctor In The House?





and divides science professionals into,











  4. Doesn’t the language we use influence how we think?



    Srinivasa Ramanujan

    Srinivasa Ramanujan








Copyright Firas MR. All Rights Reserved.

“A mote of dust, suspended in a sunbeam.”

Search Blog For Tags: , , , ,

Written by Firas MR

November 6, 2010 at 5:21 am

Let’s Face It, We Are Numskulls At Math!

with one comment

Noted mathematician, Timothy Gowers, talks about the importance of math






How the human mind struggles with math!




Copyright © Firas MR. All rights reserved.

# Footnotes:

  1. ذرا غور فرمائیے اپنے انسان ہونے کی حیثیت پر
  2. Decision Tree Questions In Genetics And The USMLE
  3. The Story Of Sine
  4. On The Impact Of Thinking Visually
  5. A Brief Tour Of The Field Of Bioinformatics
  6. Know Thy Numbers!

, , , , ,

ذرا غور فرمائیے اپنے انسان ہونے کی حیثیت پر

with 2 comments

واقعی کتنا چھوٹا ہے انسان

(ایک ضروری بات: اس مضمون کو سہی روپ میں دیکھنے کے لئے آپ ناظرین کو یہ font ڈاونلوڈ کرکے اپنے سسٹم پر ڈالنا ہوگا . یہ ایسی font ہے جو خاص کمپیوٹر سکرین پر باآسانی پڑھنے کے لئے بنائی گئی ہے .)

آداب دوستو ،

پچھلے کچھ لمحوں میں میرے ذہن میں ایک بات آئی . ہم انسان ‘ اشرف المخلوقات ‘ کے نام سے اپنے آپ کے بارے میں سوچتے ہیں ، اور یقیناً مذہبی طور پر بھی ہم کو یہی سکھایا جاتا ہے . اکثر اس بات کو لے کر ہم کافی مغرور بھی ہو جاتے ہیں . بھول جاتے ہیں کہ ، یے خطاب ہم پر یوں ہی نہیں نوازا گیا . کیا ہم اسکے واقعی حقدار ہیں ؟

سچ پوچھیں تو ہم اسکے حقدار تبھی کہلایںگے جب ہماری فکر اور ہمارے اعمال میں واضح طور پر اسکا ثبوت ہو . لیکن مجھے لگتا ہے کہ ہم میں سے اکثریت کا یہ حال ہے کہ نا تو ہم کو اس کا احساس ہوتا ہے اور نا اس بات کو لے کر دلچسپی . ہم اپنی روز مرّہ زندگیوں کو جینے میں اتنے گم و مبتلا ہیں کہ ‘ اشرف المخلوقات ‘ کا کردار نبھانا بھول جاتے ہیں . اور ایسی چیزوں پر توجہ دینا بھول جاتے ہیں جن پر وقت لگا کر ہم یے کردار نبھانے کی کم از کم کوشش تو کر سکتے ہیں .

کل میں نے جول سارٹور نام کے مشہور فوٹوگرافر کی تقریر دیکھی . اس میں وہ یے بیان کر رہے تھے کہ ہماری یے قدرتی ماحول کو تباہ کرنے کی رفتار کی تیزی ، ہماری اس رفتار کی تیزی سے کئی گنا بڑھ کر ہے جس سے ہم جیتے جاگتے جانور ، پیڑ – پودوں کے نئے اقسام کے بارے میں معلومات حاصل کرتے ہیں . آخر کتنی حیرت انگیز بات ہے یے . نا جانے کتنے ایسے قدرتی چیزوں کو دیکھے بغیر اور ان کے بارے میں غور کئے بغیر انسان یوں ہی آخر تک جیتا جا ے گا . وہ یے بھی بتا رہے تھے کہ اگلے دس سال میں دنیا کے تمام جل تھلیوں کے اقسام میں ، پچاس فیصد کا ناپیدا و غیب ہونے کا امکان ہے . یہ کوئی معمولی بات نہیں ہے !

طبّی دنیا میں بھی ہم نے حال ہی میں genetic codes کو سمجھنا شروع کیا ہے . اور ہماری بیماریوں کو لے کر جانکاری میں نئی طرح کی سوچ پیدا اب ہی ہو رہی ہے . نا جانے آگے اور کیا ترقی ہوگی  اور نئی باتوں کا پتا چلے گا .

ہم حیاتی دنیا کے بارے میں کتنا کم جانتے ہیں ، کیا ہم کو اس بات کا احساس ہے ؟

مشہور فوٹوگرافر جول سارٹور کی قدرتی ماحول کے بچاؤ پر لاجواب تقریر .

نامور فوٹوگرافر ، Yann Arthus-Bertrand کی یہ شاندار فلم ہم کو سمجھاتی ہے کہ ہم کیا داؤ پر لگا رہے ہیں . پوری فلم یہاں دیکھئے .

فزکس کی دنیا بھی ہم کو ہمارے ماحول کے بارے میں سکھاتی ہے . کبھی غور کیجئے ، چاہے واقعہ کیسا بھی ہو یا چیز کیسی بھی ہو ، وہ ایک probability wave کے ڈھنگ میں سوچا یا سوچی جا سکتی ہے . بہت ہی انوکھی بات ہے یے . کیونکہ انسان کا دماغ ایسا نہیں چلتا . وہ اس بات کو ماننے سے انکار کرتا ہے کہ بھلا کوئی چیز ایک ہی پل میں ، ایک سے زائد مقام پر بھی پائی جا سکتی ہے . لیکن یے علمی تجربوں سے ممکن پایا گیا ہے (جیسا کہ Wheeler’s Experiment) اور دانشوروں میں اس بات کو لے کر اب بھی بحث ہوتے رہتی ہے . اور ہان ، علمی تجربوں سے یے بھی ثابت ہوا ہے کہ دو علیحدہ چیزیں ، چاہے ان کے بیچ میں کتنا بھی فاصلہ ہو ، کبھی کبھی ان میں ایک قسم کا رابطہ ہوتا ہے ، جس کو quantum entanglement کہتے ہیں . ذہن ماننے کو انکار کرتا ہے ، لیکن ہاں یہ سچ ہے . اور بھی ایسی کئی دلچسپ باتیں ہیں جیسے multiple-space-dimensions , time dilation, wormholes وغیرہ . اور تو اور ، ان چیزوں کا جائزہ ہم گھر بیٹھے ہی لے سکتے ہیں . کبھی اندھیری رات کو ، اپنی نظریں آسمان کے ستاروں کی طرف دوڑ ایں اور غور کریں کہ ان کی روشنی کو ہماری آنکھوں تک پہنچنے میں کتنا وقت لگا ہوگا . کیا وہ جو ستارے آپ کو نظر آ رہے ہیں ، اتنی مدّت میں وہیں کے وہیں ہیں یا پھر چل بسے ہیں ؟ نظر دوڑانا شاید آپ کو مشکل کام لگتا ہوگا . لیکن Orion Nebula جیسی دور کی چیزیں تو آپ کے سامنے ہی ہیں ! ذرا دیکھئے تو !

ہم طبیعی کائنات کے بارے میں کتنا کم جانتے ہیں ، کیا ہم کو اس بات کا احساس ہے ؟

The Elegant Universe - PBS NOVA

PBS NOVA سے جاری کی گئی فزکس پر بہترین فلم

حساب کی دنیا میں ہم کو حال ہی میں پتا چلا ہے کہ infinity کے بھی اقسام ہوتے ہیں . بلکہ infinity کے infinite اقسام ہیں ! ایک infinity دوسری infinity سے بڑھی یا چوٹی ہو سکتی ہے . غور کر یے دو circles A & B پر . ایک بڑھا ہے ، تو دوسرا چھوٹا . یعنی کہ ایک کا circumference دوسرے سے بڑھا ہے . لیکن کیا یہ سچ نہیں کہ ہر circumference کے اندر infinite sides ہوتے ہیں ؟ تو بڑھے circle میں جو infinite sides ہیں وہ چھوٹے circle کے infinite sides سے زیادہ ہوئے ؛ ہے نا ؟ کتنی دلچسپ بات ہے . اور ایسی نا جانے کئی ایسی چیزیں ہیں جن کا اندازہ ہم کو آج بھی نہیں ہے .

ہم حساب کے بارے میں کتنا کم جانتے ہیں ، کیا ہم کو اس بات کا احساس ہے ؟

The Story of Maths - BBC

BBC کی شاندار فلم ، The Story of Maths

Marcus du Sautoy بتاتے ہیں symmetry کی اہمیت

پرسوں میں نے ایک اور تقریر دیکھی جس میں خطیب نے یے نقطہ اٹھایا کہ ہر دو ہفتے ، ایک ایسے انسان کی موت ہوتی ہے جو اپنے ساتھ ساتھ اپنی زبان اور ادبیات لے کر اس دنیا سے چل بستا ہے . وہ اپنی زبان کا واحد اور آخری بول چال میں استعمال کرنے والا فرد ہوتا ہے اور اس کے جانے کے بعد اس کی نسل ، اس زبان سے ناتا ہمیشہ کے لئے کھو بیٹھتی ہے . اور اس نسل کے ساتھ ساتھ دنیا کے باقی سبھی لوگ بھی . صدیوں سے اکٹھا کی گئی حکمت یافتہ باتیں جو اس زبان میں بندھی پڑھی تھیں ، اب وہ گویا ہمیشہ کے لئے غیب ہو جاتی ہیں .

ہم بیٹھے بیٹھے صدیوں کا علم ہاتھوں سے گنوا رہے ہیں ، کیا ہم کو اس بات کا احساس ہے ؟

ہر دو ہفتے اس دنیا سے ایک زبان چل بستی ہے

سچ پوچھیں توعام طور پر اس سوال کا جواب نفی میں ہوتا ہے .

اور انسان ان چیزوں پر غور و فکر کرنے کے بجائے ایسی چیزوں پر توانائی اور وقت ضائع کرنے کو ہمیشہ تیّار رہتا ہے . جیسا کہ ایک دوسرے سے جھگڑنا یا جنگ لڑنا ، یا پھر غیر اخلاقی اقتصادی برتری کے نشے میں آ کر ایک دوسرے کو کچلنا یا ایک دوسرے کے سامنے ٹانگ اڑانا وغیرہ وغیرہ .

کیا یے دانشمند مخلوق کی صفت ہے ؟ کیا ہم ایسا برتاؤ کر کے اپنے ‘ اشرف المخلوقات ‘ والے کردار سے منہ نہیں موڈ رہے ہیں ؟ کبھی کبھی لگتا ہے کہ آخرت تک یہی ماجرا رہے گا . جب تک کہ ہم میں اپنے ترجیحات‌‍ٍ زندگی کو صحیح کرنے کا احساس نہیں ہوگا یہی حال رہے گا .

اس نقطے سے ذہن میں ایک اور ایک خیال آیا . نا جانے انسان کی عقل کا کتنا حصّہ ماضی کے تجربوں پر منحصر ہوتا ہے . یعنی کہ ذکاوت کی دین (output) ، ماضی کی لین (input) پر کتنی منحصر ہے ؟

اگر انسان اپنے ماضی میں ، اپنے گرد و نواح سے اور اپنی حیثیت و کیفیت سے ناواقف ہوتا تو کیا یے توقع سے بعید ہے کہ وہ چھوٹی موتی ، نا گوار چیزوں پر اپنا وقت ضائع کرتا ؟ اپنا اصلی کردار ادا کرنا بھول جاتا ؟ غور کیا جاے تو ہم یے مظہرartificial intelligence programming میں بھی پا سکتے ہیں . میرا قیاس ہے کہ کئی AI systems اسی طرح چلتے ہیں . ان میں ضرور ایسا code ہوتا ہوگا جس سے روبوٹ کو باہر کی دنیا کا احساس پانے میں مدد ملتی ہوگی . جیسے ہی اس کو باہر کے ماحول میں تبدیلی کا احساس ہوتا ہے ، وہ اپنا رویّہ بدل دیتا ہے . شاید ہم بھی اسی طرح ہی ہیں . بس ہمارے شعور و احساسات کو مزید جگانا ہوگا .

کبھی سوچا نہیں تھا کہ اتنا طویل فلسفیانہ مضمون لکھو نگا . لکھتے لکھتے اتنا وقت گزر گیا ! تو بس دوستو ، آج کے لئے اتنا ہی . ملتے ہیں اگلی بار . اس طرح کبھی کبھی ہمیں اس تیز رفتار زندگی سے وقت نکال کر اپنے کردار کو نبھانے کے بارے میں سوچنا ہوگا . کہ بھئی ، ہم ‘ اشرف المخلوقات ‘ خطاب کے واقعی حقدار بنتے ہیں یا نہیں ؟ اپنے رب اور اس کی کائنات کو سمجھتے ہیں یا نہیں ؟ اور کس طرح اپنا وقت گزارنا چاہتے ہیں .

جانے سے پہلے اسی موضوع پر دیکھئے ایک لطف بھرا انگریزی گیت :

… The sky calls to us,
If we do not destroy ourselves,
We will one day venture to the stars …

Copyright Firas MR. All rights reserved.

Beginning Programming In Plain English

with 3 comments

Part 1 of an introductory series on programming using the Python language via SciPy @ Special Thanks

Before I begin today’s discussion (since it concerns another book), a quick plug for Steve McCurry, whose photography I deeply admire and whose recent photo-essays on the subject of reading, are especially inspirational and worth checking out. I quote:

Fusion: The Synergy of Images and Words Part III « Steve McCurry’s Blog


Susan Sontag said: “The camera makes everyone a tourist in other people’s reality.” The same can be said for reading books.

Every once in a while, I receive feedback from readers as to how much they appreciate some of my writing on non-clinical/non-medical subjects. Sometimes, the subject matter concerns books or web resources that I’ve recently read. Occasionally, I also like taking notes as I happen to read this material. And often, friends, family and colleagues ask me questions on topics that I’ve either read a book about or have made notes on. Note-taking is a good habit as you grow your comprehension of things. In my opinion, it also helps you skeletonize reading material – sort of like building a quick ‘Table Of Contents’ – that you can utilize to build your knowledge base as you assimilate more and more.

If you’ve ever visited a college bookstore in India, you’ll find dozens and dozens of what are popularly referred to as “guides” or “guidebooks”. These contain summaries and notes on all kinds of subjects – from medicine to engineering and beyond. They help students:

  1. Get verbosity in their main coursebooks (often written in English that is more befitting the Middle Ages) out of the way to focus on skeletonizing material
  2. Cram before exams

I tend to think of my notes and summaries of recently-read books, as guidebooks. Anchor points, that I (& often family or friends) can come back to later on, sometimes when I’ve long forgotten a lot of the material!

I write this summary in this spirit. So with all of that behind us, let’s begin.

I stumbled upon an enticing little book recently, called “Learning the BASH shell“, by Cameron Newham & Bill Rosenblatt. Being the technophile that I am, I just couldn’t resist taking a peek.

I’ve always been fascinated by the innards of computers – from how they’re made and assembled to how they are programmed and used. My first real foray into them began with learning some of the fundamentals of DOS and BASIC on an old 286 (I think) as a 7th grader. Those were the days of pizza-box styled CPU-case form factors, monochrome monitors that had a switch that would turn text green, hard disks that were in the MB range, RAM that was measured in KB and when people thought 3.5 inch floppies were cool. Oh boy, I still do remember the way people used to go gaga over double-sided, high-density, pre-formatted and stuff! As I witnessed the emergence of CDs and then later DVDs and now SSDs and portable HDs, I got my hands dirty on the 386, the 486, the Pentium 1, the Pentium 3, the Pentium 4 (still working!) and my current main workstation which is a Core 2 Duo. Boy, have I come a long way! Over the years I’ve read a number of books on computer hardware (this one and this one recently – more on them for a future post) and software applications and Operating Systems (such as this one on GIMP, this one on GPG, this one, this one and this one on Linux and this one and this one on FreeBSD – again, more on them later!). But there was always one cranny that seemed far too daunting to approach. Yup, programming. Utterly jargoned, the world of modern programming has seemed really quite esoteric & complicated to me from the old days, when BASIC and dBASE could get your plate full. When you’ve lost >95% of your memory on BASIC, it doesn’t help either. Ever since reading about computational biology or bioinformatics (see my summary of a book on the topic here), I’ve been convinced that getting at least a superficial handle on computer programming concepts can mean a lot in terms of having a competitive edge if you ever contemplate being in the research world. This interplay between technology and biology and the level to which our research has evolved over the past few decades was further reinforced by something I read recently from an interview of Kary Mullis, the inventor of PCR. He eventually won the Nobel Prize for his work:

Edge: Eat Me Before I Eat You! A New Foe For The Bad Bugs, A Talk with Kary Mullis


What I do personally is the research, which I can do from home because of the Internet, which pleases me immensely. I don’t need to go to a library; I don’t need to even talk to people face to face.


There are now whole books and articles geared towards programming and biology. I recommend the great introductory essay, Why Biologists Want to Program Computers by author, James Tisdall.

“Learning the BASH shell” is a fascinating newbie-friendly introduction to the world of programming and assumes extremely rudimentary familiarity with how computers work or computer programming in general. It certainly helps if you have a working understanding of Linux or any one of the Unix operating system flavors, but if you’re on Windows you can get by using Cygwin. I’ve been using Linux for the last couple of years (originally beginning with Ubuntu 6.06, then Arch Linux and Debian, Debian being my current favorite), so this background certainly helped me grasp some of the core concepts much faster.

Defining Programming

So what exactly is programming anyway? Well, think of programming as a means to talk to your computer to carry out tasks. Deep down, computers understand nothing but the binary number system (eg: copy this file from here to there translates into gibberish like .…010001100001111000100110…). Not something that most humans would find even remotely appealing (apparently some geeks’ favorite pastime is reverse-engineering human-friendly language from binary!). Now most of us are familiar with using a mouse to point-and-click our way to getting tasks done. But sometimes it becomes necessary to speak to our computers in more direct terms. This ultimately comes down to entering a ‘programming environment’, typing words in a special syntax (depending on what programming language you use) using this environment, saving these words in a file and then translating the file and the words it contains into language the computer can understand (binary language). The computer then executes tasks according to the words you typed. Most languages can broadly be divided into:

  1. Compiler-based: Words in the programming language need to be converted into binary using a program called a ‘compiler’. The binary file can then be run independently. (eg. the C programming language)
  2. Interpreter-based: Words in the programming language are translated on-the-fly into binary. This on-the-fly conversion occurs by means of an intermediary program called an ‘interpreter’. Because of the additional resources required to run the interpreter program, it can sometimes take a while before your computer understands what exactly it needs to do. (eg. the Perl or Python programming languages)

If you think about it, a lot of the stuff we take for granted is actually similar to programming languages. HTML (the stuff of which most web-pages are made) and LATEX (used to make properly typeset professional-quality documents) are called Text Mark-up Languages. By placing the typed words in your document between various tags (i.e. by ‘marking’ text), you tell your web-browser’s HTML-rendering-engine or your LATEX program’s LATEX-rendering-engine to interpret the document’s layout, etc. in a specific way. It’s all actually similar to interpreter-based programming languages. Javascript, the language that’s used to ask your browser to open up a pop-up, etc. is also pretty similar.

What is BASH?

BASH is first and foremost a ‘shell’. If you’ve ever opened up a Command-Prompt or CLI (Command Line Interface) on Windows (Start Menu > Accessories > Command Prompt), then you’ve seen what a shell looks like. Something that provides a text interface to communicate with the innards of your operating system. We’re used to doing stuff the GUI way (Graphical User Interface), using attractive buttons, windows and graphics. Think of the shell as just an alternative means to talk to your computer. Phone-line vs. paper-mail, if that metaphor helps.

Alright, so we get that BASH provides us with an interface. But what else does it do? Well, BASH is also an interpreted programming language! That is amazing because what this allows you to do, is to use your shell to create programs for repetitive or complicated multi-step tasks. A little segue into Unix philosophy bears merit here. Unix-derivative operating systems, unlike others, basically stress on breaking complicated tasks in to tiny bits. Each bit is to be worked on by a program that specializes in that given component of a task. sort is a Unix program that sorts text. cut snips off a chunk of text from a larger whole. grep is used to find text. sed is used to replace text. The find program is used to find files and directories. And so on. If you need to find a given file, then look for certain text in it, yank out a portion of it, replace part of this chunk, then sort it from ascending to descending order, all you do is combine find, grep, sed, cut and sort using the proper syntax. But what if you didn’t really want to replace text? Then all you do is omit sed from the workflow. See, that’s the power of Unix-based OS(s) like Linux or FreeBSD. Flexibility.

The BASH programming language takes simple text files as its input. Then an interpreter called bash translates the words (commands, etc.) into machine-readable code. It’s really as simple as that. Because BASH stresses on the Unix philosophy, it assumes you’ll need to use the various Unix-type programs to get stuff done. So at the end of the day, a BASH program looks a lot like:

execute the Unix program date
assign the output of date to variable x
if x = 8 AM
then execute these Unix program in this order(find, grep, sed, cut, sort, etc.)

Basic Elements of Programming

In general, programming consists of breaking down complicated tasks into bits using unambiguous language in a standard syntax.

The fundamental idea (using BASH as an example) is to:

  1. Construct variables.
  2. Manipulate variables. Add, subtract, change their text content, etc.
  3. Use Conditions such as if/then (referred to in technobabble as “Flow Control”)
  4. Execute Unix programs based on said Conditions

All it takes to get going is learning the syntax of framing your thoughts. And for some languages this can get hairy.

This explains why some of the most popular programming languages out there try to emulate human language as much as possible in their syntax. And why a popular language such as Perl was in fact developed by a linguist!

This was just a brief and extremely high-level introduction to basic concepts in programming. Do grab yourself a copy and dive in to “Learning the BASH shell” with the aforementioned framework in mind. And before you know it, you’ll soon start putting two and two together and be on your way to developing your own nifty program!

I’m going to end for today with some of the additional excellent learning resources that I’m currently exploring to take my quest further:

  1. Steve Parker’s BASH tutorial (extremely easy to follow along)
  2. Greg’s BASH Guide (another one recommended for absolute noobs)
  3. Learning to Program Using Python – A Tutorial for Hobbyists, Self-Starters, and All Who Want to Learn the Art of Computer Programming by Alan Gauld
  4. How to think like a Computer Scientist – Learning with Python by Jeffrey Elkner, Allen B. Downey, and Chris Meyers

UPDATE 1: If you’re looking for a programming language to begin with and have come down to either Perl or Python, but are finding it difficult to choose one over the other, then I think you’ll find the following article by the famous Open Source Software advocate, Eric S. Raymond, a resourceful read: Why Python?

UPDATE 2: A number of resourceful, science-minded people at SciPy conduct workshops aimed at introducing Python and its applications in science. They have a great collection of introductory videos on Python programming concepts & syntax here. Another group, called FOSSEE, has a number of workshop videos introducing Python programming here. They also have a screencast series on the subject here.

UPDATE 3: has quite a number of useful lecture series and Open Courseware material on learning programming and basic Computer Science concepts. Check out the MIT lecture, “Introduction to Computer Science and Programming” which is specifically designed for students with little to no programming experience. The lecture focuses on Python.

Copyright Firas MR. All rights reserved.

# Player used is Stream Player licensed under the GPL. Special thanks to Panos for helping me get the embedded video to work! Steps I followed to get it working:

  • Download the Stream Player plugin as a zip. Extract it locally. Rename the player.swf file to player-swf.jpg
  • Upload player-swf.jpg to your Media Library. Don’t worry, will not complain since it thinks it’s being given a JPG file!
  • Next insert the gigya shortcode as explained at Panos’ website. I inserted the following between square brackets, [ ] :
  • gigya  src=""  width="512" wmode="transparent" allowFullScreen="true" quality="high"  flashvars="file="

  • Parameters to flashvars are separated by ampersands like flashvars="file=MOVIE URL HERE&image=IMAGE URL HERE". The provider="http" parameter to flashvars states that we would like to enable skipping within the video stream.