Ordering vectors with scalar valued function

49 Views Asked by At

I have a bunch of 3D vectors $\vec F_i = (F_{xi}, F_{yi}, F_{zi})$ which I would like to order. The ordering rule is the following:

$\vec F_i$ ">" $\vec F_j$ when:

  • $F_{xi} < F_{xj}$
  • $F_{yi} < F_{yj}$
  • $|F_{zi}| > |F_{xj}|$

My question is whether I can find a scalar function $g(\vec F)$ so that:

$g(\vec F_i) > g(\vec F_j)$ when $\vec F_i$ ">" $\vec F_j$

Thanks.

What makes this custom-ordering problem maybe a bit easier is that all vector components $F_{xi}, F_{yi}, F_{zi}$ assume their values from (0, -30, -60, ... -300).

So the first point would be (0, 0, 0) and the last (-300, -300, -300).

My tries have lead me nowhere. I basically tried multiplying the vector with an array whose coefficients I tried to "tune" but to no avail.

Note that there can be unorderable pairs as well. For example:

$F_1 = (-120, -90, -270)$

vs

$F_2 = (-90, -120, -150)$

$F_{x1} < F_{x2}$ but $F_{y1} > F_{y2}$ and therefore neither can "win"

1

There are 1 best solutions below

1
On BEST ANSWER

Such a function doesn't exist.

The reason is that when you are comparing two vectors, you require all the 3 parameters of the one that will be larger, however you will need only two from the one that is smaller. So, you need such an $F$ such takes all three components in to evaluate to a scalar number but somehow magically ignores the third component when it is compared to a smaller number, no matter how large the $z$ component of the smaller one is.

To understand this let go of the function for a moment. Your order doesn't make sense; i.e it is possible to find elements $X,Y,Z$ such that $X>Y$ and $Y>Z$ but $X$ and $Z$ are not orderable . Try to find an example. If you can't then comment below.I will give you one. I am asking you to find to understand why there will be a problem. Once you find the example you can see that you can't find such a function. Because if $X>Y$ and $Y>Z$ then if such a function existed then $g(X)>g(Y)>g(Z)$.

(Hint: Try 2D first to find example)