Thursday, August 12, 2010

The OR gate: A Hindi filmi demonstration

The very first TP article, regurgitated and remodeled for your viewing pleasure:

(Once again, if you didn't get it the first time or maybe you came directly to this page somehow, we are demonstrating the OR gate in LOGIC to you people, so that you can get a start on your simple digital circuits and all that.)

The following example of Boolean logic in Hindi cinema is brought to you by Subroto. For those of you who don't know what an OR gate is, it accepts two inputs and returns a "True" if at least one of the inputs is "True". The truth table for the OR gate is as below:

Input A Input B Output
0 0 0
0 1 1
1 0 1
1 1 1

This particular example is from the movie Paap Ki Duniya (for those of you who haven't seen this movie... shame shame, paapi shame, for those of you who have, high five!). Let me remind you of a song from this movie:

Main tera tota, tu meri maina
Maane na kyon kehnay?
Phoolon ke jaisi teri jawaani
Jaane kya jaadoo chalaye...
Mera dil tota ban jaaye,
Kaisa mithu mithu bole haye!...

(this is a cover of a Marathi song which shares almost the same sentiment.)

Now, if seeing those lyrics doesn't remind you of the tune of that song and doesn't immediately bring up the picture of Neelam and my man Chunky Pandey dancing together in Ghat dress in some garden at Observation Post (which is a sort of park in Aarey Colony, Bombay, and is the place where most ``OUTDOOR SCENES'' in the 80s were shot, it was a time when people didn't have to rush off to Switzerland/Belgium/UK/USA/Maldives for filming song sequences for a movie which claimed to be patriotic and INDIAN), then nothing ever will.

Anyway, this movie stars Pran as the honest and God-fearing (Main sirf bhagwaan se darta hoon kamine!) inspector and Danny Dengzongpa as Pasha (thanks, xzintax) the daaku (dacoit). Chastising Danny during a pre-credit standoff, Pran posits that its just his bad blood and bad environment that have made Danny bad, and that he [Pran] thinks even a child born of bad blood can be brought up to possess good character. Danny scoffs at this, and in order to prove his point he switches his newborn son with Pran's (A similar stunt was pulled by Prem Nath in Dharam Karam). brings up Danny's son with all the love in the world, while Danny teaches the tricks of his trade to Pran's son. The latter kid is being chased by the cops during his crime of initiation, and cue opening credits, zooming in on the kid's feet, and then zooming out to show a fully-grown Sunny Deol. Predictable 70s montage. Danny's son (the one growing up with Pran) grows into the great and unforgettable Pandey, who also becomes an inspector (that's Inspector Vijay to you douche bags!). And, of course, Sunny Deol, even though he is a petty thief and all that, grows up with a conscience.

So that in the final confrontation scene, Pran delivers a lengthy, laboured dialogue showing Danny the error of his ways. Pran's testimonial of his peer-reviewed twenty-five-year research goes something like this (please try to imagine Pran delivering these dialogues with his eyes slitted to show he means business, like he always does, with every other word accentuated by a shake of his head):

``Achcha khoon agar achche mahoul mein paida ho, to woh hamesha achcha hota hai. Uski misaal main khud hoon!
Achcha khoon agar gande mahoul mein bada ho, to woh hamesha achcha hota hai. Iski misaal hai mera beta, Suraj!
Ganda khoon agar achche mahoul mein bada ho, to woh hamesha achcha hota hai. Iski misaal hai tumhara beta, Vijay!
Ganda khoon agar gande mahoul mein paida ho, to woh hamesha ganda hota hai! Iski misaal tum khud ho, Pasha!!!...''

Let's tabulate this set of inputs (two inputs: Khoon and Mahoul) and the output and example in each case, to generate the Paap Ki Duniya truth table:

Khoon (Blood) Mahoul (Environment) Grows up to possess Example from Paap Ki Duniya
Ganda (Bad) Ganda Ganda character Danny
Ganda Achcha (Good) Achcha character Chunky (YAY!!!)
Achcha Ganda Achcha character Sunny
Achcha Achcha Achcha character Pran

See a pattern here? Of course you do! It's just the OR gate... who said you don't learn anything from Hindi cinema?? Where else would you see an inspector teaching the intricacies of Boolean logic to a daaku in the Chambal valley? ("Yeh nishaan hum sab par dhabba hai. Aao isey mitaakar Pasha banaa dein." Remember that PSA?)

Obviously, Danny doesn't give a shit about Pran's gates, and therefore is sent to Hell's gates by the three greats, at a totally unacceptable cost: Chunky is collateral damage. THIS IS NOT FAIR!!!! I WANT A REMATCH!!!

Thanks to Subroto for reminding me of this situation and for comparing it to logic.
Now that you have learnt some logic, want to learn some diplomacy? Want to learn to tactfully change the subject? Wait for the next post.

Note: The above example is only to illustrate the OR gate, and it does not necessarily mean that whatever Pran claims about the blood-environment relationship is true. For example (this example comes thanks to Ajay Negi), consider the movie Dharam Karam, starring Raj Kapoor, Prem Nath and Randhir Kapoor among others (The first thing that pops into your head when you hear the name of this film is probably the song, Ek Din Bik Jaayega. The first thing that pops into *my* head is the routine that ended: "Hanh?! Aur ek lakh ka char guna?" "ANDA! (Egg)"). This movie also employs the pre-credit infant switch. Randhir Kapoor, Raj Kapoor's son (in the movie, obviously) grows up under the able guidance of Prem Nath, while Prem Nath's son grows up under Raj Kapoor's sad ``What you sow, you will reap'' guidance, and in this case, Good Blood + Bad Environment is still Good, but Bad Blood + Good Environment is Bad (actually, this is true in most movies of the exchanged-children genre - the Good father always keeps wondering why his son is such an asshole, and it ends up he's not his son after all...), therefore this can't be an OR gate. It just is a nature vs. nurture assumption that Bad always begets Bad, no matter how much Boolean logic and/or electronics you know!