Tuesday, September 13, 2016

An ounce of responsibility

We consider information and knowledge to be the most valuable assets that we, humans, accumulate. Information and knowledge once gained have been handed down through the ages to the subsequent generations. It is the blatant disregard for the integrity of information, from the very people who are supposed to be its guardians, that pains me.

Yet again, I'm cribbing about irresponsible journalism, and an article that I chanced across earlier today, in the front page of a prominent daily. The article runs thus:

These Paralympians Ran The 1500m Faster Than The Rio Olympics Gold Winner. Wait, What!



http://www.indiatimes.com/sports/rio-olympics/did-you-know-the-top-4-paralympians-who-ran-the-1500m-did-so-faster-than-rio-s-gold-medallist-261622.html



Our paralympians ran an absolutely fantastic race, no doubt. So, why am I complaining? 

Unfortunately, I find this to be a classic example of lousy reporting, if done out of ignorance or an example of unethical reporting, if it was shooting off people's sentiment for our wonderful paralympians.  Here's why.

1500 m races are not run as a sprint, where the goal is not to have the fastest time, but to be tactically faster and tougher than the current set of runners. It is a long distance race where the runners have to combine physical prowess with mental acumen to outpace the competition while considering the entire duration of the race. This is no simple task, as one has to evaluate the strength, stamina, and sprint abilities to decide on the pace and strategy on-the-fly during the race.

To give a concrete example from not too far long ago, this is what happened last month at the vary same stadium, in the able-bodied Olympics. In fact, this is same 1500m event, that is referred to in the article. 

This was the results in the finals:



And this is what happened in the semi-finals, 


And surprise, surprise ! This is what happened in the qualification rounds. 



While the gold medalist had a timing of 3:50 min in finals, about 24 people had run in less than 3:50 min in the semi finals, and about 35 runners have less than 3:50 min in the qualification rounds. 

To compare two 1500 m races is therefore logically flawed. In fact, the very same paralympians, may clock a very different time if they reran the race. However, to say this "But here's one story that may put able-bodied athletes to shame." in an non-satirical article is denigrating the efforts of all the wonderful athletes (both able-bodied and differently-abled). 

Not long ago, I had written about journalists needing a pinch of responsibility to do their research before penning down an article that thousands would read to acquire information and knowledge. But it looks like we now need not a pinch, but an ounce of responsibility! 

Tuesday, April 01, 2014

The lemon and the spoon

Coffee shops and I share a very unique relationship, as my readers would have realized by now. Many (in)significant posts in this very blog has been inspired by what I had observed during my solitary coffee sessions (where I have successfully pretended, so far, to be thinking deep) at the nearby coffee shop. And while I was immersed in one such session today, I happened to notice someone order a grilled 'something' sandwich and followed it up with some whispered request (note: being the gentleman that I am, I didn't try to overhear what they asked. Ahem! ). Nothing quite out of the ordinary so far. Until I saw the maître'd gripping a whole lemon between two spoons and take it to the table with the something sandwich.

What ignorance! What horror! This is not how one honors the unique relationship that a whole lemon shares with the spoon. As a kid who had spent his childhood in a society where lemon-and-spoon races are serious sporting events for any child until he/she reaches middle school, this is just blasphemy beyond proportions. While seemingly simple in concept, the science behind lemon-and-spoon races have been perfected over the many years in India, so much so that it can be called an art now. It is a sport that requires rapt attention (balancing a pseudo-sphere on a hemispherical surface is not easy), swift athleticism (it is a race!), keen insight (optimally trade-off pace for stability) and deep strategy ('accidentally' knock the lemon off your opponents' spoon). To top it off, you might encounter vicissitudes of fortune, if the wind decides to play rough on you, toppling the lemon despite your desperate nose-dive to balance it. 

Wait! Did I tell you that the spoon is not to be held with your hands, but with your mouth? Yeah. Now that's how we roll in the Shire! If you still think this is a trivial sport, suit yourself. 

Our colony (with around 200 households) used to organize an annual Pongal festival, where the lemon-and-spoon was an integral part of the event, year after year. Quite unsurprisingly, this sport is extremely popular among all age-groups. This, of course, complicates the strategy for the elderly aunties having to delicately balance themselves (and the lemons too) without tripping on their sarees. To give you an idea on how seriously this event was taken up, some of them had dared their inhibitions towards non-traditional south-Indian wearables and wore salwar-kameez to gain that distinct advantage. They even engage in the ritualistic pre-race and post-race trash-talk, which goes around for another year within the community gossip circles.  

The beauty of the game (sport, not game, sport!) lies in its innate ability to flex the rules and make it infinitely complex than a chess game. For example, simple deviances like allowing a certain number of pit-stops where you could re-balance the lemon, and creating a lane (within which you should run) can create a variety of strategies that you could adopt. In fact, in a certain event, we even took this to the extreme where one had to move around obstacles and climb stairs like in a cross-country race.  

Like with any major sport, there are serious obstacles that we have to get out of the way for this sport to flourish. For instance, like in Formula one, there is a potential health hazard warning here as well - especially if the spoons aren't sterilized properly after each round of the race. Thankfully, solutions do exist for most real world problems. In this instance, we enforced the BYOS (Bring Your Own Spoon) rule, but had to enforce regulations on the dimensions of the spoon with the help of our regulatory committee. Another issue that had risen time and again is the use of adhesives (like sugar syrup) on their spoons by the athletes. Also, the impact of gender in this sport is not conclusively established. Whether lemon-and-spoon can be a co-ed sport, has been discussed extensively till date with little avail. This, I believe this is one of open questions faced in this sport and has to be addressed peacefully through dialogue (we believe strongly in peace and secularism) within the committee and by careful analytics.
Given these amazing facts, it is nothing short of sheer genius that this game is wonderfully cost effective as well. For example, the used lemons can be consumed as lemonade soon after the race, making it both economical and attractive to the athletes. These lemons can also be hung in front of our bicycles as mementos (which also effectively double up as charms in collusion with our Indian mythological beliefs). Little wonder that lemon-and-spoon enjoys such wide popularity ! 

You might think, Cricket is the unofficial national sport of our country (for the records, hockey is still the national sport of India). I beg to differ. Lemon-and-spoon for the win !

Titan.

PS. I strongly suspect (unofficial news from undisclosed sources) that following the success of IPL, IHL, IBL, etc., talks have begun with sponsors about hosting an annual ILaSL (Indian Lemon-and-Spoon League). Hush ! 

Image courtesy: Internet and Flickr and Google Search. No infringement on copyrights intended !  

Monday, October 28, 2013

A pinch of responsibility

My habitual ritual of reading through "The Hindu" (an Indian broadsheet that I grew up reading) with my cup of morning coffee led to a pleasant surprise today. An article, the title of which read thus, "He has arrears in engineering, PhD. in physics" (Original article). Being a research student myself, the story was appealing and inspirational to a certain extent. It was very heart warming to see a student not only identify his passion so early, but also pursue it and succeed as well.

I immediately google-scholar'ed the student's work, wanting to understand more about his work - an instinct that I had developed over the last 4 years. The search landed me on to a couple of papers (listed at the bottom), reading through which had me stunned. The paper was quite naive, largely unedited and published in a journal that had an impact factor of 1.4.

What appalled me was not the journal's content, but the article which had led me to this. While it is well known in the academic circles that some journals literally publish "anything", I find it hard to digest that reports published in well known newspapers can no longer be trusted. A minute's research on the story, something as simple as a Google search for the journal articles, and reading it's contents would have been more than sufficient. For the love of physics, it even had a reference to Resnick & Halliday and NYTimes! A simple background check on its content like looking up the Journal's website or the UC Berkeley's pages would have easily raised doubts on the validity of the story.

This brings me to the part that irked me enough to write it up - the need for responsible reporting. I find it sad when news reports are misleading due to lack of responsibility and ownership of what is being published. While the broadsheet did published a correction soon enough (Follow-up article), the article has done enough damage. For starters, this has tarnished the belief of its many readers (including me), which is a critical cornerstone for any newspaper. Instead of a false claim (if indeed it was made by the student) being reported to the University authorities for corrective measures or a responsible research conduct coaching, the article has now exposed the student  in a bad light to the world (I really hope that this does not affect the future prospects of the student, all he needed was a little guidance and support).

All this and more could have been avoided if a minute's thought was spent on the article, a little more care when the article was written. All it needed was a pinch of responsibility.


http://www.ijser.org/researchpaper%5CSub-structure-of-an-electron-based-on-the-Gravitational-Interaction.pdf,
http://www.ijoart.org/docs/Micro-Controller-Based-Automatic-Plant-Irrigation-System.pdf


Wednesday, June 26, 2013

Tuning replication in distributed datastores

What the heck have you been researching?  

Undoubtedly, this has to be the most common question that any research student is asked while at grad school. And I'm no exception. It has been a mystery to so many of my readers as to what I have been doing over the past few years. Unlike some of my other research projects, I now have something that I am allowed to showcase and let others use it too. Over the last year, I have been tackling problems that are of highest priority.  How fast can Facebook or Twitter be ? Can world of warcraft be more responsive and real-time ? ;)

Jokes aside, the crux of the problem is more pervasive than WoW or Facebook. What we are really asking is - how fast can interactive applications be? Can our web services be that extra second faster than what they are today? And the answer, I believe, lies in the fact that the application can only be as fast as the underlying data is fetched. This problem is exacerbated in geo-replicated databases which have users literally from all over the world and the applications that use these datastores are striving to be as responsive as possible. We (the shenanigans at our university) mulled over this for a while (a good year or so) and the solution was born - D-Tunes.

And the first version of D-Tunes (Datastore Tune), as a web interface is alive here. As a precis, D-Tunes configures the replication in your datastore in the most optimal way for your application, thereby ensuring that the application receives the best possible performance from the datastores.

For the brave, here lies the heart of D-Tunes in all its splendor. As the Spartans would have said, In details, lie the glory!  

Wednesday, May 29, 2013

The functional illiteracy called Geography

Years ago, when I moved out of India, I was amazed to find that most conversations in the western world always begin with the weather, something that we never encounter in the subcontinent. If I were to say this now in India - Looks like it is going to rain today, the most compassionate remark I can hope to get is - Are you crazy ? Of course it will rain - it is monsoon now ! And there's good reason to it too. Unlike in the west, weather is totally predictable in India. During summer it is hot, during winter it is pleasant (cold in northern parts), during monsoon it rains. There you go. As simple as it comes. 

The obvious reason for weather to be a hot conversational material (despite the numerous weather apps in the smartphones that people checked N times a day) is because it works as a wonderfully polite, safe, universally approved, social-awkwardness substitute. Elevators, Subway trains, birthday parties,weddings, B-DUBS, you name it. Any imaginable awkward conversation can be handled effortlessly by progressively suggesting weather alternatives - starting off with a mild excitement, transcending to a reticent amusement, or a disinterested observation, moving on to an affable annoyance before finally settling down on explicit bitching. It works - always. 

Extending this thought, I have been consciously trying to experiment with geography as a possible conversational substitute for weather. Over the years, here are a few of the priceless nuggets that came up during the conversation, those which I managed to remember or document. I have tried to present them verbatim to retain their natural conversational flair.

Wait! Korea isn't an island ? I'd always thought it was.
Yeah. Too bad.

I need to take a vacation in the Andamans. That'd be cool. The Arabian sea, I've heard is beautiful. 
You mean the Bay of Bengal, right ?
Same difference.

Really? Hmm. What is the capital of Assam?
Guwahati.
Nope. Its Dispur. 
Dude! You cant make stuff up. There's even an IIT there !

Japan to the United States is a long flight. 
Why ?
What why ? They are at the far end of the maps - that's why.

Which direction does the moon rise?
West, of course. Wait - that's opposite to the Sun right ?

So, if I need to get to Alaska, I have to catch a flight or take a ship right ?
Or you could drive. 
How? Isn't Alaska north-west of Canada ?
Yup. But Canada has roads too.

In the month of January, watching a game of cricket played between South Africa and India..
Why does the commentator keep talking about summer season games? Isn't that like another 5 months away. Brr...rrrr...

If I go across Antarctica, I should reach the Arctic circle right ? No ?

Do you know how many states India has now ?
Now, now. You're just getting political.

You know, the Musi river flows right beside Osmania campus..
He he ! Yeah., right.

The spread of South Indian culture northwards would have happened if not for the Vindhya ranges..
I dont think so. I remember reading that Agasthya had pushed those mountains back into the earth a long long time ago.

Malaysians are good badminton players.
Of course, they come from the Chinese sub-continent.
You mean, south-east asian
No, no. Chinese.

You know, India is divided roughly into two halves by the tropic of cancer.
The tropic of what ?

There are many more, but despite being free, online acreage is to be used judiciously. Jokes aside - the one thing that I want you to remember as a take-away is the value of questioning information that were fed into us as facts. Sun rising in the east is a fact - very few questioned, why? Fewer still, understood. True to the fact that humanity evolves and solves bigger and smarter problems, it remains to ponder what we traded off. A common example is the use of GPS navigators, an epitome of human innovation - replacing human directional skills. Good? Bad ? Your call. 

May our kids be able to spell Geography.

InvalidKeyPair.NotFound EC2 Boto package



It is fair to say that I have been acquainted with Amazon AWS for the past couple of years for my research requirements. Actually it is more than fair - it has been my bread-and-butter environment for scripting experiments on cloud platforms and wide-area storage networks.  And boto has been my go-to api for AWS tasks given that most of my experiments evolve from ad-hoc python scripts that does a bit of this and that.

And yesterday, I started receiving "InvalidKeyPair" response exception from the API out of the blue (not entirely true since I had made a host of changes to my scripts), which suggested that my keypair doesn't exist. A simple ls said otherwise - I found the keypair well and truly alive with the right set of permissions as well.

Source:

EC2Connection.run_instances(image_id='ami-09b11233', key_name='awskeys.pem', instance_type='m1.small',security_groups='default'])

Exception:

boto.exception.EC2ResponseError: EC2ResponseError: 400 Bad Request
InvalidKeyPair.NotFound. The key pair 'awskeys.pem' does not exist

After almost running out of hair to pull and Googl'ing all abstract keywords, here is the solution:

EC2Connection.run_instances(image_id='ami-09b11233', key_name='awskeys', instance_type='m1.small',security_groups='default'])


Apparently, the key is just "awskeys" and not "awskeys.pem". I haven't yet figured out why this exception wasn't raised until now or performed a trace-back to see when this started becoming an issue, but wanted to make a note right away just in case this is useful to someone else too.

Issued in public interest to all AWS dependent developers. May you always hit the right price for your spot  instances. Amen !

~Titan.

Saturday, February 09, 2013

Eight years of writing

Yesterday, I opened my inbox to a pleasant shock and surprise. I had received a note from the Google analytics service which said that my blog had seen its 10000th visitor. Looking back, Is it an achievement? Well, Yes and No. No - because I didn't expect that many people to read what I wrote (and I'm thankful to them all !). Yes - because, I see the transition of Titan, the kid who had been awed by his exposure to a virtual world to the Titan, who is now realizing the value, virtue and vices of his virtual entity. And this blog has been one of the catalysts. As we say in tamizh movies, some elderly gentleman from the bygone era should have definitely said this (and I have no clue who he is) "A man's writing is a reflection of himself ". Actually, it doesn't matter if it hasn't been said so. It is at least largely true with most people that I have seen and known.

I happened to re-read my initial posts in this blog, which was written back in 2005. So many things have changed since then, so many things haven't. The most obvious is the content of the blog in itself. The transition from the half-broken language and muddled usage of words to a more clean and non-arbitrary diction in my writing (I recommend taking a look at my initial posts. I can assure you a 30 min episode worth laughter in it). But more interestingly, I found a significant change in the clarity of thought and in the structure of what I write. I do think (hope) there still is a fair bit of humor in my writing, but now, I also see the link between the words and the thoughts behind them. I'm guessing, this also means I have changed over time as a person. Maybe, maybe not.

Some of the complaints that I had been receiving from my readers (Yes! they do exist and they do reach out  to me by email too!)  is with the mix of technical (I mean, why not ! I'm a technology person still!) and non-technical posts in my blog. Some of them have out-right mentioned to me that those posts were boring, long, completely out of the blue and terribly uninteresting. Guilty as charged - but those posts are as much a part of me as my other posts are. And I'm sure you all know what I mean.

My writing has gained me many friends. When I was a kid, I remember the good old Amar chitra katha comics having a section called "Pen Pals". I used to wonder what it means. And now, I know. Some of my blogger friends (since I came to know them from the blogs) have been known to me for almost 8 years now, and I haven't met quite a few of them in person at all. But we have read our write-ups so many times over the years that, I think, if we happened to meet in the future, our conversation is likely to begin with a simple "Hey, What's up?". 

A common impediment that keeps many from writing on a public forum is the fear of saying something silly  and friends, relatives or prospective employers seeing it. I have seen many articles that spread this notion of being restrained or distancing your virtual avatar from yourself is a must. And to this end, I ask - if you are silly and write something silly and a person who you never meet in your life reads it, how does it matter? And if you do happen to meet him in the future, wouldn't he then realize that you are silly? I have found great satisfaction in my writing, and I write because it has helped me evolve. It has taught me to retrospect and constantly become a better person. I know many of my friends who would have loved to write, but haven't yet done so due to the fear of being judged. To them, I say - do write. Not for me, not for others, but for your own joy.

If that gentleman from the tamizh movies of the bygone era happens to stop by now and gives a talk about the virtues of writing, I'd pick up a coffee, switch off my cell-phone and listen.

Monday, July 30, 2012

Wabash Wisdom


At a fortunate moment of indecision, I decided to go all the way to Udupi, a restaurant 50 miles away from my dear WestLala, lured by the prospect of gobbling idlis and vadas (yes, you read the verbs right). As an after-effect of the above decision, I was forced to go for a jog in order to fit myself into my T-shirts again. In a certain sense, I'm happy that I decided to jog, since jogging along the northern parts of Wabash Heritage trail was one of my to-do things at West Lafayette. Just in case you are wondering, yes, I'm still looking for the second item in that list.  But let that be. For, as a fall out of my expedition today, I learnt many a thing that I'm postulating here as the dozen pearls of jogging wisdom


I learnt 
  • that Rajinikanth is right, as always. He once said "vazhkai oru vattam da" (roughly translates to 'circle of life')
  • that it takes at least 7 miles of running for your stomach to feel normal after hogging 11 medu vadas.
  • that less traversed under-the-bridge pathways are a popular destination for men with OAB, no matter what country you are in.
  • that 'The Road not taken' is an inspired poetry is a lie. Robert Frost had once taken a stroll along the N. 9th Street, Lafayette.
  • that all roads in West Lafayette lead to the Happy Hollow park.
  • why India does not compete in track and field events - we are just not meant to be athletes.
  • It is final.  The winner in the category "best music track for inspired running" is Bhag bhag DK Bose. Sanjay Subrahmanyan's Upacaharamu cheseva comes a distant second.
  • that fitness Apps in iPhone are not to be trusted for predicting distances. Ever. 
  • what Jenny meant when she said "Run Forrest, run."
  • that it is a good idea to take bath after running 9 miles . Apparently you turn into an effective rodent repellent after 7 miles.
  • deer in west lafayette is not a fable. I saw two by the US-52.
  • the meaning of life

Glossary:

WestLalaa rhyming pet name for West Lafayette, influenced by hours of watching innumerable tamizh songs with completely worthless lyrics.  
Bhag bhag DK Bose - hindi equivalent for encouraging a certain gentleman who goes by the name of D.K.Bose, to run. Really. Even Mr.Aamir Khan said so.
Upacaharamu cheseva - a carnatic composition by Saint Thyagaraja in the raga Bhairavi.
Rajinikanth - "      " intentionally left blank, undefined - the inventors of Boson particle at CERN are still working on this
Medu vadas - fried salted spiced lentil donuts. Salt - no sweet,.
US-52 - a very popular and landmark destination connecting the historic towns of Lafayette and West Lafayette across the might Wabash. All visitors of the Walmart definitely pass by this historic location.

A note to the posterity - this is the route that I ran today. May you find peace and prosperity and enough oil to light your lamps!

 
View Larger Map

Wednesday, June 20, 2012

Understanding Cassandra's consistency and conflicts

After a long time, here comes another technical entry into my blog. I have been playing around with Cassandra trying to understand it as a system and one of the things that had often come up in many forums is the difficulty in understanding Cassandra's consistency. In this post, I hope to consolidate what I inferred from various forums, solutions and problems extended by many others who have been working with Cassandra. I intend this post to be useful to someone who has already had a flavor of what Cassandra is about and is familiar with the fundamental concepts of Distributed Systems and data stores. If not, I strongly recommend skimming through some of the basics here before proceeding further with this post.

A different ACID

Consistency in Cassandra doesn't directly relate to the 'C' in ACID. Consistency in traditional database systems refers to transactional consistency which ensures the correctness of the state for a given DB transaction. Whereas, in Cassandra, consistency of data across its replicas. In fact, it would be simpler to view this as the consistency of data that can be observed by an external client or client side consistency.  The consistency that is observed within Cassandra cluster (which might be different from that observed by an external client) can be defined as server side consistency. Cassandra does not provide transactional consistency (across multiple reads/writes) which is traded off for the higher speed and scalability. If essential, transactions and transactional consistency has to be implemented by the client. 

No rollbacks! 

An important implication of the above fact is that a Cassandra cluster (or simply cluster) could have partial writes (or writes in progress) but would not provide a roll-back mechanism for any (potentially) failed operations. For example, consider a Cassandra cluster with 3 nodes (N1, N2, N3), a replication factor (RF) of 3 and Read-Write Consistency Level (CL) of 2. Consider a write to X  is initiated on nodes N1,N2 and node N1 fails while the write is in progress. The write to N2 would succeed, a timeout is reported to client, but the write on N2 is not rolled-back as would have been the case with traditional databases. Fixing this inconsistency by retrying the failed operation or any corrective mechanism is the responsibility of the client. I believe, the only case of a true failure reported by Cassandra is when not enough nodes in the cluster are live for a given operation.  

Eventually consistent

"So what you are saying is, Cassandra cannot provide any consistency guarantees what-so-ever." No - this is a common misconception of many people that I have observed in many a user forum. Cassandra is eventually consistent. Huh!? Okay. Let me put it this way. Cassandra can be as consistent as you want it to be. The condition for strong consistency is 

R + W > N, where 
N - Number of replicas
W - Number of nodes that need to agree for a successful write
R - Number of nodes that need to agree for a successful read

And if R + W <= N, we say that the cluster is configured to have weak consistency or is eventually consistent. For example, consider the Figure 1. The system has a Read consistency (R CL) of quorum and a Write consistency (W CL) of ANY ( at least 1) and is therefore said to be eventually consistent. Since writes can succeed with just one node,  (W3) write 3 to N1 at time T0 and  (W5) write 5 to N2 at time T1 can happen independently to the same variable X. However, we can see from right hand side of the figure that a read  (R CL = quorum) at time T2 can result in different values depending on the set of nodes (N1, N2) or (N1,N3) which are chosen to serve the read request. 



Okay, I see that there can be inconsistency. But will it always remain so? And the answer is No - thanks to the read repairs that happens on the background. In both the cases illustrated here the read repairs (shown in purple) will ensure that subsequent reads will have converged on the same value for X. And this is why we say that Cassandra is eventually consistent.

Strong Consistency

Alright, now what would happen if I were to have R + W > N. Let us consider the extreme case where W CL = ANY and R CL = ALL shown in Figure 2. In this case, for the read to succeed, all replicas need to be in agreement and therefore have to be consistent before we respond back to the client.


Conflict resolution

Hold on, how did you decide that 5 and not 3 is the correct value? I didn't, Cassandra did. To resolve conflicts, all columns in Cassandra has a time stamp associated with it. Since T1 > T0 in our example, 5 becomes a later write and is therefore assumed to be correct. It is therefore evident that the nodes in the Cassandra cluster need to be synchronized in their measure of time to be semantically correct.


I thought Cassandra used vector clocks, no? After going through a number of threads and forums, I realized that this is not true. Vector clocks and version vectors are popular methods used for conflict identification. However, Cassandra already employs a per column time stamp for resolving conflicts thereby obviating the need for a causal ordering that is provided by the vector clocks.


Okay, I have synchronized my clocks. But what if I have a truly concurrent write with the same time stamp? In the unlikely case that you precisely end up with two time stamps that match in its microsecond, you might end up with a bad version but Cassandra ensures that ties are consistently broken by comparing the byte values.

Partial writes

Done. I did my math and made my cluster strongly consistent. Am I safe? The answer is both yes and no. This subtle but interesting scenario comes up when we have failures, which brings in the notion of partial writes. Consider Figure 3 which is the same example as shown before, but at time T1, the node N2 is disconnected from the cluster momentarily due to which the W5 gets timed out. This would mean that the a value of 5 is written to N2 but the write operation is not successful yet as it could not meet the required consistency level. Thereby N2 has the updated value while N1 and N3 have the older values. At a later time T2 (when N2 is back in cluster), the read can give different results based on the nodes which serve the reads.


Wait! Are you saying that we do not have strong consistency? No. We are still running strongly consistent, but there is a little non-determinism in the system. Consider Case 1 where the read goes to (N1,N3) and the value of 3 is returned after nodes N1 and N3 arrive at a consensus. It should be noted that the W5 is still in flight or in a timeout which is being handled by the client. In other words, the write is still in progress. Therefore it is semantically correct that the previous value 3 be returned.  In case 2, the read goes to (N1, N2). Here N2 has a more recent value (time stamp, remember?) and a consensus is reached with N1 before the value 5 is  returned. Now the subtlety - in this process, the W5 which was still in progress gets completed. Since W5 is now complete, the value returned (5),  is semantically the correct one. The read repairs shown by the purple lines happen asynchronously in both cases. So, despite the non-determinism we see in such cases, the semantics of consistency is still maintained and the conditions for strong consistency described earlier hold! 

To summarize, consistency in Cassandra is (a) different from that of transactional consistency (b) can be eventually or strongly consistent. A cliched conclusion to the post, I know, but I hope to have discussed some of the finer aspects that help understand what consistency means in Cassandra. Though some of these design decisions made in Cassandra incur additional effort for the developer, it keeps Cassandra simple and focused on its primary purpose - store and deliver data at blinding speeds. And trust me, it does that! 

Friday, February 17, 2012

The art of bus-riding

Today morning, a fellow student accidentally held on to my backpack to steady himself when the bus turned a corner. He looked up at me with a worried expression on his face and said apologetically "I'm so sorry, I didn't mean to.. I, I, I... was out of balance.." I looked up at him and smiled.

In the state where I hail from, school kids have a free-ride in government run buses - provided they are able to produce their
bus-pass within a micro-second to the bus-overseer (colloquially: 'kandectaar annan' - big brother conductor). As I was to learn in my undergraduate courses later, this was the speed at which early microprocessors used to operate. Therefore, keeping it folded in the wallet or inside the backpack is both infeasible and unacceptable. I'll avoid getting into the intricacies here, since carrying backpacks while riding a bus requires metier and is a topic requiring an intense treatment on its own. Losing the bus-pass is an expensive incident (as you don't get a replacement for that year) that earns severe rebuke from all affected parties. An exceptionally unfortunate situation is when teh kid realizes that he had lost his bus-pass when asked to produce on-board the bus. Elder co-passengers suddenly realize their social responsibility in educating the already shattered kid on the "art of carefulness".

Often, what clothing to wear when you ride the bus is a great dilemma, especially for the youth. In fact, it puts your morality, up-bringing and social-status at stake and determines where you end up in the social chart of your co-passengers. For instance, a young looking fellow by default is a good-for-nothing vagabond who apparently can have no respectable social status what-so-ever. A fellow with a neatly pressed shirt is tolerable and anyone with a ripped jean has no salvation, ever.

To top it up, bus-riding has a bunch of innate protocols associated with it. Any person who is occupying a double-seater is always required to offer the seat when he sees a couple standing. The decision to offer a seat when you see a couple is intricately complex and a direct confrontation of your morality. The worst part is, the correctness of your decision is never influenced by the ensuing behaviour of the couple. If they are married and abide by the socially accepted protocol of having non-mushy conversations, then your decision to offer the seat makes you earn a scornful look from your co-passengers. In case, the couple seem happy enough, you earn disdain. And if they turn out to be unmarried or just friends -  congratulations, you just got promoted to being an uncouth fellow and an object of sheer contempt for having allowed them to sit together.

With a billion people, buses are the life-line of public transportation in India and it is natural to expect them to be crowded. Bus-riding without jostling or stepping on someone is therefore a rare event and if you manage to get out of the bus after accidentally step on someone without having to put your all your known ancestors to shame, you should definitely buy yourself a lottery ticket that day. As a kid carrying a heavy backpack, my life was always in an unstable equilibrium when riding a bus. Enriching experiences have trained me not to worry too much about what goes on around you when in a bus.

But today, I looked up at him and smiled.

PS. Just in case you were wondering where I managed click this photograph, it was taken at our own Chennai a few years ago when I had been there visiting my friends.

Wednesday, October 19, 2011

2brnt2b is the question!

It is when you need to concentrate the most does your mind play all the tricks up it's sleeve and more often than not, the mind emerges the winner. Most of my writing is an artifact of such moments, but I'll let that be since that is definitely not the theme of my write-up today. I have always advocated that 'annoyance' is a perfect example of an intangible creation of our own mind, something that you can completely avoid. And yet, I infallibly fall for it every single time. But enough said about the mind, which I know is a product of my own contradictions. The anguished linguaphile in me had to seek solace by writing his agony targeted towards everyone and none in particular. It would be nothing short of being perfectly idiotic to fight for a lost cause, especially when the entire world is against you. But I'll stand up now and dish out a piece of my mind  to the world  in which mutilation of languages is considered fashionable.

Today, I was woken up by the muddled hooting of my phone on receiving a text message which said "tst" which was followed by another which said "txt d msg". And there it was - annoyance on two counts. The first being the most obvious - someone apparently chose me as the lucky person for his random testing of the new features of his/her phone. To explain this in terms of the butterfly effect, a few days ago the 'half-bitten fruit' folks released a new version of their iOS (to be pronounced ayyos), the impact which I had to bear now with some random person's experimental text messages. Following the two minute silence spent ruminating over my ill-luck was a half-an-hour nostalgia session recounting the undergrad days when free text messaging had been in vogue. Back then, it was the bread-and-butter communication strategy for students for a variety of recreational* purposes. The second reason for my annoyance was the content of the message - not the semantics but its syntax. The blatant non-availability of vowels in the message was just the icing that the cake needed.

That brings me to my chosen theme of the day - spelling. I can possibly understand the intent of robbing the words off its heart, if you were sending a Morse coded message hundred years ago when every alphabet communicated (or perhaps spoken too) was costing you money. Or if you were effecting a will endowing your million rupee property to an orphanage right before your very last breath^. Or if you were preparing** for an examination. But even the gentleman in me just cannot accept an email missing the vowels in a professional setting like requesting an appointment or writing to someone whom you do not know personally.

Very recently, an update appeared on my Facebook notifications; a comment that read thus "gr8,u 2 cum... pls du sumthn awsum dis wknd 4 dat." How in the sweet heaven do you guys even manage to do that! Every single word in there was perfectly misspelt! It has become fashionable to spell 'date' as 'd8' and 'time' as 'tym'. "To be or not to be" becomes "2 b r nt 2 b", "awesome" becomes "ossum" and "right" becomes "rite". And then there is "Choooo chweet" that pops up in all diabetic conversations between couples. And this list is endless. To misspell a word has sadly become a measure of cuteness in writing. If you end up spelling "do" as "du", I really think you should rather spend more time in middle school than on social networking. 

While there is one faction who splendidly mutilate the spelling by truncation, there is the other group who believe in perpetual repetition of an alphabet as a perfect equivalent for punctuation. So apparently, the length of grunting encoded using 'r'  in a "grrrrrrrrr" or the depth of disappointment in a "booooooooo" is a perfectly acceptable measure of your emotion. To say 'cooooool' is super cool and 'beautifullllllll' becomes extra-beautiful. On a similar note, the level of excitement in a "Superrrrrrr" or the measure of awe in a "Woooooooooow" is totally justified too. Sometimes, the length of repetition is so appalling that I often suspect their keyboard could possibly be the miscreant.

To all those who take pride in writing such sentences - Yes, I do appreciate your exceptional ability to comprehend sentences encrypted using phonetics and without vowels. But words are spelled in a language in a certain way for a reason - please let them be.

End of rant.

* includes SOS calls and soul-searching
** if you know what that means
^ if you don't understand this, you really need to watch more Hindi/Tamizh/Telugu movies. Don't look for Kannada, apparently even Google is not able to find any such thing called kannada movie.

Thursday, October 13, 2011

dmr - a true titan

Last week-end, one of the great minds of our time, a true Titan of Computer Science, someone whom I respect from the bottom of my heart for his contributions to the world, departed this physical world. He revolutionized the world of computers - a true pioneer, a superlative mind and a great person. He invented the language that formed the fundamentals of the computers that we so freely use today. He laid the foundation for an operating system that fuels the world we live in. It is on his giant shoulders that millions ride on today and will do so for ever. He won the Turing award and the Hamming medal, something that can only be dreamt by most people. Being the intellectual giant he was, he kept contributing to this world, until his very last days.

I hate making comparisons, but it pains to see such a great person like dmr departing the world unnoticed while that of an corporate innovator gets flashed in the headlines and is being mourned by millions. By what standards is a Turing award winner lesser than the corporate wizard? But then, this is how the machinery of the world works. I guess, it doesn't matter anymore. That said, I do hope there would be a few who will recognize the magnitude of his contribution to the world. I do. 

You are one of the few people whom I shall repent not having known personally despite being almost in the same building.  Your emails signed with the famous dmr will no more reach us. You will be missed, Sir. The world will most definitely miss Dennis MacAlistair Ritchie.

http://cm.bell-labs.com/who/dmr/




Saturday, April 02, 2011

Beyond the golden urn

So that's that. And we have the golden urn once again. And it doesn't end there.

The last few weeks have been an excellent avenue for columnists to mass-hypnotize a humongous audience and it is not surprising that they had milked it dry. I had run across many an article that elaborates why cricket is a religion in India. Numerous theories were churned out to proffer explanations about how a sport could bind a billion strong nation. Look at it from a hundred feet and it's just another game involving a few people. Generation after generation have warned us about the banality that surrounds the sport and how fragile the sentiments behind it are. It is also imperative that a sport cannot feed a country that has been fighting hard to establish itself on the world map. It was a dream come true for an entire nation all the same. A billion hearts beat as one today. And therefore we needed to win.

A friend of mine said she felt a sense of belonging every time India plays cricket and the things people do when they are passionate about something. There cannot be anything more honest than that statement. The thinkers have put it simply - the nation needed something to cheer about, to be passionate about, something that would help sail through disappointments that each individual is facing every moment in his life. And thus Cricket became a religion and Sachin Ramesh Tendulkar its God. A religion to a country in which you have to constantly compete - compete to progress, compete to prosper, compete to survive. We have to constantly fight against dominance from the rest of the world, fight against our own systems, fight against bureaucracy, fight against corruption, fight against mediocrity, fight for pride. A mere outlet for our passion in the form of a sport would never suffice. And therefore we needed to win.

While it is plain that cricket has been the glue that binds Indians together, a billion people coming from all obscure parts of life, it has remained just a symbol of hope and not of confidence. It is true that the flame had burned bright at times, but never consistent enough. And no, I'm not speaking of just cricket, but of a spectrum beyond it. We needed much more than a faint 'hope' to cling on to, something that can inspire us, motivate us, give us something to cheer for and aspire. And therefore we needed to win.

Today is definitely going down as one of the most historic days in Indian sports. Today is the day when we declared that the heroes of 1983 are not legends. We can do a better job of what they did earlier. They too are mortals and today, we ground them. Today, we declared that it wasn't just a lucky chance that we won. Today, we declared our will and grit to compete, fight till the finish. Neither was it an associate nation that we beat on our way, nor was it a result of a contrived complex interplay of politics. We blasted our way through the champions of the game and resoundingly declared that we are no less. And therefore we needed to win.

We needed to show, we learn from mistakes. We needed to show, we have the consistency and courage to stand up, aspiration to succeed. We needed to show that we do not merely stand and stare. This transformation in Team India wasn't an overnight process. It started ten years ago with a man who ripped off his shirt at Lord's and declared his grit and will to win.  And we never looked back. The last decade stands an immutable testimony. And today, we needed to show that irrespective of the future, we shall keep our will to compete burning bright as ever. And therefore we needed to win.


It is totally justified if you think of this to be a thought of mine that comes from the heat of the moment, a flash of inspiration that comes from passion rather than an instilled confidence. Trust me, I have been waiting for this right moment for a long time. I have had times of quiet satisfaction and pride when I have seen India stand up and command its authority and will to fight. How many of us remember our shooters and pugilists quietly wrapping up accolades in the Olympic events over the past decade? We had a time when India was huffing and puffing about a single medal that we won "long long ago, nobody knows how long ago" and now are at a stage where we take as many as 10 for granted every time. How many times have we been able to afford a contented chuckle when a coach from a pugilist powerhouse like Cuba comes over to the changing room and says, "I'm certain your boy would win the bout hands down".  We needed to show it wasn't just in a bunch of sporting events that we are competing. We needed to show that it is our indomitable spirit to compete and progress as a professional and as a peer to the rest of the world. And therefore we needed to win.

We all connect to cricket in a way that we do not connect with any other. Shedding their differences in social or economic status, Indians unite when it comes to cricket. We identify ourselves with cricket to the extent that we feel actually feel good about ourself when Team India wins. We let our thoughts and spirits fly high with intensity when we watch our team play. The Men In Blue resounded the nation's spirit today at the Wankhede Stadium. And then they lifted it. At that moment we realized what we gained was much beyond just the golden urn.

Thursday, December 30, 2010

The holy dip in the trough

 Owing to the state of shock that beheld the moment, I was caught frozen adoring my mobile phone which at that precise moment was undergoing ablution in the deep-dish Sambar container that our household covets as a piece of priceless possession. The LCD screen provided by Sony Ericsson was ever so refulgent from underneath the translucent liquid that topped it. And no, my cellular phone definitely wasn't an ingredient in the new recipe for Sambar that I was trying out. How it came about to be in this bedraggled position is a story that expresses as much mystery as any typical Tamil or Telugu movie would and so I have benevolently decided to spare my readers of that trouble. In an instinctive reaction, I matrix-pulled the phone out of the container though it was now the phone's turn to get frozen, but irradiate all the same. All the electronics-common-sense that my brain had managed to understand and index through the past decade was swept away by the puerile joy on seeing the phone alive despite the debacle it just underwent.

Murphy and the other genuine laws of physics were not so benevolent though. Fighting my initial adolescent euphoria, I had to try flip the lid down to see if that augured well with the phone. And there it was - the deadly flicker of death, like the sparks of a dying candle, the phone showed a final flare of its former glory before shutting itself off. Damn! I need to get a new phone now. But such kindness was deemed unwarranted to me.  The phone came back to life when I restarted it, but took an enormous amount of time to become operational. And that has been the problem ever since - it has become an obstinate child that needs to be entreated with tenderness, fortitude and oppressiveness all at the same time. It requires careful and delicate touches required of an eye surgeon to make it respond to the charger, an aeon before it responds to an key press or a flip and an equal amount of time to make it stop from any of the random action that it choses to take on receiving an impulse.

The pinnacle of my misery is when someone calls me - the phone keeps ringing despite my earnest attempts to keep it quiet. No amount of pacification helps - neither attempting to take the call nor drop it seemed to work with my phone. It couldn't have chosen a more opportune moment to embarrass me than at the birthday party of a friend with a room full of people pristinely talking and exchanging pleasantries. The volume of its ringing mutated from a mild purr to an ominous hooting proportionately attracting as much audience with every passing moment. I changed colors faster than a chameleon - from white to yellow to pink to purple to blue to green. And then, there had to be this brilliant suggestion from one among the audience while I was trying my best to convince the onlookers about my incapacity to deal with my phone - "Why don't you try silencing it?". Oh, yeah! Thanks! Like I didn't think of that.

But there are somethings that the phone started doing excellently, sometimes a tad too steadfastly. Alarm, for instance exerted itself beyond its expectations to wake not only me, but also my room-mate whose threw me a few fiery glances powerful enough to cook my breakfast. At that moment, I realized how much I missed my previous room-mate who used to promptly set alarm in his mobile phone and benevolently slipped it underneath my pillow when I am fast asleep. And then there is the MegaPixel camera which I had been once so proud of that no longer wants to turn itself on and the music player which I had grown to love as a soulful companion that has departed never to arrive again. Such dolor forced me to endure the ordeal of looking for a new mobile phone which I assure you is no easy task requiring all the financial tact and wizardry that one could conjure. My provider has this strange policy of extending step-motherly treatment to its existing customers while treating new customers lucratively. It actually took me a few minutes to digest the fact that a new connection would be less expensive than upgrading the existing connection. Take a bow for customer loyalty!

And so, here I am writing the woeful story of how I ended up with a punch-holed wallet and a semi-mortified phone that isn't open to any deal anylonger. On the brighter side, I'll be gifting myself with a new phone absolving myself of all the crime that I had committed and all the trials undergone as a result. Just the fairy tale end that was required to bid adieu to the decade!


Have a great year ahead folks!! 

Wednesday, November 17, 2010

My fair lady

Famished as much as I was then, I couldn't help noticing the sweet aroma of caffeine mixed with Pecan and Ginger. That isn't the surprising fact, given the recent accounts of my gluttony exploits have been critically acclaimed thanks to my hyperactive socially networked accomplices. But what was surprising was that I also happened to notice a girl sulking at the corner by the window, buried over a mound of books and discreetly fiddling with a brightly colored "smart" phone that distinctly stood out from the general mood of the coffee shop. I ordered my special brew coffee/lunch and went near the glass window which insulates the cold from outside yet lets through the sunlight to provide the warmth - one of the rare moments of pleasure that one can experience on the bright days of winter.

And it was at this juncture that I heard a shuffle behind my shoulders (and thanks to the semi-reflective properties of silicon glass) and realized that the girl was now accompanied by a friend who was a guy. That observation of mine had to be further fine-tuned when I heard the very first words that he spoke to the girl. No amount of bureaucratic or social protocols would have mandated him to apologize as profusely as he did; except if he were her boy-friend. I am almost sure that it beats by quite a margin, a murder convict pleading guilty of genocide and asking for pardon from a death sentence. By that time, my lunch arrived and I was obliged to stay put and hear the ongoing conversation. In my defense, I have to say that 'overhear' is not an apt term I should have used, as the conversation was happening right behind my back and the only option I had was to walk away clumsily with the food in my hand. On hindsight though, I really think that would have been the saner choice.

Now that I have established my innocence, I shall now proceed with relating the crux of the conversation I happened to hear. I'll have to refer to them as the 'girl' and 'guy' since I did not even turn to look at them, let alone know their names. And it is least surprising that I did not learn it through the conversation either, given that human recognizable proper-nouns are to be promptly replaced by diabetic pro-nouns like sweety, sweetheart, sugar, darling, etc., during all conversation between couples. The guy had apparently committed the unpardonable crime of coming in 5 minutes later than she had called him (as he was giving a project presentation), which triggered another round of apologies tendered in all possible permutations known to mankind. To be noted is that my friends have already classified me under the emotionally-challenged species and I was already beginning to feel uncomfortable with all the emotional appeals taking place behind me. For a moment, I felt relieved when she said she was cross with him for being late and was about to walk away. Fair enough, I thought.

Destiny is never so kind! He stopped her and made her sit down which was followed by another tirade of emotions as she began to initiate the intricate process of converting anger into self-pity and started sobbing. Ouch! "Just leave! Get up and just leave the damn place.."- I thought.  The will of my mind was subdued only by the half eaten sandwich and the thought of potentially ending up with a coffee stained T-shirt (provided by my previous employers, of course). Coming back to the present, she was saying that the homework needs to be done in another hour and that "we" would not be able to do it. But it was when he asked, "What time do you need to submit it?" that its implication struck me in full (Again, I'm well known to be spontainity-challenged). Interesting..., I thought, but was interrupted by a fresh burst of vocal cacophony from behind. She said that she was not going to submit "her" homework because "he" was late and "he" was responsible for it. But what totally stumped me was when he started apologizing again and pleaded with her to complete and submit her homework. Oh! the ways of the world!

And what ensued further is chronicled for purely academic interests - She overslept and he apologized. She forgot to bring her glove and he apologized. She got to campus late and he apologized. She couldn't find an "app" for her smart phone that morning (she did have time for that!) and he apologized. She wouldn't pay the bill for the coffee and he apologized. Readers, please pardon me for my inability to elaborate further on those parts of the conversation - our language falls drastically insufficient in its ability to express them with any finer granularity than the term mushiness allows.

As you would have guessed, this emotional overdose was way too much beyond my earthly abilities of forbearance and I took flight at the earliest possible moment. I must have looked quite a sight with a half filled coffee cup in one hand, a bunch of crumpled tissues and silverware in the other and a sandwich stuffed mouth. For, the Samaritan beside me, whom I thought so far to be sunken deep into his MacBook Pro and oblivious to all the ensuing drama, looked up and smiled. The smile said one word - compassion.

~Titan.

PS. I had drafted this write up almost a year ago, but was not happy either with the phrasing/structure or the authenticity about the generality of the content. The former was remedied with rephrasing the content and latter by various similar encounters and snippets that had been related to me.

Monday, July 26, 2010

Inception - a thoroughly thought thought about thought

Okay. So there are hundreds of reviews about this movie written by well known and renowned critics, but I feel it is right on my part to write on the movie that I felt was one among the best that I've seen in the last few years. I have been criticising movies one too many and my readers have at times found it disconcerting that I should consistently have a negative take on reviewing the movies. And it is now time to change that perception.

Despite being in a very quiet part of New Jersey, I have had a lot of opportunities (I'm still not sure I've capitalized as much as I should have) for travel and entertainment respites. Theatres in these parts of the country usually run empty and I have an unbeatable record of being the only person to watch a movie thanks to the friend who ditched me and "happened" to miss the train. But that is a different story, and so was the story the day I went to watch the 'Inception'. The theatre ran almost a full house on the opening Friday and the hall did have a huge capacity of about 600. If it were 'Sura' there would have been ample time and patience for the audience to express their emotions and whistle. But, this one was different.

The thing that impressed me the most is the plot. Unlike most other movies that are being produced all around the world left, right and center, the ones that trade off the plot for the cast and action, Inception is woven into the plot as tight as a cocoon's nest. After a long time, I have truly enjoyed a movie because of its ability to derive its strength from the plot. I'm sure it has taken Nolan quite a while to come up with the plot (despite it's obvious ancestral properties from Matrix) and with great care and intricacy. Any less and the movie would not have probably had the same integrity of thought and feature. The concept of lucid dreams and sharing dreams has been out in the world for centuries (I personally know of its existence in one of the ancient Indian scripts - Bhagavat Purana and the oldest surviving text of this script is at least a thousand years old), but it still takes an amazing amount of effort and thought to capture it a 2 hour celluloid. For instance, the fact that your dreams are woven into reality is amazingly casted in form of people losing gravity in the dream when the previous level has people suspended in the air.

With a story of this kind, it is quite easy for people to get carried away with making the movie infinitely complex, but Nolan's effort in making it simple to the viewer yet not lose the value of the concept just amazed me. With the right measure of terminology (limbo, kick, inception) to give it a sci-fi bent, the story has been carved into shape by equally brilliant screenplay. The pace of the movie is just right and keeps the audience always interested in what is happening on screen. If one were to pardon my sense of drawing parallelisms, I'd say Sekhar Kammula comes the closest to this calibre when it comes to screenplay and integrity of thought. I'm sure this movie would go a long way in making Hollywood (and Bollywood, Tollywood, Kollywood, ??llywoods ) appreciate the importance of thought in the inception of a movie. And yes, I still cannot believe how DiCaprio has managed to make such splendid choice of movies. Either, he is really worthy of these, or he should go buy lottery tickets. In either case, he is going to be a billionaire.

There isn't much of a suspense in the plot and leaving the end wide open to audience hardly qualifies as a suspense in my perception. Yet, I shall not be delving into the details of the plot or the storyline, like I usually do. For now, I remain happy and immersed in the ecstasy of seeing a movie that is well scripted and amazing thought out. Unless you are addicted to watching movies like Sura which are perfect antonyms of Inception, I'm sure it will be love at first sight.

Thursday, July 22, 2010

The Chains, The Markets and The Saws

I have a couple of posts that I had started drafting before this but I am pretty sure this one is going to see the light and on to my blog much before it's predecessors. It happened yesterday, when I was shopping in the supermarket and a "Marketing Manager" waylaid me and gave me his intellectual piece of advice about making money. For reasons that are obvious, I do not want to mention the name, origin or the firm he represented as they are of no consequence to what I'm going to relate here. So here he was, explaining to me about a shopping card that I can "buy" and earn points when I recommend somebody for buying the card. The 'Concept' he said, was simple - the more people I get to join, the more money I make. He went on to explain that I get a certain 'percentage' of points for each person who joins the chain with my "Number". And then, we just en-cash the points for free supplies from the "most" supermarkets all around the country!

While I stood dazed at his attempt, he conveniently 'understood' that the person he was talking to wasn't making heads or tails of this brilliant opportunity. And he went on explaining how the growth of the chain under me would generate revenue for me without me having to do anything. He said that computer scientists call this type of chain a 'Tree" or a pyramid and that it is a very powerful mathematical model that has been translated into a marketing model by the most brilliant of market strategists in New York. He even said, in full happiness of having stumped me, that the "growth" I would have in terms of revenue would be exponential. And I continued my state of daze, my mind thrown in its own whirlwind of thoughts, anguish and pity. Realizing that I hardly spoke anything, he gave me his card and left in pursuit of another outbound customer. I'm sure he wouldn't have imagined to meet a person, who has been working on a "Tree Differencing Optimization" problem for a part of his thesis dissertation and has been traveling up and down the 'Tree' data structure like a monkey for the past three months.

What I'm now going to talk about is my very own personal opinion and I hope it remains the same. It is the general lack of awareness about these "Pyramid" or "Chain" business models which made me wonder if people who stepped into this even realize the extent and impact of what they were doing! I have to agree that the "Chain Marketing" was one of the most brilliant marketing model that has been invented to attract low and middle income group, who, otherwise would not have invested in a business venture. That said, I do strongly believe that this is one of the most unethical ways to make money. Trust me, I do!

So what is this "Chain Marketing" ?

A Marketing model based on the exponential growth of a tree. For all my fellow computer science and math enthusiasts, the number of nodes at each level of depth of a tree is n^d, where n is the spread of nodes and d is the depth of the tree.


What does this mean to the chain marketing strategy. For a very simple analysis - let us assume that a person who bought the card, initiates no more than two others into the program. So the tree would now look as shown in the left. Imagine you are at the top (Red) of the chain. Assume you initiate two people (Green) into the program, and the green  initiate two more people (Blue), and the blues initiate two apiece. Now let's do a computation of the income - Assume for simplicity, profit of 10% per person and the card sells for $100. The Blues would get $20, the Greens ($20 + $4), and the Red ($20 + $5).  So what is the big deal here? If you haven't already noticed the second component, viz., the profit percentage keeps increasing the with the number of people in the tree. And even for a small spread tree, like the above, which is called a binary tree - the number of people at each level d grows by 2^d. For a ternary tree, you would imagine this number to grow even faster- and yes, it does as can be seen below. 
 
This strategy is a version of the well known doubling the chessmen problem. Imagine if you actually took this as an opportunity to make money and initiate probably a hundred to operate for you! Yes, we are talking about minting some serious money in here. Sounds like a fair deal, isn't it? You are just making use of mathematics and smart marketing and hardwork (yes, you are expending huge amounts of effort to initiate people into the chain) to make money. It looks like a very fair opportunity for everyone, after all, you could always initiate more people and retrieve your investment. What is so unethical about it? Think.

Common sense says that there has to be some logical point where the growth has to stop - there are just finite number of people out there in the whole world. Therefore, there are people who end up at the bottom of the chain, but do you want to take a guess how many..? Remember, at each level in the chain, the number of people grow by a factor of n^d which is large, very very large. Believe me, I've been working for the past few months on a tree with the number n hovering about 25~30 and it takes a 4Ghz computer hours to even count the numbers! Come again... the number is large. Agreed. So whats unethical about it? Well, if you have understood this, it is simple - the more the number of people you initiate, the more the spread and growth in the chain resulting in a gargantuan number of people at the very end of the chain. A lot of people who will not be getting their value for the $100 card that they bought. They will end up losing a part of their money which travels to the ones at the top of the chain who make profit out of it.

As you can see, the higher up in the chain you are, the more money you make. Again, what is so unethical about it? I'm not cheating someone!! I'm just providing them with an opportunity to make money by initiating them into this program. With every person whom you initiate into the program, there are potentially thousands at the bottom of the pyramid. Hey! I know the math. So what? You still haven't told me what is so unethical about this?       Nothing.