# Thread: [SOLVED] Metric Space basic definition

1. ## [SOLVED] Metric Space basic definition

Problem:
Let $\displaystyle X = C([0,1 ], R)$. Find d(f,g) for each of the following pairs of functions:
a. $\displaystyle f(x) =x$ and $\displaystyle g(x)=cos(x)$ for each x in [0, 1]
b. I did not bother to write down this part; I just need to understand the notation properly.
=======================
Definition:

$\displaystyle d(p,q) = \sqrt{\sum_{i=1}^n (p_{i}-q{i} )^2}$

So for part (a), I let $\displaystyle p_{i} = x$ and $\displaystyle q_{i}=cosx$ and n = 1, since this is in $\displaystyle \mathbb{R}$.

$\displaystyle d(f, g) = \sqrt{\sum_{i=1}^1 (x - cos(x))^2}$

but here I am confused. Would the d(f, g) be

$\displaystyle d(f, g) = \sqrt{(1-cos(1))^2 + (0 - cos(0))^2}$ ?

Thank you for your help. Much appreciated.

2. Originally Posted by Paperwings
Problem: Let $\displaystyle X = C([0,1 ], R)$. Find d(f,g) for each of the following pairs of functions: $\displaystyle f(x) =x$ and $\displaystyle g(x)=cos(x)$ for each x in [0, 1]
I think that you have not understood the definition of the metric on this space.
Do you understand the there are many different ways to define metrics?
One sees the so called supremum metric for this space of continuous functions:
$\displaystyle d\left( {f,g} \right) = \mathop {\sup }\limits_{x \in \left[ {0,1} \right]} \left| {f(x) - g(x)} \right|$.

Here is another possible metric: $\displaystyle d\left( {f,g} \right) = \int\limits_0^1 {\left| {f(x) - g(x)} \right|dx}$.

Thus you need to see what is the definition for the metric your textbook expects you to use on the space.

3. For $\displaystyle C([a,b],R)$, my textbook defines the metric space as

$\displaystyle d(f,g) = max { \left| f(x)-g(x) \right| | x \in [a,b]}$, which is the supremum metric that you've pointed out.

So, pertaining to the problem, d(f,g) it is asking for the greatest/maximum distance between the function x and cosx in the interval [0, 1], correct?

4. Originally Posted by Paperwings
For $\displaystyle C([a,b],R)$So, pertaining to the problem, d(f,g) it is asking for the greatest/maximum distance between the function x and cosx in the interval [0, 1], correct?
Yes that is correct.

5. Plato, is there a way to find the maximum distance of two functions mathematically instead of looking at the graphs such as a formula? For in this problem, I can tell by graphing that d(f, g) = 1 for f(x) = x and g(x) = cosx since at x = 0, then f(0) = 0, and f(x) = 1.

If for example if $\displaystyle f(x) = 4x^4$ and $\displaystyle g(x) = 6x^2 -3x$ for $\displaystyle x \in [0, 1]$, how would I find the maximum distance? Thank you.

6. Well, you have done that is basic calculus. Have you not?
Find the max of $\displaystyle f(x)-g(x)$ and $\displaystyle g(x)-f(x)$ to account for the absolute value.

7. I see. At first, thinking of an integral formula but that made no sense. Thank you.