Shapley Value in Game Theory: Definition, Application, and Example

The Shapley Value is a fundamental concept in game theory that enables fair distribution of gains (or costs) among actors (players) in a cooperative coalition. When multiple players collaborate—even with unequal contributions—to achieve a shared payoff, the Shapley Value ensures each player’s contribution is recognized and rewarded equitably. This tool is critical in fields like economics, machine learning, and project management, where cooperation and fair allocation are essential.

Table of Contents#

What is the Shapley Value?#

The Shapley Value is a solution concept for cooperative games (where players form coalitions to maximize joint payoffs). It answers: How should the total payoff of a coalition be divided among its members, considering their unique contributions?

  • Cooperative Games: Players work together (rather than competing) to achieve a shared goal (e.g., building a product, delivering a service).
  • Unequal Contributions: Players’ individual contributions to subsets of the coalition (not just the “grand coalition” of all players) determine their fair share.

Game Theory Context: Coalitions and Payoffs#

In game theory, a “coalition” is any subset of players. A characteristic function v(S)v(S) defines the total payoff (or cost) a coalition SS can generate independently. The Shapley Value focuses on the grand coalition (all players, S=NS = N) and distributes v(N)v(N) fairly by analyzing:

  • Marginal contributions: How much a player adds to a coalition when joining (compared to the coalition’s value without them).
  • All permutations of coalition formation: Every possible order of players joining the coalition is considered to average out biases (e.g., who joins first/last).

How Shapley Value Works: Mathematical Framework#

For a game with nn players, the Shapley Value ϕi\phi_i for player ii is calculated as:

ϕi=SN{i}S!(nS1)!n![v(S{i})v(S)]\phi_i = \sum_{S \subseteq N \setminus \{i\}} \frac{|S|! \cdot (n - |S| - 1)!}{n!} \cdot \left[ v(S \cup \{i\}) - v(S) \right]

Breakdown of the Formula:#

  1. SS: All subsets of players excluding ii (i.e., coalitions SS that exist before ii joins).
  2. v(S{i})v(S)v(S \cup \{i\}) - v(S): The marginal contribution of ii to coalition SS (value added when ii joins SS).
  3. S!(nS1)!n!\frac{|S|! \cdot (n - |S| - 1)!}{n!}: The probability (or weight) of coalition SS forming before ii (derived from all permutations of nn players).

Key Properties of Shapley Value#

The Shapley Value satisfies four critical properties, ensuring fairness:

  1. Efficiency: The sum of all Shapley Values equals the total payoff of the grand coalition: i=1nϕi=v(N)\sum_{i=1}^n \phi_i = v(N).
  2. Symmetry: Players with identical marginal contributions across all subsets receive the same value.
  3. Dummy Player: A player who never contributes ( v(S{i})=v(S)v(S \cup \{i\}) = v(S) for all SS) receives ϕi=0\phi_i = 0.
  4. Additivity: If two games are combined, the Shapley Value of the combined game is the sum of the values from each game.

Example: Applying Shapley Value in a Coalition Game#

Let’s analyze a simple coalition game with three players (A, B, C) collaborating on a project. The characteristic function v(S)v(S) (value created by coalition SS) is:

Coalition SSv(S)v(S) (in $)
{A}\{A\}20
{B}\{B\}10
{C}\{C\}5
{A,B}\{A,B\}50
{A,C}\{A,C\}40
{B,C}\{B,C\}20
{A,B,C}\{A,B,C\}100

Step 1: Enumerate All Permutations of Players#

There are 3!=63! = 6 permutations (orders of joining the coalition):

  1. ABCA \rightarrow B \rightarrow C
  2. ACBA \rightarrow C \rightarrow B
  3. BACB \rightarrow A \rightarrow C
  4. BCAB \rightarrow C \rightarrow A
  5. CABC \rightarrow A \rightarrow B
  6. CBAC \rightarrow B \rightarrow A

Step 2: Calculate Marginal Contributions for Each Player#

For each permutation, compute the value added by each player when they join the coalition:

PermutationA’s Marginal ContributionB’s Marginal ContributionC’s Marginal Contribution
ABCA \rightarrow B \rightarrow C200=2020 - 0 = 20 (joins empty)5020=3050 - 20 = 30 (joins {A}\{A\})10050=50100 - 50 = 50 (joins {A,B}\{A,B\})
ACBA \rightarrow C \rightarrow B200=2020 - 0 = 2010040=60100 - 40 = 60 (joins {A,C}\{A,C\})4020=2040 - 20 = 20 (joins {A}\{A\})
BACB \rightarrow A \rightarrow C5010=4050 - 10 = 40 (joins {B}\{B\})100=1010 - 0 = 10 (joins empty)10050=50100 - 50 = 50 (joins {A,B}\{A,B\})
BCAB \rightarrow C \rightarrow A10020=80100 - 20 = 80 (joins {B,C}\{B,C\})100=1010 - 0 = 102010=1020 - 10 = 10 (joins {B}\{B\})
CABC \rightarrow A \rightarrow B405=3540 - 5 = 35 (joins {C}\{C\})10040=60100 - 40 = 60 (joins {A,C}\{A,C\})50=55 - 0 = 5 (joins empty)
CBAC \rightarrow B \rightarrow A10020=80100 - 20 = 80 (joins {B,C}\{B,C\})205=1520 - 5 = 15 (joins {C}\{C\})50=55 - 0 = 5

Step 3: Average Marginal Contributions#

Sum the marginal contributions for each player and divide by 66 (number of permutations):

  • A’s Shapley Value: \frac{20 + 20 + 40 + 80 + 35 + 80}{6} = \frac{275}{6} \approx \45.83$
  • B’s Shapley Value: \frac{30 + 60 + 10 + 10 + 60 + 15}{6} = \frac{185}{6} \approx \30.83$
  • C’s Shapley Value: \frac{50 + 20 + 50 + 10 + 5 + 5}{6} = \frac{140}{6} \approx \23.33$

This example shows how the Shapley Value accounts for every possible coalition formation, ensuring each player’s “average” contribution is rewarded fairly.

Real-World Applications of Shapley Value#

The Shapley Value is widely used across industries:

  1. Cost Allocation: Fairly distributing costs in shared projects (e.g., building a bridge, developing software) based on each party’s contribution.
  2. Revenue Sharing: Allocating profits in partnerships (e.g., music royalties, joint ventures) or platforms (e.g., app stores, streaming services).
  3. Explainable AI (SHAP Values): In machine learning, Shapley Additive Explanations (SHAP) use Shapley Values to attribute prediction importance to features, improving model interpretability.
  4. Multi-Agent Systems: Allocating resources or rewards in teams (e.g., autonomous vehicles, robotics) where agents collaborate to achieve goals.

Conclusion#

The Shapley Value is a powerful tool for fair distribution in cooperative games, balancing individual contributions with collective outcomes. Its properties (efficiency, symmetry, etc.) and versatility across fields like economics, AI, and engineering make it indispensable for ensuring equity in collaborative efforts. Whether splitting costs, explaining AI decisions, or rewarding teamwork, the Shapley Value provides a rigorous framework for “fairness” in complex systems.

References#

  • Shapley, L. S. (1953). A Value for n-Person Games. In Contributions to the Theory of Games II (pp. 307–317). Princeton University Press.
  • Lundberg, S. M., & Lee, S.-I. (2017). A Unified Approach to Interpreting Model Predictions. In Advances in Neural Information Processing Systems (pp. 4765–4774).
  • Osborne, M. J., & Rubinstein, A. (1994). A Course in Game Theory. MIT Press.