Game Theory in The Dark Knight: A Critical Review of the Opening Scene (Spoilers)

19 August 2008   |   by Presh Talwalkar   |   3 Comments »   |  Print This Article Print This Article

Every Tuesday is a Game Theory article at Mind Your Decisions

The newest Batman flick The Dark Knight absolutely stunned me. Not since Dr. Strangelove has a movie contained so much game theory. While many others have noticed the game theory connection, particularly about a scene near the end of the movie, such commentaries miss the big picture: the entire film is a sequence of games and an exploration of strategic thought.

Game theory comes up in many scenes even where it’s not clear what the “game” really is. Strategy is a theme introduced immediately in the opening bank robbery scene. This scene is one of the most powerful movie openings and it foreshadows the chaos and tempo in the story. Today, I’ll analyze the robbery scene using the lens of game theory.

(Fair warning: this article contains spoilers and covers roughly the first five minutes of the movie. I will write follow-up articles if there is interest.)

How can we split up the stash?

The movie starts out with a bang. An aerial attack begins when a window shatters on a skyscraper, allowing two robbers to glide across a zip-line on to a bank’s roof. On the street-level, a car screeches to a stop to pick up the last member of the ground attack.

The first spoken words concern the topic of strategy. These lines introduce the Joker’s character and they foreshadow the punch and counterpunch of the entire movie. The robbers in the car explain the job and how the loot will be divided. It’s apparent they are not happy with the plan:

Driver: “Three of a kind. Let’s do this.”

Passenger side: “That’s it—three guys?”

Driver: “Two guys on the roof. Every guy gets a share. Five shares is plenty.”

Passenger side: “Six shares. Don’t forget the guy who planned the job.”

Driver: “He thinks he can sit it out and still take a slice. I know why they call him the Joker.”

The robbers don’t like that the Joker gets an equal share for doing unequal work. Their complaint raises the issue of fair division, which is central to game theory. In fact, fair division is the first problem that game theory addressed historically. The problem appears in the Babylonian Talmud about how creditors should divide an estate. The text offers a mysterious solution that had baffled scholars for over 2,000 years. It was only very recently that a Nobel Laureate economist deciphered the answer using the tools of coalitional game theory. Let me tell you, the answer is fascinating.

Fair division is about understanding incentives and strategic thought. How can you trust self-interested people? How can you achieve cooperative outcomes with diametrically opposed motives? Such ideas have been applied to important areas such as nuclear disarmament and labor negotiations. But they are even applicable to mundane situations, like dividing up restaurant bills fairly.

The robbers accept an equal division for unequal work, but should they believe things will go as planned? Perhaps they should not, if they really considered the incentives and the possible ways others could tamper with the plan. In game theory you do not trust someone because they are your friend. You trust them because it is in their self-interest to help you. We can learn from a natural example: children should trust their parents on safety rules because parents have a vested interest in seeing their children are safe. They should not, however, trust strangers.

Had the robbers considered these issues, perhaps their fate would have been different. A little bit of thinking ahead and reasoning backwards would have demonstrated flaws in the plan.

The scene is reminiscent of a popular game theory puzzle about pirates and splitting up treasure. Some of you may have even heard this as a technical interview question. The game offers insights to collective voting and the ability of a leader to buy off votes.

The Pirate puzzle

The game

Three pirates (A, B, and C) arrive from a lucrative voyage with 100 pieces of gold. They will split up the money according to an ancient code dependent on their leadership rules. The pirates are organized with a strict leadership structure—pirate A is stronger than pirate B who is stronger than pirate C.

The voting process is a series of proposals with a lethal twist. Here are the rules:

  1. The strongest pirate offers a split of the gold. An example would be: “0 to me, 10 to B, and 90 to C.”
  2. All of the pirates, including the proposer, vote on whether to accept the split. The proposer holds the casting vote in the case of a tie.
  3. If the pirates agree to the split, it happens.
  4. Otherwise, the pirate who proposed the plan gets thrown overboard from the ship and perishes.
  5. The next strongest pirate takes over and then offers a split of the money. The process is repeated until a proposal is accepted.

Pirates care first and foremost about living, then about getting gold. How does the game play out?

The solution

At first glance it appears that the strongest pirate will have to give most of the loot. But a closer analysis demonstrates the opposite result—the leader holds quite a bit of power.

The game can be solved by thinking ahead and reasoning backwards. All pirates will do this because they are a very smart bunch, a trait necessary for surviving on the high seas.

Looking ahead, let’s consider what would happen if pirate A is thrown overboard. What will happen between pirates B and C? It turns out that pirate B turns into a dictator. Pirate B can vote “yes” to any offer that he proposes, and even if pirate C declines, the situation is a tie and pirate B holds the casting vote. In this situation, pirate C has no voting power at all. Pirate B will take full advantage of his power and give himself all 100 pieces in the split, leaving pirate C with nothing.

But will pirate A ever get thrown overboard? Pirate A will clearly vote on his own proposal, so his entire goal reduces to buying a single vote to gain the majority.

Which pirate is easiest to buy off? Pirate C is a likely candidate because he ends up with nothing if pirate A dies. This means pirate C has a vested interest in keeping pirate A alive. If pirate A gives him any reasonable offer—in theoretical sense, even a single gold coin—pirate C would accept the plan.

And that’s what will happen. Pirate A will offer 1 gold coin to pirate C, nothing to pirate B, and take 99 coins for himself. The plan will be accepted by pirates A and C, and it will pass. Amazingly, pirate A ends up with tremendous power despite having two opponents. Luckily, the opponents dislike each other and one can be bought off.

The game illustrates the spoils can go to the strongest pirate or the one that gets to act first, if the remaining members have conflicting interests. The leader has the means to buy off weak members.

Don’t get caught up in the exact assumptions or outcomes of the game—just remember the basic lesson. In the real world, it might be necessary to buy a vote with 20 gold coins. Nonetheless, the general logic is the same. Here are some of the main insights from the game:

Lessons:

  • Players should think ahead and reason backwards
  • A leader can win by exploiting conflict among weaker members
  • Players derive worth from voting power, and some players can be bought off

The robbery scene in The Dark Knight

The original plan of equal division is flawed. Each robber has incentive to increase his share by killing a fellow team member. Once a member performs his job, he loses his negotiating power and value to the team.

The Joker plays off this conflict by instructing the robbers to take out fellow teammates once their tasks are performed. The game would be different if the robbers were a group and they repeated crimes together—perhaps an even split could be sustainable. But as the movie hints right away with the first backstabbing scene, this robbery will be a one-shot game.

Many of the robbers fail to see they can be victim to the same deceit they pull on others. The second robber on the rooftop is a prime example. After his partner disarms the silent alarm, he quickly kills him and then proceeds to perform his own job. He doesn’t see the same thing could happen to him.

After he disarms the bank vault, he is greeted with a most unpleasant surprise:

Robber: “Where’s the alarm guy?”

Vault guy: “Boss told when the guy was done, I should take him out. One less share, right?” [opens the vault]

Robber: “Funny. He told me something similar.”

Vault guy: “What? No! No!” [gets shot in the back]

By now it’s clear the Joker wants everyone dead, and minutes later we learn the Joker has been present on the job all along. The plan finishes with two more deaths both involving the escape vehicle bus.

The Joker, being the “strongest pirate,” was able to sequentially bribe the weaker robbers one by one. In the end, he puts a twist on the game by taking the whole pie.

Other strategic elements

There are many other mini-strategy elements during the robbery scene. Here are three that came to my mind:

  • How can a handful of robbers overtake a bank?

In theory, a mob of unarmed citizens should be able to overwhelm a small group of armed robbers. The problem is there will be casualties, particularly for those that act first. Who is going to step out and be the hero? Robbers make sure that people don’t coordinate to force them to act sequentially. Any individual that attempts to be a hero will be killed as an example, like the angry bank employee. In the movie, the robbers demonstrate they are willing to use lethal violence by shooting up in the air and taking out the bank cop.

  • Do you trust your teammate?

This is a subtle point and I loved it. The robbers face a small obstacle when an angry bank employee starts firing his shotgun. The robbers duck for cover, and after a few shots, one robber asks the other if the bank employee is out of bullets.

If you watch closely, you’ll see the robber (really the Joker) ponders the question carefully and then nods his head “yes.” The other robber jumps out and is greeted with a bullet that narrowly misses him. Almost immediately the disguised Joker jumps out and disables the bank employee with a round of bullets. The disguised Joker acted so quickly and without fear, almost as if he was now sure the bank employee was out of bullets. Did the Joker lie on purpose earlier to put the other robber in danger? The other robber, not aware it’s the Joker, is furious that he was almost shot and yells back: “Where did you learn to count?” The disguised Joker looks back in scorn.

  • What kind of robber is the Joker?

The cops who arrive on the scene will be stunned. They will see a crime scene with five dead robbers and a bank vault that has been cleaned out. They will likely conclude the Joker is interested in selfish gains, a simple criminal, who wants all the money in Gotham.

As the cops, the mobsters, Batman, and we as the audience experience the complex themes that unfold later in the movie, many of us are left with one thought: if only the Joker were so simple.

The Joker demands money, yes, but is that what he really wants? That’s a question the Joker plays off later in the movie in an explosive fashion.



Game Theory Roundup (8/18/08)

18 August 2008   |   by Presh Talwalkar   |   2 Comments »   |  Print This Article Print This Article

Recently I’ve come across some amazing articles discussing game theory concepts. I love it when others join the discussion so let’s promote them. I’ll do my part by linking out more frequently. Please do your part to encourage game theory by reading and spreading the following articles:

–Dorian Wales asks Why are we working so much? at The Personal Financier

–Pratik ponders the strategy of school dances and buying dresses at pratiksrandomwalk

–Jake Young writes about The Dark Knight and a scene with game theory (warning–major spoilers) at Pure Pedantry. Another approach I liked is Michael Allen’s analysis of the same scene at The Quantitative Peace

–Mark Chu-Carroll has written some great articles on game theory at Good Math, Bad Math. I enjoyed the discussion of solving zero-sum games and solving tic-tac-toe: game tree basics

–Brian Burke writes two excellent articles applying game theory to NFL football. Check out the beautiful graphics in the articles: Game theory and play calling and Game theory and great running backs

And if you ever need a game theory fix, check out the Mind Your Decisions game theory archives which now have over 1 year’s worth of articles.

Did I miss any important articles? Send me links and I’ll add them on.



Try New Foods to Deal with Rising Costs

15 August 2008   |   by Presh Talwalkar   |   4 Comments »   |  Print This Article Print This Article

All the things I love to eat are getting more expensive. Simple pleasures like bread, rice, and corn have almost doubled in price. What’s one to do? Try new food, naturally.

There are two reasons to do this. The first is an economic reason. Food prices are the result of supply and demand. Because the standard fare is in high demand and short supply, prices are likely to continue to go up. It’s necessary to think outside the box to try and get a good deal. Strange and new foods offer that opportunity. The second reason is personal. It’s just fun to try new foods. I think it’s okay to splurge a little bit since it’s a healthy form of entertainment. I find fruits and vegetables are among the cheapest but most rewarding pleasures.

Here are some of the foods I have recently discovered:

Champagne grapes


photo credit: Lisa Sanderson

Don’t be fooled by their small size! Though smaller than a pencil eraser, each grape is packed with flavor. It’s great to nibble on one by one. I eat them a bunch at a time. I imagine this is what kings snacked on.

Asian pears


photo credit: WayTru

Asian pears are a wonderful treat. They look like a cross between a pear and an apple, and that’s pretty much what you get. The pears pack the sweetness of pears with the crispness of apples. I’ve tried the varieties labeled “fragrant,” “yali,” and “pear apple.” The “yali” are my favorite so far.

Unfortunately they are on the expensive side and can run almost a dollar apiece. If you’re lucky, you can get them for a much reduced price in your local Chinatown (yes, it’s safe to get food from Chinatown).

Prickly pear fruit


photo credit: Kyknoord

Who would have thought that cactus could bear such pleasant fruit? Prickly pear fruit has a very mild and pleasant flavor. The inside is an even brighter purple color than on the outside. These fruit are made into jams and the vibrant color offers endless culinary possibilities (a mixed drink perhaps?).

The only downside is hard seeds inside, similar to guava. But the seeds are probably why not many people eat these fruit, meaning they are very affordable. When I find them, I enjoy them as a snack after a morning workout.

Young (green) almond


photo credit: ReefRaff

You eat the white nut inside of the green shell. The joy is lost if you wait too long: the nut matures and the skin forms into the conventional brown skin from regular almonds.

These green almonds have a distinct crunch and a lighter and fresher taste than regular almonds. I suspect they have less fat than regular almonds but I could not verify this. But I don’t worry about the fat since it’s very hard to eat a lot of them. I usually get bored after peeling four or five of them. I wonder if that’s how nature intended us to eat nuts–as a rare treat, rather than as something we could swallow down in handfuls from a jar.

Mustard greens


photo credit: Betsssssy

I bought this as an alternative to spinach and I was pleasantly surprised. The leaves smell very strong, like mustard in fact, and that really amused me. I chopped them up really small and cooked them with tomato and onion for a delicious vegetable dish. The mustard taste became quite mild after cooking and it was very enjoyable.

Kohlrabi


this is a cropped version of a photo by libookperson

These odd-looking bulbs are kohlrabi. These things are also called Russian turnips, but they are actually part of the cabbage family. They have a mild and somewhat sweet flavor.

You can get them by the bunch. Here are some shopping tips and recipe ideas.

Calabaza squash


photo credit: benketaro

Expand your collection of squashes to include this treat. You can prepare it like other squashes by baking it or turning it into a soup. It is a pumpkin and has a sweet flavor.

Here is some more on how to select it.

What uncommon foods do you recommend others give a try?



How do you deal with overdraft fees?

14 August 2008   |   by Presh Talwalkar   |   2 Comments »   |  Print This Article Print This Article

“Bob” emails me his frustrations with managing his checking account:

I just got hit with an overdraft fee and I’m really annoyed. I regularly check my account online but this time a check cleared unexpectedly. It was a check I wrote a couple months ago and forgotten about.

How do you deal with situations like this or avoid them altogether?

I love this email because it shows why balancing a checkbook monthly is not good enough. Most of us need more information on how much money is available to spend. There are three ways I manage my checking to avoid paying fees like overdrafts.

1. Ask the bank to waive the fee

This one is common sense but it bears mentioning. Banks or other companies often waive fees to good customers. Why? It’s because good customers are costly to acquire. Think about it—if a bank like Chase can offer $200 for you to sign up, it has to make more than enough money to make up for that. You have the power when negotiating fees, so use it. In my experience, 90 percent of the time a single phone call will solve the problem.

In the remaining 10 percent, it pays to be persistent and know you have a good chance of getting the entire fee waived. Companies don’t always offer the full discount right away hoping you’ll bite. If you get a low offer, reply that you are not content and ask them what else they can do to give you the full refund. You’ll be fine if you work on the principle of being reasonably unreasonable.

Bonus tip: Make a note about the call, including the time you called, who you talked to, and the stated resolution. If you don’t get what you were offered, you’ll have your own record to ask again.

2. Have your own tracking system

This is good advice in general. While your bank keeps track of money, there can be errors. I once was credited a few dollars less on a deposit for no explicable reason. This error persisted to my monthly statement. I noticed it because I tracked my transactions and the bank quickly fixed it.

It doesn’t really matter what you use. For many years I used a paper check registry. Then I switched to a password protected spreadsheet. Commercial software is fine too though not always necessary.

Tracking puts you in touch with your spending and you avoid the most common mistakes, like writing a check a day or two early.

3. If you can afford it, keep a little extra on hand

It’s not great to keep boatloads of money lying in a low-interest checking, but having a little extra can save you plenty of headaches. Not everyone can afford this option, but I highly encourage it to busy professionals. Most of them would rather avoid fees in the first place than have to spend time arguing to remove them.

Many people worry that they are forgoing interest on the money that’s “lying around,” but this turns out to be a small concern since many savings accounts don’t offer high rates. An extra $1,000 has the potential to earn a $30 in a savings account with 3 percent interest. And the interest is taxable so it really amounts to even less. Plus, there are other reasons to keep some extra money in a checking account, like being able to pay for unexpected expenses or invest in business opportunities.

I supplement this recommendation with my own method about how to track a checking balance. I don’t actually try to keep a real-time account. Instead, I keep a tally of how much money I think I have to spend. This boils down to two rules:

–subtract expenses when they occur, whether cleared or not

–add deposits only when they clear the bank

This is a safe method because you’ll always have more money than you think.

I keep track of my account at the beginning of each week and after every transaction. By the end of the month, most things have posted so it’s easy to reconcile when I balance my books.

Here are some examples of the system:

–check to roommates (subtract right away)
–transfers for investments (subtract right away)
–automatic deposits of his paycheck (wait until clears bank)
–payments to credit cards (subtract right away)
–cash withdrawals at ATMs (subtract after it occurs)
–depositing rebate checks (wait until clears bank)

This is easy to do in a spreadsheet if you make a new entry each time you do something. Here’s the basic bare-bones template that I use:

But use whatever tool you want. The most important part is keeping up you’re your transactions. If you have many, you might consider commercial software.

You can download the template at the Financial Tools Page. Be sure to password protect the file.



The Game of Free Food: Why We Should Just Say No

12 August 2008   |   by Presh Talwalkar   |   No Comments »   |  Print This Article Print This Article

Every Tuesday is a Game Theory article at Mind Your Decisions


photo by jbcurio

How do you shop for food? Whether you realize it or not, every time you enter the store you are engaged in a game with food companies. You want to get the best deals. They want to make the most profit. The game is about dividing the surplus that exists between the cost of the product and the highest price you are willing to pay. Who should win this game?

On the surface, we consumers should because we have a strategic advantage of moving second. We can comparison shop. We can switch to other brands. And if store food is not suitable, we can often buy directly from farmers. Being responsive should give us power, but that isn’t always how it works. Food companies can overcome our better judgment–just ask any parent. Just the other day I saw a kid complain about the cereal at Trader Joe’s: “No mom, I don’t want these. I want the ones I see on TV.” The kid had already committed to a set of products before entering the store–now that’s good marketing, but bad game theory.

There are many ways that food companies influence our buying decisions. Today, I want to consider one of those strategic methods: giving out free samples. Why might companies do it? How does it influence us?

I motivate the discussion with three stories. Then I give my opinion on how samples affect us more generally. I conclude that free samples put us consumers in a bad negotiating position. I urge you to think twice when taking free food.

Three tales of free food

Beer

My friend primarily drinks Budweiser beer. He used to enjoy more brands, but during college he developed a taste for the great American lager. The situation reminds me of a story my relative told me.

In Boston, about twenty years ago, beer companies used to send trucks outside the dorms. The company representatives–men dressed like superheroes and scantily clad women–would unload the kegs and gave out free beer along with branded trinkets. Students loved this and eagerly waited for the next beer party. Administrators were not as happy and quickly put an end to the practice. But the beer parties have had a long-lasting effect: my relative has fond memories of the beer and continues to buy that brand.

Candy

I used to have a favorite brand of candy while growing up. It was from a company that had an office in my town. I enjoyed the candy because in a very small sense, I had a role in its creation. While I was in fifth grade I was a student candy taster, which entailed getting free candy in exchange for honest answers. It was exciting because I could try the newest stuff, some times candy that had not hit market, and my opinion helped marketing and product development. I was loyal to them. So when Halloween came around, you can be sure which candy I told my mom to buy.

Ice cream

From an interesting article:

When McDonald’s introduced ice cream to its franchises operating in Indonesia, it faced a problem: many people had lactose problems and would not buy the product because it made them sick.

So what did they do? They gave ice cream cones away for free.

Can you guess what ended up happening?

You’d be surprised at what people will consume when its free, regardless of the associated nausea. After repeated exposure to dairy products, the allergic reaction diminishes such that people can enjoy the dairy product without any significant consequences. So sure enough, after a while the target market in Indonesia had lost its intolerance. This made McDonald’s (and I suppose the Indonesians?) happy.

The strategy of the game

What’s similar in all three stories? They are all different instances where companies have used free samples to gain lifelong or long-time customers. It was the free samples that contributed to such tremendous loyalty.

That the strategies worked is not too surprising because companies are diligent when handing out samples. They don’t give out things with the hope customers will respond. It is costly to give free samples, so they must be reasonably sure that extra customers and extra sales will more than offset the sampling costs. This is nothing sinister—it is simply good business.

Businesses take calculated risks, so it is natural to ask: which products would make the most sense to be sampled? It’s not the initial taste that matters, as the ice cream example illustrates. It’s the ability to develop loyal customers who would go to long lengths to get their fix. Psychologists have a term for such a product: it is addictive. Brand loyalty turns changes customers from merely “wanting” a product to thinking they “need” it.

The sinister part is that companies research in advance and have a better understanding of what’s addictive. It is difficult for customers to keep up. Smoking has taken lots of heat for marketing to children, but food can be addictive too, as the three stories illustrate.

Wait, food is addictive?

We know that drugs are addicting. So the first story about beer isn’t a shocker to anyone. Alcoholics are often facing more than willpower. As Nora Volkow, M.D., discusses in an article on the science of addition, while the initial choice to consume is voluntary, repeated use can cause brain changes that impair a person’s ability to exert self control. Perhaps a similar process shapes people to acquire tastes for particular brands.

It appears addiction can happen with more conventional food products, as the second story about candy story suggests. Most of us have had sugar cravings at some time or another, so we might suspect it’s some kind of addiction. Research discussed in the Society of Neuroscience in October 2003 shows some confirmation about our long-held feelings—sugar might be an addiction.

What about ice cream? Is it an addiction? It turns out there might be a reason we chase the ice cream truck as kids. For ice cream, along with other dairy products, contains something we would not expect.

The discovery was made in 1981 when researchers saw that cow’s milk contained traces of a substance that looked a lot like morphine. They tested and tested to figure out what it might be. What they concluded was the substance was in fact, morphine. It’s not a lot, but it is interesting to note milk contains something that can be highly addicting.

Neal Barnard, M.D., of Physicians Committee for Responsible Medicine, explains this opiate-like effect is most felt with cheese, which is concentrated in milk protein and an array of opiates known as casomorphines. I guess that might explain why virtually every fast food joint puts cheese on everything, and why places like Subway and Dunkin Donuts have added pizza to the menu. My local supermarket samples new kinds of cheeses daily. I used to try and buy, but now I realize the sampling could distort my better judgment and I skip it entirely.

The bottom line

Notice that it was only relatively recently that cheese could be considered to be addicting. What other food might be addicting? What ingredients might be added to overwhelm our judgment?

As smart as any shopper can be, it’s likely that businesses will be ahead of the curve. Think about how MSG was put in everything from potato chips to salad dressing until recent awareness campaigns. Weaning off of a taste is hard stuff. After you repeatedly consume something you acquire a taste, like the Indonesians for McDonald’s ice cream. The best time to stop an addiction is before it starts.

So here’s my own advice: keep your better judgment when shopping. It cannot make a difference if you take a sample of something you were going to buy any way. I love fresh bread and have no issues with the samples I take from my local bakery. But it’s best to be cautious of new food. I still try new things but I do so by buying the product. That adds one additional screen that I can do research in advance and make the decision more consciously. It’s not perfect, but it’s a step in the right direction.

So say no to free, and free your mind for better shopping decisions. Let’s tip the advantage in the shopping game back to consumers.

Related reading

I’ve written about food topics many times before. Here are some of my favorites:

How to split bills fairly

Misleading cereal packaging

Why “40 percent reduced fat” is not what it sounds like

Why 98 or 99 percent fat-free foods can make you fat