Lecture 4 Duality and game theory Knapsack problem
Lecture 4 Duality and game theory
Knapsack problem – duality illustration • A thief robs a jewelery shop with a knapsack • He cannot carry too much weight • He can choose among well divisible objects (gold, silver, diamond sand) • A thief wants to take the most valuable goods with him
The model • Parameters: W – knapsack maximal weight N – number of goods in a shop wi – good i’s weight vi – good i’s value • Decision variables: xi – share of total amount of good i taken to the knapsack • Objective function: Maximize the total value • Constraints: (a) Cannot take more than available (b) Cannot take more than the knapsack capacity (c) Cannot take the negative (if he is a thief indeed)
The model • Formulate as an LP: Max
Problem of a thief (a primal problem) • Substitute N=3, W=4, w=(2, 3, 4) i v=(5, 20, 3) gold, diamond sand silver. max p. w. A thief problem solution: (x 1, x 2, x 3)=(0. 5, 1, 0) Objective function value: 22. 5
Analysis • Only one good will be taken partially (gold). It is a general rule in all knapsack problems with N divisible goods. • Intuition: – The optimal solution is unique. – In order to uniquely determine 3 unknowns, we need 3 independent linear equations. – So at least 3 constraints should be satisfied as equalities. – One constraint is the knapsack weight, but another two are about goods quantities 0≤xi≤ 1. – Hence only one good may be taken in fractional amount in the optimum.
Crime syndicate buys out the thief’s business • The crime syndicate wants to buy out the goods from the thief together with his thief business (equipment etc. here: knapsack). • They propose prices y 1 for gold, y 2 for diamond sand, y 3 for silver and y 4 for 1 kg knapsack capacity. • But the thief may use 2 kg knapsack capacity and all the gold to generate 5 units of profit , so the price offered for gold 2 y 4+y 1 should be at least 5. Similarly with other goods. • The syndicate wants to minimize the amount it has to pay the thief y 1+y 2+y 3+4 y 4 • The prices should not be negative, otherwise thief will be insulted.
The syndicate problem (a dual problem) • The syndicate problem may be formulated as follows: min p. w. Syndicate problem solution: (y 1, y 2, y 3, y 4)=(0, 12. 5, 0, 2. 5) Objective function value: 22. 5
The thief problem Is equivalent Because e. g. Transforming: Because e. g. It is equivalent to the sybdicate problem
Thief problem optimal solution: (x 1, x 2, x 3)=(0. 5, 1, 0) Optimal objective function value: 22. 5 Syndicate problem optimal solution: (y 1, y 2, y 3, y 4)=(0, 12. 5, 0, 2. 5) dual prices Optimal objectuve function value: 22. 5 Microsoft Excel 12. 0 Raport wrażliwości Arkusz: [knapsack. xlsx]primal Raport utworzony: 2013 -03 -27 16: 27: 40 Komórki decyzyjne Komórka Nazwa $B$2 x 1 x $B$3 x 2 x $B$4 x 3 x Wartość Przyrost Współczynnik Dopuszczalny końcowa krańcowy funkcji celu wzrost spadek 0, 5 0 5 8, 33333 3, 5 1 0 20 1 E+30 12, 5 0 -7 3 7 1 E+30 Warunki ograniczające Wartość Cena Prawa strona Dopuszczalny Komórka Nazwa końcowa dualna w. o. wzrost spadek $E$8 knapsack weight Ax 4 2, 5 4 1 1 $E$9 x 1 Ax 0, 5 0 1 1 E+30 0, 5 $E$10 x 2 Ax 1 12, 5 1 0, 333333333 $E$11 x 3 Ax 0 0 1 1 E+30 1
Rozwiązanie problemu złodzieja: (x 1, x 2, x 3)=(0. 5, 1, 0) Optymalna wartość funkcji celu: 22. 5 Rozwiązanie problemu syndyka: (y 1, y 2, y 3, y 4)=(0, 12. 5, 0, 2. 5) ceny dualne Optymalna wartość funkcji celu: 22. 5 Microsoft Excel 12. 0 Raport wrażliwości Arkusz: [knapsack. xlsx]dualny Raport utworzony: 2013 -03 -27 16: 27: 15 Komórki decyzyjne Komórka $B$2 y 1 y $B$3 y 2 y $B$4 y 3 y $B$5 y 4 y Nazwa Wartość Przyrost Współczynnik Dopuszczalny końcowa krańcowy funkcji celu wzrost spadek 0 0, 5 1 1 E+30 0, 5 12, 5 0 1 0, 333333333 0 1 1 1 E+30 1 2, 5 0 4 0, 99999 1 Warunki ograniczające Wartość Cena Prawa strona Dopuszczalny Komórka Nazwa końcowa dualna w. o. wzrost spadek $F$7 min price per gold A'y 5 0, 5 5 8, 33333 3, 5 $F$8 min price per diamonds A'y 20 1 E+30 12, 5 $F$9 min price per silver A'y 10 0 3 7 1 E+30
Matching/assignment x David Edward Fenix colsums Gene compatibility David Edward Fenix Gene Objective fun Helen 1 0 0 1 Irene 0 1 Helen 1 0. 75 0. 5 Rowsums 0 0 1 1 1 Irene 0 2 2. 5 0. 5 1 1. 5 4. 5 http: //mathsite. math. berkeley. edu/smp. html
Individual decision theory vs game theory
Zero-sum games • In zero-sum games, payoffs in each cell sum up to zero • Movement diagram
Zero-sum games • Minimax = maximin = value of the game • The game may have multiple saddle points
Zero-sum games • Or it may have no saddle points • To find the value of such game, consider mixed strategies
Zero-sum games • If there is more strategies, you don’t know which one will be part of optimal mixed strategy. • Let Column mixed strategy be (x, 1 -x) • Then Raw will try to maximize
Zero-sum games • Column will try to choose x to minimize the upper envelope
Zero-sum games • Tranform into Linear Programming
Fishing on Jamaica • In the fifties, Davenport studied a village of 200 people on the south shore of Jamaica, whose inhabitants made their living by fishing.
• Twenty-six fishing crews in sailing, dugout canoes fish this area [fishing grounds extend outward from shore about 22 miles] by setting fish pots, which are drawn and reset, weather and sea permitting, on three regular fishing days each week … The fishing grounds are divided into inside and outside banks. The inside banks lie from 5 -15 miles offshore, while the outside banks all lie beyond … Because of special underwater contours and the location of one prominent headland, very strong currents set across the outside banks at frequent intervals … These currents are not related in any apparent way to weather and sea conditions of the local region. The inside banks are almost fully protected from the currents. [Davenport 1960]
Jamaica on a map
Strategies • There were 26 wooden canoes. The captains of the canoes might adopt 3 fishing strategies: – IN – put all pots on the inside banks – OUT – put all pots on the outside banks – IN-OUT) – put some pots on the inside banks, some pots on the outside
Advantages and disadvantages of fishing in the open sea Disadvantages Advanatages • It takes more time to reach, so fewers pots can be set • When the current is running, it is harmful to outside pots • The outside banks produce higher quality fish both in variaties and in size. – marks are dragged away – pots may be smashed while moving – changes in temeperature may kill fish inside the pots – If many outside fish are available, they may drive the inside fish off the market. • The OUT and IN-OUT strategies require better canoes. – Their captains dominate the sport of canoe racing, which is prestigious and offers large rewards.
Collecting data • Davenport collected the data concerning the fishermen average monthly profit depending on the fishing strategies they used to adopt. FishermenCurrent FLOW NO FLOW IN 17, 3 11, 5 OUT -4, 4 20, 6 IN-OUT 5, 2 17, 0
OUT Strategy
Zero-sum game? The current’s problem • There is no saddle point • Mixed strategy: – Assume that the current is vicious and plays strategy FLOW with probability p, and NO FLOW with probability 1 -p – Fishermen’s strategy: IN with prob. q 1, OUT with prob. q 2, INOUT with prob. q 3 – For every p, fishermen choose q 1, q 2 and q 3 that maximizes: – And the vicious current chooses p, so that the fishermen get min
13 11 9 7 5 0 0. 05 0. 15 0. 25 0. 35 0. 45 0. 55 0. 600000001 0. 650000001 0. 700000001 0. 750000001 0. 850000001 0. 950000001 1 Graphical solution of the current’s problem 21 19 17 15 Solution: p=0. 31 IN OUT IN-OUT Mixed strategy of the current
The fishermen’s problem • Similarly: – For every fishermen’s strategy q 1, q 2 and q 3, the vicious current chooses p so that the fishermen earn the least: – The fishermen will try to choose q 1, q 2 and q 3 to maximize their payoff:
Maximin and minimax Maximize 13, 31 Fishers' mixed strategy q 1 q 2 q 3 0, 67 0, 00 0, 33 Expected payoff of the current when FLOW NO FLOW probabilities 13, 31 1, 00 >= >= = objective function Value of the game minimize Expected payoff from strategy: IN OUT IN_OUT probabilities objective function 13, 31 12, 79 13, 31 1, 00 Optimal strategy for the fishermen 13, 31 1, 00 Mixed strategy of the current p 1 -p 0, 31 0, 69 <= <= <= = 13, 31 1, 00 Optimal strategy for the current
Minimax sensitivity report Microsoft Excel 12. 0 Raport wrażliwości Arkusz: [jamajka. xlsx]minimax Raport utworzony: 2013 -03 -27 16: 24: 55 Komórki decyzyjne Komórka Nazwa $C$3 objective function $D$3 p $E$3 1 -p Wartość Przyrost końcowa krańcowy 13, 31 0, 00 0, 69 Współczynnik funkcji celu 0, 00 Dopuszczalny 1 0 wzrost 1 E+30 11, 8 0 5, 8 Dopuszczalny spadek 1 5, 8 11, 8 Warunki ograniczające Komórka Nazwa $B$6 IN $B$7 OUT $B$8 IN-OUT $B$9 probabilities Wartość Cena końcowa 13, 31 12, 79 13, 31 dualna -0, 67 0, 00 -0, 33 1, 00 13, 31 Prawa strona Dopuszczalny w. o. wzrost spadek 0 0 0 12, 1 1 E+30 0, 3 0, 7 0, 525 12, 1 1 1 E+30 1
Maximin sensitivity report Microsoft Excel 12. 0 Raport wrażliwości Arkusz: [jamajka. xlsx]maximin Raport utworzony: 2013 -03 -27 16: 23: 31 Komórki decyzyjne Komórka $C$3 $D$3 $E$3 $F$3 Nazwa objective function q 1 q 2 q 3 Warunki ograniczające Komórka Nazwa $B$6 FLOW $B$7 NO FLOW $B$8 probabilities Wartość Przyrost końcowa krańcowy 13, 31 0, 00 0, 67 0, 00 -0, 52 0, 33 0, 00 Wartość końcowa 13, 31 1, 00 Cena dualna -0, 31 -0, 69 13, 31 Współczynnik funkcji celu 1 0 0 0 Prawa strona w. o. 0 0 1 Dopuszczalny wzrost 1 E+30 0, 7 0, 525 12, 1 Dopuszczalny spadek 1 12, 1 1 E+30 0, 3 Dopuszczalny wzrost spadek 5, 8 11, 8 1 E+30 11, 8 5, 8 1
Forecast and observation Game theory predicts Observation shows • No fishermen risks fishing outside • Strategy 67% IN, 33% INOUT [Payoff: 13. 31] • Optimal current’s strategy 31% FLOW, 69% NO FLOW • No fishermen risks fishing outside • Strategy 69% IN, 31% INOUT [Payoff: 13. 38] • Current’s „strategy”: 25% FLOW, 75% NO FLOW The similarity is striking Davenport’s finding went unchallenged for several years Until …
Current is not vicious • Kozelka 1969 and Read, Read 1970 pointed out a serious flaw: – The current is not a reasoning entity and cannot adjust to fishermen changing their strategies. – Hence fishermen should use Expected Value principle: • Expected payoff of the fishermen: – IN: 0. 25 x 17. 3 + 0. 75 x 11. 5 = 12. 95 – OUT: 0. 25 x (-4. 4) + 0. 75 x 20. 6 = 14. 35 – IN-OUT: 0. 25 x 5. 2 + 0. 75 x 17. 0 = 14. 05 • Hence, all of the fishermen should fish OUTside. • Maybe, they are not well adapted after all FishermenCurrent FLOW (25%) NO FLOW (75%) IN 17, 3 11, 5 OUT -4, 4 20, 6 IN-OUT 5, 2 17, 0
Current may be vicious after all • The current does not reason, but it is very risky to fish outside. • Even if the current runs 25% of the time ON AVERAGE, it might run considerably more or less in the short run of a year. • Suppose one year it ran 35% of the time. Expected payoffs: – IN: 0. 35 x 17. 3 + 0. 65 x 11. 5 = 13. 53 – OUT: 0. 35 x (-4. 4) + 0. 65 x 11. 5 = 11. 85 – IN-OUT: 0. 35 x 5. 2 + 0. 65 x 17. 0 = 12. 87. • By treating the current as their opponent, fishermen GUARANTEE themselves payoff of at least 13. 31. • Fishermen pay 1. 05 pounds as insurance premium Optimal Actual OUT Actual (25%) 13. 3125 13. 291 14. 35 Vicious (31%) 13. 3125 13. 31164 12. 85 35% 13. 3125 13. 3254 11. 85
Decision making under uncertainty FishermenCurrent IN OUT IN-OUT 0, 67 IN+0, 33 IN-OUT RybacyPrąd IN FLOW NO FLOW MAXIMIN MAXIMAX 17, 3 11, 5 17, 3 9, 1 -4, 4 5, 2 13, 3125 20, 6 17 13, 3125 21, 7 12, 1 7, 2875 Płynie Nie płynie 0 9, 1 OUT 21, 7 0 IN-OUT 12, 1 3, 6 3, 9875 7, 2875 0, 67 IN+0, 33 IN-OUT MINIMAX REGRET
Decision making under uncertainty FishermenCurrent IN OUT IN-OUT 0, 67 IN+0, 33 IN-OUT RybacyPrąd IN FLOW NO FLOW MAXIMIN MAXIMAX 17, 3 11, 5 17, 3 9, 1 -4, 4 5, 2 13, 3125 20, 6 17 13, 3125 21, 7 12, 1 7, 2875 Płynie Nie płynie 0 9, 1 OUT 21, 7 0 IN-OUT 12, 1 3, 6 3, 9875 7, 2875 0, 67 IN+0, 33 IN-OUT MINIMAX REGRET
Decision making under uncertainty FishermenCurrent IN OUT IN-OUT 0, 67 IN+0, 33 IN-OUT FLOW NO FLOW MAXIMIN MAXIMAX 17, 3 11, 5 17, 3 9, 1 -4, 4 5, 2 13, 3125 20, 6 17 13, 3125 21, 7 12, 1 7, 2875 Regret matrix FishermenCurrent FLOW NO FLOW 0 9, 1 OUT 21, 7 0 IN-OUT 12, 1 3, 6 3, 9875 7, 2875 IN 0, 67 IN+0, 33 IN-OUT MINIMAX REGRET
Decision making under uncertainty FishermenCurrent IN OUT IN-OUT 0, 67 IN+0, 33 IN-OUT FLOW NO FLOW MAXIMIN MAXIMAX 17, 3 11, 5 17, 3 9, 1 -4, 4 5, 2 13, 3125 20, 6 17 13, 3125 21, 7 12, 1 7, 2875 Regret matrix FishermenCurrent FLOW NO FLOW 0 9, 1 OUT 21, 7 0 IN-OUT 12, 1 3, 6 3, 9875 7, 2875 IN 0, 67 IN+0, 33 IN-OUT MINIMAX REGRET
Decision making under uncertainty FishermenCurrent FLOW IN 17, 3 OUT -4, 4 IN-OUT 5, 2 0, 67 IN+0, 33 IN-OUT 13, 3125 NO FLOW MAXIMIN MAXIMAX Hurwicz optimism/pessimism index 11, 5 17, 3 11, 5α+17, 3(1 -α) 20, 6 17 13, 3125 -4, 4 5, 2 13, 3125 20, 6 17 13, 3125 -4, 4α+20, 6(1 -α) 5, 2α+17(1 -α) 13, 3125
11 9 7 5 0 0. 05 0. 15 0. 25 0. 35 0. 45 0. 55 0. 600000002 0. 650000003 0. 700000002 0. 750000002 0. 850000002 0. 950000002 1 21 19 17 15 13 IN OUT IN-OUT
- Slides: 41