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.

Presentation on theme: "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."— Presentation transcript:

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 w i – good is weight v i – good is value Decision variables: x i – 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 and silver. max p.w. A thief problem solution: (x1,x2,x3)=(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 0x i 1. – Hence only one good may be taken in fractional amount in the optimum.

Crime syndicate buys out the thiefs 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 2y 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 +4y 4 The prices should not be negative, otherwise the thief will be insulted.

The syndicate problem (a dual problem) The syndicate problem may be formulated as follows: min p.w. Syndicate problem solution: (y1,y2,y3,y4)=(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

Syndicate problem optimal solution: (y1,y2,y3,y4)=(0,12.5,0,2.5) dual prices Optimal objectuve function value: 22.5 Thief problem optimal solution: (x1,x2,x3)=(0.5, 1, 0) Optimal objective 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 WartośćPrzyrostWspółczynnikDopuszczalny KomórkaNazwakońcowakrańcowyfunkcji celuwzrostspadek \$B\$2x1 x0,5058,3333333333,5 \$B\$3x2 x10201E+3012,5 \$B\$4x3 x0-7371E+30 Warunki ograniczające WartośćCenaPrawa stronaDopuszczalny KomórkaNazwakońcowadualnaw. o.wzrostspadek \$E\$8knapsack weight Ax42,5411 \$E\$9x1 Ax0,5011E+300,5 \$E\$10x2 Ax112,510,333333333 \$E\$11x3 Ax0011E+301

Rozwiązanie problemu złodzieja: (x1,x2,x3)=(0.5, 1, 0) Optymalna wartość funkcji celu: 22.5 Rozwiązanie problemu syndyka: (y1,y2,y3,y4)=(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 WartośćPrzyrostWspółczynnikDopuszczalny KomórkaNazwakońcowakrańcowyfunkcji celuwzrostspadek \$B\$2y1 y00,511E+300,5 \$B\$3y2 y12,5010,333333333 \$B\$4y3 y0111E+301 \$B\$5y4 y2,5040,9999999991 Warunki ograniczające WartośćCenaPrawa stronaDopuszczalny KomórkaNazwakońcowadualnaw. o.wzrostspadek \$F\$7min price per gold A'y50,558,3333333333,5 \$F\$8min price per diamonds A'y201 1E+3012,5 \$F\$9min price per silver A'y100371E+30

Matching/assignment xGeneHelenIreneRowsums David1001 Edward0101 Fenix0011 colsums111 compatibilityGeneHelenIrene David100.5 Edward0.7521 Fenix0.52.51.5 Objective fun4.5 http://mathsite.math.berkeley.edu/smp/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 dont 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 It takes more time to reach, so fewers pots can be set When the current is running, it is harmful to outside pots – marks are dragged away – pots may be smashed while moving – changes in temeperature may kill fish inside the pots Advanatages The outside banks produce higher quality fish both in variaties and in size. – 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. Fishermen\CurrentFLOWNO FLOW IN17,311,5 OUT-4,420,6 IN-OUT5,217,0

OUT Strategy

Zero-sum game? The currents 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 – Fishermens strategy: IN with prob. q1, OUT with prob. q2, IN- OUT with prob. q3 – For every p, fishermen choose q1,q2 and q3 that maximizes: – And the vicious current chooses p, so that the fishermen get min

Graphical solution of the currents problem Mixed strategy of the current Solution: p=0.31

The fishermens problem Similarly: – For every fishermens strategy q1,q2 and q3, the vicious current chooses p so that the fishermen earn the least: – The fishermen will try to choose q1,q2 and q3 to maximize their payoff:

Maximin and minimax objective function Fishers' mixed strategy q1q2q3 Maximize13,310,670,000,33 Expected payoff of the current when FLOW13,31>=13,31 NO FLOW13,31>=13,31 probabilities1,00= objective function Mixed strategy of the current p1-p minimize13,310,310,69 Expected payoff from strategy: IN13,31<=13,31 OUT12,79<=13,31 IN_OUT13,31<=13,31 probabilities1,00= Optimal strategy for the fishermen Optimal strategy for the current Value of the game

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 WartośćPrzyrostWspółczynnikDopuszczalny KomórkaNazwakońcowakrańcowyfunkcji celuwzrostspadek \$C\$3objective function13,310,0011E+301 \$D\$3p0,310,00011,85,8 \$E\$31-p0,690,0005,811,8 Warunki ograniczające WartośćCenaPrawa stronaDopuszczalny KomórkaNazwakońcowadualnaw. o.wzrostspadek \$B\$6IN13,31-0,67012,10,7 \$B\$7OUT12,790,0001E+300,525 \$B\$8IN-OUT13,31-0,3300,312,1 \$B\$9probabilities1,0013,3111E+301

Microsoft Excel 12.0 Raport wrażliwości Arkusz: [jamajka.xlsx]maximin Raport utworzony: 2013-03-27 16:23:31 Komórki decyzyjne WartośćPrzyrostWspółczynnikDopuszczalny KomórkaNazwakońcowakrańcowyfunkcji celuwzrostspadek \$C\$3objective function13,310,0011E+301 \$D\$3q10,670,0000,712,1 \$E\$3q20,00-0,5200,5251E+30 \$F\$3q30,330,00012,10,3 Warunki ograniczające WartośćCenaPrawa stronaDopuszczalny KomórkaNazwakońcowadualnaw. o.wzrostspadek \$B\$6FLOW13,31-0,3105,811,8 \$B\$7NO FLOW13,31-0,69011,85,8 \$B\$8probabilities1,0013,3111E+301 Maximin sensitivity report

Forecast and observation Game theory predicts No fishermen risks fishing outside Strategy 67% IN, 33% IN- OUT [Payoff: 13.31] Optimal currents strategy 31% FLOW, 69% NO FLOW Observation shows No fishermen risks fishing outside Strategy 69% IN, 31% IN- OUT [Payoff: 13.38] Currents strategy: 25% FLOW, 75% NO FLOW The similarity is striking Davenports 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 Fishermen\CurrentFLOW (25%)NO FLOW (75%) IN17,311,5 OUT-4,420,6 IN-OUT5,217,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 Actual (25%)Vicious (31%) 35% Optimal13.3125 Actual13.29113.3116413.3254 OUT14.3512.8511.85

Decision making under uncertainty Rybacy\PrądPłynieNie płynie IN09,1 OUT21,70 IN-OUT12,13,6 0,67 IN+0,33 IN-OUT3,98757,2875 Fishermen\CurrentFLOWNO FLOWMAXIMINMAXIMAX MINIMAX REGRET IN17,311,5 17,39,1 OUT-4,420,6 -4,420,621,7 IN-OUT5,217 5,21712,1 0,67 IN+0,33 IN-OUT13,3125 7,2875

Decision making under uncertainty Rybacy\PrądPłynieNie płynie IN09,1 OUT21,70 IN-OUT12,13,6 0,67 IN+0,33 IN-OUT3,98757,2875 Fishermen\CurrentFLOWNO FLOWMAXIMINMAXIMAX MINIMAX REGRET IN17,311,5 17,39,1 OUT-4,420,6 -4,420,621,7 IN-OUT5,217 5,21712,1 0,67 IN+0,33 IN-OUT13,3125 7,2875

Decision making under uncertainty Fishermen\CurrentFLOWNO FLOW IN09,1 OUT21,70 IN-OUT12,13,6 0,67 IN+0,33 IN-OUT3,98757,2875 Fishermen\CurrentFLOWNO FLOWMAXIMINMAXIMAX MINIMAX REGRET IN17,311,5 17,39,1 OUT-4,420,6 -4,420,621,7 IN-OUT5,217 5,21712,1 0,67 IN+0,33 IN-OUT13,3125 7,2875 Regret matrix

Decision making under uncertainty Fishermen\CurrentFLOWNO FLOW IN09,1 OUT21,70 IN-OUT12,13,6 0,67 IN+0,33 IN-OUT3,98757,2875 Fishermen\CurrentFLOWNO FLOWMAXIMINMAXIMAX MINIMAX REGRET IN17,311,5 17,39,1 OUT-4,420,6 -4,420,621,7 IN-OUT5,217 5,21712,1 0,67 IN+0,33 IN-OUT13,3125 7,2875 Regret matrix

Decision making under uncertainty Fishermen\CurrentFLOWNO FLOWMAXIMINMAXIMAX Hurwicz optimism/pessimism index IN17,311,5 17,311,5α+17,3(1-α) OUT-4,420,6 -4,420,6-4,4α+20,6(1-α) IN-OUT5,217 5,2175,2α+17(1-α) 0,67 IN+0,33 IN-OUT13,3125

Download ppt "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."

Similar presentations