Prisoner's dilemma

The Prisoner's Dilemma is a fundamental concept in game theory.

The cops have caught two prisoners and do not have sufficient evidence. They decide to put them in separate cells and give the choice to either betray the other person and be free or be silent.

Case Prisoner 1 Prisoner 2
1) Betray (go Free) Silent (10 year Jail)
2) Silent (10 year Jail) Betray (go Free)
3) Silent (6 month Jail) Silent (6 month Jail)
4) Betray (5 year Jail) Betray (5 year Jail)

What would you do?

Game theory deals with this topic nicely.

Paid 300 as bribe to a policewala

That was near the corporation circle where the vehicles and people are generally crowded. I missed the signal and I realized only when people crossing the road that I had missed it. Got caught by the police and with the routine checks, I noticed that I did not have emission certificate with me.

My bad, 2 offenses. 1) Not stopping at Signal and 2) Not having emission certificate for my vehicle.

But the Police guy wanted to add another offense as 3) dangerous driving. When pleaded and argued that I was not driving dangerous, he just reminded that it is his decision to inform that was I dangerous driving or not and wanted to put fine as Rs.800/- with dangerous driving fine as Rs.500/-.

With lot of requests and conversations and he pulled in two of his friends and to settle the matter, was happy if I pay him Rs.300/-. I did not think much, thought it was okay, just giving him money for his himself and house, rather than lasting it further and gave Rs.300/- as bribe and came back.

Today morning as I recollect it, I think I did wrong.

1) Have my papers ready and be ready to pay the fine would have been more appropriate.

2) Unnecessary talking could have been avoided.

But in the instance when wrongly charged all I wanted to was escape and Rs.300/- for that escape was bit costly.

Previously, near the Indiranagar to Koramangala flyover, when the cop caught me, I had emission certificate but not insurance. So just checked the emission certificate and for the lack of insurance instead of fining Rs.300/-, he just gave Rs.100/- back and pocketed Rs.200/-. I did not say anything then either, thought Rs.100/- saved.

# of sourashtra speaking people

I did some rough calculation and arrived at this number: 1234021 ( that is 12 lacks 34 thousand people).

I based the calculation according to following facts:

1997 IMA - 510000 (the info says, it can be double the number), So I took 1020000 to begin with.

Birth rate in India: 22 births / 1000 people

Date rate in India: 6 deaths / 1000 people.

Just wait a Second.

1 second has been added to this year, according to the official time keepers at http://hpiers.obspm.fr/iers/bul/bulc/bulletinc.dat

So our clocks at Bangalore should have been:

1 Jan,2009

5:29:58

5:29:59

5:29:60 <--- Hurray!

5:30:00

Greedy vs Non-Greedy in Re - Good Example

Here is a good example to explain greedy vs, non-greedy search using module re in Python.

The '*', '+', and '?' qualifiers are all greedy; they match as much text as possible. Sometimes this behaviour isn't desired; if the RE is matched against '

title

', it will match the entire string, and not just '

'. Adding '?' after the qualifier makes it perform the match in non-greedy or minimal fashion; as few characters as possible will be matched. Using .*? in the previous expression will match only '

'.