Tuesday, November 17, 2009
Tuesday, September 22, 2009
If twitter existed
Twitter is an addiction for some and JASN (Just Another Social Networking site) for others. What if twitter existed in the past? This is a South Park-ish attempt to generate humour with that idea.
mlkingjr
I have a dream that one day this country stops FUCKING AROUND with niggers. "I have a dream" @ http://niggerforlife.blogspot.com
indian_nightingale
Count me in. RT @mkgandhi Sick of British colonialism. Going to Dandi to make salt. Anyone game?
adolf_hitler
Please support killing innocent jews by adding a swastika to your profile pic. Takes just a click http://tinyurl.com/nazi123. Kindly Retweet #hatejew #nazi
showmansteve
@johnscully Do you want to spend the rest of your life selling sugared water to children, or do you want a chance to change the world?
A few years later...
johnscully
@showmansteve You are fired.
einstein_emc^2
@maxborn @god doesn't play dice. He is more of a poker guy. How is @schrodinger's cat btw?
jimi_hendrix
Note to self: Don't get too stoned and burn your guitar. It fucking costs a lot of money.
neilarmstrong
is walking on the moon :) (via @tweetNASA)
The number of tweets are low due to lack of appropriate pop culture references and racist jokes. Ideas are welcome and will be appreciated.
mlkingjr
I have a dream that one day this country stops FUCKING AROUND with niggers. "I have a dream" @ http://niggerforlife.blogspot.com
indian_nightingale
Count me in. RT @mkgandhi Sick of British colonialism. Going to Dandi to make salt. Anyone game?
adolf_hitler
Please support killing innocent jews by adding a swastika to your profile pic. Takes just a click http://tinyurl.com/nazi123. Kindly Retweet #hatejew #nazi
showmansteve
@johnscully Do you want to spend the rest of your life selling sugared water to children, or do you want a chance to change the world?
A few years later...
johnscully
@showmansteve You are fired.
einstein_emc^2
@maxborn @god doesn't play dice. He is more of a poker guy. How is @schrodinger's cat btw?
jimi_hendrix
Note to self: Don't get too stoned and burn your guitar. It fucking costs a lot of money.
neilarmstrong
is walking on the moon :) (via @tweetNASA)
The number of tweets are low due to lack of appropriate pop culture references and racist jokes. Ideas are welcome and will be appreciated.
Sunday, September 20, 2009
Tharoor and Twitter
It is strange to see a tweet making it to the front page in a country where 35% of population is illiterate and a significantly higher percent (including my parents) do not understand social media. Nevertheless, Tharoor succeeded in getting away with it and Congress got some publicity for the austerity campaign. It is a win-win situation. Shobaa De (who btw doesn't know it is tweeting and not twittering. What a n00b!) says it is cool as long as they pay for it. Chetan Bhagat talks about how our netas should improve their sense of humour.But is it all that simple? If you are reading this post, you think it is. But imagine reading about it in the newspaper about some minister who refused to stay in his house because there was no gym there and called common people cows on the internet. What kind of an impression would it create?
I totally agree that the congress austerity campaign is merely an act of tokenism and all the hue and cry about Tharoor's comments doesn't make sense. But when you are representing people you should ensure that all of them understand the context of your statements especially when they are made about them. It doesn't create a good impression when you publicly refuse your accomodation and pay (may be out of your pocket) for a 5-star hotel when half of the people that you represent do not have food to eat. So should he be a saint and abandon his comfortable life? No. All I am saying is do not act in a way which thrusts into their face, the disparity in your lifestyle and theirs.
We (Web aware Indians) constitue a very small portion of the electorate and if we lose an able leader like Tharoor just because a lot of others cannot relate to him or his lifestyle, it would be sad. And the media should also be responsible enough to give a complete background of the situation before putting it on the front page.
Labels:
Common Man,
Congress,
Leader,
Tharoor,
Twitter
Monday, September 14, 2009
Absolut Minima
Global Minimum. That is what I would call my life right now. I knew it was coming since a long time but I was too arrogant to accept it. Thought I was good enough to handle it but I cannot convince myself any more. There was a time when I actually did things rather than talk about them. When I was actually good at what I did than show off that I was. When I inspired people and cared about them than acting indifferent. Had the balls to take up a challenge and fail trying. I seem to have lost that ability somehow. I don't feel myself anymore. All that I am right now is a pretentious bastard living in an illusion. I am nothing but a disappointment to all the people who believed in me (including myself). I don't know if I will ever be myself again. But if I don't try, I know I never will.
Labels:
college,
depression,
me
Wednesday, August 12, 2009
Psenti-Sem
The following are the activities that will constitute most of my final semester on campus
- Getting bit by LGMF's and other wildlife in my bhawan
- Convincing people that Microsoft Windows actually sucks
- Attending first year classes and hitting on first year girls
- Conning my project professor
- Being under the influence every alternate day (at the least)
- Taking a "trip"
- Campaigning in elections for the "gults"
- Coding a virtual pet
- Plan "the road trip" with Andy
Labels:
bits pilani,
chill,
lazy,
psentisem
Friday, July 3, 2009
Prisoner's Paradox : Solution
Here is an interesting math puzzle that I found here:
The objective:
Three condemned prisoners share a cell. A guard arrives and tells them that one has been pardoned.
"Which is it?" they ask.
"I can't tell you that," says the guard. "I can't tell a prisoner his own fate."
Prisoner A takes the guard aside. "Look," he says. "Of the three of us, only one has been pardoned. That means that one of my cellmates is still sure to die. Give me his name. That way you're not telling me my own fate, and you're not identifying the pardoned man."
The guard thinks about this and says, "Prisoner B is sure to die."
Prisoner A rejoices that his own chance of survival has improved from 1/3 to 1/2. But how is this possible? The guard has given him no new information. Has he?
This is a classic example of a paradox usually encountered in the theory of probability. Like most other paradoxes it might seem a bit confusing initially but there is a simple technique to come to the correct conclusion.We studied it in school and it is called Baye's theorem.Let us take a closer look at the problem:
The objective:
We need to find out what is the probability that prisoner A lives before and after getting the information from the guard.Let LA denote the event that prisoner A lives.Before getting the information from the guard it is fairly simple, since only one of them is going to live it is P(LA) = 1/3.
Now consider the event of guard telling prisoner A that prisoner B is going to die.Let us denote the event as GAB.Let us assume that A actually is freed (I shall tell you why a little later) then the probability of the guard giving the information is P(GAB/LA) which is 1/2.
For those of you who are wondering why it is not 1,this is the tricky part.If prisoner A lives then the guard can tell either the name of B or C because both of them are going to die.The probability that he told A that B is going to die is 1/2 (remember, given the condition!).Now for the fact why we computed P(GAB/LA)? You must have already solved loads of problems where to find a conditional probability you will find its posterior probability and apply Baye's theorem.The case is no different here.It is crucial to note that we are trying to find the probability that A lives after getting the info so the desired probability is P(LA/GAB) which can be computed using the standard formula.
Therefore
P(LA/GAB) = P(GAB/LA)*P(LA)/P(GAB)
To evaluate P(GAB) we need to evaluate all possible cases (if you don't know what I am referring to refer Wikipedia on Baye's theorem).Let us look at the following cases:
We know P(GAB/LA) and P(LA) which are 1/2 and 1/3 respectively.So the product is 1/6.
The second case is P(GAB/LB) and P(LB) which is zero because he cannot tell A that B will die when B will actually live (he cannot lie!)
The third case is P(GAB/LC) which is 1.Confused again? It goes like this... When C is actually living that means both A and B are going to die.Since the guard cannot tell A about his own fate he HAS to tell him about the death of B.So hence it is 1 and its product with P(LC) is 1/3.
Finally the sum is P(GAB) = 1/3+1/6 = 1/2.
Now substituting it in the Baye's formula we get P(LA/GAB) = 1/6/(1/2) = 1/3.You can observe that the probability is infact the same as that was before asking the question.So technically there is no new information that A received.Secondly, A incorrectly estimates that his chances after asking the guard have become 1/2.His chances actually remained 1/3 before and after asking the guard.So the paradox is just superficial and the law of probability still prevails.
Going further, isn't it paradoxical that the probability of C living increased without him actually doing anything?Well...if you followed the steps properly it should not be difficult figuring out the answer.And also note that none of the other prisoners have the same information as prisoner A.So they would still be clueless and assume that their probability of survival is 1/3.And if prisoner C also approaches and asks the guard and both A and B share the information with each other.Then what would the probability of their survival be?
This problem is also called the three prisoners problem and available in Wikipedia for more reading.One of the methods shown there is similar to this with slight change of details.I took me a couple of hours to come up with a sound explanation of what was going on in the problem and put it on paper.
Any flaws, corrections or comments are welcome.
Now consider the event of guard telling prisoner A that prisoner B is going to die.Let us denote the event as GAB.Let us assume that A actually is freed (I shall tell you why a little later) then the probability of the guard giving the information is P(GAB/LA) which is 1/2.
For those of you who are wondering why it is not 1,this is the tricky part.If prisoner A lives then the guard can tell either the name of B or C because both of them are going to die.The probability that he told A that B is going to die is 1/2 (remember, given the condition!).Now for the fact why we computed P(GAB/LA)? You must have already solved loads of problems where to find a conditional probability you will find its posterior probability and apply Baye's theorem.The case is no different here.It is crucial to note that we are trying to find the probability that A lives after getting the info so the desired probability is P(LA/GAB) which can be computed using the standard formula.
Therefore
P(LA/GAB) = P(GAB/LA)*P(LA)/P(GAB)
To evaluate P(GAB) we need to evaluate all possible cases (if you don't know what I am referring to refer Wikipedia on Baye's theorem).Let us look at the following cases:
We know P(GAB/LA) and P(LA) which are 1/2 and 1/3 respectively.So the product is 1/6.
The second case is P(GAB/LB) and P(LB) which is zero because he cannot tell A that B will die when B will actually live (he cannot lie!)
The third case is P(GAB/LC) which is 1.Confused again? It goes like this... When C is actually living that means both A and B are going to die.Since the guard cannot tell A about his own fate he HAS to tell him about the death of B.So hence it is 1 and its product with P(LC) is 1/3.
Finally the sum is P(GAB) = 1/3+1/6 = 1/2.
Now substituting it in the Baye's formula we get P(LA/GAB) = 1/6/(1/2) = 1/3.You can observe that the probability is infact the same as that was before asking the question.So technically there is no new information that A received.Secondly, A incorrectly estimates that his chances after asking the guard have become 1/2.His chances actually remained 1/3 before and after asking the guard.So the paradox is just superficial and the law of probability still prevails.
Going further, isn't it paradoxical that the probability of C living increased without him actually doing anything?Well...if you followed the steps properly it should not be difficult figuring out the answer.And also note that none of the other prisoners have the same information as prisoner A.So they would still be clueless and assume that their probability of survival is 1/3.And if prisoner C also approaches and asks the guard and both A and B share the information with each other.Then what would the probability of their survival be?
This problem is also called the three prisoners problem and available in Wikipedia for more reading.One of the methods shown there is similar to this with slight change of details.I took me a couple of hours to come up with a sound explanation of what was going on in the problem and put it on paper.
Any flaws, corrections or comments are welcome.
Labels:
logic,
paradox,
prisoner,
probability,
rationality
Wednesday, July 1, 2009
Stuck without Javascript
A couple of days back I was working on a mobile optimized website.Since Javascript is not supported in mobile phone browsers (though Opera Mini and some others do but most of the default browsers don't!) I had to figure out a way to display tiny bits of a large result without querying the server every time.I was facing the following problem...A couple of days back I was working on a mobile optimized website.Since Javascript is not supported in mobile phone browsers (though Opera Mini and some others do but most of the default browsers don't!) I had to figure out a way to display tiny bits of a large result without querying the server every time.I was facing the following problem...
I had a huge array that contained search results from a database and I had to display one result at a time without querying the server every time.Well, if I had Javascript I would have put each result in a container and kept all of them invisible except the one that I wanted to display.Since I don't have that option I had to use the following PHP hack.
I queried the server for the results and got an array.After getting the array, I serialized it using serialize() function and passed it along with a display index using GET to a display URL.I unserialized() the string in the display page, thereby recovering the array.Using the display index I could display the desired element.So I could display each element without querying the server each time for results.
This is not an uncommon technique but it will help you if you are stuck without Javascript like me :)
Note:There are other ways of passing information using curl etc, but you will need support from the server for using them.
I had a huge array that contained search results from a database and I had to display one result at a time without querying the server every time.Well, if I had Javascript I would have put each result in a container and kept all of them invisible except the one that I wanted to display.Since I don't have that option I had to use the following PHP hack.
I queried the server for the results and got an array.After getting the array, I serialized it using serialize() function and passed it along with a display index using GET to a display URL.I unserialized() the string in the display page, thereby recovering the array.Using the display index I could display the desired element.So I could display each element without querying the server each time for results.
This is not an uncommon technique but it will help you if you are stuck without Javascript like me :)
Note:There are other ways of passing information using curl etc, but you will need support from the server for using them.
Subscribe to:
Posts (Atom)