Saturday, 17 July 2010

Totem

Two days, after watching the movie am still thinking about it subconsciously.I need to move on, hence jotting down my final thoughts about the movie "Inception".
If u haven't seen the movie yet, please don't read further.

So, this is a movie which drops sufficient clues to the audience and leaves the climax to them. The typical high school " Lady and the tiger story" where u can't tell which door was opened, lady or the tiger.

According to me,these are the possibilities.We don't know whether the totem toppled or not.
So assuming equally probable independent events this is what might have happened.:

1) Cobb and Saito wake up in the real world and Cobb goes home to his kids.
2) Cobb was inside a dream. He was wrong all the time and his wife was right. When she killed herself , she went back to the real world and he was still stuck in the limbo.
3) The third one to me is the most likely possibility, the entire movie was real, except the climax which was a dream, they never show Cobb and Saito getting the kick, they just get up in their seats after Cobb's realization and after all this time his kids are still wearing the same clothes.

The biggest problem with the script(deliberate problem) is the concept of the goddamn TOTEM, it can only tell you that you are not in someone else's dream. But what if you were in your dream, all this time?


But as a story teller the message Nolan was trying to send us was that, once Cobb leaves the totem to spin, he doesn't turn back to check itz state,he has reached his reality, he has gone back home to his kids, awake or asleep doesn't matter.
Hats off, if u can think of better explanations, please post.

Creep

While watching inception, i happened to watch the first theatrical trailer of "The Social Network" ,the movie about the story of Facebook.The thing that struck me about the trailer is that, the background song in it was a mashed up version of Radio-head's "Creep". A timeless, ageless masterpiece. http://www.youtube.com/watch?v=XFkzRNyygfk

The mashed up version had these few lines reverberating over and over again in it.

I don't care if it hurts,
I wanna have control
I want a perfect body
I want a perfect soul

I want you to notice
when I'm not around
You're so fuckin' special
I wish I was special

But I'm a creep
I'm a weirdo
What the hell am I doin' here?
I don't belong here, ohhhh, ohhhh

Huh, so many researchers , mathematicians,computer scientists are trying to mathematically model the human behaviour in the virtual world and radio-head had all that figured out, since yore.

The vicarious me , the voyeuristic me, the meforming me,the informing me, the connected me, the " am so fuckin " special me, the facebook profile me.
Hats off, radiohead!!

Thursday, 1 July 2010

Binary Search

This is how binary search works, and this how you will find it written in most popular books.This one is straight out of Wikipedia.

low = 0

high = N

while (low <>

mid = (low + high) / 2

if (A[mid] <>

low = mid + 1;

else

//can't be high = mid-1: here A[mid] >= value,

//so high can't be <>

high = mid;

}

// high == low, using high or low depends on taste

if ((low <>

return low // found

else

return -1 // not found


It feels perfect, looks perfect even the Prof in your class must have written the same, then why am I talking about it. Well ,it has a major bug which had stayed undetected like for ever and detected sometime very recently. (Google for more details and timeline)

Problem: Well line 4 says, mid=(high+low)/2.Say if "high" is the highest integer your compiler can access and if low is any number greater than zero then mid goes out of range and causes overflow problems. :O :O

Solution: Do (high/2 +low/2) or low+(high-low)/2

Come to think of it: While implementing many other array based divide and conquer algorithms like merge sort etc, we do the same to get to the center of the array.

Caution :Don't take the average.