Tuesday, January 8, 2013

Barber Shop Eureka

************************************************************************************************************


 



We read plenty of Greek mythology in our school books...Helen of Troy and her Trojan Horse, Ulysses and his Cyclops, Philippides and his Marathon, Socrates and his termagant wife Xantippe and many others. We also had Pythagoras and his Theorem and its proof to mug up.

But the cake went to the story of Archimedes and how he discovered his celebrated Principle in his bath tub and cried: "Eureka!" and ran out to his King as naked as the heavens. 

Some moment that!

In the beginning I never followed what the hungama about the gold crown was all about. After all he had to find the density of the crown and he could weigh it in a balance and divide it by its volume. To get its volume all he had to do was to sink it in water and use the Displacement Method a la the drunken duo of the Maupassant story, 'Sale', where they drowned their woman in a tub full of water and measured her volume in liters by the amount of water she displaced (by counting the number of mugs of water they had to pour back in):

 http://gpsastry.blogspot.in/2010/03/sold-women-bold-women.html

It was only when I came to the Principle of Flotation that I enjoyed the Archimedes Principle. But, not quite understood all its ramifications. After reading, writing, and teaching Physics all my working life, I discovered one day that I am the 4th Idiot. I was wondering how all this global warming could raise sea levels by melting the Arctic glaciers. For, the Principle of Flotation and its famous rider told us that when a floating piece of ice  melts it doesn't change the level of water in the beaker.

It took many months for me to realize how stupid I was to think that glaciers are like icebergs floating on seas...they are solid ice formed on rocky mountains that rise above the seas. That was for poor me a Eureka moment! One among thousand such silly stuff.

There was but one moment that made me do something as crazy as Archimedes...I woke up my sleeping sister past midnight to announce my Eureka.

It was like this:

My friend NP and I were playing with what are called Series Production Systems and their efficiency...our own P. M. Morse is the Father of their theoretical study which he did during his War Years. 

Let me illustrate:

Suppose we have a barber shop with a greedy owner. He instals two chairs and employs two barbers to man them. There is a perennial demand for barbers in his locale and his shop is always full with waiting customers. At first each of his barbers was doing the entire hair-cutting-shaving drill and the process was slow and his margins were meager in this parallel processing.


 
 


He then hears of Henry Ford and his Assembly Line:

 

 


And divides the barbering work equally asking his first barber, Ramu, to specialize in scissor-work (clipping hair) and forget about the razor-work (neck and beard) which he allots to the second barber, Shyamu. So they become super-efficient in no time in their specializations. Each incoming customer first goes into Ramu's chair and then into Shyamu's before quitting.

The problem is that heads and beards of all customers are not identical. Some beards are bushy and take more time while some heads are baldy and take less time to service...and vice versa. They come in various 'distributions' like the Exponential (Poisson). The two barbers have  the same Mean Service Time with the same Variance say. 

So, when Ramu is through with his job but Shyamu is not, the customer has to sit and wait in Ramu's chair which is 'blocked'. On the other hand, at times when Shyamu is quicker than Ramu, he has to 'idle'. 

The problem is to figure out the mean number of customers getting serviced in a day.

The earlier method called the Method of Stages was algebraical. We wanted to do a calculus method that can be applied to distributions other than Poisson. It was a pretty easy thing to do...it resulted in a double integral.

Now the Owner of the barber shop gets greedier and instals a third chair in between the two and employs Bhimu to man it. His specialization is Massaging (Malish). He is given the nail-clipping and kneading work. And he too takes the same mean service time with the same variance as the other two say.

Now what is the 'throughput' of customers?

It turns out to be tricky...with so many blocking and idling times...it results in a horrendous double integral equation with nested limits and also an inhomogeneous thing and doesn't fall under the well-known stuff of math books. We were struggling to get the solution for this and groping in the dark.

At that time my younger sister was staying with me at IIT KGP in our Qrs C1-97 and studying for her PG Diploma in Physics. So, while walking home one evening I hit upon what could be the solution of the cussed integral equation when Bhimu was absent one day. But the answer was not matching with the known result of a two-barber system that we studied earlier. And that worried me. And I talked about it with my sister.

That night at 2 O'clock I happened to wake up and visit the bathroom. And there it occurred to me that when Bhimu was absent the Owner DIDN'T remove the middle chair. So, when Ramu was through with his scissor-work, his customer didn't have to block Ramu's chair, but shift to the middle chair of the absent Bhimu if it was vacant...so also Shyamu needn't idle if there was a customer in the middle chair waiting. And everything gelled...

It was then no longer a simple 'Two-Stage System' but a 'Two-Stage System with a Buffer'...

And once THAT got cracked, the rest flowed like champagne...

That Eureka was too much for me and I woke up my poor sister from her dreamless sleep and hammered her...

*************************************************************************************************************

No comments:

Post a Comment