Course Test · University: upper level

Optimisation: independent answers

Each answer here was worked out by hand, without RatMath, before the RatMath code was written. Where the arithmetic is long, the working says how it was checked.

  1. 1.A linear program
    Maximise 3x+5y3x + 5y subject to x≤4x \le 4, 2y≤122y \le 12, 3x+2y≤183x + 2y \le 18, x,y≥0x, y \ge 0.
    Answer
    The corners are (0,0),(4,0),(4,3),(2,6),(0,6)(0,0), (4,0), (4,3), (2,6), (0,6) with values 0,12,27,36,300, 12, 27, 36, 30: the maximum is 36 at (2,6)(2, 6).
  2. 2.Shadow prices
    For the same program, find the dual solution (shadow prices) and check that the dual value equals 36.
    Answer
    At (2,6)(2,6) the second and third constraints are tight. Solving y1⋅1+3y3=3y_1 \cdot 1 + 3y_3 = 3, 2y2+2y3=52y_2 + 2y_3 = 5 with y1=0y_1 = 0 gives y=(0,32,1)y = (0, \tfrac32, 1); 4⋅0+12⋅32+18⋅1=364 \cdot 0 + 12 \cdot \tfrac32 + 18 \cdot 1 = 36.
  3. 3.Minimising
    Minimise 3x+2y3x + 2y subject to x+y≥4x + y \ge 4, x+3y≥6x + 3y \ge 6, x,y≥0x, y \ge 0.
    Answer
    The corners are (6,0),(3,1),(0,4)(6,0), (3,1), (0,4) with values 18,11,818, 11, 8: the minimum is 8 at (0,4)(0, 4).
  4. 4.Infeasibility
    Show that x+y≤1x + y \le 1, x+y≥2x + y \ge 2, x,y≥0x, y \ge 0 has no solution.
    Answer
    Adding the first inequality to the negative of the second gives 0≤−10 \le -1.
  5. 5.Unboundedness
    Show that maximising x+yx + y subject to x−y≤1x - y \le 1, x,y≥0x, y \ge 0 is unbounded.
    Answer
    Along (0,t)(0, t) every constraint holds and x+y=tx + y = t grows without bound.
  6. 6.Integer programming
    Maximise 5x+4y5x + 4y subject to 6x+4y≤246x + 4y \le 24, x+2y≤6x + 2y \le 6, x,y≥0x, y \ge 0 integers. Compare with the LP relaxation.
    Answer
    The relaxation peaks at (3,32)(3, \tfrac32) with value 21. Among integer points, (4,0)(4, 0) gives 20, (3,1)(3, 1) 19, (2,2)(2, 2) 18: the integer optimum is 20 at (4,0)(4, 0).
  7. 7.Knapsack
    Items weigh 2, 3, 4, 5 and are worth 3, 4, 5, 6. Which should go in a knapsack holding weight 5?
    Answer
    The pairs within weight 5: only {1,2}\{1, 2\} (weight 5, worth 7); single items are worth at most 6. Take items 1 and 2, worth 7.
  8. 8.Assignment problem
    Assign four workers to four jobs at least total cost, with costs (9278643758187694)\begin{pmatrix} 9&2&7&8\\6&4&3&7\\5&8&1&8\\7&6&9&4 \end{pmatrix}.
    Answer
    By the Hungarian method: worker 1 → job 2, 2 → 1, 3 → 3, 4 → 4, cost 2+6+1+4=132 + 6 + 1 + 4 = 13.
  9. 9.Transportation problem
    Two warehouses hold 20 and 30 units; three stores need 10, 25 and 15. Shipping costs per unit are (861091213)\begin{pmatrix} 8&6&10\\9&12&13 \end{pmatrix}. Find the cheapest plan's cost.
    Answer
    Warehouse 1 sends 20 to store 2; warehouse 2 sends 10, 5, 15. Cost 120+90+60+195=465120 + 90 + 60 + 195 = 465 (checked by the stepping-stone test: every unused route has nonnegative reduced cost).
  10. 10.Optimising a rectangle
    A rectangle has perimeter 20. What is the largest area it can have?
    Answer
    With sides xx and 10−x10 - x, A=x(10−x)A = x(10 - x) is largest at x=5x = 5: area 25.
  11. 11.One-variable minimum
    Find the minimum of f(x)=x4−3x3+2f(x) = x^4 - 3x^3 + 2.
    Answer
    f′(x)=x2(4x−9)f'(x) = x^2(4x - 9): critical points 0 (not an extremum) and 94\tfrac94. f(94)=−1675256≈−6.5430f(\tfrac94) = -\tfrac{1675}{256} \approx -6.5430.
  12. 12.Critical points in the plane
    Find and classify the critical point of f=x2+xy+y2−3xf = x^2 + xy + y^2 - 3x.
    Answer
    fx=2x+y−3=0f_x = 2x + y - 3 = 0, fy=x+2y=0f_y = x + 2y = 0: (2,−1)(2, -1). The Hessian (2112)\begin{pmatrix}2&1\\1&2\end{pmatrix} is positive definite, so it is a minimum, f=−3f = -3.
  13. 13.Second-derivative test
    Classify the critical points of f=x3−3x+y2f = x^3 - 3x + y^2.
    Answer
    fx=3x2−3f_x = 3x^2 - 3, fy=2yf_y = 2y: (±1,0)(\pm1, 0). The Hessian is diag⁡(6x,2)\operatorname{diag}(6x, 2): at (1,0)(1, 0) a minimum, at (−1,0)(-1, 0) a saddle.
  14. 14.Lagrange multipliers
    Find the point of the line x+2y=5x + 2y = 5 closest to the origin.
    Answer
    Minimise x2+y2x^2 + y^2: 2x=λ2x = \lambda, 2y=2λ2y = 2\lambda, so y=2xy = 2x and x=1x = 1, y=2y = 2; distance squared 5.
  15. 15.A constrained maximum
    Maximise xyzxyz on the plane x+y+z=3x + y + z = 3 with x,y,z>0x, y, z > 0.
    Answer
    By symmetry (or AM–GM, xyz3≤1\sqrt[3]{xyz} \le 1), the maximum is 1 at (1,1,1)(1, 1, 1).
  16. 16.Convexity
    Is f=2x2+2xy+3y2f = 2x^2 + 2xy + 3y^2 convex? Give the Hessian's eigenvalues.
    Answer
    The Hessian (4226)\begin{pmatrix}4&2\\2&6\end{pmatrix} has eigenvalues 5±5≈2.7639,7.23615 \pm \sqrt5 \approx 2.7639, 7.2361, both positive: strictly convex.
  17. 17.Least squares
    Fit a line y=a+bxy = a + bx to (0,1),(1,3),(2,4),(3,4)(0, 1), (1, 3), (2, 4), (3, 4) by least squares.
    Answer
    xˉ=1.5\bar x = 1.5, yˉ=3\bar y = 3, Sxy=5S_{xy} = 5, Sxx=5S_{xx} = 5: b=1b = 1, a=1.5a = 1.5.
  18. 18.Gradient descent
    Take one gradient-descent step of size 0.1 from (1,1)(1, 1) on f=x2+4y2f = x^2 + 4y^2.
    Answer
    ∇f=(2x,8y)=(2,8)\nabla f = (2x, 8y) = (2, 8), so the step lands at (1,1)−0.1(2,8)=(0.8,0.2)(1, 1) - 0.1(2, 8) = (0.8, 0.2).
  19. 19.Newton's method for a minimum
    Take two Newton steps for minimising f(x)=x2−ln⁡xf(x) = x^2 - \ln x from x0=1x_0 = 1. What is the exact minimiser?
    Answer
    f′=2x−1/xf' = 2x - 1/x, f′′=2+1/x2f'' = 2 + 1/x^2. x1=1−13=23x_1 = 1 - \tfrac{1}{3} = \tfrac23, x2=23−4/3−3/22+9/4=23+251=1217≈0.70588x_2 = \tfrac23 - \frac{4/3 - 3/2}{2 + 9/4} = \tfrac23 + \tfrac{2}{51} = \tfrac{12}{17} \approx 0.70588. The minimiser is 1/2≈0.7071071/\sqrt2 \approx 0.707107.
  20. 20.Duality
    Write the dual of: maximise x+yx + y subject to x+2y≤4x + 2y \le 4, 3x+y≤63x + y \le 6, x,y≥0x, y \ge 0; show both optimal values agree.
    Answer
    Dual: minimise 4u+6v4u + 6v with u+3v≥1u + 3v \ge 1, 2u+v≥12u + v \ge 1, u,v≥0u, v \ge 0. Primal optimum at (85,65)(\tfrac85, \tfrac65) is 145\tfrac{14}{5}; dual optimum at (25,15)(\tfrac25, \tfrac15) is 85+65=145\tfrac{8}{5} + \tfrac65 = \tfrac{14}{5}.