Wednesday, July 26, 2017

Concentration and Awareness - great Tedx talk by Dandapani




Given below is a link to a great TedX talk on 'concentration'.

We are what we think - our life is a manifestation of where our energy is flowing.  The science of yoga holds this to be paramount, which is why yoga exercises are more than mere physical postures, they are exercises in controlling the mind, in making the energy flow in a desired direction, to focus within, to be aware, and to merge with all your senses into what you are doing. Yoga exercises done with this kind of awareness are a transformational experience.

Swami Satyananda of the Bihar School of Yoga in his excellent book on Kriya Yoga when he talks about meditation,  says it is impossible for people to meditate nowadays since they are never relaxed. To achieve perfect relaxation is an art in itself, and the primary pre-requisite for it is Awareness. Awareness, or absorption in any one thing, with your  mind and all your senses, leads to concentration; concentration in turn leads to a meditative state, which need not wait for you sit in the lotus position and chant some esoteric mantras - meditation can be a state which you can aim to achieve in your every activity, every moment of the day. Meditation is also something that you cannot 'do', you prepare the right conditions and just slip into it, like you slip into sleep. And extreme relaxation, which is a result of focused awareness, is the foundation to our health and well-being.

The video below is a good primer on the first step 'Awareness'.





Dinesh Gopalan



Tuesday, March 21, 2017

The King and the Poisoned Wine: An interesting problem, with solution explained



The King and the Poisoned Wine: An interesting Problem

 

I got introduced recently to an interesting math problem, (thanks to Srikumar Raman). The problem goes like this:

 

A king has an important party coming up where he intends to serve the wine from his cellars. There are 500 barrels of wine in all, but there is one problem. One of those barrels contains poisoned wine – even a drop of this wine will kill.

 

The king also has a prison which is full of people whose lives are expendable. It is one of the king's pastimes to use the prisoners for various experiments where their lives are put at risk.

 

Now for the problem on hand:

 

(The requirement in each case is to find the minimum number of prisoners needed to test the wine.)

 

 

Level 1

 

The poisoned wine will kill anytime within 24 hours, i.e. if any person consumes it, he will die sometime within that period. The king wants to test the wine using his prisoners so that he finds the poisoned barrel and keeps it aside for future use, this party not being one such intended use.

 

The party is to be held 24 hours from now.

 

How many prisoners are needed in all to test the wine? Your job is to minimise the number of prisoners needed to test the wine. It does not matter how many prisoners die in the experiment.

 

Solution to Level 1:

 

In case the party is to be held at an indefinite future date, then all you need is 1 prisoner. Every 24 hours, he is fed some wine from one of the barrels. He will eventually die of poisoning, and that particular barrel can be segregated.

 

However, we have only 24 hours. Since it does not matter how many prisoners die, we need to line up the required number of prisoners, and feed them a 'combination' of wines from identified barrels. For each barrel, the combination must be unique, for example, if Prisoners  A,B,D, and E die, it will identify, say, Barrel 27, or some such.

 

How do we arrive at the most effective combinations to minimize the number of prisoners?

 

Assume there is only one prisoner. How many barrels can be tested? Two. You make him have the wine from Barrel 1. If he dies, that is the poisoned barrel; if he does not, Barrel 2 is the poisoned barrel.

 

Assume there are two prisoners. You can test four barrels. Prisoner A gets wine from Barrels 1 and 3. Prisoner B from Barrels 2 and 3. If only A dies, Barrel 1 is poisoned. If only B dies, Barrel 2 is poisoned. If A and B both die, Barrel 3 is poisoned. If none of them die, it is barrel 4 that is poisoned.

 

You get the idea. The most effective way of arriving at the combinations for 500 barrels is to number each of the barrels from 0 to 499 in binary. To write the numbers 0 and 1 in binary, you need one digit. To write 0 to 4, you need two digits, to write 0 to 8 three digits, 0 to 9 four digits and so on.

 

If there are n binary digits, we can write all the numbers from 0 to ((2 ^ n)-1)

 

You need nine binary digits to represent all numbers from 0 to 511, and hence, nine binary digits for the 500 barrels that will be numbered 0 to 499.

 

Pick 9 prisoners, label them A to I. A will represent the rightmost digit (2 ^ 0), B will represent the next digit from the right (2 ^ 1), and so on, till I, who will represent 2 ^ 8 = 256.

 

Like this:

 

 

I

H

G

F

E

D

C

B

A

2^8

2^7

2^6

2^5

2^4

2^3

2^2

2^1

2^0

256

128

64

32

16

8

4

2

1

 

Taking a few barrels as an example, Barrel nos. 0,8,303 401 and 499 will be represented as follows in binary:

 

 

I

H

G

F

E

D

C

B

A

 

2^8

2^7

2^6

2^5

2^4

2^3

2^2

2^1

2^0

 

256

128

64

32

16

8

4

2

1

 

 

 

 

 

 

 

 

 

 

0

0

0

0

0

0

0

0

0

0

8

0

0

0

0

0

1

0

0

0

303

1

0

0

1

0

1

1

1

1

401

1

1

0

0

1

0

0

0

1

499

1

1

1

1

1

0

0

1

1

 

 

Number all the barrels from 0 to 499 using the above binary scheme.

 

Make Prisoner A drink the wine from all barrels marked 1 in column A.

Make Prisoner B drink the wine from all barrels marked 1 in column B.

And so on…

 

 

At the end of 24 hours, if you find A,B,C,D,F and I dead, it is barrel no. 303 that contains the poison.

 

If Barrel No. 499 has the poison, all prisoners except C and D will die.

 

If no one dies it is of course barrel no. 1 that is poisoned, since that is the only barrel from which no one drank.

 

So, in order to test 500 barrels (actually any number upto 512 barrels) you need 9 prisoners.

 

The answer is, thus, nine prisoners.

 

 

(Thanks to Dilip Thosar for solution to Level 1)

 

Level 2

 

The party is 48 hours from now – other conditions remain the same. What is the minimum number of prisoners needed?

 

 

 

Solution to Level 2

 

There are two time periods available now. So you can divide the barrels into two lots of 250 each. For the above lot, applying the same binary system explained above, you will need 8 prisoners. If you find the poisoned barrel, fine; else, use the same 8 prisoners and repeat the experiment in period 2.

 

Now, 8 prisoners is a good solution, but not the best. Let us try for a better solution.

 

When one time period was available to test the barrels, we used the number system with base 2. Now let us try using the number system with base 3. If there are n digits, we can represent 3 ^ n numbers in base 3. Base 3 of course will only use the digits 0,1 and 2.

 

6 prisoners can represent 729 numbers, viz., all numbers from 0 to 728.

 

Number the barrels using the base 3 number system, like so:

 

 

F

E

D

C

B

A

 

3^5

3^4

3^3

3^2

3^1

3^0

 

243

81

27

9

3

1

 

 

 

 

 

 

 

0

0

0

0

0

0

0

8

0

0

0

0

2

2

303

1

0

2

0

2

0

401

1

1

2

2

1

2

499

2

0

0

1

1

1

 

 

For this example, let us assume Barrel No. 303 is poisoned.

 

In Period 1, let each prisoner drink wines from those barrels under his respective column that are marked "1".

 

In this case F will die. Mark a "1" under column F.

 

In Period 2, let each surviving prisoner drink wines from those barrels under his respective column that are marked "2".

 

Continuing the example,  B and D will die. Mark "2" under those columns.

 

Put "0" in the unmarked columns, i.e. columns A, C and E.

 

You end up representing the number 303 in base 3. Thus, you have found the poisoned barrel.

 

And you need only 6 prisoners to do it.

 

 

 

 

Level 3

 

The party is 72 hours from now –

 

 

Solution to Level 3:

 

This time we have three testing periods, hence represent the barrels using Base 4 notation. You will need 5 prisoners to solve the problem for anywhere upto 1024 barrels.

 

So, 5 prisoners are enough.

 

Level 4

 

The party is any 24x 9 hours from now, i.e. nine testing periods are available.

 

Solution to Level 4:

 

Since we have nine testing periods, use the decimal numbering system, the one we are all familiar with. Three prisoners are enough to take care of upto 1000 barrels.

So, in case nine testing periods are available, three prisoners are enough.

 

 

Level 5

 

Back to Level 2, i.e. the party is 48 hours from now. But with a twist. The wine will kill anytime exactly between 23 and <less than 24> hours, i.e. it will kill in 23 hours and n minutes, n being less than 60.

 

 

Solution to Level 5:

 

 

Arrange the barrels in a grid of 23 rows and 23 columns. Since there are only 500 barrels, some slots will be empty, but that does not matter.

 

You need only two prisoners. Let prisoner A drink all wines in Row 1 in Hour 1, all wines in Row 2 in Hour 2, etc.

 

Let prisoner B drink all wines in Column 1 in Hour 1, all wines in Column 2 in Hour 2, etc.

 

Both will die. Depending on when exactly each of them dies, you can establish which barrel is poisoned.

 

(Thanks to Srikumar Raman for solution to Level 5)    


Saturday, January 21, 2017

On Trump's inauguration


Every new dawn heralds a change,
What else is left for them but hope?
They hope this time it'll be different,
But somehow, their cheers ring hollow!

They are now a nation divided,
About the man they helped elect;
Bemused, they watched him take the post,
Even as he was derided!

He went from victory to victory,
Buoyed up by hate and invective,
And by one set of dispossessed,
Who didn't care how they wrought the change!

They watch in fascinated horror,
At this new being that has risen,
As an answer to their prayers,
from the sacrificial fires!

The were the ones who lit the fires,
And, chanting, poured in their oblations;
Now look at them transfixed in terror,
As they behold their own creation!

Dinesh Gopalan
21 January, 2017
 



Friday, December 23, 2016

Memories of a Reunion - In Haiku form


My attempt at writing Haikus - this is as a result of my IIM batchmate Giri's prod on whatsapp today to write something about our 30th anniversary Reunion (held on the 9th to 11th of this month), in Haiku form.

First time I am attempting Haikus, so I crave your indulgence if some of them seem a bit clumsy...

dinesh

(Haiku is a Japanese art form. Haiku in English usually follows the 5-7-5 syllable format, though this is not a hard and fast rule. It is usually about nature, or something the poet observes; two lines suggest one thought, there is a break in thought with the other line suggesting something else in juxtaposition. Supposed to be indicative, inducing thought in the reader, and not descriptive. It expects the reader to fill in the blanks with the mental images thus conjured. I just read the rules on Wikipedia)

A crowded city - 
No vultures on the tower,
Diclofenac deaths. (1) 

More and more students
Staying awake in the nights - 
Cafes on campus. (2)

A virtual world,
Professors struggling to cope - 
More brick and mortar. (3)

All concrete blocks,
I miss the old world charm - 
Back to Harvard steps. (4)

Louis Khan Plaza - 
Redolent Library books,
Which no one now reads. (5)

All of us older - 
Teenagers young and sprightly,
How time moves on. (6)

Sunlight through the walls -
This is the place where I studied,
And found my footing. (7)

Remember my love,
This is where we used to sit - 
Oh! How the time flies (8)

Now empty classroom - 
This once shady bower,
Where we used to meet (9)

The late night studies -
Chai and omelette at the gate,
Weekly trip to Lutf (10)

Vadilal parlour - 
Now I can't eat the Ice Cream,
Damn Diabetes (11)

Cranky professor - 
The dorm where we used to stay,
Happy dorm nights (12)

Life is sweet and sour - 
This is where it all began,
The sweetness remains (13)

I found my life mate - 
My father used to send fees
for me to study (14)

The same old buildings -
See those students passing by,
It was you, and me (15)

I wrote on this wall, 
How time erases writings - 
Can I write again? (16)

Morning sun shining - 
Some things I see only now,
Small, important things (17)

My teachers of then,
Now I want to touch their feet - 
I now understand (18)

Confused teenager - 
Three decades outside the walls,
Returning is sweet (19)

Come here oh my love,
This is where we used to meet - 
Our now daily fights (20)

How I came running - 
That same tree, that same room,
May be I have changed (21)

I see but see not - 
Are my memories what is here,
Why then this dull ache (22)

Climbing up the stairs - 
The stars shine in the night sky,
Too many lights (23)

Ant crossing the path,
It used to be paving stones - 
The sky looks the same (24)

Did I ever read - 
The people who crossed my path
Have taught me so much (25)

Place is scrubbed and clean - 
I picked up so many things
Most of it clutter (26)

How I used to be -
Full of hope, smiles and laughter - 
Life is now more full (27)

Convocation gown,
My parents watching with pride - 
Now they are gone (28)





Wednesday, December 21, 2016

By whom are we being led?

The Utopian ideal is here,
Holy Grail within touching distance;
All the beliefs we hold dear,
Are the true path to redemption!

Democracy, motherhood, apple pie,
Women in arms, on the frontlines;
Universal suffrage, gay rights,
Man's place too is in the Kitchen.

Secularism as negation,
of any religion at all;
Burkini fights, women's rights,
Compulsory bikinis for all.

Fifty six different types of gender,
Makes me wonder if I'm a man;
Political correctness gone amuck,
I'll shut up, I'm offending myself!

Cash is bad, the devil uses cash,
Upload all lives on to the Cloud;
Big Brother will be my Mama,
In charge of my online, naked life!

Globalisation, free trade, exports,
Nothing belonging to me is mine;
Silently the invisible Force,
has made us all to think alike.

The beliefs go deep, into our Souls,
That all of should be one, alike;
Are we thinking or being thought,
lIke sheep, to the slaughter being led?

Anything unique, artisanal,
Cannot be cast from the same mould;
Each turn of the wheel makes a new pot,
Beauty lies in none being alike!

The Lone Wolf I would rather be,
Cast out of the Pack, ranging alone;
Than part of a herd thusly led,
Why should all our fates be the same?