Shapley Value Calculator

Measure each player's marginal contribution across coalitions. Compare weighted permutations, surplus splits, and payoff sensitivity. Turn coalition values into fair shares using transparent math.

Use this Maths calculator to estimate each player’s fair allocation in a cooperative game. Enter all coalition values, calculate weighted marginal contributions, inspect efficiency, export results, and compare players visually.

Calculator Inputs

Use the responsive form below. Large screens show three columns, smaller screens show two, and mobile uses one column.

Supported range is 2 to 6 players.
Comma-separated names matching the player count.
Examples: Utility, Profit, Revenue, Score.
Controls table, summary, and export precision.
Use the helper to see every required coalition.
Results will appear above this form after submission.
Enter one coalition per line using coalition=value. The empty coalition is assumed to equal 0.

Required Coalition Checklist

This helper table shows every coalition you need to define for the chosen players.

Example Data Table

This example uses three players and a characteristic function with seven non-empty coalitions.

Coalition Example Value Interpretation
A 20 Player A working alone.
B 30 Player B working alone.
C 25 Player C working alone.
A,B 70 Joint value created by players A and B.
A,C 65 Joint value created by players A and C.
B,C 80 Joint value created by players B and C.
A,B,C 120 Grand coalition value shared using Shapley allocation.

Formula Used

Shapley Value Formula

φᵢ(v) = Σ [ |S|! (n - |S| - 1)! / n! ] × [ v(S ∪ {i}) - v(S) ]

Where:

  • φᵢ(v) is the Shapley value for player i.
  • S is any subset of players that excludes player i.
  • v(S) is the value of coalition S.
  • v(S ∪ {i}) - v(S) is player i’s marginal contribution.
  • The factorial weight averages that contribution across all joining orders.

This calculator evaluates every subset, applies the standard combinational weight, sums the weighted marginal contributions, and reports the allocation for each player.

How to Use This Calculator

  1. Select the number of players, from 2 to 6.
  2. Enter player names in the same order you want shown in outputs.
  3. Optionally adjust the value label and decimal precision.
  4. Enter every non-empty coalition on a new line using coalition=value.
  5. Click Generate Coalition Checklist if you want a complete entry guide.
  6. Press Calculate Shapley Value to show results above the form.
  7. Review the player allocation table, efficiency summary, coalition audit, and Plotly graph.
  8. Download the result set in CSV or PDF format when needed.

FAQs

1. What does the Shapley value measure?

It measures the average contribution a player makes across every possible coalition order. The method allocates total value fairly by considering all marginal gains.

2. Why must I enter all non-empty coalitions?

The formula compares a player’s contribution against every subset that excludes them. Missing coalition values break that comparison and prevent accurate allocation.

3. Why is the empty coalition not required?

In standard cooperative game setup, the empty coalition value is usually defined as zero. This calculator assumes that default automatically.

4. What if the sum of Shapley values differs from the total?

A non-zero efficiency gap usually means data entry issues, inconsistent coalition values, or numerical rounding. The Shapley method should normally match the grand coalition value.

5. Can this calculator handle negative values?

Yes. Coalition values can be negative, positive, or mixed. The calculator still computes each player’s weighted marginal contribution correctly.

6. Why is there a six-player limit?

The number of coalitions doubles with each added player. Six players already require 63 non-empty coalition entries, which is practical for a single-page calculator.

7. What does average marginal contribution show?

It shows the simple mean of a player’s marginal gains across all subsets. It complements the Shapley value, which uses factorial weights instead of plain averaging.

8. When should I use Shapley allocation?

Use it when a group jointly creates value and you need a transparent way to divide that outcome fairly among participants, teams, channels, or models.

Related Calculators

2×2 Normal-Form Nash Equilibrium Finder Calculatornash equilibrium solverdominant strategy findermixed strategy calculatorprisoner dilemma calculatorutility maximization solverbest response calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.