今日は昨日の論文のレジュメの続きで、論文の数値例とグラフの部分を実際にExcelで再現してみた。
The Bargaining Problem(1950)-Examples
EXAMPLES
論文の数値例をExcelの"BargainingProblem"というシートのA1-C10のエリアに以下のように入力し、
| Item | Utility to Bill | Utility to Jack |
|---|---|---|
| Book | 2 | 4 |
| whip | 2 | 2 |
| ball | 2 | 1 |
| bat | 2 | 2 |
| box | 4 | 1 |
| pen | -10 | -1 |
| toy | -4 | -1 |
| knife | -6 | -2 |
| hat | -2 | -2 |
後掲のExcelマクロを実行すると、2^9-1=511通りの交換パターンについて、
- J列にBillの効用
- K列にJackの効用
- L列に実際の交換Item
- M列に2人の効用の積
が入る。
以下は、実行結果をM列の降順にソートした最初の23行(=Utility積が40以上のパターン)。
| Bill's Utility Gain | Jack's Utility Gain | Item exchanged | Utility Multiplication |
|---|---|---|---|
| 12 | 5 | book,whip,ball,bat,-pen,-toy,-knife | 60 |
| 14 | 4 | book,whip,bat,-pen,-toy,-knife | 56 |
| 10 | 5 | book,whip,bat,-pen,-knife | 50 |
| 10 | 5 | book,whip,bat,box,-pen,-toy,-knife | 50 |
| 8 | 6 | book,whip,bat,-pen,-toy | 48 |
| 8 | 6 | book,whip,ball,bat,-pen,-knife | 48 |
| 8 | 6 | book,whip,ball,bat,box,-pen,-toy,-knife | 48 |
| 6 | 7 | book,whip,ball,bat,-pen,-toy | 42 |
| 14 | 3 | book,whip,ball,-pen,-toy,-knife | 42 |
| 14 | 3 | book,ball,bat,-pen,-toy,-knife | 42 |
| 14 | 3 | book,whip,ball,bat,-pen,-toy,-knife,-hat | 42 |
| 10 | 4 | book,whip,-pen,-toy | 40 |
| 8 | 5 | book,whip,ball,-pen,-toy | 40 |
| 10 | 4 | book,bat,-pen,-toy | 40 |
| 8 | 5 | book,ball,bat,-pen,-toy | 40 |
| 10 | 4 | book,whip,ball,-pen,-knife | 40 |
| 10 | 4 | book,ball,bat,-pen,-knife | 40 |
| 10 | 4 | book,whip,ball,box,-pen,-toy,-knife | 40 |
| 10 | 4 | book,ball,bat,box,-pen,-toy,-knife | 40 |
| 10 | 4 | book,whip,bat,-pen,-toy,-hat | 40 |
| 8 | 5 | book,whip,ball,bat,-pen,-toy,-hat | 40 |
| 10 | 4 | book,whip,ball,bat,-pen,-knife,-hat | 40 |
| 10 | 4 | book,whip,ball,bat,box,-pen,-toy,-knife,-hat | 40 |
(マイナス付きの交換ItemはJackからBill、それ以外はBillからJackへの贈与を示す)
→ J-K列を散布図として描画すれば、論文の図2を再現できる。

Sub nash()
cnt = 0
Dim bill(1000), jack(1000), item(1000)
Sheets("BargainingProblem").Activate
cnt = 0
Cells(1, 2).Select
Set tbl = ActiveCell.CurrentRegion
' 品物の数
itemcnt = tbl.Rows.Count - 1
' 品物のやり取りの組み合わせ数 は 2^品物数−1
'(まったくやり取りなしのケースを除く)
For j = 1 To (2 ^ itemcnt - 1)
cnt = cnt + 1
bill(cnt) = 0
jack(cnt) = 0
item(cnt) = ""
For i = 1 To itemcnt
'2進数で表現した場合にビットが立つ品物はやり取りする
'品物がBillからJackへ = Billの効用減、Jackの効用増
If (cnt Mod (2 ^ i)) >= (2 ^ (i - 1)) Then
bill(cnt) = bill(cnt) - Cells(i + 1, 2).Value
jack(cnt) = jack(cnt) + Cells(i + 1, 3).Value
If Cells(i + 1, 2).Value < 0 Then work = "-" Else work = ""
item(cnt) = item(cnt) + "," + work + Cells(i + 1, 1).Value
End If
Next
Next
Cells(1, 10).Value = "Bill's Utility Gain"
Cells(1, 11).Value = "Jack's Utility Gain"
Cells(1, 12).Value = "Item exchanged"
Cells(1, 13).Value = "Utility Multiplication"
For i = 1 To cnt
Cells(i + 1, 10).Value = bill(i)
Cells(i + 1, 11).Value = jack(i)
Cells(i + 1, 12).Value = Right(item(i), Len(item(i)) - 1)
Cells(i + 1, 13).FormulaR1C1 = "=rc[-3]*rc[-2]"
Next
End Sub