Saturday, July 30, 2011

Error-reduction codes hidden in Vedic chants

The Vedas are timeless. Indic scholars do not ascribe a particular time to its origin because it has always "been there" - the Vedas are considered to be a constantly evolving treasure of knowledge, wisdom, science, math, and 'best practices' since time immemorial. Modern researchers' requirement to assign a measurable date to an event and slot it into their finite history model results in a 'start date' for some random snapshot of the Vedas that is anywhere between 2-5K years prior to the common era.

The Vedas are in Sanskrit
The Vedas contains a wealth of useful guidelines and ethical principles to ensure a productive lifestyle that is in harmony with the surroundings. Indeed, the word as well as the religion 'Hinduism' that is in use today is an inaccurate artifact created by colonizing Europeans (update, 2013: Term 'Hindu' is much more ancient). The correct term is Sanathana Dharma, a phrase that very roughly translates as "the right way for good guys (and gals) to lead their life". There is no equivalent for Dharma in English, and there is no word for organized religion in Sanskrit to the best of my knowledge (update, 2013: highly limited knowledge).

Fidelity of the Vedas
From an algorithmic and modeling perspective, an amazing fact is that the Vedas have been orally transmitted and remembered using Vedic Chants across millennia, and what we hear today is probably what was first chanted a very, very, long time ago. In a world that is so accustomed to written proof, this approach and it's implications can be a bit tough to grasp initially.

Vedic Chants and its Impact
Per Wikipedia "The UNESCO proclaimed the tradition of Vedic chant a Masterpiece of the Oral and Intangible Heritage of Humanity on November 7, 2003." The Vedas are to be listened to, and not primarily intended to be a reading text. The textual meaning of the Sanskrit words in the Vedas are but a part of its benefit, but the way it is combined together and chanted in a specific manner is equally if not more important. It is this entire structure that has been remarkably preserved across eras and onslaughts including Greek, Mongolian, Central Asian, and European invaders. There were no "heretic" writings for them to easily destroy and thanks to these error codes, India has been able to maintain an unbroken chain of culture and thus retain the most ancient of its connections to its roots.

Here's a digital sample of a Vedic chant. Some may notice a passing resemblance to mystic pagan, Gaelic, or Gregorian Latin chants.

Combinatorial Aspects
I'm betting those wise old Rishis (Indian sages) would have dug OR for its practicality, so they sure would have loved to chant:
"operations research is the science and engineering of better". We'll drop the 'engineering' part for the sake of brevity.

The meaning and pronunciation of each Sanskrit word stands unambiguously by itself and is written just like it sounds (unlike, say English). Sanskrit is characterized by precision. It requires no punctuation marks. Orally, this is accomplished by chanting each word in the passage distinctly, one after the other (a "/" indicates a brief pause).

Code 1: operations/research/is/the/science/of/better

However, even a few hundred cycles is likely to induce errors (In English: where's the comma, pause, syllable emphasis, etc), so they must have decided to add a second layer that chains a word to the next one:

Code 2: operations research/research is/is the/the science/science of/of better

Each word is now spoken twice in order, thereby introducing some redundancy, while also explaining how pairs of words are to be spoken in combination. Remember, the pitch and tone for a particular word may depend on one or more words that precede or follow any given word. Sure enough, another Rishi decided to take this a step further by chaining three words to introduce further redundancy and handle cases where the ebbs and flows in the chants persist a bit longer.

Yet another Rishi put words together in an apparently strange way to create:

Braid Code: operations research research operations operations research/research is is research research is /is the the is is the/the science science the the science/science of of science science of/of better better of of better

The number of times a particular word is repeated is 6. The phrases seem to be chanted in a forward/reverse/ forward format. However, this is a moot point in Sanskrit because switching the order of the words in a sentence does not change the meaning! In other words, each section in Code 2 is chanted thrice in different orders, but they reinforce the exact same meaning each time. Indeed, this also ensures that Rishis who loved to swap words around could now do so (even inadvertently) without fear of messing up the cadence. Pretty cool. Those who've followed this tab for a while would have noticed that the words in this tab are often hopelessly out of order. It's not easy to downgrade to English and write acceptable OR journal papers :)

There are a few more codes, but the pièce de résistance is this particular "bell code" which also happens to be the most pleasing to the ear:

Bell code: operations research research operations operations research is is research operations operations research is/
research is is research research is the the is research research is the/
is the the is is the science science the is is the science/
the science science the the science of of science the the science of/... and so on

The number of times a particular word is spoken in this code is 10, i.e. a factor of 10 redundancy. A sample of the Bell-code chant (the example chosen is the "peace mantra") can be found toward the bottom of this site. Search for the phrase "Ghana Paatha". The first 2.5 minutes is the same mantra that was chanted in the first example, but is now done by a different individual. Comparing the variations in the two performances gives us an idea of the challenge faced by those Rishis eons ago.

If the order of words doesn't matter, there's going to be an exponential number of ways of speaking a sentence correctly without altering the meaning (although some choices are more preferable and popular). But this also serves as a natural fault-tolerant mechanism. Each ordering is an alternative feasible solution that results in at least the correct decoding of the meaning of the passage; yet another reason why the treasures of the Vedas would have been lost to the world without the magical medium of Sanskrit. The Rishis appear to have managed these permutations by carefully designing the chants in sync with phrases to make it easier to orally encode and decode a massive amount of information across generations without a single written note. Indeed, they may have thought of this as an infinite horizon problem given the cyclical time concept of Indian philosophy. They appear to have converged on a limited number of simple encoding rules that appear to be quite effective as well as practically robust. It is estimated that it would take a month or two of continuous chanting to cover the entire bell-code version of the Vedas!

Present Day
We know that there's an inherent connection between linguistics and computer science. If Jeopardy were to be played in Sanskrit, would IBM's Watson have been more accurate and less dependent on guesswork?

These ideas also seem to be used in reinforcing learning among kids. Songs and rhymes with repetitive themes appear to be relatively easier to remember over long time periods. The holiday song in the previous post is a good example. If we ever wondered what drives otherwise fun-loving Indian kids to memorize entire lexicons to collect endless Spelling Bee trophies, and why there is so much emphasis on rote learning in India, now we know its because of Shruti and her dual, Smriti.

It would be nice if our business customers were to present all their business rules, priorities, and goals in bell-code Sanskrit verse on a CD rather than Word text and Power-point charts to avoid the endless headaches arising from the inevitable losses in translation!

Credits and Disclaimer
The sources for this post include numerous websites and individuals. It's tough to list each one, so a big thanks to all who are working hard to preserve this part of the world heritage in its original form and context. Being neither a Sanskrit or an English (or pretty much any language) expert, errors, inadequacies, and misinterpretations, if any, in this post are of course, entirely mine.

update: some typos fixed.
2nd update: January 2013

Wednesday, July 27, 2011

A tough MIP for the winter

The 7.33 Days of C.Xmas

On the first day of C.Xmas,
mipsolver sent to me
A node-zero bound and a tiny branch-and-bound tree.

On the second day of C.Xmas,
mipsolver sent to me
two depth-first searches that dove ...,
and came back empty to a growing branch-and-bound tree.

On the third day of C.Xmas,
mipsolver sent to me
3 French-invented cuts,
2 'doves',
and a tighter bound, trimming the branch and bound tree.

On the fourth day of C.Xmas,
mipsolver sent to me
4 call-back birds,
3 French cuts,
2 doves,
and a still-infeasible branch-and-bound tree.

On the fifth day of C.Xmas,
mipsolver sent to me
5 hi-flying rounding heuristics,
4 call-back birds,
3 French cuts,
2 doves,
all tossed into a gigantic branch-and-bound tree.

On the sixth day of C.Xmas,
mipsolver sent to me
6 more goose eggs,
5 rounding heuristics,
4 call-back birds,
3 French cuts,
2 doves,
and still no incumbent in that branch-and-bound tree.

On the seventh day of C.Xmas,
mipsolver sent to me
7 types of warnings,
6 more goose eggs,
5 rounding heuristics,
4 call-back birds,
3 French cuts,
2 doves,
all mocking me from the overflowing branch-and-bound tree.

8am after my last day of C.Xmas,
manager said to me,
(this song is exponentially grating)
7 days of computing,
6 paying customers a-waiting,
5 days of test-match cricket watching,
4 P-series server-snatching,
3 more tough MIPs in your job batching,
2 minutes for u to clear your desk of every bird-dropping,
and climb that branch-and-bound tree.

Disclaimer: Purely in jest, to state the obvious. Claims of any statistically significant correlation to any real MIP solvers, real managers, real holidays, and virtually anything else that is real is just as unimaginative as this song.

Saturday, July 16, 2011

Where are the new OR innovations coming from?

The telephone appears to be increasingly rejected in favor of returning to Morse-code like telegraphic tweets and talk-free 'radio' text messages. Is OR going through a similar cycle? In a prior tab, empirical evidence was provided to suggest that the so-called age of analytics did not really start at Y2K; like the telegraph and the radio, its always been there and only gone digital now.

Our airline customers who pioneered the construction of scalable OR-embedded infrastructure to manage complex revenue and cost issues have seemingly run out of similar low-hanging fruit. Attending a recent INFORMS conference felt like reading a classifieds ad: "thoroughly impressive solutions seek unanswered practical questions to justify time and expense". This does not mean that we are not innovating - far from it; it's just not from within the OR community, where we continue to indulge in our dual laundering cycle of model building and tool polishing. Occasionally we hunt for non-existent (or worse, gullible and real) customers to pay us good money to take the resultant code-scrap off our hands. After all, OR is merely the science of 'better'. It is our customer who did all the hard work of taking it all the way from 'nothing' to 'good'.

The world of retail is one example of a margin-starved, data-rich industry that is driven by a realistic necessity to innovate. Our retail customer has been gratefully but carefully adapting practically useful resource optimization techniques from the airline world. By carefully refining these methods in the demanding retail context, they are generating a bunch of new analytical 'best practices'. Combined with some good old sales techniques, these approaches appear to be on the verge of reigniting similar innovations in other industrial sectors.

On a related note, OR resembles the fast-drawing gunman of the wild west legend whose niche skills are desperately sought after and bid for by a town threatened by outlaws, but one who also becomes a liability for the town once peace has been established. We should avoid outliving our welcome and be more proactive in seeking new 'towns'.

Tuesday, July 5, 2011

Goodbye, Maine.

There's much forest in Maine, more than any other state in the US. If you randomly parachute into ME, the odds of landing in mother earth's lap is about 1:8, which improves marginally in the winter. People love the outdoor life. This is the land of Acadia, a place for camps and hikes, and is so full of summer life. Yet ME is also the resting place for fallen heroes who have always arrived quietly from distant lands - Korea, Vietnam and Iraq. On rare and lucky occasions at Bangor Airport, you get to see the tired but elated troops walk safely home after a tough tour of duty in another one of those quagmires. And there are other days, when the same faces wait to cross the pond on the orders issued by generals and politicians. Bangor, is an important logistical point for such overseas operations. You can't get a decent runway more north-east in the mainland US.

Nothing sensational happens in Maine, and yet the first events at dawn on 9/11 unfolded at the Portland airport, and at dusk, a small airport-town in Newfoundland, just north of Maine improvised splendidly as they hosted several international flights that were ordered to land as soon as they touched North America. We border just one US state, and I cheered in vain for the 2010 Canadian Edelman team who turned out to be from the 'hood (New Brunswick).

Maine is a strong blue state which elected not one but two red senators, grumbled about it, and then decided to elect a red governor and grumbled even more. ME actually voted against FDR in 1936. Tough times makes for tough decisions. ME always scrapes the bottom in terms of the other green - business-friendliness, and most Mainers struggle through these tough times, as people seem to put up more and more of their possessions 'for sale'. Yet it's hard to get angry at people here after a bad day at the office - even the cable TV operators here are so damn friendly and helpful. The post-woman delivers mail flawlessly in her USPS car on her route, and come winter, very politely asks me to do something about her postbox, even though she knows the answer. Her nemesis is the ubiquitous snow-plow truck whose demon drivers perfectly take out every postbox on their TSP routes for fun. Its a game where Stephen King's creatures rule the streets of Bangor at night, and blissful peace returns at daybreak. There is this duality about Maine that will be missed.