# Shapley value

In game theory, the Shapley value, named in honour of Lloyd Shapley, who introduced it in 1953, is a solution concept in cooperative game theory.[1][2] To each cooperative game it assigns a unique distribution (among the players) of a total surplus generated by the coalition of all players. The Shapley value is characterized by a collection of desirable properties. Hart (1989) provides a survey of the subject.[3][4]

The setup is as follows: a coalition of players cooperates, and obtains a certain overall gain from that cooperation. Since some players may contribute more to the coalition than others or may possess different bargaining power (for example threatening to destroy the whole surplus), what final distribution of generated surplus among the players should arise in any particular game? Or phrased differently: how important is each player to the overall cooperation, and what payoff can he or she reasonably expect? The Shapley value provides one possible answer to this question.

## Formal definition

Formally, a coalitional game is defined as: There is a set N (of n players) and a function ${\displaystyle v}$ that maps subsets of players to the real numbers: ${\displaystyle v\;:\;2^{N}\to \mathbb {R} }$, with ${\displaystyle v(\emptyset )=0}$, where ${\displaystyle \emptyset }$ denotes the empty set. The function ${\displaystyle v}$ is called a characteristic function.

The function ${\displaystyle v}$ has the following meaning: if S is a coalition of players, then ${\displaystyle v}$(S), called the worth of coalition S, describes the total expected sum of payoffs the members of ${\displaystyle S}$ can obtain by cooperation.

The Shapley value is one way to distribute the total gains to the players, assuming that they all collaborate. It is a "fair" distribution in the sense that it is the only distribution with certain desirable properties listed below. According to the Shapley value,[5] the amount that player i gets given in a coalitional game ${\displaystyle (v,N)}$ is

${\displaystyle \phi _{i}(v)=\sum _{S\subseteq N\setminus \{i\}}{\frac {|S|!\;(n-|S|-1)!}{n!}}(v(S\cup \{i\})-v(S))}$

where n is the total number of players and the sum extends over all subsets S of N not containing player i. The formula can be interpreted as follows: imagine the coalition being formed one actor at a time, with each actor demanding their contribution v(S∪{i}) − v(S) as a fair compensation, and then for each actor take the average of this contribution over the possible different permutations in which the coalition can be formed.

An alternative equivalent formula for the Shapley value is:

${\displaystyle \phi _{i}(v)={\frac {1}{|N|!}}\sum _{R}\left[v(P_{i}^{R}\cup \left\{i\right\})-v(P_{i}^{R})\right]\,\!}$

where the sum ranges over all ${\displaystyle |N|!}$ orders ${\displaystyle R\,\!}$ of the players and ${\displaystyle P_{i}^{R}\,\!}$ is the set of players in ${\displaystyle N\,\!}$ which precede ${\displaystyle i\,\!}$ in the order ${\displaystyle R\,\!}$.

## Example

Consider a simplified description of a business. An owner, o, provides crucial capital in the sense that without him no gains can be obtained. There are k workers w1,...,wk, each of whom contributes an amount p to the total profit. So N = {o, w1,...,wk} and v(S) = 0 if o is not a member of S and v(S) = mp if S contains the owner and m workers. Computing the Shapley value for this coalition game leads to a value of kp/2 for the owner and p/2 for each worker.

### Glove game

The glove game is a coalitional game where the players have left and right hand gloves and the goal is to form pairs.

${\displaystyle N=\{1,2,3\}\,\!}$

where players 1 and 2 have right hand gloves and player 3 has a left hand glove

The value function for this coalitional game is

${\displaystyle v(S)={\begin{cases}1,&{\text{if }}S\in \left\{\{1,3\},\{2,3\},\{1,2,3\}\right\}\\0,&{\text{otherwise}}\\\end{cases}}}$

Where the formula for calculating the Shapley value is:

${\displaystyle \phi _{i}(v)={\frac {1}{|N|!}}\sum _{R}\left[v(P_{i}^{R}\cup \left\{i\right\})-v(P_{i}^{R})\right]\,\!}$

Where ${\displaystyle R\,\!}$ is an ordering of the players and ${\displaystyle P_{i}^{R}\,\!}$ is the set of players in ${\displaystyle N\,\!}$ which precede ${\displaystyle i\,\!}$ in the order ${\displaystyle R\,\!}$

The following table displays the marginal contributions of Player 1

Order ${\displaystyle R\,\!}$ ${\displaystyle MC_{1}}$
${\displaystyle {1,2,3}\,\!}$ ${\displaystyle v(\{1\})-v(\varnothing )=0-0=0\,\!}$
${\displaystyle {1,3,2}\,\!}$ ${\displaystyle v(\{1\})-v(\varnothing )=0-0=0\,\!}$
${\displaystyle {2,1,3}\,\!}$ ${\displaystyle v(\{1,2\})-v(\{2\})=0-0=0\,\!}$
${\displaystyle {2,3,1}\,\!}$ ${\displaystyle v(\{1,2,3\})-v(\{2,3\})=1-1=0\,\!}$
${\displaystyle {3,1,2}\,\!}$ ${\displaystyle v(\{1,3\})-v(\{3\})=1-0=1\,\!}$
${\displaystyle {3,2,1}\,\!}$ ${\displaystyle v(\{1,2,3\})-v(\{2,3\})=1-1=0\,\!}$
${\displaystyle \phi _{1}(v)=(1)\!\left({\frac {1}{6}}\right)={\frac {1}{6}}\,\!}$

By a symmetry argument it can be shown that

${\displaystyle \phi _{2}(v)=\phi _{1}(v)={\frac {1}{6}}\,\!}$

Due to the efficiency axiom the sum of all the Shapley values is equal to 1, which means that

${\displaystyle \phi _{3}(v)={\frac {4}{6}}={\frac {2}{3}}.\,}$

## Properties

The Shapley value has the following desirable properties:

1. Efficiency: The total gain is distributed:

${\displaystyle \sum _{i\in N}\phi _{i}(v)=v(N)}$

2. Symmetry: If i and j are two actors who are equivalent in the sense that

${\displaystyle v(S\cup \{i\})=v(S\cup \{j\})}$

for every subset S of N which contains neither i nor j, then ${\displaystyle \phi _{i}(v)=\phi _{j}(v)}$.

3. Linearity: if two coalition games described by gain functions v and w are combined, then the distributed gains should correspond to the gains derived from v and the gains derived from w:

${\displaystyle \phi _{i}(v+w)=\phi _{i}(v)+\phi _{i}(w)}$

for every i in N. Also, for any real number a,

${\displaystyle \phi _{i}(av)=a\phi _{i}(v)}$

for every i in N.

4. Zero player (null player): The Shapley value ${\displaystyle \phi _{i}(v)}$ of a null player i in a game v is zero. A player ${\displaystyle i}$ is null in ${\displaystyle v}$ if ${\displaystyle v(S\cup \{i\})=v(S)}$ for all coalitions ${\displaystyle S}$.

Given a player set N, the Shapley value is the only map from the set of all games to payoff vectors that satisfies all four properties 1, 2, 3, and 4 from above.

1. Anonymous: If i and j are two actors, and w is the gain function that acts just like v except that the roles of i and j have been exchanged, then φi(v) = φj(w). In essence, this means that the labeling of the actors doesn't play a role in the assignment of their gains. Such a function is said to be anonymous.

2. Marginalism: the Shapley value can be defined as a function which uses only the marginal contributions of player i as the arguments.

## Aumann–Shapley value

In their 1974 book, Lloyd Shapley and Robert Aumann extended the concept of the Shapley value to infinite games (defined with respect to a non-atomic measure), creating the diagonal formula.[6] This was later extended by Jean-François Mertens and Abraham Neyman.

As seen above, the value of an n-person game associates to each player the expectation of his contribution to the worth or the coalition or players before him in a random ordering of all the players. When there are many players and each individual plays only a minor role, the set of all players preceding a given one is heuristically thought as a good sample of the players so that the value of a given infinitesimal player ${\displaystyle ds}$ around as "his" contribution to the worth of a "perfect" sample of the population of all players.

Symbolically, if ${\displaystyle v}$ is the coalitional worth function associating to each coalition ${\displaystyle c}$ measured subset of a measurable set ${\displaystyle I}$ that can be thought as ${\displaystyle I=[0,1]}$ without loss of generality.

${\displaystyle (Sv)(ds)=\int _{0}^{1}(v(tI+ds)-v(tI))dt.}$


where ${\displaystyle (Sv)(ds)}$denotes the Shapley value of the infinitesimal player ${\displaystyle ds}$ in the game, ${\displaystyle tI}$ is a perfect sample of the all-player set ${\displaystyle I}$ containing a proportion ${\displaystyle t}$ of all the players, and ${\displaystyle tI+ds}$ is the coalition obtained after ${\displaystyle ds}$ joins ${\displaystyle tI}$. This is the heuristic form of the diagonal formula.

Assuming some regularity of the worth function, for example assuming ${\displaystyle v}$ can be represented as differentiable function of a non-atomic measure on ${\displaystyle I}$, ${\displaystyle \mu }$, ${\displaystyle v(c)=f(\mu (c))}$ with density function ${\displaystyle \phi }$, with ${\displaystyle \mu (c)=\int 1_{c}(u)\phi (u)du,}$ ( ${\displaystyle 1_{c}()}$ the characteristic function of ${\displaystyle c}$). Under such conditions

${\displaystyle \mu (tI)=t\mu (I)}$,


as can be shown by approximating the density by a step function and keeping the proportion ${\displaystyle t}$ for each level of the density function, and

${\displaystyle v(tI+ds)=f(t\mu (I))+f'(t\mu (I))\mu (ds).}$


The diagonal formula has then the form developed by Aumann and Shapley (1974)

${\displaystyle (Sv)(ds)=\int _{0}^{1}f'_{t\mu (I)}(\mu (ds))dt}$


Above ${\displaystyle \mu }$ can be vector valued (as long as the function is defined and differentiable on the range of ${\displaystyle \mu }$, the above formula makes sense).

In the argument above if the measure contains atoms ${\displaystyle \mu (tI)=t\mu (I)}$ is no longer true—this is why the diagonal formula mostly applies to non-atomic games.

Two approaches were deployed to extend this diagonal formula when the function ${\displaystyle f}$ is no longer differentiable. Mertens goes back to the original formula and takes the derivative after the integral thereby benefiting from the smoothing effect. Neyman took a different approach. Going back to an elementary application of Mertens's approach from Mertens (1980):[7]

${\displaystyle (Sv)(ds)=\lim _{\epsilon \to 0,\epsilon >0}{\frac {1}{\epsilon }}\int _{0}^{1-\epsilon }(f(t+\epsilon \mu (ds))-f(t))dt}$


This works for example for majority games—while the original diagonal formula cannot be used directly. How Mertens further extends this by identifying symmetries that the Shapley value should be invariant upon, and averaging over such symmetries to create further smoothing effect commuting averages with the derivative operation as above.[8] A survey for non atomic value is found in Neyman (2002)[9]

## References

1. ^ Shapley, Lloyd S. (1953). "A Value for n-person Games". In Kuhn, H. W.; Tucker, A. W. Contributions to the Theory of Games. Annals of Mathematical Studies 28. Princeton University Press. pp. 307–317.
2. ^ Roth, Alvin E., ed. (1988). The Shapley Value: Essays in Honor of Lloyd S. Shapley. Cambridge: Cambridge University Press. ISBN 0-521-36177-X.
3. ^ Hart, Sergiu (1989). "Shapley Value". In Eatwell, J.; Milgate, M.; Newman, P. The New Palgrave: Game Theory. Norton. pp. 210–216.
4. ^ Hart, Sergiu (May 12, 2016). "A Bibliography of Cooperative Games: Value Theory".
5. ^ For a proof of unique existence, see Ichiishi, Tatsuro (1983). Game Theory for Economic Analysis. New York: Academic Press. pp. 118–120. ISBN 0-12-370180-5.
6. ^ Aumann, Robert J.; Shapley, Lloyd S. (1974). Values of Non-Atomic Games. Princeton: Princeton Univ. Press. ISBN 0-691-08103-4.
7. ^ Mertens, Jean-François (1980). "Values and Derivatives". Mathematics of Operations Research 5 (4): 523–552. doi:10.1287/moor.5.4.523. JSTOR 3689325.
8. ^ Mertens, Jean-François (1988). "The Shapley Value in the Non Differentiable Case". International Journal of Game Theory 17 (1): 1–65. doi:10.1007/BF01240834.
9. ^ Neyman, A., 2002. Value of Games with infinitely many Players, "Handbook of Game Theory with Economic Applications," Handbook of Game Theory with Economic Applications, Elsevier, edition 1, volume 3, number 3, 00. R.J. Aumann & S. Hart (ed.).[1]