Coalition formation, Shapley value. Fair allocation.
Multi-session curriculum - substantial prior knowledge and complex material. Use mastery gates and deliberate practice.
When cooperation creates value, conflict shifts from “how do we win?” to “how do we split?” Cooperative game theory is the toolkit for turning coalition power into fair, stable allocations—especially when many different groups could form and generate different amounts of value.
A cooperative (TU) game assigns each coalition S ⊂ N a value v(S). The central question is allocation: choose payoffs (x₁,…,xₙ) that split v(N). The Shapley value φᵢ is a principled “fair” allocation defined as a player’s expected marginal contribution when players join in a random order. It satisfies axioms (efficiency, symmetry, dummy, additivity) and can be computed by averaging marginal contributions across permutations or by a closed-form subset formula.
In many real systems, value is produced by groups, not isolated individuals:
In these settings, the core strategic issue is not “Which action do I pick in a payoff matrix?” but:
Cooperative game theory abstracts away the internal bargaining process and focuses on the outcome space of cooperation.
Let N = {1,2,…,n} be the set of players. A coalition is any subset S ⊂ N. Think of S as a group that can coordinate and act as a unit.
Two immediate observations:
In a transferable utility (TU) cooperative game, coalitions can generate a single real-valued “pie” that can be freely redistributed among coalition members. The game is defined by a characteristic function:
Common conventions:
Intuition: v(S) is the best total payoff S can secure by coordinating internally (and possibly acting against outsiders).
An allocation (also called an imputation in some contexts) is a vector x = (x₁,…,xₙ) that assigns each player i a payoff xᵢ.
Two baseline requirements often appear:
∑ᵢ xᵢ = v(N)
xᵢ ≥ v({i}) for all i
Efficiency says we split the entire grand-coalition value. Individual rationality says nobody should get less than they can guarantee alone.
But these are not enough. There are usually many efficient allocations, and many individually rational ones. We need a principle for fairness and/or stability.
A central primitive is the marginal contribution of player i to a coalition S (not containing i):
This measures the incremental value created when i joins S.
Why this matters: any reasonable allocation rule must “pay attention” to contributions across different contexts. A player might be crucial when paired with certain others, and irrelevant elsewhere. Cooperative game theory gives a systematic way to aggregate these context-dependent contributions into a single number φᵢ.
It’s easy to confuse cooperative games with “players cooperate in a matrix game.” Cooperative games (in this TU characteristic-function form) do not specify:
They specify coalition values and then analyze allocation rules and stability concepts (like the core, which we’ll connect to later).
If v(N) is large, you might think forming N is automatic. But if a subgroup S believes it can do better on its own, it can threaten to break away.
That creates two intertwined design goals:
These are not always compatible. Some games have no stable split that satisfies all coalitions (empty core), but still have a well-defined fair split (e.g., Shapley value).
A common (not mandatory) assumption is superadditivity:
This expresses synergy: merging coalitions doesn’t destroy value.
If superadditivity holds broadly, the grand coalition is socially attractive. But even then, the division is contentious.
In cooperative games, contributions are not fixed numbers like “player i is worth 5.” Instead:
This is why marginal contribution Δᵢ(S) depends on S.
Here are some common allocation ideas and why Shapley stands out.
| Approach | Core idea | Upside | Downside |
|---|---|---|---|
| Equal split | xᵢ = v(N)/n | Simple | Ignores contributions; unfair in asymmetric games |
| Standalone-based | start from v({i}) then split surplus | Respects individual rationality | Still ambiguous; ignores coalition structure |
| Bargaining solutions | model negotiation | Behaviorally grounded | Requires extra assumptions, solution can vary |
| Shapley value | average marginal contribution over random arrival orders | Axiomatic fairness; unique under axioms | Computationally heavy for large n; not always stable |
Shapley’s key move is to treat “who joins first” as a source of symmetry and average across it.
Imagine players enter a room one by one in a random order. When player i enters, they join the set of players already present S, and the coalition value increases from v(S) to v(S ∪ {i}).
The increment:
is credited to i for that arrival order.
Fairness idea: since no arrival order is privileged, we average i’s credited increments over all n! possible orders.
This is exactly the Shapley value.
For a fixed player i, each subset S ⊂ N \ {i} can appear as “the set of players who arrived before i” in many permutations.
If |S| = k, then:
So the probability that “exactly S arrives before i” under a uniform random permutation is:
This produces a closed form:
φᵢ(v) = ∑_{S ⊂ N\{i}} [ |S|! (n − |S| − 1)! / n! ] · ( v(S ∪ {i}) − v(S) )
This is the same averaging idea, just regrouped by subset rather than enumerating permutations.
Shapley value is often taught via axioms because axioms clarify what kind of fairness you are buying. The standard axioms are:
A remarkable theorem (Shapley, 1953): There is a unique allocation rule satisfying these axioms. That unique rule is φ.
At difficulty 5, it’s worth pausing on additivity: it says if total value is the sum of two independent “sources” of value, then the allocated payoff should sum as well. This linearity becomes powerful for decomposition and computation, and it’s one reason Shapley shows up in ML feature attribution.
Let n = |N|. Fix i. Consider a subset S not containing i.
Number of permutations π where S is exactly the set before i:
So count = |S|! (n − |S| − 1)!
Uniform over n! permutations ⇒ weight:
w(S) = |S|! (n − |S| − 1)! / n!
Then:
φᵢ = ∑_{S ⊂ N\{i}} w(S) · (v(S ∪ {i}) − v(S))
This shows exactly how combinatorics encodes the “random order” fairness principle.
Many allocation rules sound plausible until you test them against edge cases:
The Shapley axioms are designed to remove these ambiguities.
Let N be the player set, n = |N|.
Permutation form
Let Π be the set of all permutations of N. For a permutation π, define Preᵢ(π) as the set of players appearing before i.
Then:
φᵢ(v) = (1 / n!) · ∑_{π ∈ Π} [ v(Preᵢ(π) ∪ {i}) − v(Preᵢ(π)) ]
Subset form
φᵢ(v) = ∑_{S ⊂ N\{i}} \frac{|S|! (n − |S| − 1)!}{n!} ( v(S ∪ {i}) − v(S) )
A key sanity check: do the φᵢ sum to v(N)? Yes.
Using the permutation form, sum over i:
∑_{i ∈ N} φᵢ
= ∑_{i ∈ N} (1/n!) ∑_{π ∈ Π} [ v(Preᵢ(π) ∪ {i}) − v(Preᵢ(π)) ]
Swap sums:
= (1/n!) ∑_{π ∈ Π} ∑_{i ∈ N} [ v(Preᵢ(π) ∪ {i}) − v(Preᵢ(π)) ]
Now fix a permutation π = (i₁,i₂,…,iₙ). The inner sum telescopes:
Let S₀ = ∅
S₁ = {i₁}
S₂ = {i₁,i₂}
…
Sₙ = N
Then the increments are:
v(S₁) − v(S₀)
Telescoping gives:
= v(Sₙ) − v(S₀) = v(N) − v(∅) = v(N)
So for each π, the inner sum equals v(N). Therefore:
∑_{i ∈ N} φᵢ
= (1/n!) ∑_{π ∈ Π} v(N)
= (1/n!) · (n!) · v(N)
= v(N)
That’s efficiency.
Suppose v describes profit from “Project A” and w from “Project B”, and the combined situation is (v + w)(S) = v(S) + w(S).
Then for any coalition S:
(v + w)(S ∪ {i}) − (v + w)(S)
= [v(S ∪ {i}) + w(S ∪ {i})] − [v(S) + w(S)]
= [v(S ∪ {i}) − v(S)] + [w(S ∪ {i}) − w(S)]
Averaging preserves sums, so φᵢ(v + w) = φᵢ(v) + φᵢ(w).
This linearity means you can often decompose a complex value function into simpler components (when structure is available), compute Shapley on each, and sum.
The subset formula includes all S ⊂ N\{i}: that’s 2^{n−1} subsets per player, and n players.
For n = 30, 2ⁿ is already ~1 billion.
So in large systems, people use approximations:
A useful Monte Carlo estimator:
φᵢ ≈ (1/K) ∑_{k=1}^K [ v(Preᵢ(πₖ) ∪ {i}) − v(Preᵢ(πₖ)) ]
By the law of large numbers, this converges to φᵢ as K grows.
A weighted voting game is often written as:
Characteristic function typically:
v(S) = 1 if S is winning, else 0
Shapley value here becomes the Shapley–Shubik power index: the probability a player is pivotal (their addition turns a losing coalition into a winning one) under a random order.
This bridges cooperative games to political science and reliability theory.
The core is the set of allocations x such that:
This says no coalition S can do better by leaving, because the members of S already receive at least v(S) in total.
Shapley value is not guaranteed to lie in the core. When it does, you get an allocation that is both fair (axiomatic) and stable (coalition-proof).
At difficulty 5, it’s helpful to keep the conceptual separation:
They answer different “why should I accept this split?” questions.
Any time you can measure the value of a group, you can ask how to assign credit or cost:
The same mathematics appears under different names.
Suppose several departments share a cloud contract. Coalition value might represent savings compared to buying alone. Then Shapley assigns each department an expected marginal savings contribution, producing a principled discount allocation.
A key modeling step is deciding what v(S) means:
The Shapley math works as long as v is consistent; interpretation changes with sign.
In a weighted voting game with v(S) ∈ {0,1}, φᵢ is the probability that i is pivotal in a random order.
This can diverge sharply from weight share. A player with moderate weight can have outsized power if they frequently “complete” winning coalitions.
In many ML explanation methods (e.g., SHAP), features are treated like “players,” and v(S) is the model’s expected prediction when only features in S are “present.” Then:
The axioms (efficiency, symmetry, dummy, additivity) become desiderata for explanations:
This is not a coincidence: SHAP is explicitly built from Shapley values.
In some applications, you might prioritize:
A practical perspective:
| Goal | Typical tool | Question answered |
|---|---|---|
| Fair split by contribution | Shapley value | “What is each participant’s expected marginal impact?” |
| No coalition wants to leave | Core (or nucleolus) | “Can any subgroup do better by breaking away?” |
| Both | Shapley-in-the-core (when possible) | “Is there a split that is fair and stable?” |
Cooperative games sit at a crossroads:
A useful mental model: Shapley is expected marginal contribution under a symmetry assumption (random order). If you remember that, you can re-derive the formulas whenever needed.
Let N = {1,2,3}. Define v(∅)=0 and:
Compute φ₁, φ₂, φ₃.
List all permutations of (1,2,3):
(1,2,3), (1,3,2), (2,1,3), (2,3,1), (3,1,2), (3,2,1).
For each permutation, compute each player’s marginal contribution when they arrive.
Permutation (1,2,3):
Permutation (1,3,2):
Permutation (2,1,3):
Permutation (2,3,1):
Permutation (3,1,2):
Permutation (3,2,1):
Average each player’s marginal contributions across the 6 permutations.
Player 1 contributions: 1, 1, 2, 3, 1, 3
Sum = 11 ⇒ φ₁ = 11/6
Player 2 contributions: 2, 3, 1, 1, 3, 1
Sum = 11 ⇒ φ₂ = 11/6
Player 3 contributions: 1, 0, 1, 0, 0, 0
Sum = 2 ⇒ φ₃ = 2/6 = 1/3
Sanity check efficiency:
φ₁+φ₂+φ₃ = 11/6 + 11/6 + 1/3
= 22/6 + 2/6
= 24/6
= 4 = v(N).
Insight: Players 1 and 2 are symmetric and share the large complementarity (the jump from 1+1 to 3). Player 3 adds value only when joining {1,2}, so it receives a smaller share even though it is needed to reach v(N)=4.
Let N={A,B,C}. Weights: w_A=2, w_B=1, w_C=1. Quota q=3. Define v(S)=1 if total weight ≥3 else 0. Compute Shapley values (power indices).
Enumerate permutations (A,B,C), (A,C,B), (B,A,C), (B,C,A), (C,A,B), (C,B,A).
A player is pivotal if adding them turns the running coalition from losing (0) to winning (1). Track cumulative weights.
Permutation (A,B,C):
Permutation (A,C,B):
Permutation (B,A,C):
Permutation (B,C,A):
Permutation (C,A,B):
Permutation (C,B,A):
Count pivotal events:
Convert to Shapley values by dividing by 6:
φ_A = 4/6 = 2/3
φ_B = 1/6
φ_C = 1/6
Interpretation:
Even though A has only half the total weight (2 out of 4), it has 2/3 of the power because it frequently completes a winning coalition.
Insight: In voting games, Shapley value measures pivotal probability, not weight share. Power depends on how often you are the “swing” member across coalition-building orders.
Let N={1,2,3,4}. Define v(S)=|S|² (so value depends only on coalition size). Compute φ₁ (and infer all φᵢ by symmetry).
By symmetry, all players must have equal Shapley value:
φ₁=φ₂=φ₃=φ₄.
So if we find one, we get all.
Compute v(N)=v({1,2,3,4})=4²=16.
Efficiency requires:
φ₁+φ₂+φ₃+φ₄=16
⇒ 4φ₁=16
⇒ φ₁=4.
So each player gets 4.
Verify directly using subset formula for player 1 as a consistency check.
Here n=4. Consider S ⊂ {2,3,4}.
We need weights w(S)=|S|!(3−|S|)!/4! and marginal Δ₁(S)=v(S∪{1})−v(S).
Case |S|=0: S=∅
w=0!·3!/24=6/24=1/4
Δ=1²−0²=1
Contribution: 1/4·1=1/4
Case |S|=1: there are 3 such S
w=1!·2!/24=2/24=1/12
For any |S|=1:
Δ=(2²−1²)=(4−1)=3
Total from all size-1 sets:
3 sets · (1/12·3)=3·(3/12)=9/12=3/4
Case |S|=2: there are 3 such S
w=2!·1!/24=2/24=1/12
Δ=(3²−2²)=(9−4)=5
Total:
3 · (1/12·5)=15/12=5/4
Case |S|=3: S={2,3,4}
w=3!·0!/24=6/24=1/4
Δ=(4²−3²)=(16−9)=7
Contribution: 1/4·7=7/4
Sum contributions:
φ₁ = 1/4 + 3/4 + 5/4 + 7/4
= (1+3+5+7)/4
= 16/4
= 4
Insight: When v(S) depends only on coalition size, symmetry plus efficiency almost solves the game instantly. The subset formula then acts as a check, and it reveals a pattern: Shapley averages the increments from sizes 0→1→2→3→4.
A TU cooperative game is defined by a characteristic function v: 2ᴺ → ℝ that assigns a total value to every coalition S ⊂ N.
The marginal contribution Δᵢ(S)=v(S ∪ {i})−v(S) is the basic local notion of “what i adds,” but it depends on context S.
The Shapley value φᵢ is the expected marginal contribution of player i under a uniformly random arrival order of players.
Shapley’s subset formula weights each S ⊂ N\{i} by |S|!(n−|S|−1)!/n!, the probability S is exactly the set arriving before i.
Shapley value is uniquely characterized by efficiency, symmetry, dummy, and additivity axioms.
Exact Shapley computation is Θ(n2ⁿ) in general; Monte Carlo over random permutations is a common scalable approximation.
In weighted voting games, Shapley value equals the probability of being pivotal (Shapley–Shubik power index), which can differ dramatically from weight share.
Fairness (Shapley) and stability (core) are different objectives; Shapley need not lie in the core.
Confusing cooperative TU games with “cooperation” inside a normal-form payoff matrix; TU games summarize coalition capabilities via v(S).
Treating marginal contribution as a single number per player; in reality Δᵢ(S) varies with S and must be aggregated.
Forgetting efficiency: any claimed Shapley vector must satisfy ∑ᵢ φᵢ = v(N).
Assuming Shapley allocations are always stable (in the core); they are fairness-based and may be blocked by some coalition.
Let N={1,2,3}. Define v(∅)=0, v({1})=0, v({2})=0, v({3})=0, v({1,2})=0, v({1,3})=2, v({2,3})=2, v({1,2,3})=2. Compute (φ₁,φ₂,φ₃).
Hint: Use the permutation definition. In each order, only the player who completes a coalition containing player 3 with one of {1,2} may create value; check each arrival order carefully.
List permutations and marginal contributions.
(1,2,3):
(1,3,2):
(2,1,3):
(2,3,1):
(3,1,2):
(3,2,1):
Average contributions:
φ₁: (0+0+0+0+2+0)/6 = 2/6 = 1/3
φ₂: (0+0+0+0+0+2)/6 = 2/6 = 1/3
φ₃: (2+2+2+2+0+0)/6 = 8/6 = 4/3
Check: 1/3+1/3+4/3 = 2 = v(N).
Show using the permutation (telescoping) argument that for any TU game with v(∅)=0, the Shapley values satisfy efficiency: ∑ᵢ φᵢ = v(N).
Hint: Fix a permutation π=(i₁,…,iₙ). Write the running coalitions S₀=∅, S₁={i₁}, …, Sₙ=N, and sum the increments v(S_k)−v(S_{k−1}).
By definition:
φᵢ = (1/n!) ∑_{π∈Π} [v(Preᵢ(π)∪{i}) − v(Preᵢ(π))].
Sum over i and swap sums:
∑ᵢ φᵢ = (1/n!) ∑_{π∈Π} ∑ᵢ [v(Preᵢ(π)∪{i}) − v(Preᵢ(π))].
For a fixed π=(i₁,…,iₙ), define S_k={i₁,…,i_k}. Then the inner sum equals:
[v(S₁)−v(S₀)] + [v(S₂)−v(S₁)] + … + [v(Sₙ)−v(S_{n−1})]
which telescopes to v(Sₙ)−v(S₀)=v(N)−v(∅)=v(N).
Therefore:
∑ᵢ φᵢ = (1/n!) ∑_{π∈Π} v(N) = v(N).
Weighted voting game: N={A,B,C,D}, weights (2,2,1,1), quota q=4, v(S)∈{0,1}. Compute the Shapley–Shubik index for player A.
Hint: Use pivotal probability. Instead of listing all 24 permutations blindly, count when A is pivotal by looking at the total weight of players before A. A is pivotal when the weight before A is <4 but becomes ≥4 after adding A’s weight 2.
A is pivotal iff the weight before A is in {2,3}:
Players other than A: {B,C,D} with weights 2,1,1.
Possible subsets before A and their weights:
Count permutations where each subset S is exactly before A.
For n=4, if |S|=k, number of permutations with exactly S before A is k!(3−k)!.
Compute:
1) S={B}, k=1 ⇒ count = 1!·2! = 2
2) S={C,D}, k=2 ⇒ count = 2!·1! = 2
3) S={B,C}, k=2 ⇒ count = 2
4) S={B,D}, k=2 ⇒ count = 2
Total pivotal permutations for A = 2+2+2+2 = 8.
Total permutations = 4! = 24.
So φ_A = 8/24 = 1/3.
Next nodes you can study: