0
$\begingroup$

I have $3$ points on a $2$d graph. Say, $(X_1, Y_1)$, $(X_2, Y_2)$, $(X_3, Y_3)$. I want to find a function which is sum of several modulus functions which can achieve this .

For example,

  1. $(-1,1)$, $(0,0)$, $(1,1)$. The function connecting these points in shortest path is $|x|$ or modulus of $x$.

  2. $(0,2)$, $(1,4)$, $(1.25,5)$. The function connecting these three points in shortest path is $$ |x| + |x-1| + |2x+1|. $$

Find the series sum of modulus function that joins $(X_1, Y_1)$, $(X_2, Y_2)$, $(X_3, Y_3)$.

$\endgroup$
6
  • 2
    $\begingroup$ So say $x_1 < x_2 < x_3$, then the shortest path (that is a function) will be the 2 straight lines that connect these three points. Hint: How can we find a sum of 2 modulus that does this? EG $|2x-1|+|2x+1|$ works for the second example. $\endgroup$
    – Calvin Lin
    Commented Jun 24, 2023 at 21:28
  • $\begingroup$ I graphed |2x-1| +|2x+1| and found that it does not work for the second example, it takes a longer path compared to the |x| + |x-1| + |2x+1| $\endgroup$
    – Anonymous
    Commented Jun 24, 2023 at 21:36
  • $\begingroup$ Sir, your path distance for the three points. i.e., (0,2), (1,4), (1.25,5) is 3.59 .My function gives a path distance of 3.26 $\endgroup$
    – Anonymous
    Commented Jun 24, 2023 at 21:51
  • $\begingroup$ Oh, I see the error that I made when trying to combine from your solution. I found a sum of 2 modulus hat went through those 3 points, but it didn't give me those 2 line segments so it isn't the shortest distance. $\quad$ So, correcting my example, $|3x+1| + |x-1|$ works for the second example. It agrees with your path on $[0, 1.25]$. $\endgroup$
    – Calvin Lin
    Commented Jun 24, 2023 at 21:56
  • $\begingroup$ I had not thought of that sum. one thing I had notice from your solution and mine is that the coordinate (1,4) that is between the other two points has to remain a critical point, while the other two coordinates don't really need to. $\endgroup$
    – Anonymous
    Commented Jun 24, 2023 at 22:04

1 Answer 1

0
$\begingroup$

First hint: We have a piecewise function defined by 2 line segments. Then, there exists a (unique) way to express this as the sum or difference of 2 modulus expressions. This gives us the desired result.

Further Hint: $\max (a, b) = \frac{ |a+b| + |a-b| } { 2}$.
Find a similar formula for $ \min (a, b)$.

$\endgroup$
2
  • $\begingroup$ @Anonymous To check, you fully understand what is going on here? I'm slightly surprised at how quickly you accepted the answer. $\endgroup$
    – Calvin Lin
    Commented Jun 24, 2023 at 22:13
  • $\begingroup$ Sir, yes I have understood and have solved the question successfully and derived a general formula as well. $\endgroup$
    – Anonymous
    Commented Jun 25, 2023 at 2:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .