hw4: done 1 and 2

This commit is contained in:
Claudio Maggioni 2021-05-25 21:09:29 +02:00
parent 23c00f39a9
commit fd5ce90894
2 changed files with 38 additions and 2 deletions

View file

@ -104,11 +104,47 @@ $$X \approx \begin{bmatrix}-0.966\\-0.199\\-0.166\end{bmatrix}$$
To reformulate the problem, we first rewrite the explicit values of $G$, $c$, To reformulate the problem, we first rewrite the explicit values of $G$, $c$,
$A$ and $b$: $A$ and $b$:
$$G = \begin{bmatrix}3&0&0\\2&2.5&0\\1&2&2\end{bmatrix}$$ $$G = 2 \cdot \begin{bmatrix}3&0&0\\2&2.5&0\\1&2&2\end{bmatrix}$$
$$c = \begin{bmatrix}-8\\-3\\-3\end{bmatrix}$$ $$c = \begin{bmatrix}-8\\-3\\-3\end{bmatrix}$$
$$A = \begin{bmatrix}1&0&1\\0&1&1\end{bmatrix}$$ $$A = \begin{bmatrix}1&0&1\\0&1&1\end{bmatrix}$$
$$b = \begin{bmatrix}3\\0\end{bmatrix}$$ $$b = \begin{bmatrix}3\\0\end{bmatrix}$$
Then, using these variable values and the formulation given on the assignment
sheet the problem is restated in this new form.
## Exercise 2.2
The lagrangian for this problem is the following:
$$L(x, \lambda) = \frac12\langle x, Gx\rangle + \langle x, c \rangle - \lambda
(Ax - b) =$$$$= \begin{bmatrix}x_1&x_2&x_3\end{bmatrix}
\begin{bmatrix}3&0&0\\2&2.5&0\\1&2&2\end{bmatrix}
\begin{bmatrix}x_1\\x_2\\x_3\end{bmatrix} +
\begin{bmatrix}x_1&x_2&x_3\end{bmatrix}
\begin{bmatrix}-8\\-3\\-3\end{bmatrix} - \lambda
\left(\begin{bmatrix}1&0&1\\0&1&1\end{bmatrix}
\begin{bmatrix}x_1\\x_2\\x_3\end{bmatrix} -
\begin{bmatrix}3\\0\end{bmatrix}\right)$$
The KKT conditions are the following:
First we have the condition on the partial derivatives of the Lagrangian w.r.t.
$X$:
$$\nabla_x L(x, \lambda) = Gx + c - A^T \lambda = \begin{bmatrix}3 x_1 - 8 +
\lambda_1\\ 2x_1 + 2.5 x_2 - 3 + \lambda_2\\x_1 + 2x_2 + 2x_3 - 3 + \lambda_1
+ \lambda_2\end{bmatrix} > 0$$
Then we have the conditions on the equality constraint:
$$Ax - b = 0 \Leftrightarrow \begin{bmatrix}x_1 + x_3\\x_2 + x_3\end{bmatrix} =
\begin{bmatrix}3\\0\end{bmatrix}$$
Then we have the conditions on the equality constraint:
$$\lambda^T (Ax - b) = 0 \Leftarrow Ax - b = 0 \text{ which is true if the above
condition is true.}$$
Since we have no inequality constraints, we don't need to apply the KKT
conditions realated to inequality constraints.