Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Triangle Inequality for a Metric

  1. Feb 2, 2012 #1
    1. The problem statement, all variables and given/known data

    Prove the triangle inequality for the following metric [itex]d[/itex]

    [itex] d\big((x_1, x_2), (y_1, y_2)\big) = \begin{cases}
    |x_2| + |y_2| + |x_1 - y_1| & \text{if } x_1 \neq y_1 \\
    |x_2 - y_2| & \text{if } x_1 = y_1
    \end{cases}, [/itex]

    where [itex]x_1, x_2, y_1, y_2 \in \mathbb{R}.[/itex]

    2. Relevant equations

    We may assume the triangle inequality for real numbers. That is, [itex]|x + y| \leq |x| + |y|[/itex] for [itex]x, y \in \mathbb{R}[/itex]

    3. The attempt at a solution

    We wish to show that

    [itex]d\big( (x_1, x_2), (z_1, z_2) \big) \leq d\big( (x_1, x_2), (y_1, y_2) \big) + d\big( (y_1, y_2), (z_1, z_2) \big)[/itex]

    We may write
    [itex]d\big( (x_1, x_2), (z_1, z_2) \big) \leq |x_2| + |z_2| + |x_1 - z_1|[/itex]
    [itex]d\big( (x_1, x_2), (y_1, y_2) \big) \leq |x_2| + |y_2| + |x_1 - y_1|[/itex]
    [itex]d\big( (y_1, y_2), (z_1, z_2) \big) \leq |y_2| + |z_2| + |y_1 - z_1|[/itex],
    although I am not sure if this is helpful.

    There are essentially two cases to consider: (i) [itex]x_1 = y_1[/itex] and [itex]y_1 = z_1[/itex], and (ii) [itex]x_1 \neq y_1[/itex] or [itex]y_1 \neq z_1[/itex]

    I can do the first case, since [itex]|x_2 - z_2| = |x_2 - y_2 + y_2 - z_2| \leq |x_2 - y_2| + |y_2 - z_2|[/itex], which completes this case.

    I have problems with the second case though. I feel like there is some trick that I am missing. Or maybe I shouldn't be handling cases at all? Any help would be appreciated!
  2. jcsd
  3. Feb 2, 2012 #2
    For your case (ii) there are 3 cases
    1. x1≠y1≠z1, where
    2. x1=y1≠z1, where
    3. x1≠y1=z1, same as 2
  4. Feb 2, 2012 #3
    That makes much more sense. Thank you so much!
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook