Least square solution for vector

108 Views Asked by At

Suppose we have a vector $\vec{x}$ given by the equation

$\vec{x} = \begin{bmatrix}\frac{7}{3}\\-2\\0\end{bmatrix} + t\begin{bmatrix}0\\1\\1\end{bmatrix}$.

I wish to choose $t$ such that the length of $\vec{x}$ is as small as possible.

The solution I have states

$\|\vec{x}\|^2 = \frac{85}{9} - 4t + t^{2}2$

minimizing respect to $t$ yields

$-4 + 4t = 0 \implies t = 1$.

Therefore the smallest $\vec{x}$ is $\begin{bmatrix}\frac{7}{3}\\-1\\1\end{bmatrix}$.

I am a bit confused with how they got $-4 + 4t = 0$ from $\|\vec{x}\|^2$.

Is there something I am missing?

Any help would be appreciated.

Thank you for reading.

2

There are 2 best solutions below

0
On

The first part of the solution finds the magnitude of $\vec x$ in respect to the variable $t$. The second part optimizes $t$ by finding the derivative of the magnitude of $\vec x$. The derivative $-4t + 4t$ has zeroes that are the maximums and minimums of the parent function. So, by setting the derivative equal to $0$ and solving, we find a value of $t$ such that the value corresponds to the minimum of the magnitude. You can tell that it is a minimum by inspection; the function of magnitude in respect to $t$ is an upward facing parabola, so its vertex is a minimum. Then, you just plug in said value of $t$ (which in this case is 1) into the original vector $\vec x$ and voila, you have your minimum length of the vector.

0
On

If you take the derivative of $\|x\|^2$ with respect to $t$ and set it to zero, you obtain a minimum or maximum.

But since the euclidean norm is convex and differentiable, you know that it has to be a minimum and not just that, it also is a global minimum due to convexity.