Thursday, May 28, 2009

Janani Janani - An ocean of devotion

This one is based on the song 'Janani Janani' by Ilayaraja. The original can be seen here. This song is a truly touching composition that left a deep impression, and is sung in praise of Janani (Mother) Mookambikai. It appears to be one of Ilayaraja's favorite ones.

This version is approximated on acoustic guitar using C, D, G, Em, and something else. We create the distortion effects to mimic the ocean wave ambiance using Audacity, a free sound editor. I've put the final output on YouTube:

The pictures were taken by my cousin N.M. Krishna of Singapore (get well soon!), photographer extraordinaire (Acadia, Maine).

Finally, this song is about the humility of the devotee surrounded by the omnipresence of the divine mother. This tab dedicates the song to those working quietly to overcome challenges in life - a mother battling lack of sleep while trying to care for her daughter, a daughter trying to be a good girl, grandparents staying healthy, a sister writing an exam (such as the CFA), a brother trying to make it as an entrepreneur or waiting to be with his kids again. This humble song wishes well for all. Om.

Wednesday, May 27, 2009

Thursday, May 21, 2009

Gurobi v/s CPLEX: A real-life LP example

The general availability of Gurobi, the new solver in town means that it allows us to compare how the de-facto commercial standard for the last 3 decades matches up. For starters, lets look at that good old work-horse, the Simplex Method. In particular, we will look at the dual simplex performance on a particular LP from real-life that has very few rows and many, many bounded columns that tries to maximize a linear objective function subject to "<=" constraints. Perfect for dual simplex since most of your work is with 6x6 linear systems for this instance.

Let's see what the default solvers of CPLEX and Gurobi do with it. You would like to think that there should not be much difference when it comes to 'mature' technology. Surprise.
These are run on my personal Ubuntu-Linux quad-core PC, 4GB RAM in serial mode. While the data is not available for public use, it should be easy to generate random instances of similarly sized LPs and do your own tests.

The result:CPLEX-dual simplex is nearly 40X slower on this instance.

Problem stats: 6 Rows, 935645 Columns, 3192263 Non zeros

Gurobi solves it in 76 iterations and 10.16 seconds
Optimal objective 9.531245720e+05

Tried aggregator 1 time.
LP Presolve eliminated 0 rows and 392 columns.
Reduced LP has 6 rows, 935253 columns, and 3191065 nonzeros.
Presolve time = 3.06 sec.

Initializing dual steep norms . . .

Iteration log . . .
Iteration: 1 Dual objective = 1203067.101646
Solution status = Optimal
Solution value = 953124.5720420766
Solution time = 391.32 seconds

It is well known that f your dual-simplex implementation is fast, all your branch-and-cut operations that rely on dual-simplex will also be that much more faster.

CPLEX-Primal was even slower, but CPLEX-Barrier does it in about 100 seconds (including the cross-over to a corner solution), which is still 10X slower. I tried many other tweaks with CPLEX for what should have been a relatively quick and simple problem to solve for an industry-standard LP solver, but without much improvement. To be fair to CPLEX, which is still a fantastic product, this is just one instance. Without the barrier solver as yet, Gurobi may be slower on LPs that are strongly amenable to interior point methods (more on that in a future post).

Hopefully, the owners of these products will continue to devote R&D effort toward these two great products and keep pushing the envelope, so we practitioners get the best of both worlds!

Disclaimer: These are purely my personal observations made in an unofficial capacity, based on tests on a very limited sample of real-life data sets, and do not reflect the views of my employers or associates. I am not affiliated with Gurobi or ILOG-IBM.

Wednesday, May 20, 2009

IPL update - More on the millisecond, and some Game theory

Two tabs in a day. This one was necessitated by IPl happenings, so apologies.

First, Ravi Shastri is the first IPL commentator to finally pick up on Raina's feinting action that this tab mentioned a few weeks ago in "the longest millisecond". Raina just bowled 4 overs for 13 runs with 2 wickets to sink the Punjab-11, clean bowling yuvraj (6 of 19 balls!) with that technique. He earlier bowled the last over in the high-scoring previous match against SRK's circus, and did so really well and almost got them to victory using his methods.

Second, it's game-theory time, which of course means duality. With the Punjab loss, 3 teams are vying for two spots (B'lore, Deccan, Punjab). The three teams are tied on points, with a game between Deccan and Blore left. Teams tied on points will be selected based on net run rate'. Obviously the winner goes thru, but that will be known only after the conclusion of the match. How should Blore and Deccan approach their match to maximize their chances of grabbing the remaining two spots? Its a classic team sport situation.

A) maximize your optimistic objective and go all out for a win, or the dual option:
B) minimize your worst case to ensure that no matter what happens, u grab the spot on net-run-rate

Punjab will certainly be hoping that the victory margin will be huge. In particular, home team Bangalore's net run rate is in the middle, below Deccan, so a bad loss would probably eliminate them. Too much dual noise..... Here's this tab's strategy for the home team:

1. win the toss. (heh). bat first and aim for a decent par score around 145. the logic is that unless u get a really low score, Deccan is not going to go crazy chasing it down in 17 overs. seeing dravid and kallis batting happily at run-a-ball with calm deccan nerves and they'll relax too. so your final net-run rate will not change much.

2. if u lose the toss - deccan will probably bat first and since they dont want to collapse, they are going to bat the same way. but gilly's game theory is 100 of 50 balls, so u have to get him out soon or you are IPL history very soon.

in some ways, the 2 teams will be playing punjab tomorrow. so if neither team rocks the boat and ensures an exciting last over finish, punjab-11 will sadly be eliminated. in short, play smart and reasonably aggressive cricket, keep wickets in hand, bowl well. Its' just sensible 20-20 cricket in the end. the math will just back u up. Now, if Buchanan coached Blore, we will lose for sure :-)

Death of a tiger

If you have traveled through the Shivajinagar area of Bangalore, India in the 70s and 80s, you would have seen a large photo of Vellupillai Prabhakaran next to the bus stand, in one of the many Tamizh-owned shops on the busy main road. That area was dominated by the Muslim and Tamil communities in those days, and some Dravida party candidates even won elections in those areas. VP was finally killed in North Sri Lanka yesterday. Looking at the newly released photos of him with what sure looks like a beautiful family is surreal, and triggers a lot of questions. VP's actions have several dual elements to it, riddled with noise as usual.

Like the old west, the gunslinger turned lawman is the hero everybody desperately wants until his heroic shootout. The dual aspect is that he then becomes the only guy in town with a lethal gun and therefore a nuisance, and ideally one who should have gone down while taking the outlaw out. Gunmen who outlive their welcome become the very problem they eliminated in the first place. Like all maoist/militant groups, the LTTE also falls in this category. They do not want to relinquish the power earned from the barrel of a gun. They first fight the fanatics (in this case, the Sinhala Chauvinists), but they reach a certain point where they become what they fight against. It's a classical but vicious fratricidal, boom-and-bust cycle - of who is more fanatic. LTTE's ruthless elimination of all common-sense, moderate Tamizh leaders is well documented. Ultimately, the movement is in tatters since the most fanatic are rarely the smartest, and are doomed to die a lonely death. If the Sinhala majority will allow for pluralistic views based on mutual self-respect, then a new LTTE will not spring up, else the new, deadlier VP is 10 years old today. Muthiah Muralitharan is an good positive example. He is the most successful cricketer in the history of Lanka, and is Tamizh, and morever, has been fiercely defended by (Sinhala) team-mates through all controversies. On the field, they are all Lankans. (Cricket rules!)

That photo of VP captured my imagination. India supported these freedom fighters too. That quickly disappeared when VP's gunmen entered an apartment in Madras and wiped out entire Tamizh families in cold blood. Folks who cry for VP today should also pause to reflect about these families and their offspring that never will be because of this man and an entire generation of smart Tamizh leaders who were wiped out, who will not be there today to provide leadership. In short, after all the fighting and the 100,000 deaths, the Lankan Tamizhs are worse off than just being back to square one. A new and smarter leadership for the 21st century has to arise, but from where?

The war nerd always has a wacky take on the LTTE.

Wednesday, May 13, 2009

A tale of two airlines: The flying jails of British Airways and Air France

The service levels on British Airways (BA) and Air France (AF), in particular has been going rapidly downhill over the last few years. There are countless web reviews of nightmarish traveler experiences on these two carriers. Them flying jails have some nasty wardens. This week's incident, where all the Indians were rounded up in a herd and kept in a room for 16 hours with little comfort, food and drink, is just the proverbial final straw, and its about time we say NO to AF and BA. A couple of family members flew BA's flying jails a year ago (premium economy or equivalent), and the experience was so bad (rudeness bordering on racism), they discarded the return tickets, losing all the money, and just returned to the US on another airline. Losing your dignity is just not worth it. Lufthansa is not too far behind, so I have skipped European carriers for good. I dont know if they hate Indians, or just hate me :-) These airlines have taken hospitality back to the dark ages. A stop-over in Europe is a bad option for Indian Americans in the Midwest and east coast.

Despite my paranoia about the middle east, Emirates via Dubai appears to be a great alternative. The crew is more cosmopolitan and friendly and recent feedback suggests that it is the best option to get to India. Lots of cricket videos and movies for personal viewing. On-time performance is good too and its cheap. Based on current performance, it is certainly the way to go.

Tuesday, May 12, 2009

Dual Noise

An underlying intent of this tab is to explore duality. A belief that there is a counter-balance to everything, that there are always two sides to a coin. neither of which is fully clear unless you understand the other. In other words, the truth is "not this alone". We speak and somebody listens, We write and somebody reads. Cause and Effect, Yin and Yang, What goes around .... If we pay careful attention, the more we learn about the first one ("the primal"), we get to know a lot about the other one ("the dual"). In fact, Modern O.R theory and practice is founded on the concepts of mathematical duality. In Hindu Philosophy, duality (and non-duality) are fundamental recurring themes (Dvaita, Advaita).

In virtually every instance, what we write about or speak of is only an approximation of our intent, and what we read and hear is a further approximation of that primal intent. Crime and Punishment are rarely commensurate. In other words, while duality is a powerful property that helps us get closer to the ultimate truth, it is riddled with a lot of noise that is 'lost in translation' that considerably confuses the issue. Mathematically, dual noise is a phenomenon observed in Operations research where sometimes, your raw dual information does not guarantee a better understanding of the primal problem. One reason for this is degeneracy (multiplicity). A seemingly endless number of paths that have to be explored to discover the truth. This is yet another OR theme that always shows up in practice. There seem to be many truths! Which of these truths is the 'best' truth?

So this tab, when tired of tooling, will try to explore various events in real life through the prism of duality, and try to characterize it using some of the concepts described above. It's a lofty yet unclear goal that's set up to fail, but for every primal failure, there's got to be dual success, right?

Saturday, May 9, 2009

Mothers Day - An Acoustic Guitar Tribute

This is a simple instrumental improv of the wonderful song (amma endrazhaikkadha) from the movie 'Mannan'. You can find the original video on youtube here.
The song is approximated in 'C' using simple open chords (you can find it here if you are interested). The tabs are replayed over the chords to give it some melody. It's recorded using my 2-year old's mic, so sound quality is iffy.

Hope you like it. video

Thursday, May 7, 2009

The longest millisecond

Suresh Raina's talent is dazzling, as is Rohit Sharma's. The Latter took a hattrick yesterday, while the former came up with an amazing bowling cameo. In an inspired move, Dhoni brought him in to bowl the 15th and the 17th overs (in a match reduced to 18 overs) at a point when Yuvraj and Mahela were belting sixes like crazy. He came up with this gem:
SK Raina 2 overs, 8 runs, no wickets

12 balls without a single boundary when everybody else was getting hit quite easily during the death overs. How did he do it? This tab has a theory.

He appears to have developed a 'feinting' bowling technique - that can be visually explained best by looking at examples like the famous Brazilian soccer player Socrates before he used to take penalties, or the Pakistani hockey player Shabaz's (or Ronaldinho's) deft dodge-moves at the last instant, leaving a defender behind. Every delivery appears to be a game played out in the milliseconds during which the batsman or the bowler blinks first and commits to a move. Raina is able to delay his delivery that millisecond more, and the results are amazing. It has worked so far, and will work until he comes across a batsmen who can stay still that fraction longer. Would be interesting to see him bowl to Sehwag who has the ability to stay still the longest and spot the bowler's intent before the rest of the stadium catches on.

Sports at the highest level, always appears to be played in these milliseconds.

Sunday, May 3, 2009

IPL-II: Ball of the Tournament

The credit goes to the young Indian, Sudeep Tyagi of Chennai SK, who missed out on the first IPL due to a stress fracture. Cricinfo has a nice piece on him here. The quality of TV commentary has hit a nadir during the IPL and it is painful to see past cricket legends and ex-players donning the role of peanut hawkers. They were so busy playing vending machine that they spent too little time on this ball (cricinfo scoreboard)

AB de Villiers b Tyagi 0 (1 ball)

AB is probably the best of the young international cricketers who have already made their mark in the tough world of Test Cricket. Coming fresh of his success in previous IPL matches, the first ball he received from Tyagi shaped away, but then hit the seam and came in to rattle the castle. Tyagi of course, had just gotten a wicket the previous ball. An outstanding performance on IPL debut and I hope he is consistent enough to play for India in the future. Dhoni and Warne certainly seem to inspire the rookies.

The second ball of the tournament was also bowled in this match:

TM Dilshan b Jakati 13 (13 balls)

- this time by Indian spinner Shadab Jakati, who took out TM Dilshan, another in-form batsman. Both these players were clean bowled on defensive strokes in a T20 match. Good cricket is still alive! Too bad the third-rate commentary (except Bhogle) is too busy selling everything other than the many good cricketing moments (To to be precise, 'many' is relative to IPL-I that was played on flat Indian tracks with no bounce). 'DLF Maximum Swindle' and 'Citi Moment of Madness' would be apt for these two morally and financially bankrupt IPL sponsors. sigh.

Home team Bangor, err, i mean Bangalore, has risen from the ashes and has smartly picked an Indian-South African combination. 7 of the 8 teams are now within a point of each other, so its a dogfight. With classy Indian test players in the form of Kumble and Dravid, B'lore may still make it to the semis - but they will need to win 4 of their remaining 6 contests. For this, they have to keep their current hot streak alive...

And finally, Buchanan must resign. Its not the same without Warne, McGrath, and Gilchrist, is it?