The Art of Game Theory

It's only a dismal science if you allow it to be.


Leave a comment

Turn Bases and Time Limits

It’s been a while since my last post, but don’t worry, I haven’t forgotten about you guys. (Both of you.) I’ve been searching for better employment – consulting can be fun, but it just doesn’t pay the bills the way I’d like it to right now.

So, writing and re-writing and tweaking and fine-tuning applications, cover letters, and resumes has been my life for the past couple months. I don’t have anything concrete to show for it just yet, but I’ve heard the job search process described as being like a Jackson Pollock-style artist: most of the paint you throw will just slide off and make a mess, but some of it will stick. Keep slinging long enough, and eventually you’ll have what you’re looking for. (And a supremely irritated landlord if you do this inside.)

But that’s just my own personal side quests, so let’s get back to business and talk about another aspect of game theory: timing.

Most games I’ll talk about here are turn-based games. What do I mean by that? Well, turn-based games involve players alternating on some regular basis, generally after each move or after some defined sequence of actions. Chess, Blackjack, WarMachine, and XCom are some examples of turn-based games. The alternative would be a game where the action is more continuous, like Tag, Call of Duty, and Hungry Hungry Hippos.

In game theory, even continuous games are generally broken down into discrete steps and decisions, because it’s easier to figure out how people make decisions. That can get to be complex in a hurry, though, as you might imagine – or really tedious, if a continuous game is based on really simple decisions. In any case, it’s useful to think of them this way because it’s a lot easier to figure out how a flowchart works than wade through a stream of consciousness. So, most analyses treat games as turn-based.

Another aspect of timing is how long games last. Some games last just long enough for one or both players to have a turn, and then they end. The initial concept of the Prisoners’ Dilemma works like that, and its result of both prisoners deciding to rat each other out is dependent on that. They only play against each other once, so there’s no way they can threaten the other with some reprisal to force him into silence.

The result can be changed a bit if they play the game repeatedly, though, since now threats of reprisal have meaning: if you got hosed last time, you’re not going to let that punk get away with it twice! But now you have a realistic option (at first glance) to play nice and actually realize the ‘good’ outcome. If the other guy can be cool, then there’s less of a reason to actively work against him. (There’s still a reason, of course, because the advantage from ratting out the other guy and not being ratted out yourself is still there, but threats to keep him in line can be meaningful now.)

As it turns out, the typical format of the Prisoners’ Dilemma with multiple turns involves a very specific retaliatory plan. This grim strategy comes down to “if the other player rats me out, I will rat him out for all remaining turns.” For games that are likely to last for a long time, or for extremely high-stakes games, you can see that this might be a pretty substantial threat. Hopefully, it’s enough of a long-term threat to overpower the short-term gains the other guy might make by screwing you over.

Hopefully. It can work, if the penalties are steep enough and the length of time is long enough – but to ensure a grim strategy will work, one or both of those have to approach infinity.

Even knowing how many times you’re going to play the game can change things. One way to look at this might be to think, “We’ll play this game for ten turns. If I play nice for nine turns, and screw him over on the tenth, then he won’t be able to do anything about it! *evil laughter*

“…Wait. He’s probably thinking the same thing. So he’s planning to toss me under the bus in turn ten – the punk! Well, I’ll show him! I’ll get my licks in on turn nine! Even the penalty for us both backstabbing is still better than just him winning.

“…Wait. If he had my first thought, then he might have had my second plan as well. Fine, I’ll slide the knife in on turn eight…” And so on, until you’re all the way back at turn one, desperately suspicious that the other guy is going to rat you out at the first opportunity. Back to square one.

As it turns out, most games with definite lengths can be plotted out this way. That’s not to say that complex games (like chess, for example) don’t have lots of room for variability, just that they can be calculated. Games where the timing is indefinite change things. Knowing that the game would last only ten turns meant you knew when the best time for a first strike was, and could modify your timetable based on that. If the game lasts an infinite number of times, though, then retaliation is certain for a very long time if you betray the other guy at any point.

Even if you know the game will end, but you don’t know when, the advantage is still to be friendly. Any retaliation he enacts because of something you did might last one turn, or it might last a hundred thousand. That’s a lot of potential good outcomes to put at risk.

…I’d meant to get into more applications of this sort of thing, but this is running long as it is. So, I’ll leave it as given that we’re all on the same page for why timing is…

important.


Leave a comment

Caution: Lane Ends

A few weeks ago, I had the “pleasure” of a long car trip to attend a relative’s wedding. Our various maps and GPS estimated it would take us about six hours to skate through Washington, Baltimore, and two-thirds of New Jersey. The wedding itself was wonderful, the area was beautiful, and I had a fantastic time, but the drive itself… Next time, I’ll take the train. Or fly. At one point, an hour into one particular traffic snarl, booking passage on a tramp steamer seemed preferable.

I’m sure you’ve been there in traffic, waiting to get to the end, wondering about the reason for the holdup. The longer the wait gets, the more out-there you start to think the cause of the delay might be. The mind wanders as time starts to lose meaning, especially when there are no “caution: road work” signs to explain why you’re trapped.

So, imagine my surprise when the reason for the delay was two multi-lane highways merging together. All told, they lost two lanes out of six – but that sort of thing shouldn’t be too difficult to work out over the course of a couple miles, right?

Well, suffice to say that Hanlon’s Razor (“never attribute to malice that which is adequately explained by incompetence”) comes to mind. But this sort of merge around construction isn’t new, certainly on major highways, which begs a question: exactly why were so many people getting it wrong?

The problem, as I saw it, was that a lot of people didn’t really understand how, or at least when, to merge. They’d have to figure it out at some point, but picking the wrong time to perform the merge probably aggravated the slowdown. Choosing a better time to merge would yield a better outcome: smoother and faster travel.

We have players, distinct options, specific outcomes, and turns – enough to turn traffic into a game!

The Scenario

You’re on the highway, and you start to see signs telling people that the lane you are using will close ahead. It gives you a rough idea of how far ahead it will happen. I’ll use an example of five miles, but it could be any non-trivial distance. When you see that first sign, you have some time before the “doomed” lane ends, so you can decide when to merge into a “safe” lane.

The Options

You can’t stay in your lane forever, so at some point you will have to merge out of it. You can merge at four points in time. In reality, the opportunity is continuous rather than discrete, meaning you could actually decide to merge at any number of points, or even switch back and forth, but for this game we’ll say we only want to make one lane change. The four points in time I use are representative of broader times for merging rather than specific instants. Essentially, you can merge 1) very early, at the first warning sign; 2) more than halfway through, perhaps with one mile remaining; 3) most of the way through, say 1/4 mile remaining; and 4) there’s a guy with a hard hat and a reflective “Dept. of Transportation” vest standing there, merge RIGHT NOW.

The first three decision points have two options: merge there, or delay one turn and make another decision. The last point is more demanding: if you haven’t merged by then, the game (or the concrete Jersey Wall) forces you to do so. That means you have four strategies:

  1. Merge at (1) with 5 miles remaining;
  2. Delay-Merge at (2) with 1 mile remaining;
  3. Delay-Delay-Merge at (3) with 1/4 mile remaining; and
  4. Delay-Delay-Delay-Merge at (4)

If you want to think of your possible strategies graphically, they might look something like this:
Outcomes Missing

I haven’t filled in any of the payoffs yet, so this crude illustration by itself isn’t quite enough to inform a decision yet. That’s our goal, though, so let’s look at what would serve us best.

Before we get into that, though, I should mention some assumptions I’ve made.

  1. There are already some people on the road ahead of you, so you’ll face some traffic no matter what you do;
  2. People started out evenly divided between all the available lanes, but because some people got there ahead of you, the safe lane is slightly more crowded and moving a bit more slowly than the doomed lane as people up ahead merge;
  3. If you wait until the doomed lane completely closes, you risk having to stop fully; and
  4. Each of the four merge strategies will be followed by some part of the population, regardless of which is optimal.

Now we’re ready to determine some payoffs and find out if there’s any clear ‘best’ strategy.

Some people merge as soon as the first sign comes along. This has its benefits, but some significant drawbacks. While it’s true that if you merge at the first sign that you won’t be trapped at the dubious mercy of other drivers at the very end, it means you’re behind a lot more people – everyone who would normally be in the ‘safe’ lane, plus everyone in the process of merging up ahead – and certainly moving more slowly. Merging early means you maximize the amount of slow (but not stopped) traffic you’ll face.

The second strategy is kind of a catch-all category for taking advantage of up to about 80% of the doomed lane’s remaining life. You’ll slip by a lot of the traffic, maybe most of it, but you’ll still merge well before your lane starts to slow down. This is a lot better than merging immediately, but you’re still accepting some delays that you could avoid.

The third strategy comes up either at the last warning, or when the doomed lane starts to slow down. If you merge just when things slow down, it’s safe to say you have avoided all the avoidable traffic. Merging at this point might start to get a bit tricky, but it’s not enough to worry most drivers. Both lanes are equally slow at this point, so there’s no obvious advantage to waiting any longer.

Merging can become difficult with the fourth strategy, and you will likely have to slow or stop completely to wait for an opening, because the end (of your lane) is nigh at this point. If you’ve stayed in the doomed lane this long, then you’ve been cruising by dozens of drivers going slower than you, and this is their moment to exact revenge. Even with courteous drivers, merging into slow-moving and closely packed traffic can be difficult, and the risk of a fender-bender rises with this sort of vehicular dressage. This is the outcome people merging early are trying to avoid. On the strength of the time saved, though, it’s far from the worst, especially if other drivers know what they’re doing.

The Decision

With some very basic weights, the diagram might look something like this:
Outcomes Complete
I contend that the best strategy is to merge at (3). It lets you avoid the most traffic without the risk of having to stop at the very end. There is a body of research that supports late merging, though the ‘zipper’ approach they take (alternating between lanes at the doomed lane’s endpoint to funnel traffic smoothly) assumes traffic in both lanes is at or near a full stop at the merge point already. If things are fully or very nearly stopped already, then there’s no obvious speed advantage to either lane. At that point, I’d base my decision on how easy it is to merge, which means waiting until the bitter end is as reasonable an option as anything else.

That may hint at a question some of you may have: why do some of these outcomes have two payoffs listed?

With strategy (2), I did so because different people have different attitudes toward risk – here, the risk of having to slow down before you absolutely have to. A complete treatment of attitudes toward risk needs its own post at least, but the basic idea here is that some people would be happy with settling for what they can be sure they’ll get, and other people would see merging at (2) to be like leaving money on the table.

The first group is more risk-averse. Their payoff is 0 because they don’t see themselves as losing anything by merging before traffic slows down, and they’ve already outpaced the payoff from strategy (1). The advantage to staying in the doomed lane is equaled by the risk of losing the gains they’ve realized, so they would see merging at (2) to put them ahead. The second group is more accepting of risk, and so merging before anything starts slowing down makes them feel worse off than waiting a bit longer. That’s why they see the payoff to merging at (2) to be worse than trying their luck later on.

The reason for strategy (4)’s two possible payoffs is simpler: I never know how well other drivers really understand how to merge in the first place. If they are reasonably competent, then (4) comes out well: a +1 for having avoided so much delay and merging properly – the same payoff as to merging at (3).

However…

Well, heavy traffic tends to encourage a pretty low opinion of other drivers’ skills. Still, having (n+1) lanes to work with for five miles means more people moved further. Even with a +0 outcome, you’re still better off than if you’d merged at the first sign.

Of course, if everything has stopped for miles the way it was on the New Jersey Turnpike that hot Sunday morning, then all bets are off.


Leave a comment

For every complex problem…

This video isn’t exactly new – it’s coming up on a year now since I first ran across it in a friend’s Facebook feed – but I love thinking about how this guy makes his case. His goal is to “make the climate change debate obsolete” and lays out some scenarios.

In his presentation, there are two ‘players’, nature and humanity. Nature decides whether climate change is either true or false, and humanity can either take action to address it or not. That gives a simple 2×2 grid of decision pairs: “true/take action”, “false/take action”, “true/ignore” and “false/ignore”. When he assigns the outcomes, he specifically did not include any particular weights to them, other than ‘good’ versus ‘bad’. For that matter, to avoid immediately turning off any skeptics watching his presentation, he did not assign any probabilities to nature’s ‘true’ or ‘false’ states of the universe.

So, we have two players, we have outcomes that can be weighed against each other, and we have decisions they can make – even if nature’s decision is purely a mechanical one, like a coin flip. We have enough basic ingredients to think about this in game theory terms!

He’s direct, he’s excited about his topic, he makes his point clearly, and he seems to make a solid case by playing the payoffs of different outcomes against each other. His conclusion is that the only reasonable course is to act (and spend) like climate change is real, regardless of whether it is actually real or not, because its potential consequences are so devastating.

OR IS IT?

Well, no, not really. Once again, complex problems refuse to suffer oversimplification. In this case, based on how he set up his outcomes, he actually proved that the only logical course is to not spend a dime on counteracting climate change. There were also some other issues in his presentation, like the fallacy of the extremes (climate change is either fictional or apocalyptic, action is either All In or nonexistent), but I’m more interested in the decision itself. So, how did this backfire?

Let’s walk through the logic and find out.

He starts off with three assumptions: 1) that taking action will be effective, if immensely expensive, 2) climate change is either real or not – but we don’t know which yet, and 3) if damage from climate change occurs, it will be catastrophic. Starvation, a twenty-foot sea level increase, wars. Riots and pillaging. Moral decay.

With you so far...

The first box he fills in is the top left, “not real/take action”. Here, global warming turned out to be a hoax, an overreaction, or simply a mistake – but action was taken to counteract it anyway, and at great expense. He predicts a global depression due to the staggering amount of scarce resources redirected to this project. Not so good.

Second, he fills in the top right: “not real/no action”. Climate change turned out to be false, but no one spent anything to correct it, so no harm, no foul. This box gets a happy face.

The third box is the bottom left, “real/take action”. Global warming turned out to be as big a danger as the alarmists feared, but fortunately our handsomest politicians came up with a way to deal with it. It was not cheap – just as expensive as causing the global depression in the top left box – but at least we won’t drown in acid rain. Having avoided the looming peril, this box also gets a happy face.

The final box, “real/no action” on the bottom right, gets lots of detail. Here, humanity allowed Earth’s transition to Venusian conditions to begin. The presenter lists economic, political, social, environmental, and health crises all emerging from climate change. Also not good.

mass hysteria

There are some problems that should be fairly clear at this point. I’ll get to implications in a moment, but this first problem should be obvious. The first is that “take action” will always result in the global depression. The money is just as spent regardless of whether the threat it was supposed to address is actually real or not. He considers a global depression a problem, since he doesn’t give that cell a smiley face, but the “real/take action” cell is just as depressed. Since the environment is just as stable as it was in the ‘not real’ state, the outcomes are identical – and if you call one bad, the other is bad, too.

Not addressing a real peril leads to experiencing that peril, too, of course. However, the presenter made a point of not assigning any weights to these outcomes. Without weights more specific than ‘good’ and ‘bad’, there’s no way to tell if one bad outcome is preferable to another. If he meant one bad outcome to be worse than another, then he had ample opportunity to describe it that way – but he didn’t. Because he did not differentiate, we can’t, either.

That means the only square that has a positive outcome is “not real/no action”. As mentioned, he assumed we don’t know whether ‘real’ or ‘not real’ is true. However, the way he set this game up, the only way to get the good ending is to take no action and hope the odds are in your favor. Doing nothing risks disaster, but taking action guarantees it.

Now, you might argue, “Wait a minute, he listed economic consequences in the “real/no action” cell! Surely that means it’s worse because it includes the bad side of taking action!” There may be some merit to that, but he passed on the chance to make that argument. If you assume he knows what he’s talking about, you have to assume that was a conscious decision.

I would also argue that a global depression is nothing to laugh off. A persistent depression contributed to the rise of fascism in 1930’s Germany, and terror groups like al Shabab often target young men with little social or economic stability for recruitment.

For that matter, the measures addressing climate change on a global scale likely would involve immediate and severe cutbacks on fossil fuels. Such cuts would certainly cause pain at the pump, but this is more than a nuisance. As fuels like diesel and gasoline become more expensive, the cost of food production and transportation increase dramatically. The food shortages caused by a misguided US corn ethanol mandate are a prime example of this disruption.

Access to cleaner alternatives is uneven, but a simple way to put it is that money opens more options. A France or a Japan, for instance, can far more easily afford to invest heavily in nuclear power than an Afghanistan or an Ivory Coast. Poorer nations could face disaster if cheaper, dirtier options are unavailable.

On top of the problems fossil fuel use causes, cuts to production would fall unevenly as well. Russia, for instance, derives significant political power from the fact that it supplies most – in some cases all – the natural gas European nations use. Iran’s situation is more complex, but its oil reserves give it a similar bargaining chip. Neither country would take kindly to suddenly losing their influence, and the resulting economic devastation would be blamed squarely on the countries leading the effort.

That means the cuts themselves, along with being expensive outright, can bring about the political, social and health crises an environmental breakdown supposedly avoids, and make the economic disaster they already caused even worse.

Finally, there’s the potential for an economic disaster to cause an environmental collapse. There are several scenarios that do this, but they boil down to a conflict over resources escalating into a nuclear exchange, with obvious environmental consequences.

So, don’t listen to this guy…
gw-dichotomy1

…unless you want to have to listen to this guy next.
T51b


Leave a comment

…And the world creates a website with you.

Welcome to the inaugural post of the Art of Game Theory! So, what is this place all about? Well, this is a place where I can relate news and thoughts that are of interest to me. As the title suggests, I have interests in politics and economics, particularly in game theory. I’m interested in physics, technology, fitness, and writing, too, though those didn’t make the cut for the site title.

…Okay, that’s direct enough, but maybe a better way to look at this site is how Niccolo Machiavelli prefaced The Prince. His thinking was that showing respect to a leader generally meant giving them some sort of gift, like classy jewelry, custom weapons, fast horses, or other swag. Machiavelli was a theorist and historian, so his offering was a primer on how a leader could be more effective and, ultimately, safer. At least personally. The only thing ol’ Nic asked for was to be remembered once his patron had risen to power.

So, if you think of me like that – a nerd offering unsolicited perspectives and “clarifications” – then you shouldn’t be disappointed.

Okay, let’s get started!

So: game theory. What is it? Well, ask five economists and you’ll get seven or eight answers, few of them satisfying. But then, you’re dealing with economists, so you should probably expect that. It’s okay: we’re used to it.

Personally, I love game theory. It’s always seemed straightforward enough to me, in that it’s the part of economics that focuses on decision-making. The basic premise depends on knowing your opponent (as in, whether they’re rational, how they value outcomes, what they consider useful objectives), and knowing the game (the basic rules, available options, turn order, whether you’ll see this opponent again) to figure out how to get the best outcome of the game.

The classic example of a game theory… uh… game… is the Prisoner’s Dilemma. Most textbooks start off with this, so I won’t rehash it here just now, but I see no reason not to buck tradition and at least mention it. It’s straightforward enough to make minor changes and see whether those modifications change the decisions pretty much immediately.

Does adding more players change things? (sometimes) How about moving simultaneously versus turn-based? (yes) What if you play the game more than once – and can retaliate if the other guy screwed you last time? (sometimes, depending on the next question) Does it matter if you know how many times you’ll play against this guy? (yes)

Other games can get more practical, though the math that backs them up can get complex. I’m not planning to get into the calculus or linear algebra that supports the conclusions of these here. One practical (sort of) game theory paper I ran across a few years ago was about activist groups and ‘morally managed’ companies. The premise was that you had three groups. Companies, who differed in size (big/small) and management style (profit/moral); customers, who could decide how to divide their funds between buying stuff and donating to activists; and the activists themselves, who used their donated cash to pick a company and hassle it, and viewed success as how big an effect they had in customers’ buying habits the next cycle. This was a mathematical model, not a historical one, so all three groups were generic beyond the aspects I mentioned.

You’d think the decisions would be obvious. People would prefer to buy stuff from morally managed companies – think Chipotle’s reputation for humanely-raised meats, or Starbucks’ efforts to buy “fair trade” coffee beans – and activists would target those companies that weren’t ‘morally managed’.

The conclusion was very interesting. Sometimes it turned out that way, but mostly it turned out that the activists targeted whatever company they thought would most likely change its habits to keep them happy, not the company that was disregarding morals the most. There was some fairly involved integral calculus behind the model, but luckily, it makes intuitive sense: it’s usually a bad idea to pick fights you don’t know you’ll win, especially if you have other options. So, from the activists’ perspective, it’s better to 

And, to my mind, you always have other options. Of course, figuring out what those options are, whether they’re viable or not, and what the outcomes of those options might be, well… That can take some outside-the-box creativity.

To my way of looking at it, though, that’s the fun part.