0

I am trying to solve the following problem I came up with:

Let $W = \{(x_1, x_2, x_3, x_4) \in \mathbb{R}^4 : x_1 + x_2 + x_3 + x_4 = 1\}$

Then, for any $p \in \mathbb{R}^4$, what are the $k$ points $\{q_j\}_{j=1}^k$ closest to $p$, where $q_j \in W$

I don't know what to do since, normally I would work with a subspace of $\mathbb{R}^4$ and use orthogonal decomposition. In this case, $W$ is not a subspace of $\mathbb{R}^4$. Eventually, I want to do the same thing, but with the convex subset $V = \{(x_1, x_2, x_3, x_4) \in \mathbb{R}^4 : \sum_{j=1}^4x_j=1, x_j\geq0\}$.

The Bosco
  • 1,965
  • Subtract the vector $u=(1,0,0,0)$ to everything, so that you are looking for the vector $x$ that minimises the distance of $p-u$ from $W-u={(x_1,\cdots,x_4)\in\Bbb R^4,:, x_1+\cdots+x_4=0}$. Then the solution to the original problem is the vector $u+x$. –  Dec 30 '19 at 14:06

2 Answers2

1

Even though $W$ is not a subspace of $R^4$, it is still nonempty, closed and convex. These three conditions imply that there is still a unique point $w \in W$ which is closest to a given point $p \in R^4$.

You could calculate it explicitly by finding a vector which is orthogonal to all three directions of the (hyper)plane defined by $W$. Since you can write $$W = \{ (0,0,0,1)+r(1,0,0,−1)+s(0,1,0,−1)+t(0,0,1,−1) : r,s,t \in R \} $$ as I explained in the other post (Finding basis of subspace of $\mathbb{R}^4$ such that $x_1 + x_2 + x_3 + x_4 = 1$), you need to find a vector in $R^4$ that is orthogonal the three spanning vectors.

To do that, you can for example use a generalization of the cross product, as explained here (Cross product in higher dimensions).

Once you have this vector, just construct a line through $p$ in the direction of this vector, and intersect it with the plane $W$. That should give you the best approximation to $p$ in $W$.

Wizact
  • 1,846
  • But why is $W$ necessarily convex? I thought only $V$ would be convex. – The Bosco Dec 30 '19 at 14:15
  • 1
    @TheBosco If you agree with my parametrization of $W$, then you see that it's just a translation of the linear subspace $W' = \mathrm{span} { (1,0,0,-1), (0,1,0,-1), (0,0,1,-1) }. $ Since linear subspaces are always convex, $W'$ is convex. Moreover, if you translate a convex set over a given vector, it is still convex. – Wizact Dec 30 '19 at 14:20
  • I have the vector $(-1,-1,-1,-1)^T$ which is perpendicular to the vectors in $W'$, but how I find from this one, one that is perpendicular to $W$? – The Bosco Dec 30 '19 at 14:33
  • 1
    The vector you just found is already the one you need. I am looking for a vector in the direction that is perpendicular the hyperplane. Since the $W$ and $W'$ are parallel, those directions are actually the same. – Wizact Dec 30 '19 at 14:42
  • Oh ok! Then, we have the line defined by $(p_1, p_2, p_3, p_4) + c(-1,-1,-1,-1) = (p_1 - c, p_2 - c, p_3 - c, p_4 - c)$ and, at the intersection with $W$, we have that $(p_1 - c, p_2 - c, p_3 - c, p_4 - c) = (u_1, u_2, u_3, 1-u_1-u_2-u_3)$ for some numbers $u_1, u_2, u_3$. Now, I can use these 4 equations to find the values of $u_1, u_2, u_3$ in terms of the coordinates of $p$ which would give the closest point right? – The Bosco Dec 30 '19 at 14:57
  • Yes, you have four equations with four unknowns $u_1,u_2,u_3,c$, so that should give the solution. Though it might be slightly easier to first determine $c$ by filling in the point $(p_1−c,p_2−c,p_3−c,p_4−c)$ into the equation which defines $W$. – Wizact Dec 30 '19 at 15:05
  • It’s not really necessary to go to all of the work that you’ve outlined in this answer to find a nonzero vector orthogonal to the direction vectors of $W$. One can be read directly from the defining equation. – amd Dec 30 '19 at 19:21
0

In general, if $C$ is a closed convex subset of $\mathbb{R}^n$ then for any $p$ there is a unique minimiser of the problem $\min_{x \in X} \|p-c\|$, where $\|\cdot\|$ is the euclidean norm.

You could solve the problem using Lagrange multipliers, in particular, you want to solve $\min \{ {1 \over 2} \|p-w\|^2 | e^T w = 1 \}$, where $e=(1,1,1,1)^T$.

This gives $p-w+\lambda e = 0$ from which we get $e^Tp-1+4\lambda = 0$. Solving for $\lambda$ gives an expression for the minimiser $w$.

copper.hat
  • 172,524