Review for final exam
Upcoming SlideShare
Loading in...5
×
 

Review for final exam

on

  • 3,988 views

 

Statistics

Views

Total Views
3,988
Views on SlideShare
3,966
Embed Views
22

Actions

Likes
1
Downloads
136
Comments
0

1 Embed 22

http://www.slideshare.net 22

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Review for final exam Review for final exam Presentation Transcript

  • Review for Final Exam Math 20 January 15, 2008 Announcements Final Friday, January 18, 9:15am ML Office Hours Wednesday (tomorrow) 10–11 and 2–3 (SC 323) Old exams (and solutions) on website
  • Outline Strictly Determined Games Linear Programming Two-by-two The Corner Principle non-strictly-determined Duality games The Simplex Method Larger, non-strictly The Assignment Problem determined games Zero-sum Game Theory Review of older material
  • The Corner Principle Learning Objectives Formulate a linear programming problem Use the corner principle to solve an LP problem
  • Linear Programming The Corner Principle Definition A linear programming problem is a constrained optimization problem where the objective function is linear and the constraints are all linear inequalities. Theorem (The Corner Principle) In any linear programming problem, the extreme values of the objective function, if achieved, will be achieved on a corner of the feasibility set.
  • Example A farmer who has a 120-acre farm plants corn and wheat. The expenses are $12 for each acre of corn planted and $24 for each acre of wheat planted. Each acre of corn requires 32 bushels of storage and yields a profit of $40; each acre of wheat requires 8 bushels of storage and yields a profit of $50. If the total amount of storage available is 160 bushels and the farmer has $1200 in capital, how many acres of corn and how many acres of wheat should be planted to maximize profit?
  • Formulating the Problem Let x be the number of acres of corn planted and y the number of acres of wheat planted. Then we want to maximize z = 40x + 50y (profit) subject to constraints x+ y ≤ 120 (land) 32x+ 8y ≤ 160 (storage) 12x+24y ≤1200 (capital) as well as x, y > 0.
  • Drawing the feasible set 120 x + y ≤ 12 0 50 12x +2 32x + 4y ≤1 20 200 8y ≤ 160 5 100 120
  • Checking the corners x y z = 40x + 50y 0 0 0 5 0 200 0 20 1000
  • Checking the corners x y z = 40x + 50y 0 0 0 5 0 200 0 20 1000 We should plant 20 acres of wheat and no corn.
  • Duality Learning Objectives Given an LP problem, formulate its dual problem Interpret the solutions to the dual problem in terms of the primal problem
  • Duality Definition An LP problem is in standard form if it is expressed as max z = c1 x1 + c2 x2 + · · · + cn xn subject to the constraints a11 x1 + a12 x2 + · · · + a1n xn ≤ b1 a21 x1 + a22 x2 + · · · + a2n xn ≤ b2 ··· ··· am1 x1 + am2 x2 + · · · + amn xn ≤ bm x1 , x2 , . . . , xn ≥ 0 In vector notation, an LP problem is in standard form it it reads max z = c x subject to constraints Ax ≤ b, x ≥ 0
  • Definition Given a linear programming problem in standard form, the dual linear programming problem is min w = b1 y1 + · · · + bm ym subject to constraints a11 y1 + a21 y2 + · · · + am1 ym ≥ p1 a12 y1 + a22 y2 + · · · + am2 ym ≥ p2 ··· ··· a1n y1 + a2n y2 + · · · + amn ym ≥ pn y1 , . . . , ym ≥ 0 or in vector notation, min w = b y subject to constraints A y ≥ c, y ≥ 0.
  • Example In a product-mix problem, the dual problem is to buy out the producer’s materials while minimizing total payout In a diet problem, the dual problem is to sell the nutrients (kind of weird) In any LP problem, the dual variables represent the marginal objective of each variable In some cases the primal problem is easier to solve.
  • Example In a product-mix problem, the dual problem is to buy out the producer’s materials while minimizing total payout In a diet problem, the dual problem is to sell the nutrients (kind of weird) In any LP problem, the dual variables represent the marginal objective of each variable In some cases the primal problem is easier to solve. Look at Lesson 30 for a good, worked out example.
  • The Simplex Method Learning Objectives Form tableaux and how to move between them Given an LP problem in standard form, solve it using the simplex method Interpret the solutions to the dual problem in terms of the simplex method solution for the primal problem
  • The Simplex Method 1. Set up the initial tableau. 2. Apply the optimality test. If the objective row has no negative entries in the columns labeled with variables, then the indicated solution is optimal; we can stop. 3. Choose a pivotal column by determining the column with the most negative entry in the objective row. If there are several candidates for a pivotal column, choose any one. 4. Choose a pivotal row. Form the ratios of the entries above the objective row in the rightmost column by the corresponding entries of the pivotal column for those entries in the pivotal column which are positive. The pivotal row is the row for which the smallest of these ratios occurs. If there is a tie, choose any one of the qualifying rows. If none of the entries in the pivotal column above the objective row is positive, the problem has no finite optimum. We stop. 5. Perform pivotal elimination to construct a new tableau and return to Step 2.
  • Example We are going to solve the linear programming problem of maximizing z = 2x1 − 4x2 + 5x3 subject to constraints 3x1 + 2x2 + x3 ≤ 6 3x1 − 6x2 + 7x3 ≤ 9 and x1 , x2 , x3 ≥ 0.
  • Tableau x1 x2 x3 u1 u2 z value u1 3 2 1 1 0 0 6 u2 3 −6 7 0 1 0 9 z −2 4 −5 0 0 1 0
  • Tableau x1 x2 x3 u1 u2 z value u1 3 2 1 1 0 0 6 u2 3 −6 7 0 1 0 9 z −2 4 −5 0 0 1 0 largest negative coefficient in ob- jective row
  • Tableau entering variable x1 x2 x3 u1 u2 z value u1 3 2 1 1 0 0 6 u2 3 −6 7 0 1 0 9 z −2 4 −5 0 0 1 0 largest negative coefficient in ob- jective row
  • Tableau entering variable x1 x2 x3 u1 u2 z value θ u1 3 2 1 1 0 0 6 6 u2 3 −6 7 0 1 0 9 9/7 z −2 4 −5 0 0 1 0 largest negative coefficient in ob- jective row
  • Tableau smallest positive entering variable θ-ratio x1 x2 x3 u1 u2 z value θ u1 3 2 1 1 0 0 6 6 u2 3 −6 7 0 1 0 9 9/7 z −2 4 −5 0 0 1 0 largest negative coefficient in ob- jective row
  • Tableau departing variable smallest positive entering variable θ-ratio x1 x2 x3 u1 u2 z value θ u1 3 2 1 1 0 0 6 6 u2 3 −6 7 0 1 0 9 9/7 z −2 4 −5 0 0 1 0 largest negative coefficient in ob- jective row
  • Tableau departing variable smallest positive entering variable θ-ratio x1 x2 x3 u1 u2 z value θ u1 3 2 1 1 0 0 6 6 u2 3 −6 7 0 1 0 9 9/7 z −2 4 −5 0 0 1 0 make this entry 1 and the rest of its largest negative column 0 coefficient in ob- jective row
  • Tableau x1 x2 x3 u1 u2 z value u1 3 2 1 1 0 0 6 u2 3 −6 7 0 1 0 9 ×1/7 z −2 4 −5 0 0 1 0 make this entry 1 and the rest of its column 0
  • Tableau x1 x2 x3 u1 u2 z value u1 3 2 1 1 0 0 6 x3 3/7 −6/7 1 0 1/7 0 9/7 z −2 4 −5 0 0 1 0 make this entry 1 and the rest of its column 0
  • Tableau x1 x2 x3 u1 u2 z value u1 3 2 1 1 0 0 6 −1 x3 3/7 −6/7 1 0 1/7 0 9/7 z −2 4 −5 0 0 1 0 5 make this entry 1 and the rest of its column 0
  • Tableau x1 x2 x3 u1 u2 z value u1 18/7 20/7 0 1 −1/7 0 33/7 x3 3/7 −6/7 1 0 1/7 0 9/7 z −2 4 −5 0 0 1 0 make this entry 1 and the rest of its column 0
  • Tableau x1 x2 x3 u1 u2 z value u1 18/7 20/7 0 1 −1/7 0 33/7 x3 3/7 −6/7 1 0 1/7 0 9/7 z 1/7 −2/7 0 0 5/7 1 45/7 make this entry 1 and the rest of its column 0
  • Tableau x1 x2 x3 u1 u2 z value u1 18/7 20/7 0 1 −1/7 0 33/7 x3 3/7 −6/7 1 0 1/7 0 9/7 z 1/7 −2/7 0 0 5/7 1 45/7 largest negative coefficient in ob- jective row
  • Tableau entering variable x1 x2 x3 u1 u2 z value u1 18/7 20/7 0 1 −1/7 0 33/7 x3 3/7 −6/7 1 0 1/7 0 9/7 z 1/7 −2/7 0 0 5/7 1 45/7 largest negative coefficient in ob- jective row
  • Tableau entering variable x1 x2 x3 u1 u2 z value θ u1 18/7 20/7 0 1 −1/7 0 33/7 33/20 x3 3/7 −6/7 1 0 1/7 0 9/7 −3/2 z 1/7 −2/7 0 0 5/7 1 45/7 largest negative coefficient in ob- jective row
  • Tableau smallest positive θ-ratio entering variable x1 x2 x3 u1 u2 z value θ u1 18/7 20/7 0 1 −1/7 0 33/7 33/20 x3 3/7 −6/7 1 0 1/7 0 9/7 −3/2 z 1/7 −2/7 0 0 5/7 1 45/7 largest negative coefficient in ob- jective row
  • Tableau smallest positive departing variable θ-ratio entering variable x1 x2 x3 u1 u2 z value θ u1 18/7 20/7 0 1 −1/7 0 33/7 33/20 x3 3/7 −6/7 1 0 1/7 0 9/7 −3/2 z 1/7 −2/7 0 0 5/7 1 45/7 largest negative coefficient in ob- jective row
  • Tableau smallest positive departing variable θ-ratio entering variable x1 x2 x3 u1 u2 z value θ u1 18/7 20/7 0 1 −1/7 0 33/7 33/20 x3 3/7 −6/7 1 0 1/7 0 9/7 −3/2 z 1/7 −2/7 0 0 5/7 1 45/7 make this entry 1 largest negative and the rest of its coefficient in ob- column 0 jective row
  • Tableau x1 x2 x3 u1 u2 z value u1 18/7 20/7 0 1 −1/7 0 33/7 ×7/20 x3 3/7 −6/7 1 0 1/7 0 9/7 z 1/7 −2/7 0 0 5/7 1 45/7 make this entry 1 and the rest of its column 0
  • Tableau x1 x2 x3 u1 u2 z value x2 9/10 1 0 7/20 −1/20 0 33/20 x3 3/7 −6/7 1 0 1/7 0 9/7 z 1/7 −2/7 0 0 5/7 1 45/7 make this entry 1 and the rest of its column 0
  • Tableau x1 x2 x3 u1 u2 z value x2 9/10 1 0 7/20 −1/20 0 33/20 6/7 x3 3/7 −6/7 1 0 1/7 0 9/7 2/7 z 1/7 −2/7 0 0 5/7 1 45/7 make this entry 1 and the rest of its column 0
  • Tableau x1 x2 x3 u1 u2 z value x2 9/10 1 0 7/20 −1/20 0 33/20 x3 6/5 0 1 3/10 1/10 0 27/10 z 1/7 −2/7 0 0 5/7 1 45/7 make this entry 1 and the rest of its column 0
  • Tableau x1 x2 x3 u1 u2 z value x2 9/10 1 0 7/20 −1/20 0 33/20 x3 6/5 0 1 3/10 1/10 0 27/10 z 2/5 0 0 1/10 7/10 1 69/10
  • Tableau x1 x2 x3 u1 u2 z value x2 9/10 1 0 7/20 −1/20 0 33/20 x3 6/5 0 1 3/10 1/10 0 27/10 z 2/5 0 0 1/10 7/10 1 69/10 No more negative coefficients. We are done!
  • Tableau x1 x2 x3 u1 u2 z value x2 9/10 1 0 7/20 −1/20 0 33/20 x3 6/5 0 1 3/10 1/10 0 27/10 z 2/5 0 0 1/10 7/10 1 69/10 No more negative coefficients. We are done!
  • Simplex Method and Duality Once the problem is solved, the entries in the objective row below the slack variables are the solutions to the dual problem! This means we can solve some LP problems by finding their duals and solving them instead.
  • Outline Strictly Determined Games Linear Programming Two-by-two The Corner Principle non-strictly-determined Duality games The Simplex Method Larger, non-strictly The Assignment Problem determined games Zero-sum Game Theory Review of older material
  • The Assignment Problem Learning Objectives Formulate a (linear) assignment problem Solve linear assignment problems using the Hungarian algorithm
  • The Assignment Problem Given: A set of “jobs” to assign to “people” (start with the same of each, can solve the general problem later) A cost of assigning each job to each person Find the assignment that minimizes total cost.
  • Mathematical Formulation Let C = (cij ) be the costs of assigning job j to person i Let X = (xij ) be 1 if person i does job j, 0 otherwise. The problem is to minimize n cij xij i,j=1 subject to constraint that there is exactly one 1 in each row and column, and the rest of the entries in each row and column are zero. The goal is to replace C with an “ideal cost matrix” with the properties that All entries are nonnegative There is a “sudoku pattern” of zeroes Then the minimal assignment(s) are clear.
  • The Hungarian Algorithm Work with C: 1. Find the minimum entry in each row and subtract it from each row 2. Find the minimum entry in each column and subtract it from each column. The resulting matrix is nonnegative 3. Using lines that go all the way across or all the way up-and-down, cross out all zeros in the new cost matrix 4. If you can only do this with n lines, an assignment of zeroes is possible. 5. Otherwise, determine the smallest entry not covered by any line. Subtract this entry from all uncovered entries Add it to all double-covered entries Return to Step 3
  • Example A coin dealer is to sell four coins through a mail auction. Bids are received for each of the four coins from five bidders with instructions that at most one of his bids is to be honored. The bids are: Bids Coin 1 Coin 2 Coin 3 Coin 4 Bidder 1 $150 $65 $210 $135 Bidder 2 175 75 230 155 Bidder 3 135 85 200 140 Bidder 4 140 70 190 130 Bidder 5 170 50 200 160 How should the dealer assign the four coins in order to maximize the sum of the resulting bids?
  • Solution We create a dummy coin for which each bidder bids nothing. The maximum bid is $230, we replace all the entries with $230 minus them. This changes our maximization problem into a minimization problem. For the entries now represent not the amount bid but the amount expected back from a $230 payment, and clearly the dealer wants to minimize the amount given back.
  • Non-negativizing the cost matrix So we have −30 −115 −40 −190     80 165 20 95 230 −20 60 145 0 75 210 55 155 0 75 230 55 155 0 75 230         95 145 30 90 230−30 65 115 0 60 200     90 160 40 100 230−40 50 120 0 60 190     60 180 30 70 230 −30 30 150 0 40 200   30 30 0 35 20 25 40 0 35 40   35 0 0 20 10   20 5 0 20 0  0 35 0 0 10
  • Crossing out     30 30 0 35 20 10 10 0 15 0 25 40 0 35 40 5 20 0 15 20         35 0 0 20 10 35 0 20 20 10         20 5 0 20 0 20 5 20 20 0       0 35 0 0 10 0 35 20 0 10   5 10 0 10 0   0 20 0 10 20     3 0 20 15 10    15 5 20 15 0  0 40 25 0 15
  • The answer Since we have the assignment of zeroes, we can read off the solution: Bidder 1 gets Coin 3 Bidder 2 gets Coin 1 Bidder 3 gets Coin 2 Bidder 4 gets the dummy coin (nothing) Bidder 5 gets Coin 4
  • Outline Strictly Determined Games Linear Programming Two-by-two The Corner Principle non-strictly-determined Duality games The Simplex Method Larger, non-strictly The Assignment Problem determined games Zero-sum Game Theory Review of older material
  • Zero-sum Game Theory Learning Objectives Formulate a game theory problem, finding strategies and payoffs Find the optimal strategies for games strictly determined games 2 × 2 non-strictly-determined games using the simplex method
  • Definitions A game theory problem is a contest between two players who “move” simultaneously The row player chooses among m strategies and the column player chooses among n strategies. The payoff aij is the amount paid to the row player if R chooses i and C chooses j (could be negative). A strategy vector is a probability vector representing the percentage of the time each strategy should be chosen: row player’s strategy is a row vector p column players strategy is a column vector q The expected value of these strategies is the sum n E (p, q) = pi aij qj = pAq i,j=1
  • Theorem (Fundamental Theorem of Zero-Sum Games) There exist optimal strategies p∗ for R and q∗ for C such that for all strategies p and q: E (p∗ , q) ≥ E (p∗ , q∗ ) ≥ E (p, q∗ )
  • Theorem (Fundamental Theorem of Zero-Sum Games) There exist optimal strategies p∗ for R and q∗ for C such that for all strategies p and q: E (p∗ , q) ≥ E (p∗ , q∗ ) ≥ E (p, q∗ ) E (p∗ , q∗ ) is called the value v of the game.
  • Theorem (Fundamental Theorem of Zero-Sum Games) There exist optimal strategies p∗ for R and q∗ for C such that for all strategies p and q: E (p∗ , q) ≥ E (p∗ , q∗ ) ≥ E (p, q∗ ) E (p∗ , q∗ ) is called the value v of the game. So the problem is to find p∗ and q∗ .
  • Strictly Determined Games Definition Let A be a payoff matrix. A saddle point is an entry ars which is the minimum entry in its row and the maximum entry in its column. A game whose payoff matrix has a saddle point is called strictly determined Payoff matrices can have multiple saddle points
  • Strictly Determined Games Definition Let A be a payoff matrix. A saddle point is an entry ars which is the minimum entry in its row and the maximum entry in its column. A game whose payoff matrix has a saddle point is called strictly determined Payoff matrices can have multiple saddle points Theorem Let A be a payoff matrix. If ars is a saddle point, then er (choose r all the time) is an optimal strategy for R es (choose s all the time) is an optimal strategy for C
  • Finding equilibria by gravity If C chose strategy 2, and R knew it, R would   definitely choose 2  1 3    This would make C     choose strategy 1     but (2, 1) is an   2 4 equilibrium, a saddle point.
  • Finding equilibria by gravity   Here (1, 1) is an equilibrium  2 3  position; starting from there     neither player would want to     deviate from this.     1 4
  • Finding equilibria by gravity    2 3    What about this one?           4 1
  • Zero-sum Game Theory Two-by-two non-strictly-determined games In this case we can compute E (p, q) by hand in terms of p1 and q1 (see Lesson 34 for the details) a22 − a21 a22 − a12 p1 = q1 = a11 + a22 − a21 − a22 a11 + a22 − a21 − a12 p2 = 1 − p1 q2 = 1 − q1 These are in between 0 and 1 if there are no saddle points in the matrix. a11 a22 − a12 a21 v= a11 + a22 − a21 − a12 To remember this, remember that q is the strategy for the column player. So to get q1 we take the difference between the two entries in the second column.
  • Examples 1 3 If A = , then p1 = 2 ? Doesn’t work because A has a 0 2 4 saddle point. 2 3 If A = , p1 = 3 ? Again, doesn’t work. 2 1 4 2 3 If A = , p1 = −3 = 3 , while q1 = −4 = 2 . So R −4 4 −2 1 4 1 should pick 1 half the time and 2 the other half, while C should pick 1 3/4 of the time and 2 the rest.
  • Larger, non-strictly determined games Theorem Consider a game with payoff matrix A, where each entry of A is positive. 1 The column player’s optimal strategy q is z x, where x ≥ 0 satisfies the LP problem of maximizing z = x1 + · · · + xn subject to the constraints Ax ≤ 1. 1 The row player’s optimal strategy p is is w y, where y ≥ 0 satisfies the LP problem of minimizing w = y1 + · · · + yn subject to the constraint that A y ≥ 1. The two problems are dual to each other, so the optimal values of the objective are the same. The value of the game is 1 1 v = z = w.
  • Method By adding a constant to every entry in the payoff matrix A, make sure every entry is positive Solve the LP problem of maximizing z = x1 + · · · + xn subject to the constraints Ax ≤ 1. 1 Then v = z and the entries of q are the entries of x divided by z The values of the slack variables, again divided by z, are the entries of p. The value of the game is v , minus the quantity added at the beginning See Lesson 35 and the Game Theory problem set solutions for details.