Mental Models204 cards · 12 fields

Mental Models/Game Theory

Cooperative Games and the Shapley Value

合作博弈与夏普利值

Split what a team earns by how much each person adds on average.

When a few people pull something off together, the easiest thing to fight over is how to split it at the end: who couldn't be done without, who could have been left out, and everyone has their own view. In 1954 Lloyd Shapley and Martin Shubik worked out a startling number for this kind of question. The UN Security Council had 11 members at the time. By their method, the five permanent members together held 98.7% of the weight, and the other six members put together had only 1.3%. Back then, passing a resolution took 7 votes, and not one of the five permanent members could be missing.

Their way of counting was simple. Picture the 11 members standing in a line, raising their hands in favor one after another. Whoever raises a hand at the exact moment the resolution passes casts the deciding vote that time. Go through every possible order of the line, and count how many times each member cast the deciding vote. Without any one of the permanent members nothing passes, so the deciding vote almost always fell to them.

A member's weight doesn't depend on how many votes it holds. It depends on how many times it was the one that couldn't be left out.

You own a 3D scanner and earn 6,000 yuan taking jobs on your own. Your friend has no equipment and earns 0 alone. Together you take on a survey of an old building and earn 10,000 yuan. To split the 10,000, the Shapley value has everyone join one at a time in every possible order, notes how much the total grows when each person joins, and then averages over all the orders.

With two people there are only two orders. If you arrive first, you bring 6,000, and when he joins he adds 4,000. If he arrives first, he brings 0, and when you join you add 10,000. Split by just one order, and the shares depend entirely on who walked in first: you get only 6,000 if you're first, and 10,000 if he is. Who walks in first is pure chance, so averaging over both orders wipes that chance out. You get the average of 6,000 and 10,000, which is 8,000; he gets the average of 4,000 and 0, which is 2,000.

Your share lands halfway between the two orders
You get8000 yuan
Friend gets2000 yuan
0 yuan2500 yuan5000 yuan7500 yuan10000 yuan02000400060008000What you earn alone (yuan)Your cutFriend first: you getAvg: your shareYou first: you getAvg: friend's share
0 yuan5000 yuan10000 yuan02000400060008000What you earn alone (yuan)Your cutFriend first: you getAvg: your shareYou first: you getAvg: friend's share

Together you earn 10,000 yuan; your friend alone earns 0. One order gives you one dashed line or the other; the average sits halfway. Drag what you earn alone.

Someone who can be replaced adds little when they join

Suppose an owner has an empty shopfront on the street, and two people, A and B, both want to rent it. Whoever rents it can earn 100,000 yuan a year. Without the shop, nobody earns anything, and the shop only has room for one. The three can arrive in 6 orders. How much the total grows when each person joins (in units of 10,000 yuan) is listed below:

Order of arrival Owner adds A adds B adds
Owner, A, B 0 10 0
Owner, B, A 0 0 10
A, Owner, B 10 0 0
A, B, Owner 10 0 0
B, Owner, A 10 0 0
B, A, Owner 10 0 0
Average 6.67 1.67 1.67

A renter who arrives first has no shop and can't earn anything, so as long as the owner isn't first, walking in pushes the total from 0 to 100,000. A adds 100,000 only when arriving right after the owner. If A comes before the owner, there's no shop to rent; if A comes after B, B has already rented it. The owner adds 100,000 in 4 of the orders, and A and B in only 1 each. So on average the owner gets about 66,700, and A and B about 16,700 each. The three shares add up to exactly 100,000.

The more people want to rent, the bigger the owner's share

When people want to rent, there are people counting the owner, and each is equally likely to be first. The owner adds nothing only in the orders where he arrives first, which make up of them; in every other order he adds 100,000. So the owner's share (in units of 10,000 yuan) is:

In other words, the owner gets 100,000 times the share of orders in which he is not first. With two would-be renters he gets 66,700; with three he gets 75,000, leaving each renter only about 8,300; with nine he gets 90,000, and each renter about 1,100. The renters can replace one another, so each extra one makes every renter's share thinner.

Accept four fairness rules, and only this way of splitting is left

In 1953 Shapley proved that any way of splitting that meets the four rules below can only be the average over all orders. First, the whole result is handed out, no more and no less. Second, if two people add the same amount to every group they join, they get the same share. Third, someone who adds nothing to any group they join gets zero. Fourth, if the same people do two projects together, settling each one separately and adding the shares up gives everyone the same amount as splitting the two as one sum. All four sound fair, and any other way of splitting breaks at least one of them.

The Shapley value works best when you can say what every group is worth and the result can be divided up. Each extra member doubles the number of groups: thirty members (thirty features, say) make more than a billion, and usually it can only be approximated by sampling. A fair share also doesn't stop a few people from deciding they'd do better leaving to start on their own, and in some partnerships they really would earn more alone.

Act
When several companies run a trade show together and need to split the venue rent, first estimate what it would cost each to run one alone and each pair to run one together, then split by the average over every order of arrival.
Explain
Make clear why a small party with only 2 seats in parliament can carry as much weight as a big party with 49: any two of the three parties together make a majority, so each of the three casts the deciding vote equally often.
Explore
Take a model whose predictions are off, break one prediction down by feature, and find the one you never expected the model to lean on so heavily.
  1. Make a table of what each group can get done: without him, which part can the rest still do?
  2. Do the gains differ much between who comes first and who comes later? Look at the gains under several orders. The bigger the difference, the less you can go by just one order.
  3. Of the values for each group, which are real numbers from the books, and which are your estimates?

Machine learning

Breaking down one pickup time

You predict pickup times at a ride-hailing company. For one ride the model estimates 14 minutes, while the average over all rides is 9 minutes. The extra 5 minutes are split among the features by the Shapley value: traffic 3 minutes, rain 1 minute, a hard-to-find pickup point 1 minute, which adds up to exactly 5. Operations uses this table to check how that pickup point is marked.

Rural life

Three households build a mountain road

Your yard and your two neighbors' yards lie along a mountain road. Counting from where the road begins, reaching your house costs 60,000 yuan to build, reaching the second house 120,000, and reaching the farthest house 180,000. A road built to the farthest house also reaches the two nearer ones, for 180,000 in all. The three households share the cost by averaging, over every order, the extra cost each one adds. Your house is nearest and pays 20,000; the second house pays 50,000; the farthest pays 110,000.

Online retail

Which ad gets credit for a sale

You run ads for an online shop. Search ads alone bring in 30 orders, short-video ads alone bring in 10, and both together bring in 80. Averaging those 80 orders over every order of arrival credits 50 to search and 30 to short video, and next month's budget is split between the two channels 5 to 3.

You, B and C are making a mobile game together. You can program: you and B together, or you and C together, can make a demo worth 200,000 yuan. None of the three can make anything alone, and B and C together can't make anything either. All three together make the full game, worth 1 million yuan. The three agree that each gets the average of what they add across every order of joining.

How much should B get?

You and two partners run a studio. C joined first, and A arrived half a year before B. By the books, A and B add the same amount to any group they join. This year you agree that each person gets the average of what they add across every order of joining.

Who gets more, A or B?

A bank scores customers with a model that predicts default. For one customer, the model's chance of default is 12 percentage points above the average for all customers. Breaking it down by each feature's average gain across every order gives this: the district the customer lives in pushes it up 8 percentage points, and everything else together pushes it up 4.

What does this result most directly show?