Friday, December 24, 2010

Game Theory and my personal dilemma

Recently I had the pleasure of applying Game Theory on one of the problems I worked with. Initially I was skeptical about the validity of the theory and felt that it is trying to give an explanation of an already occurring social event (how individuals react to the situation). Later realized the beauty of the theory on why people adopt a specific strategy on a given situation. After all we humans want to maximize our profit or at least get as much as what the opponent will get in the game of life. In "The Beautiful Mind" movie, when the beautiful blonde girl along with her 4 friends comes to the party, the best strategy of John Nash’s 4 friends is to better propose the 4 of her friends rather than the blonde girl. There is a higher probability of the blonde girl denying company to all 4 of them as well as the 4 of her friends being pissed off by the fact they all 4 approached the blonde girl in their covey. [In a lighter vein, of course once 4 of Nash’s friends have given the company to 4 of her friends, Nash has always the gain of giving company to the blonde girl]

The essence of game theory is captured by the famous Prisoner’s Dilemma (PD) experiment. Two suspects (A and B) committed a crime and were arrested. Interrogated separately: they may confess (C) or deny (D). These are their “strategies.” Payoffs are what they get by adopting a particular strategy. By adopting a strategy of D they have the freedom of not going to jail. On the other hand by adopting a strategy of C, at least one of them can escape prison and can also be rewarded for turning approver. “Best” outcome for the PD experiment is for both of them to deny: (D, D) – Pareto Optimal (i.e., the sum of payoffs is maximized). Pareto optimality implies that it is not possible to make somebody better off without making somebody else worse off. This is the whole idea for countries spending on defense and amassing weapons. This creates a sense of fear in the other country to wage a war. [I used to wonder as a kid why countries spend the maximum % of GDP on defense. Now I know why partially. See my conclusion on my personal dilemma]. The equilibrium outcome of the game need not be the Pareto optimal outcome. In the PD there’s always an incentive for a player to deviate from (D, D). In fact, choosing C always gets you a better payoff than choosing D (the black sheep or the one who turns approver escapes from prison sentence). We say that the players have a dominant strategy. Clearly, they will use this strategy in equilibrium. Nash Equilibrium (NE): by definition, a NE is a pair of strategies (SA, SB), so that if A sticks to his NE strategy SA, B has no profitable deviation (i.e., B will do no better if he uses any other strategy). The same holds for A: if B plays his NE strategy, A cannot do better than playing his equilibrium strategy. The NE for PD is (C, C). [There are no unilateral profitable deviations from the Nash equilibrium exist.] Suppose that the game in hand is the twice-repeated PD. How does a strategy look like? What about the strategy in the ten times repeated PD? In the finitely repeated PD game, consider the last period. What would you do if you were A? Go to the next-to-last period. What would you do if you were A? Conclusion: There is no collusion in the finite-period repeated PD. Equilibrium strategies are history-independent here.

What if the game is repeated an infinite (or random) number of times? We will show that if players put enough weight on future streams of income, collusion may be enforced. In PD both players would be better off if they played in each period (D, D). They choose to play C because of the opponent’s incentive to “cheat” by playing C. Mr. A offers the following “plan” to Mr. B: he will start by playing D in the first round; will continue to play D as long as Mr. B plays D; if a deviation is detected, Mr. A will play C forever. This is a “grim” trigger strategy (any deviation from D triggers “punishment” of the opponent – forever!). This won't occur in reality since as humans we are always suspicious of opponent's commitment. This partially explains why Walmart, Kroger have different pricing strategies and fortunately there is no collusion in their pricing strategies. There is always an incentive to collude and set a fixed price. But this cannot last long for an infinitely repeated game because there is always an incentive for say Walmart to lower the price and attract more customers. So it is better off for both the sellers to not collude. Thus we shoppers are protected.

What about mixed strategy in the game of chance like poker or the simple coin toss experiment? These are zero sum games: One person’s gain is another person’s loss. The only way to win in this game is to randomize our strategies: choose H and T with equal probability with no bias.

Having explained the Game Theory, I always felt it has some short comings particularly in explaining one of the critical event in Indian history (my personal dilemma). The strategy adopted by Mahatma Gandhi in freedom struggle. His strategy of adopting non-violence pitted against violence, proved to a dominant strategy. By applying Game Theory, the strategy against violence is violence of greater degree but by adopting a strategy of non-violence he was able to achieve what India badly needed - freedom.

Anyway, start analyzing how you reacted to situations with Game Theory in mind (postmortem analysis). You will be surprised to find your dominant strategy in the given situation.

Wednesday, November 17, 2010

eReader Display

Recently I have come across this company and its innovative plastic display technology. Rugged and flexible display for e-book readers. The way to go. I prefer an e-book reader with flexible display rather than the LCD display and really like this cool technology.
Check the technology and the cool name for the company:
http://www.plasticlogic.com/ereader/plastic-display.php

What next?
I really feel an e-book reader with 2 side by side display will be next big thing. This will be an interesting technology since users can back reference pages much faster as well as have different pages on each display. Let's see how fast someone is coming out with this new design.

Thursday, November 4, 2010

Video Telephony (VT) – Know-how

Sometime back I worked on implementing a solution for video telephony and thought I could document it for a wider audience. By now video telephony is known for a handful audience through Apple’s “FaceTime” application. FaceTime is nothing innovative from Apple since this technology was long established in China/Japan/Korea mobile market. But Apple still has the pleasure of being the first mover in the market. I won’t consider Apple’s FaceTime has a real video telephony application since it uses the WiFi and internet backbone (high bandwidth) instead of cellular backbone (low bandwidth). So the problem space is much easier to tackle with for Apple. One reason could be the wireless bandwidth crunch in US cellular network providers. One thing amuses me in US is that cellular chip technology is growing at a faster rate but not the cellular communication infrastructure. Still they are at least 1 generation behind in the kind of applications and kind of bandwidth supported in Asian markets like China, Japan, and Korea.
As far as multimedia is concerned is, I see the following 3 performance beast applications:
(1) Video/Image capture
(2) Video playback of different codecs (resolution, encoding, bit rate, frame rate) and container formats and image decoding
(3) Video telephony (VT)
I consider VT has one of the interesting problem to work with. To start with some of the design know how and specs:
In Tx side:
Video Chain: Camera (Driver to imaging sensor)->Video Capture Filter-> Video Encode Filter->Mux Filter
Audio Chain: Mic(Audio Driver)-> Audio Capture Filter-> Audio Encode Filter-> Mux Filter
Video Preview Chain: Camera-> Video Capture Filter-> Video Renderer->Display Driver

In Rx side:
Video Chain: Demux Filter->Video Decode Filter->Video Renderer->Display Driver
Audio Chain: Demux Filter->Audio Decode Filter-> Audio Renderer->Audio Driver (Speakers)

Couple of big missing block is the acoustic engine to reduce feedback audio noise and VT engine to take care of "packetization" and "depacketization". VT packets are transmitted and received at 64 kbps. Every 64 kbps consists of video encoded at 48 kbps and audio encoded at 8 kbps and another 8 kbps allocated for VT packeting overhead. It is interesting to note that there are no special synchronization mechanisms in the Rx end and so one less problem to work with compared to video playback. Just follow the specs and if there are no video frame drops then synchronization will be taken care by design. But one of the biggest problems in the receiving end is how to assemble the broken video frames (VT packets) into a frame. The problem becomes much more interesting since some time a packet carrying video header will be dropped or corrupted. More pronounced in wireless cellular communication compared to wired internet. You need to develop a robust solution in order to handle such random scenarios and there holds our engineering ingenuity. H263/MPEG4 is the most popular encoding standards for VT applications. H264 is slowly catching up. Chinese mobile operators I would say have a better solution to tackle the bandwidth problem and network conditions. All VT calls from A to B are routed through their servers which take care of packet loss and other random corruption in VT packets. I thoroughly enjoyed implementing the end to end  VT solution for mobile phones. It is one of the best engineering problems I have worked with.

What's going on?

Getting hectic with my work schedule, I long abandoned external blogging. Nowadays I am more involved with internal blogging within my firm as an outlet for exchanging views. Need to get started.
Exciting things going on in smart phone space in the interim.
(1) The battle of Application Processors: Snapdragon, Hummingbird (A4), and OMAP3630. [Comparative Performance - Source: http://www.droidforums.net/forum/droid-general-discussions/53521-difference-between-snapdragon-omap-3630-a.html]
(2) Next gen heterogeneous multi core from Texas Instruments - OMAP 4430 and nVidia slowly catching up.
(3) Android declared as the third best widely used smartphone OS. Easily beating the likes of iPhone OS and slowly catching RIM OS. Source: http://www.gartner.com/it/page.jsp?id=1421013
(4) Introduction of WM7. I am eagerly awaiting where WM7 will stay in the smart phone OS space.

Industry is heating up well and the smart phone market is going to thrive until 2015. So jump into the smartphone bandwagon.

Wednesday, January 27, 2010

Apple iPad - The Bigger iPhone

The announcement of Apple iPad turned out to damp squib. Expectations were so high for the next big thing but turned out nothing but a bigger iPhone. Worst part is again pay for the additional data plan for connectivity with their preferred network provider. Can it compete with kindle e-book reader? Big question since it is not based on e-ink and is not going to give the illusion to reading a real book. Hopefully Apple has got some secrets (may be better gaming experience) down the sleeve to sell their recent innovation iPads. May be few design engineers who want to visualize things can hand draw stuffs just like tablet. Other than that I feel it is still running iPhone OS with no multitasking (concurrent applications running) or limited multitasking.

One good thing that impressed me is the strategy to switch to their custom made 1 GHz (POWER (RISC) architecture of the kind of ARM) processor based on their recent PA acquisition. This translates to more $s per product sold. No more Intel's Atom and TI’s OMAP and other processors for time being. Certainly this is going to bring some differentiation in short run but the continued success depends on how long they can sustain their processor/platform road map.

It will be interesting to see how the promising OMAP4 (multicore heterogeneous processor architecture) based products fare in the market place. One thing for sure, the strategy of Apple’s is to stress the importance of good application processor (ARM based) + optimized system software to meet the power/performance numbers. Since the mantra of the day is “iPad running 10 hrs in a single charge".