Min of Quadratic Function subject to Linear Constraint - Two Variables

Calculus Level pending

Given

f ( x , y ) = 5 x 2 + 3 x y + 10 y 2 + 4 x 20 y + 50 f(x,y) = 5 x^2 + 3 x y + 10 y^2 + 4 x - 20 y + 50

Find the the minimum value of f ( x , y ) f(x, y) if ( x , y ) (x, y) satisfies

x + 2 y = 10 x + 2 y = 10


The answer is 181.625.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Karan Chatrath
Feb 2, 2021

Let:

X = [ x y ] X = \left[ \begin{matrix} x\\y \end{matrix} \right]

The optimisation problem can be re-written as follows:

f ( X ) = 0.5 X T H X + g T X + C f(X) = 0.5X^T HX + g^TX + C

Subject to:

A X = b AX = b

Where:

H = [ 10 3 3 20 ] H = \left[ \begin{matrix} 10&3\\3&20 \end{matrix} \right] f = [ 4 20 ] f = \left[ \begin{matrix} 4\\-20 \end{matrix} \right] A = [ 1 2 ] A = \left[ \begin{matrix} 1&2\end{matrix} \right] b = 10 b = 10 C = 5 C = 5

The matrix H H is a positive definite matrix which guarantees the existence of a global minimum to this constrained optimisation problem. This is analogous to the second derivative test in higher dimensions.

Now, the cost function is re-written by introducing a Lagrange multiplier as follows:

F = 0.5 X T H X + g T X + C + λ T ( A X b ) F = 0.5X^T HX + g^TX + C+ \lambda^T (AX-b)

Computing the gradient of F F with respect to the vector X X and computing it to zero. Here, zero means the null vector where necessary.

F = 0 H X + A T λ = f \nabla F =0\implies HX + A^T \lambda = -f A X = b AX = b

This gives rise to a system of linear equations:

H X + A T λ = f HX + A^T \lambda = -f A X = b AX = b

Multiplying the first equation by A H 1 AH^{-1} yields:

A H 1 H X + A H 1 A T λ = A H 1 f AH^{-1}HX + AH^{-1}A^T \lambda = -AH^{-1}f A X + A H 1 A T λ = A H 1 f AX + AH^{-1}A^T \lambda = -AH^{-1}f b + A H 1 A T λ = A H 1 f b + AH^{-1}A^T \lambda = -AH^{-1}f

A X = b \because AX = b

λ = ( A H 1 A T ) 1 ( A H 1 f + b ) \implies \lambda = -(AH^{-1}A^T)^{-1} (AH^{-1}f+b)

Plugging the above result in: H X + A T λ = f HX + A^T \lambda = -f

Gives:

X o p t = H 1 ( A T ( A H 1 A T ) 1 ( A H 1 f + b ) f ) X_{opt} = H^{-1}\left( A^T (AH^{-1}A^T)^{-1} (AH^{-1}f+b) - f\right)

Finally, the minimum value of the function is:

f m i n = 0.5 X o p t T H X o p t + g T X o p t + C = 181.625 f_{min} = 0.5X_{opt}^T HX_{opt} + g^TX_{opt} + C = 181.625

We can use the final two expression, crunch out the matrix multiplications and find the answer. I did this using a computer, for the sake of convenience. Of course, this can be done easily by hand, but I deliberately chose to demonstrate the linear algebra route to generalise the result for a quadratic problem minimisation subject to any number of linear constraints, in any number of variables.

David Vreken
Feb 3, 2021

Substituting x = 10 2 y x = 10 - 2y into f ( x , y ) f(x, y) , then simplifying, and then completing the square gives:

5 ( 10 2 y ) 2 + 3 ( 10 2 y ) y + 10 y 2 + 4 ( 10 2 y ) 20 y + 50 = 24 y 2 198 y + 590 = 24 ( y 33 8 ) 2 + 1453 8 5(10 - 2y)^2 + 3(10 - 2y)y + 10y^2 + 4(10 - 2y) - 20y + 50 = 24y^2 - 198y + 590 = 24(y - \cfrac{33}{8})^2 + \cfrac{1453}{8}

Since the minimum of a square of a real number is 0 0 , f ( x , y ) f(x, y) has a minimum of 1453 8 = 181.625 \cfrac{1453}{8} = \boxed{181.625} .

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...