{"id":658,"date":"2008-07-16T11:13:12","date_gmt":"2008-07-16T11:13:12","guid":{"rendered":"http:\/\/scientopia.org\/blogs\/goodmath\/2008\/07\/16\/back-to-math-solving-zero-sum-games\/"},"modified":"2008-07-16T11:13:12","modified_gmt":"2008-07-16T11:13:12","slug":"back-to-math-solving-zero-sum-games","status":"publish","type":"post","link":"http:\/\/www.goodmath.org\/blog\/2008\/07\/16\/back-to-math-solving-zero-sum-games\/","title":{"rendered":"Back to Math: Solving Zero-Sum Games"},"content":{"rendered":"<p> When I last wrote about game theory, we were working up to how to find<br \/>\nthe general solution to an iterated two-player zero-sum game. Since it&#8217;s been<br \/>\na while, I&#8217;ll take a moment and refresh your memory a bit.<\/p>\n<p> A zero-sum game is described as a matrix. One player picks a row, and one player picks a column. Those selections are called <em>strategies<\/em>. The intersection<br \/>\nof the strategies in the game matrix describes what one player pays to the other. The<br \/>\nmatrix is generally written from the point of view of one player. So if we call<br \/>\nour two players A and B, and the matrix is written from the viewpoint of A, then<br \/>\nan entry of $50 means that B has to pay $50 to A; an entry of $-50 means that A has to pay $50 to B.<\/p>\n<p> In an iterated game, you&#8217;re not going to just play once &#8211; you&#8217;re going to play it repeatedly. To maximize your winnings, you may want to change strategies. It turns out that the optimal strategy is probabilistic &#8211; you&#8217;ll assign probabilities to your<br \/>\nstrategy choices, and use that probability assignment to randomly select your<br \/>\nstrategy each iteration. That probability assignment that dictates how you&#8217;ll<br \/>\nchoose a strategy each iteration is called a <em>grand strategy<\/em>.<\/p>\n<p> Jon Von Neumann proved that for any two-player zero-sum game, there is an optimal grand strategy based on probability. In a game where both players know exactly what the payoffs\/penalties are, the best strategy is based on constrained randomness &#8211; because any deliberate system for choosing strategies can be cracked by your opponent, resulting in his countering you. The best outcome comes from assessing potential wins and losses, and developing a probabilistic scheme for optimizing the way that you play.<\/p>\n<p> Once you make that fundamental leap, realizing that it&#8217;s a matter<br \/>\nof probability, it&#8217;s not particularly difficult to find the grand strategy: it&#8217;s just a simple optimization task, solveable via linear programming.  The solution is very elegant: once you see it, once you see how to<br \/>\nformulate the game as a linear optimization process, it just seems completely obvious.<\/p>\n<p><!--more--><\/p>\n<p> The basic idea is: take the game matrix. Work out the expected payoff for each<br \/>\nstrategy for one player in terms of an unknown probability assignment. Then, using linear programming, optimize for the maximum value of the minimum expected payoff,<br \/>\nsubject to constraints that basically describe a probability assignment.<\/p>\n<p> As usual, that sounds terribly confusing until you see an example.<\/p>\n<p> Let&#8217;s get specific. Here&#8217;s a game. We&#8217;ll call the two players H (for the player who picks a strategy that&#8217;s a horizontal line across the graph), and V. The grid is set up from the viewpoint of player H: the entry in a position is what V needs to pay to H if that pair of strategies is selected: <\/p>\n<table border=\"1\">\n<tr>\n<th><\/th>\n<th>V1<\/th>\n<th>V2<\/th>\n<th>V3<\/th>\n<\/tr>\n<tr>\n<th>H1<\/th>\n<td>3<\/td>\n<td>1<\/td>\n<td>3<\/td>\n<\/tr>\n<tr>\n<th>H2<\/th>\n<td>2<\/td>\n<td>4<\/td>\n<td>5<\/td>\n<\/tr>\n<tr>\n<th>H3<\/th>\n<td>3<\/td>\n<td>6<\/td>\n<td>1<\/td>\n<\/tr>\n<\/table>\n<p> Then the linear programming problem works out as follows:<\/p>\n<ul>\n<li> Let E(H1) =  3p<sub>1<\/sub> + 1p<sub>2<\/sub> + 3p<sub>3<\/sub>\n<li> Let E(H2) =  2p<sub>1<\/sub> + 4p<sub>2<\/sub> + 5p<sub>3<\/sub>\n<li> Let E(H3) =  3p<sub>1<\/sub> + 6p<sub>2<\/sub> + 1p<sub>3<\/sub>\n<\/ul>\n<p> Maximize: min(E(H1), E(H2), E(H3)), where &Sigma;p<sub>i<\/sub>=1,<br \/>\nand &forall;i: 0&le;p<sub>i<\/sub>&le;1.<\/p>\n<p> When we run that through our linear programming tool, we get the following probability assignment (rounded to two figures): p<sub>1<\/sub>=0.57, p<sub>2<\/sub>=0.17, p<sub>3<\/sub>=0.26.<\/p>\n<p> If we transpose, and look at things from the perspective of V, we get that the<br \/>\noptimal strategy is (0.70, 0.09, 0.22).<\/p>\n<p> That example is an unfair game, because V always pays H. But the<br \/>\nsame basic construction of the solution will work. It&#8217;s implicit in the names of<br \/>\nthe basic strategies: maximin; maximize the minimum. It&#8217;s just that now, instead<br \/>\nof maximizing the minimum of a single strategy selection, we&#8217;re maximizing the minimum of the expected outcomes based on the probability assignments in the grand strategy.<\/p>\n<p> There&#8217;s one more question about the game: what&#8217;s the expected payoff? In game theory terms, we call that the <em>value<\/em> of the game: the value of the game to a player is the amount that the player will win\/lose if both they and their opponent play optimally. It&#8217;s very easy to figure: the probability assignments work out so that the expectation is the same for all three strategies. So to find the value for H, you pick one strategy for V, and work out the expectation for H given the probabilities in his grand strategy.<\/p>\n<p> So, suppose that player V chose strategy 1. Then the expectation for H would be:<br \/>\n0.57*3 + 0.17*2 + 0.26*3 = 2.83. So the value of the game to player H is 2.83. If you work it out from the transpose matrix to get the value of the game to player V, it works out to -2.83.<\/p>\n<p> When you see this, it&#8217;s pretty obvious that it works. In fact, most people see it,<br \/>\nand react, roughly, &#8220;Of course! Maximize the minimum!&#8221; It seems so simple! The real fundamental achievement by Jon Von Neumann wasn&#8217;t figuring out how to describe the probabilistic grand strategies as an optimization problem &#8211; that&#8217;s actually easy. The real key was realizing that the optimal strategy was based on probability &#8211; that the whole key to optimizing a zero-sum game lies in randomness constrained by a probability distribution.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When I last wrote about game theory, we were working up to how to find the general solution to an iterated two-player zero-sum game. Since it&#8217;s been a while, I&#8217;ll take a moment and refresh your memory a bit. A zero-sum game is described as a matrix. One player picks a row, and one player [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[88],"tags":[],"class_list":["post-658","post","type-post","status-publish","format-standard","hentry","category-game-theory"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p4lzZS-aC","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts\/658","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/comments?post=658"}],"version-history":[{"count":0,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts\/658\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/media?parent=658"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/categories?post=658"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/tags?post=658"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}