{"id":660,"date":"2008-07-21T11:55:17","date_gmt":"2008-07-21T11:55:17","guid":{"rendered":"http:\/\/scientopia.org\/blogs\/goodmath\/2008\/07\/21\/utility-functions\/"},"modified":"2008-07-21T11:55:17","modified_gmt":"2008-07-21T11:55:17","slug":"utility-functions","status":"publish","type":"post","link":"http:\/\/www.goodmath.org\/blog\/2008\/07\/21\/utility-functions\/","title":{"rendered":"Utility Functions"},"content":{"rendered":"<p> Before we move beyond zero-sum games, it&#8217;s worth taking a deeper look<br \/>\nat the idea of utilities. As I mentioned before, in a game, the scores in<br \/>\nthe matrix are given by something called a utility function.<\/p>\n<p> Utility is an idea for how to mathematically describe preferences in terms<br \/>\nof a game or lottery. For a game to be valid (that is, for a game to have a meaningful analysis and solution), there must be a valid utility function that<br \/>\ndescribes the players&#8217; preferences. <\/p>\n<p> But what do we have to do to make a valid utility function? It&#8217;s<br \/>\nsimple, but as usual, we&#8217;ll make it all formal and explicit.<\/p>\n<p><!--more--><\/p>\n<p> The easiest way to talk about utility and games is to think of games<br \/>\nas a lottery. A lottery is a game with one player, with a variable payoff. You can think of it as a game where you only have one strategy available, and<br \/>\nyou know a probability distribution for the other player&#8217;s strategy. So you<br \/>\ncan compute a value for the game.<\/p>\n<ol>\n<li> <em>Universality:<\/em> Every possible outcome has a utility value<br \/>\nassociated with it; this includes both specific final outcomes,<br \/>\nand indirect\/meta outcomes (that is, situations where<br \/>\nan outcome from one lottery\/game is a ticket for another lottery\/game.<br \/>\nThat outcome will have as its value the expected utility<br \/>\nfor the lottery).<\/li>\n<li> <em>Comparability<\/em>: utility values are always comparable;<br \/>\nfor a particular player with utility function u,<br \/>\ngiven any two choices A and B, they&#8217;ll either prefer one over the<br \/>\nother (u(A) &gt; u(B) or u(B)&gt;u(A)), or they&#8217;ll be indifferent (u(A) = A(B)).<br \/>\nThere are no possible utility values that can&#8217;t be compared.<\/li>\n<li> <em>Consistency<\/em>: utility comparisons are consistent. Consistency<br \/>\nrequires that utility values be reflexive (if u(A)&gt;u(B), then u(B)&lt;u(A), and if u(A)=u(B) then u(B)=u(A)), and transitive (if u(A)&lt;u(B) and u(B)&lt;U(C) then u(A)&lt;u(C)). <\/li>\n<li> <em>Rationality<\/em>: Players are rational actors. This means that<br \/>\nplayers will always make choices that maximize their expected payoff. So<br \/>\ngiven a lottery with expected payoff 5, and a winning of 4, a player will<br \/>\nalways choose to play. On the other hand, people won&#8217;t play when the<br \/>\nexpected payoff is small &#8211; there&#8217;s no intrinsic attraction to playing<br \/>\nbeyond the expected payoff encoded in the utility function. (So, for example,<br \/>\nfor a gambler who enjoys gambling, his pleasure at playing the game<br \/>\nis encoded in the utility value of every outcome that involves playing,<br \/>\nwin or lose.) Even given a probabilistic situation,<br \/>\nwhere the two choices are a definite payoff of 4, or a lottery with<br \/>\nan expected payoff of 4, the player will be indifferent.<\/li>\n<\/ol>\n<p> Let&#8217;s take an example to show how we can build a consistent utility<br \/>\nfunction. Suppose we&#8217;ve got the following<br \/>\nsitaution. We&#8217;ve got three lotteries &#8211; A, B, and C, where:<\/p>\n<ol>\n<li> In lottery A, the prizes are an apple (with probability 0.3),<br \/>\na pear (probability 0.2), a ticket for lottery B (probability 0.2)<br \/>\nor nothing.<\/li>\n<li> In lottery B, the prizes are a pear (probability 0.1), a banana<br \/>\n(probability 0.5), or a ticket for lottery C (probability 0.4).<\/li>\n<li> In lottery C, the prizes are an apple (probability 0.4), a pear<br \/>\n(probability 0.3), or nothing (probability 0.3).<\/li>\n<\/ol>\n<p> The player can choose either a pear or a ticket for lottery A. How can<br \/>\nwe decide what they should do?<\/p>\n<p> We&#8217;ll start by describing what the player prefers in the concrete prizes. They<br \/>\nsurely don&#8217;t like nothing as a prize &#8211; so we&#8217;ll give that utility 0. And they like apples twice as much as pears, and bananas three times as much as pears. So<br \/>\nwe&#8217;ll assign u(pear)=1, u(apple)=2, u(banana)=3.<\/p>\n<p> So what&#8217;s a ticket for lottery A worth? <\/p>\n<p> Since one prize of A is a ticket for B, and one prize for B is a ticket for C,<br \/>\nwe need to figure out the utility values of tickets for B and C. We&#8217;ll do C first, since it doesn&#8217;t depend on the other two. The utility value of a lottery is the weighted average of its outcome utilities. So, u(c)=0.4*2 + 0.3*1 + 0.3*0 =<br \/>\n1.1. So a ticket for lottery C is worth just a little bit more than<br \/>\na pear &#8211; given a choice between a ticket for C and a pear, the player will choose the ticket; given a choice between a ticket for C and an apple, the player<br \/>\nwill choose the apple.<\/p>\n<p> Now, we can figure out the utility value of a ticket for lottery B. u(B) =<br \/>\n0.1*1 + 0.5*3 + 0.4*1.1 = 2.04. So a ticket for lottery B is worth a lot more than a ticket for lottery C, and it&#8217;s also worth more than either an apple or a pear.<\/p>\n<p> Now, finally, we can compute the value of a ticket for A. u(A) = 0.3*2 + 0.2*1 + 0.2*2.04 + 0.3*0 = 0.6+0.2+0.408=1.208. So according to the utility function, the player will choose a ticket for lottery A.<\/p>\n<p> There&#8217;s a couple of properties of utility functions that can seem strange<br \/>\nat first. Given a utility function u, you can define another utility<br \/>\nfunction such that &forall;x:v(x)=u(x)+c (where C is a constant). In every<br \/>\npossible game, the two utility functions are effectively equivalent: they&#8217;ll result in exactly the same strategic choices. Depending on how you look at it, this can be either entirely obvious, or it can seem very strange. If you look at<br \/>\nthe example above, where we defined initial utility values in terms of the magnitude of preference &#8211; that is, &#8220;I like an apple twice as much as a pear, so I&#8217;ll say that an apple equals 2 pears&#8221;, it seems strange. But the real driving<br \/>\nthing in the utility function is the simple difference between utilities &#8211; and the simple difference is exactly the same &#8211; so the strategies will be the same. <\/p>\n<p> Similarly, utility functions have equivalent outcomes when multiplied by a constant. Again, it&#8217;s the difference between things that are important, and if the distance between outcomes is varied consistently &#8211; either by adding or multiplying, then the strategic outcomes will be the same.<\/p>\n<p> It&#8217;s all very simple and very rational. Applying it is a lot harder &#8211; because<br \/>\npeople aren&#8217;t always rational. People will gamble for the fun of gambling<br \/>\ndepending on their mood; an apple may be worth more than a pear today, and<br \/>\nless tomorrow; a person may prefer an apple rather than a pear, and be indifferent to an apple versus a banana, but prefer a pear to a banana. People just<br \/>\ndon&#8217;t necessarily define the values of their choices in ways that fit<br \/>\nwith the utility function requirements of consistency, comparability, and<br \/>\ntransitivity.<\/p>\n<p> As we&#8217;ll see in later posts, you can model some interesting economic phenomena using game theory and utility functions. But those models are tricky to apply in the real world, because real-world decision making is often too complex to be able to accurately model with a comprehensible, analyzable utility function. This leads to some really intense debates between political perspectives, ranging from<br \/>\npeople who find the whole idea of describing human interactions in terms of utility functions to be morally obscene; to people who believe that there&#8217;s no moral problem but that human behavior is too complex to describe as utility function; to people who believe that utility functions are the ideal way (both mathematically and ethically) to model behavior. Interestingly, the lines between these viewpoints <em>don&#8217;t<\/em> correspond to the traditional political divide. Most people seem to expect that the &#8220;morally obscene&#8221; group should correspond to<br \/>\nthe political left, and that the &#8220;utility functions are perfect&#8221; should correspond to the right. But you can find libertarians and free-market uber-conservatives on the morally obscene side, and marxists on the &#8220;utility functions are ideal&#8221; side. It&#8217;s pretty interesting.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Before we move beyond zero-sum games, it&#8217;s worth taking a deeper look at the idea of utilities. As I mentioned before, in a game, the scores in the matrix are given by something called a utility function. Utility is an idea for how to mathematically describe preferences in terms of a game or lottery. For [&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-660","post","type-post","status-publish","format-standard","hentry","category-game-theory"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p4lzZS-aE","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts\/660","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=660"}],"version-history":[{"count":0,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts\/660\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/media?parent=660"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/categories?post=660"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/tags?post=660"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}