The Dark Knight and Game Theory

If you have not already seen The Dark Knight, then you should read this post at a later time as to avoid spoilers after the jump.  Otherwise, follow the jump for a game theoretic discussion derived from the movie that has already broken two box office records for both best midnight opening and top first day revenue.  I personally enjoyed the movie immensely, but that discussion does not follow.

So, officially, consider this a spoiler alert for what follows.

I am sure there were plenty of other individuals who immediately conceptualized parts of the movie in game theoretic terms as one’s mind is prone to do after sufficient indoctrination; however, after discussing the scenario with Julie for a bit, it seemed to be appropriate blog material and worth formalizing. Without further introduction (as I am assuming you have already seen the movie), we can begin:

The Story

The Joker’s final act as criminal mastermind and agent of nihilism (or, seemingly, to show Gotham city that we are all Homo Economicus when the structure of the game forces us to be) involves two ferries filled with people.  The first ferry is filled with normal, law abiding citizens while the second ferry is filled with the population of Gotham Prison.  The Joker, doing so without prior knowledge of the passengers and city officials, wired the ships with powerful explosives such that their explosion would destroy the entire ship and everyone aboard.  No single individual is allowed to escape.  Each ship is given a detonator for the other ferry.  The use of the detonator saves the ship while killing everyone aboard the opposing ship.  Thus, if any member of Ship A pushes the detonator, then Ship B is destroyed and all of Ship A is saved.  Additionally, if either ship fails to use the detonator to destroy its opponent, then both ships will be destroyed by the Joker.  Assuming that the actors must make their decision simultaneously, this would lead to the following game:


Solving this game is pretty straightforward and (detonation, detonation) becomes the dominant strategy as, at best, cooperation is weakly dominated. Thus, homo economicus and politicus have a very clear strategy to, without fail, destroy their opponents, and in so doing, both will ships will be destroyed.

However, in Gotham City, this does not happen – nor would it necessarily happen in a laboratory experiment either as a few more complications are introduced into the game.  First, the game appears to be pseudo-sequential or, perhaps, a series of simultaneous game with a finite end.  The Joker gives both ferries 30 minutes in which they can detonate the other side.  Even with this complication, the outcome should be the same and both actors ought to choose detonation at the first node (that is, t =1 or when the first move is available).  Using backwards deduction, both players recognize that their opponent will choose to detonate in the final iteration even if there are some gains to short-term cooperation.  This effect cascades backwards to the initial decision node and mutual detonation occurs to prevent receiving the sucker’s payout of cooperating while the opponent defects.

Decision Rules

Beyond this, it appears that the decision making process for both ships is different.  In the ship containing prisoners, the decision to detonate becomes decentralized and any one actor willing to grab the detonator could do so.  While the armed guards gives the opposite impression of clear authoritarianism, Decentralization becomes apparent as the time moves on. Thus, decentralized decision making should lead to the optimal play as any single individual among the 500 or more sub-actors should have a preference for survival.

On the civilian ship, the decision mechanism becomes a simple majority vote.  When the votes are aggregated, the decision to detonate the other ferry is chosen at a rate of almost 3 to 1.  Yet, there is no executive to carry out the decision and the majority will does not prevail as no single sub-actor is willing to push the button.  This psychological separation between deference of active responsibility (voting to kill others) versus carrying out the task, has been illuminated in some experimental settings as shown in the video Julie blogged about previously.

The civilians act rationally as long as they, individually, are not too involved in carrying out a potentially morally reprehensible act.


Perhaps social norms mattered for the actors in the game?  In the second game, we can assume that there are some social benefits from being a moral agent; however, being moral is not as beneficial as being alive.  Since survival trumps morality, we get the second game:


As Yev Kirpichevsky notes in his comment, the pure strategy equilibria are {cooperate-detonate} and {detonate-cooperate} with a Mixed Nash Equilibrium of playing cooperation and detonation with a probability of .5 for both players with this specification (this would change depending on how we parametrize the value for being moral and the value for surviving).  Perhaps, then, we saw the cooperate, cooperate cell (with probability .25) in the movie and if we watched the movie infinite more times, we would see a nice distribution where cooperate-cooperate occurs 25% of the time, both ships defect 25% of the time, and only one ship explodes 50% of the time.  I plan on seeing the movie again, and I will let you know if the outcome of this scene changes.

However, this is not the full specification of the game, let’s assume that the parameters allow for morality to trump survival:


The pure strategy Nash equilibrium is to never detonate as cooperation is always more beneficial than destroying the other ship.  While both specifications may be able to explain the movie, I think there might be a fourth game that explains the game the best.

The Joker Misspecified his Game?

While not the moral of the story that Batman wants the Joker or Gotham City to learn (he tells the audience and the Joker that people are not all evil – there is some good in Gotham), adding an additional parameter to the game can easily induce a cooperation solution.  If the people aboard both ships believe that the cost of dying is probabilistic, then they would cooperate as long as the benefit to cooperating trumped both the probabilistic chance of punishment and the likelihood that the other ship decides to detonate.  Thus, each ship has to calculate the value for morality (m) minus the cost of punishment P(c) and the cost of the other ship defecting P(dx)(d) where x is the other actor.  The cost of opponent defection and punishment are the same (the value of survival), so the equation reduces to:

U(Ship A) = M – (Pc + P(dB))*(S)

U(Ship B) = M – (Pc + P(dA))*(S)

Each equation must still be greater than the value of Survival Minus the Cost of morality such that for Ship A (or B with appropriate substitution):

S – M < M – (Pc + P(dB))*S


If M = S, then the joint probability of punishment and opponent detonation must be less than 1 for cooperation to be preferred, else defection dominates.  As M and S vary in relation to each then, the threshold for the joint probabilities to make a preference in strategy changes.  Note, if the value for M is zero for the observed actor and survival is infinitesimal greater than 0, detonation dominates.  Likewise, if we build in opponent morality into the probability of opponent detonation, and opponent morality is zero, then the cost of morality becomes too high.  Obviously, the game becomes increasingly complicated as parameters are made endogenous.

The actors must determine a subjective probability of the game being false: that is, the probability of punishment is not 1.  The probability of punishment could go down from 100% if the passengers believe that the Joker is lying about the deadline, if they think there is a chance of technological failure, that their detonator may indeed destroy their own ship (adding a hidden cost to detonation), or if they live in a world with Batman.  I would venture forth the assumption that the probability of punishment is inversely proportional to the probability that Batman exists with some modification based on his likelihood of failing to save people — but that is just me.

There are a few other situations in this movie that are prone to game theoretic applications and I have not exhausted the ways in which this game could be modeled.  However, I think this calls for a new villian in the third movie of the trilogy: The Game Theorist.  Much like the riddler, but deadlier and requiring Batman to use mathematics to fight crime.

About Michael A. Allen

Michael is an Assistant Professor in Political Science at Boise State University with a focus in International Relations, Comparative Politics, and Methodology (quantitative and formal). His work includes issues related to military basing abroad, asymmetric relations, cooperation, and conflict. He received his Ph.D from Binghamton University in 2011.

52 Replies to “The Dark Knight and Game Theory”

  1. As Mike noted above, we had a lengthy conversation about this scene in the movie. Some points that I thought were particularly interesting:
    1. From an institutionalist’s point of view, I liked that the decision rule that determined whether they would push the detonator was different in each ferry. It played on the notion of trust. In the prisoner ferry, you had a group of people who previously had broken society’s rules. It was hard for them to trust each other not to take the detonator and simply blow up the other ship even if the majority did not agree with the decision. So not only did they centralize authority by giving the guards sole control over the detonator and the choice to use it, at the very end the one prisoner threw the detonator out the window, making it impossible for anyone to blow up the other ship. While in one sense it appears killing oneself is irrational, centralizing authority to ensure the outcome you want is realized is strategic and rational in that situation.
    In the civilian ship, there was a completely different situation. It appears as though everyone trusted one another, so if they had a majority rule vote, they had no reason to believe anyone would disobey the result. Although in the end no one could take personal responsibility for blowing up the other ship (I discuss more about that below), they all trusted each other enough to believe they would abide by the rule.
    The lesson: a group of people must trust one another in order for them to choose democratic decision rules; otherwise, they will centralize and let others make the decision for them.
    2. It was particularly interesting that the civilians on the ferry felt comfortable to vote to blow up the prisoner ferry, but no one would take personal responsibility for it. This reminds me of Congress, where members diffuse responsibility amongst themselves so that none of them can take personal responsibility for a piece of legislation. As stated in Fareed Zakaria’s “The Future of Freedom”, Robert Packwood comment’s on his Senate career demonstrate this point perfectly: “When an interest group came in, you would say, “Gosh darn, I tried to support you. I really did. The chairman bent my arm.” Then, to protect yourself, you would tell the chairman that when those guys came in, to tell them you really fought hard on the issue.”

  2. First of all, I would like to propose something: There should be special movie screenings for political scientists. I say this because there were 10 of us from our department in our group, and we had a tough time not geeking out immediately afterward about the game theoretical and otherwise perhaps-more-interesting-to-political-scientists aspects of this film. I saw a few grad students from the Math department at the showing we went to, as well, so maybe they could join us in the special academia-centered screenings of future movies.
    This is an excellent post, and as you mention, there are plenty of things for political scientists and game theorists of all stripes to think about in The Dark Knight. My favorite aspect of the movie was more generally that the Joker’s (and later Two-Face’s) MO was to inject a good helping of randomness into his villainy. I couldn’t help but think of Schelling and the effect that taking the control over the decision to act can affect bargaining. I think that the Batman series has an incipient Game Theoretician, though–if the Joker was a little too unrefined to be our game theory villain in the next installment, The Riddler is nearly a ready-made villainous version of John Nash. He could easily be portrayed as someone who manipulates the information available to actors to alter the results of the game. I would argue that he’s been kind of dumbed down in the Batman movies of the 1990’s, but the Joker’s interesting brand of chaos in this film sets up the Riddler perfectly to become the master game theoretician for the next film. We can all hope, at least… And if he does represent the villainous uses of game theory in the next film, I would hope that the costume is a little cooler than it was in the 1990’s, too.

  3. The Prisoners’ Dilemma in The Dark Knight

    One of my favorite parts of The Dark Knight was the skillfully arranged Prisoners’ Dilemma situation presented by the two ferries. A quick re-cap. The Joker has been managed to force Gotham authorities to load two ferries – one with

  4. Great movie, great topic. Two comments:
    1. The game in figure does have pure strategy Nash equilibria: CD and DC. There is a mixed eq in this game, but it’d never get played — it’s clearly pareto-suboptimal. So you really have to value morality more than survival, it seems.
    2. It’s a good point that it’s actually a repeated game, since they have 30 min to make their decision, and the equilibrium involves detonation at the first node. Now the interesting question is: what happens after the first minute when no detonation takes place? Anything can happen off the equilibrium path… But, anyway, I think this is best modeled as a game of incomplete info about the probability of dying.

  5. Elsewhere on the Interweb (7/22/08)

    We were discussing game theory and the Dark Knight. Mike at The Quantitative Peace has an excellent post that discusses all the possible iterations: I think this calls for a new villian in the third movie of the trilogy: The…

  6. I like the discussion on this site. I admit that when I was watching the movie it wasn’t immediately obvious that game theory can be applied there. This is mainly due to how biased the film would end up being. Naturally, Batman would win out in the end and the people would be saved. Thus, thinking about the results of the game are irrelevant in terms of the movie. It’s a great mental exercise though.
    I do expect that the next villain will be the Riddler and I hope they do make the movie more like a mystery thriller. That would be nice but considering what makes money (action, explosions, etc…) I doubt it will happen.
    It was a great flick and this is a great discussion on game theory.

  7. Late but additional thought: It is important to realize that the people have no reason (and perhaps specific reason not to) trust the Joker. His shooting his own men (which the criminals/cops would probably know about), burning his own money (irrational!), etc. means that the actual payouts (indeed the game’s structure) have incredible uncertainty about them..

  8. Don’t know if this got my response I just typed: Julie, they all did! That’s why they were on the boat fleeing Gotham, because the Joker declared war on the city.
    At a baseline, anyone there knew about the Joker’s fake-batmen torture video, the assassinations (attempts and successes) of high-ranking public figures, and his blowing up a hospital. The cops/criminals would have known about him betraying their own men during the bank robbery. (The cops may have known that he switched the addresses of the targets during his previous ‘game’, breaking his own rule-making.) Note that the cops/criminals weren’t energetic about playing the Joker’s game – for all they suspected, turning the switch would have blown up their own boat.
    Can’t play a game if you don’t trust the rules…

  9. Perhaps the cops and criminals associated with the Joker were aware of his tricks- but they were not playing the ferry game. The players in the aforementioned ferry game were civilians and prisoners, not people with personal contact with the Joker. Further, what the civilians and prisoners did know was that he was capable of murdering people. The fake batman torture video- he killed the guy. His promise to blow up a hospital- he followed through. Killing high ranking officials- from all of this it is obvious he was willing to take human life in sadistic ways. The civilians and prisoners had no reason to believe he would not go through with it.

  10. I think there’s more room for an analysis of the game as a repeated game. Assume a series of simultaneous games with a finite end. In the standard analysis, both players choose detonation in the first node (T = 1), because they’ve worked out the backwards induction and realized they’ll get killed sooner or later if they don’t detonate.
    However, given that time is discretized to small enough chunks (to model continuity) and that the players are subject to bounded rationality (none of the people involved can instantly think through the situation they’re in… probably not enough game theorists on board), several nodes go by with no detonation from either side. This serves to build up trust (updates a player’s prior belief about the other’s players morality).
    In fact, I think the movie encourages this analysis. I believe one of the civilians states (a few minutes into the game), “After all, we’re still here, aren’t we?”
    The tensest moments on the ferries are near the end of the 30-minute game. Now the players have had time to think through the backwards induction, and the number of remaining game nodes are quickly decreasing. I think in the end what saves them is that the game can’t be perfectly modeled as a series of discrete games, as time is continues. This is helped by the fact that the ferries have analog clocks, not digital clocks. (One can imagine a 24-style nerve wracking countdown. In such a psychological scenario, detonation might well have happened.) Since the clock is analog, it’s hard to know when the last node of the game is, which makes it psychologically possible to delay detonation, until it’s clear that the deadline has passed and everyone is still alive.

  11. “The civilians and prisoners had no reason to believe he would not go through with it.”
    Really? If you were on that ferry would you think (as I did as an audience member) that if they turned the switch, their own ship would go up? We don’t, in fact, know this one way or the other; we can assume that the rules were true (as Batman did when he went to get Rachel and found Dent), but given that the Joker made a deal in his public appearances as being some sort of agent of chaos. One can’t simply assume a sociopath is going to keep his word, as these models do.
    (Obviously we haven’t touched on the notion of these people resisting even playing the game the Joker wants to play. It’s folded under ‘morality’, but I think it’s an even more interesting dynamic.)

  12. Based on the information they had, as I stated above, they had no reason to believe the Joker would not kill them. He had a reputation of killing people and following through with his plans, such as blowing up the hospital. Further, we can’t simply assume that the average person knows what a sociopath exactly is, let alone be able to diagnose them as such. All those people knew was that the Joker was capable of promising to end human life and following through with it.

  13. It was never stated or shown, but I assumed the Joker switched the rules like he did with Rachel and Dent. I assumed that whoever pushed the button would blow up their own boat. That uncertainty would surely have been present for the persons on the boat (were it real and they actually possessed concerns), mitigating any inclination to actually press the button, regardless of the threats.

  14. However, I think this calls for a new villian in the third movie of the trilogy: The Game Theorist. Much like the riddler, but deadlier and requiring Batman to use mathematics to fight crime.
    The joker is already this villain:
    1) dog-eat-dog, profit-maximizing-with-limited-information bank heist (simultaneously, the chaotic, ignorant henchmen vs the mob bank)
    2) one spot: one pool q; or, three black dude’s thugs vs two joker’s thugs with guns
    3) Kill Reese (the one, direct responsibility) vs Have Patients Die (the many, diffuse responsibility)
    4) The Girl Vs The White Knight (individual vs collective good)
    5) the ferries, as explicated.
    I would add that it takes a good actor to make the long, expository lines of the “game theorist”/Joker’s seem like credible drama. thank you, Mr. Ledger.
    Remember the Architect scene from the second Matrix flick (or don’t!).

  15. @Chaos Motor
    The possibility that Joker switched the rules of the game actually sounds very plausible to me, and it makes the game much more interesting, I think.
    If the detonator blows up your own boat, and if both blow up at the end of 30 minutes after no decision is made, then how would the game turn out? If self-preservation were the only imperative, then the result should be that both boats blow up, but morality also seems to come into play, in which case, the end-result would seem to be less obvious.

  16. @DavidChoi,
    For me the whole point is that only a madman like the Joker could think “self-preservation” was or is or could be the only imperative. First off, it isn’t self-preservation that serves species survival, it’s that set of available self-preservation decisions which increases species adaptation to the species’ environment (e.g., it’s not enough that a biological unit preserve its own life if doing so comes at the expense of the next generation). Second, at any given moment, each individual is navigating a large number of concurrent game spaces, and behavior is determined by a weighing, partly conscious, largely unconscious, of the payoff estimates across all such spaces. Which is to say, self-preservation in one game space might be self-destruction in another, as shown by Batman’s self-destructively Christlike preservation of self in the taking on of Dent’s sins.
    As for the ferry game, you’re gonna believe the Joker? I’d assume my boat was going to blow whether I hit the detonator or not, and likewise, I’d have no reason to believe the detonator wouldn’t really just blow up my ship. The madman might just get a laugh out of me blowing myself up thinking I was saving myself, and self-proclaimed agents of chaos aren’t any too good at following rules, not even their own. Nope, what with the unreliability of the rule-giver/rule-reporter there really wasn’t any rational choice but to wait and pray for a miracle (or a reprieve from writer.)

  17. I have to agree with RL — My first thought was — why is everyone trusting what this madman (the Joker) is saying. I would tend to believe, knowing the Joker, that the detonator would more likely blow up my own ship. The writers don’t even introduce this possibility, maybe since it removes the dilemma as stated. However, I would think someone would raise the issue — my choice would be the prisoner who is given the detonator. He states, “Did any of you happen to think this just might blow up OUR boat — you’re a bunch of idiots.” Then he tosses it out the window.
    Of course, maybe the writers wanted to point out what a bunch of sheep most of us are — believing not only the lies of our leaders, but also those of a certified madman.

  18. I’m with rl/Charlie on this one, you make the assumption that indeed each boat had the detonator of the other boat. I was so waiting for the “normal” people to hit the detonator and blow themselves up.
    How does this effect the game? Do you actually believe the Joker or is their a 50% chance you could blow up yourself?

  19. The classic prisoner’s dilemma is based on knowing the “truth” (crime was committed by you and another — do you “sell out” or keep quiet — will your buddy do the same.) Once there is no truth, the PD is out the window. Oh, I guess you could form a strategy based on conditional probabilities (there is a 20% chance we believe the Joker, etc), but in my mind, at that point, you are really betting on how much you believe the Joker (a known madman), so I think your best policy is to do as the convict did, and toss the detonator and hope Batman will save you (which, of course, he will:-)

  20. Thank you for the discussion about the passenger’s dilemma in the two boats from The Dark Knight.
    What would happen if the Joker was dishonest?
    By activating the detonator, the passengers would destroy their own boat and kill themselves.
    The Joker has shown several times during The Dark Knight that he is untruthful.
    How does the Joker’s dishonesty play in your game?

  21. Here are some further complications to consider.
    The audience actually has a lot more information at hand than any of the individuals on either boat, and most of the rest of the cast of the movie period.
    It is important to note that the outcome of the Joker’s actions appeared to be pre-set. By that, I mean to say that the Joker’s plans were designed to be carried out in a specific way regardless of what actions were taken by any of his games’ “players”.
    Consider first the dilemma he sets up with Dent and Dawes. The two are placed in separate places and their demise is set to a timer. The Joker wouldn’t have a reasonable way to know that the police force would recognize Dent’s or Dawes’ disappearance before that timer blew up. (In fact, through context you can see that they didn’t even realize Dawes was missing.) The timer was set to blow that very night, which really didn’t give the police much time to realize Dent and Dawes as missing. The Joker clearly didn’t volunteer the information until he was questioned by Gordon and later Batman. So, had Dent’s status not become readily apparent, neither Gordon nor Batman would have ever questioned him and both Dent and Dawes would have died.
    Now look at the dilemma he presents with the hospital and Reese. The Joker gave a 60-minute time frame for this dilemma and had no clear feedback mechanism to determine whether or not Reese had been killed. He could have potentially used the news, but such a short time frame doesn’t really allow for a robust feedback loop. Second, the level of destruction the Joker caused to the hospital requires significant prior planning, planning which undoubtedly occured long before Reese made his statement on the news. This would indicate that the Joker had every intention to blow that particular hospital apart regardless of Reese, and simply used his already laid plan to destroy the hospital in such a way that it would cause additional chaos, not to mention keep the police sufficiently busy to aid in his continued evasion of them.
    So, where does this leave us when examining the Joker? I would argue that the Joker is not actually making any attempt to create a closed-system moral dilemma. Rather, much like the opening moves in a chess game, he creates conditions that give him as many options as possible to impose false dilemmas onto Gotham in order to force the citizens into actions they would ordinarilly find repugnant (” . . .they’ll eat each other.”)
    So, if he follows a similar pattern with the boats, then he has again created a false dilemma. It is false in that he may very well destroy both boats regardless of the decisions of their passengers. Although, due to excellent acting on his part, Ledger does display a genuine, if fleeting, sign of disappointment when the passengers do not “eat each other”.

  22. I immediately assumed it was a test of morality as the Joker had commented earlier in the movie: “You’ll see, I’ll show you, that when the chips are down, these uh… civilized people, they’ll eat each other.” So, as soon as I heard the “rules” to the game, I also assumed that as punishment for failing the test (pushing the detonator), it would actually blow up their own ship.
    Unfortunately, I wrongly assumed that one of the ships would push the detonator. I was sure that the ferry with the “good citizens” would be the one to fail the test, and thus they would die. When no one did, I almost immediately cried foul and figured the studio had edited the film because perhaps test audiences had found it too grim (for an entire ferry of “good people” to have died…and by actually “killing” themselves with their own detonator). In any case, including that ending to the “game” would have been so fitting.

  23. I stumbled upon this post while idly googling for the dark knight ferry scene. This is very very well explained from all sides of motivation and a great thought exercise for anyone who has learned about the game theory. Great post 🙂

  24. Another factor which plays here (kinda destroys the dilemma) is that if you are blown you might not get the chance to blow the other. IT is not like the prisoner’s dilemma where you can defect, if the other defected). The blow could be fast enough for you to die before you could trigger the detonator. Also the dilemma in the movie was not a dilemma as such as the Joker said that you will die by midnight anyway, so there was no benefit by not exploding the other boat (no benefit to cooperate).

  25. Correct me if I’m wrong, but shouldn’t the payoff for the player who dies be negative infinity, as opposed to just 0? I realize a dominated strategy is a dominated strategy, but when you start getting into equations that might allow for morality to outweigh death, I think the value for death becomes quite a bit more important.
    I suppose this is akin to the prisoner’s dilemma, but in the nuclear war application. The classic prisoner’s dilemma I learned in game theory class had significantly different payouts compared with the nuclear war game I learned in poli sci class. When we stop talking increased prison sentences and bring the discussion round to life or death, I’m not sure that 0 payout holds anymore.
    Side note – I understand some people are willing to die for their beliefs, and that this would change the payouts somehow, but I’m not sure I not see how this would play out mathematically. Furthermore, wouldn’t just one person’s “infinite” loss due to death outweigh the entire boat’s moral preferences? Any clarification on all that would be helpful.

  26. Im a 17 year old who’s just been introduced to the game theory. im not all that good at it.
    so people are not allowed to jump off the boat – then the boat explodes.
    but does throwing the detonators away influence our result in anyway?
    ofcourse – if both the boats don’t explode, then they will explode together ..

  27. It becomes way too complicated, because the Joker could make each detonator blow up both boats as well, just because he feels like it.

  28. Pingback: An Introduction to Game Theory | Anthony J. Evans

  29. Pingback: New Scholarship: Poli Sci Fi | The New West

  30. Pingback: Cinemath: The Game Theory Behind the Snow White War | Collider

  31. Pingback: Infiernos made in Nolan - Jot Down Cultural Magazine

  32. Pingback: The Prisoner’s Dilemma – Bit Nibble Byte

  33. Pingback: Black History Month Heroes: Tattooed Prisoner from “The Dark Knight” – Tester

  34. Pingback: Adactio: Journal—Movie Knight

  35. Pingback: The Dark Knight, The Joker, and Game Theory

  36. Pingback: The Dark Knight, The Joker y Game Theory » Mejores películas Online

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.