-
Notifications
You must be signed in to change notification settings - Fork 0
/
whats-everyones-least-favourite-season.html
executable file
·270 lines (262 loc) · 12.5 KB
/
whats-everyones-least-favourite-season.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>What's everyone's least favourite season?</title>
<link rel="stylesheet" href="/theme/css/main.css" />
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body id="index" class="home">
<header id="banner" class="body">
<h1><a href="/">Andrew Clarry Blog </a></h1>
<nav><ul>
<li class="active"><a href="/category/blog.html">Blog</a></li>
</ul>
</nav>
</header><!-- /#banner -->
<section id="content" class="body">
<article>
<header>
<h1 class="entry-title">
<a href="/whats-everyones-least-favourite-season.html" rel="bookmark"
title="Permalink to What's everyone's least favourite season?">What's everyone's least favourite season?</a></h1>
</header>
<div class="entry-content">
<footer class="post-info">
<span>Mon 20 June 2016</span>
</footer><!-- /.post-info --> <p>So, I got a text out of the blue this morning with my friend asking me to help
with my purely academic experience in game theory. I like to help others
(and be distracted from real-world responsibilities), so I agreed to help.</p>
<h1>The setup</h1>
<p>My friend's office was playing a variation of the el Farol Bar problem, a
classic problem in game theory.
Game Theory is a branch of economics, which tries to explain the behaviour of
people (or "rational actors") when they are put in a "game".
In game theory, a "game" is any situation where your choices affect the
people you are playing the game with, and vice-versa. Basically, they are
situtations in which you have to compete or coordinate your actions with others.</p>
<p>In the el Farol Bar problem, players try to coordinate against the group.
In the original version, people in a small town love going out to the
el Farol Bar, but the bar gets crowded easily. If more than 60% of
the town chooses to go to the bar, each person at the bar would rather have
stayed home. However, if less than 60% of the town goes, then the people who
stayed at home would have rather gone to the bar, and the people who went to
the bar are happy with their choice. Obviously, there is no situation where
everybody is happy. Less obviously, there is no single decision that an individual
can make that will always guarantee they will be happy with their choice.
Economists call more general versions of this game "Minority Games", and
they come in all sorts of forms.</p>
<p>My friend's workplace was asked the question:
<em>"What is your favourite season?"</em> With a couple hours before their answer was
due, I decided to go overboard. </p>
<h1>The theory</h1>
<p>Game theory analyzes games such as these by looking
at their <em>Nash Equlibrium</em>. A Nash Equlibrium is a situation where each player
is using <strong>a strategy that they are not better off deviating from</strong> when the other
players are playing their own Nash Equilibrium strategy. </p>
<p>Classic games like the Prisoner's Dilemma have simple Nash Equlibria.
In the Prisoner's Dilemma, two suspects are being interrogated by the police;
they are given the choice to either cooperate with the police and implicate
the other prisoner, or stay silent. If both prisoners stay silent, they are
each given a light sentence, since there is not enough evidence to implicate
them in the more serious crime. If one prisoner stays silent but the other
cooperates, then the prisoner who cooperates is freed, while the prisoner who
stayed silent is given a very harsh sentence. If they cooperate
with the police and implicate one another, they each get a medium sentence.
The prisoners essentially have no choice but to implicate one another; if they
stay silent, they are at risk of receiving a very harsh sentence.
If they implicate the other prisoner, the worst is that they receive a medium
sentence, but the best case is that they are set free.
The important part is that, when each prisoner is playing the strategy
to implicate the other, neither of them wants to stay silent, since they
will face the much harsher punishment. Conversely, if the prisoners start off
staying silent, each one of them wants to cooperate with the police to change
their light sentence to no sentence. There is only one equilibrium:
<em>(cooperate, cooperate)</em>.</p>
<p><img src="/images/prisoner's-dilemma-illustration.svg" max-width:auto>
<strong>Figure 1: The Prisoner's Dilemma: A game theory classic</strong></p>
<p>Our seasons problem is a little more complicated, for a couple of reasons:</p>
<ul>
<li>
<p><em>We are dealing with real people.</em> The prisoner's dilemma and other Nash Equlibria
in competitive games are notorious for not being easy to reproduce in the real
world. So, whatever the Nash Equlibrium is, we can't be guaranteed that
choosing it will actually give us a good result in the real world.</p>
</li>
<li>
<p><em>In the minority game, there isn't a single equilibrium strategy that
everyone can play and be happy with.</em> Instead, the Nash Equilibrium is a
<em>Mixed strategy</em>, where you choose a certain action randomly. Essentially,
the Nash Equlibrium strategy is to pick a season completely at random.
However, if our opponents are deviating even a little from this strategy, we
want to be able to exploit that deviation.</p>
</li>
</ul>
<p>One of the problems with trying to think strategically like this is that there
are many ways you can model your opponents. In the Seasons game, we might
imagine that none of our opponents actually understand the game, and genuinely
answer what their favourite season is. People have done polls on this, and they
seem to suggest that ~40% of our opponents would answer Fall, ~10% Winter, and
~25% between Spring and Summer each. So, Winter would be the obvious choice.</p>
<p>Of course, this is a pretty naive way of modeling the players in our game.
It is likely that most of these players are not actually playing the equlibrium
strategy, but it hard to reason about what their actual strategies might be.
So, how do we to try and get an edge on our opponents in a situation like this?
My solution to this problem was to take a poll on what the best choice was.</p>
<h1>Data!</h1>
<p>Here are the results:</p>
<table>
<thead>
<tr>
<th align="left">Season</th>
<th>Count</th>
<th>Percentage</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">Spring</td>
<td>5.25</td>
<td>25.00%</td>
</tr>
<tr>
<td align="left">Summer</td>
<td>3.25</td>
<td>15.48%</td>
</tr>
<tr>
<td align="left">Fall</td>
<td>6.25</td>
<td>29.76%</td>
</tr>
<tr>
<td align="left">Winter</td>
<td>6.25</td>
<td>29.76%</td>
</tr>
</tbody>
</table>
<p><strong>Table 1: Results from my survey</strong></p>
<p><em>(The fraction counts are from a frustrating friend who insisted on the strategy
of flipping a coin.)</em></p>
<p>From this data, we get an idea of the opinions of what the best strategy is.
Remember, these people are intended to be a representative sample of my
friend's opponents in the real game! If we have any hope of gaining an edge,
we want to use this data as a sample run of the real game.
Without any solid theory to go on, the best strategy is to run a mock game with
representative players and choose the strategy which would win in that game.</p>
<p>In the end, the small sample my friend and I collected pointed (very weakly)
to Summer as being the minority choice. With a sample size so small (N = 21),
we were skeptical of the results. So, on a whim, we went with Spring.</p>
<p>The result? Summer was the minority.
Statisticians everywhere, enjoy your vindication.</p>
<table>
<thead>
<tr>
<th align="left">Season</th>
<th>Count</th>
<th>Percentage</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">Spring</td>
<td>39</td>
<td>27.85%</td>
</tr>
<tr>
<td align="left">Summer</td>
<td>20</td>
<td>14.28%</td>
</tr>
<tr>
<td align="left">Fall</td>
<td>57</td>
<td>40.71%</td>
</tr>
<tr>
<td align="left">Winter</td>
<td>24</td>
<td>17.14%</td>
</tr>
<tr>
<td align="left"><strong>Table 2: Results from the actual game</strong></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<h1>The Important Question: Why is this interesting?</h1>
<p>The minority game in particular is pretty relevant to places like finance.
Going against the market is usually the path to money, so being able to predict
how other people will behave can allow you to "beat the market".
But, <em>everyone</em> is trying to behave strategically like this, so in practice, it's
almost impossible to beat the market.</p>
<p>I'm not exactly sure why I found this game so interesting.
I think part of it is the way it requires some backwards thinking.
My friend was asking my opinion to help choose their strategy, but the
data-oriented approach would say that my suggestion should be the <em>last</em>
answer they should choose!</p>
<p>This kind of reminds me of the
<a href="http://www.nytimes.com/interactive/science/rock-paper-scissors.html">rock-paper-scissors bot</a>,
which is able to play rock-paper-scissors pretty damn well by exploiting the
patterns that we feeble humans fall into when we try to act strategically. You
think you're being sneaky when you play a rock three times in a row, but you're
almost guaranteed that a hundred other people had that same thought too. Memory
of this is what lets the bot absolutely destroy human players. Try playing the
bot using your intuition, and see how you do. Then, play using a random number
generator to make your choice, and be amazed at winning
1/3 of the time, losing 1/3 of the time, and tieing 1/3 of the time.</p>
<p>As humans, we seem adverse to acting totally randomly.
In fact, when economists simulate these games, the players <em>don't</em> behave
randomly; they learn very specific rules with the goal of beating the other
players.
But, the evolution of players' strategies makes their behaviour chaotic,
which means that the end result is a situation very close to the behaviour
predicted by the mixed (i.e. random) Nash Equlibrium.
This is basically what would happen if you got two rock-paper-scissors bots
to play against each other. They would settle into something that looks very
similar to making random choices.</p>
<p>In the end, we don't know what's behind this result of Summer being the minority
choice. The game theory literature says that if the same people played the game
over and over again, they'd eventually tend to a strategy equivalent to choosing
their season at random.
Experiments with simpler versions of the minority game find that this does
happen in reality (see a good summary of the general Minority Game
<a href="http://news.softpedia.com/news/Minority-Games-38625.shtml">here</a> in Softpedia).
But Game Theory has a harder time predicting what people will do when playing
the game for the first time, so we're not much closer to understanding what's
actually going on in the other players' heads.</p>
<p>The goal of data analysis is to try to prevent us from needing to act randomly;
in this case, the data-oriented approach would have won us the game. Of course,
with a sample size of 21, we're not very sure that data was actually going to
give us the "right" answer. But statistics tells us that if we always follow the
data, we'll be right more times than if we didn't. Even better, we can be more
certain the more data we get!</p>
</div><!-- /.entry-content -->
</article>
</section>
<section id="extras" class="body">
<div class="blogroll">
<h2>blogroll</h2>
<ul>
<li><a href="http://getpelican.com/">Pelican</a></li>
<li><a href="http://python.org/">Python.org</a></li>
<li><a href="http://jinja.pocoo.org/">Jinja2</a></li>
</ul>
</div><!-- /.blogroll -->
<div class="social">
<h2>social</h2>
<ul>
<li><a href="https://ca.linkedin.com/pub/andrew-clarry/97/b25/294">Linkedin</a></li>
<li><a href="https://github.com/aclarry">Github</a></li>
</ul>
</div><!-- /.social -->
</section><!-- /#extras -->
<footer id="contentinfo" class="body">
<p>Powered by <a href="http://getpelican.com/">Pelican</a>. Theme <a href="https://github.com/blueicefield/pelican-blueidea/">blueidea</a>, inspired by the default theme.</p>
</footer><!-- /#contentinfo -->
</body>
</html>