Understanding the solution of homework problem

32 Views Asked by At

Greetings all for the following problem

Let x be an n-vector and define y as the non negative vector (i.e., the vector with non negative entries) closest to x. Give an expression for the elements of y.

I have some problems understanding the solution where solution

I realized that you have to take y-x as you are comparing the values of y with x. But I do not understand the main purpose of the power 2. Is it to remove the negative value or is it to remove the square root of the || y-x || ?

1

There are 1 best solutions below

0
On BEST ANSWER

By the n-dimensional pythagorean theorem:

$$||v|| = \sqrt{v_1^2+v_2^2+\cdots+v_n^2}$$

Now take $v=y-x$