2 years, 1 month ago
Which of these is a metric ?
x=(x1,x2,...xn),
y=(y1,y2,...,yn)
d1(x,y)=sum (xi-yi)^2
or
d2(x,y)=sqrt( sum (xi-yi)^2) (the Euclidean distance)
sqrt means square root
Is d1 or d2 a metric that makes R^n a metric space?
Can you prove it?
y=(y1,y2,...,yn)
d1(x,y)=sum (xi-yi)^2
or
d2(x,y)=sqrt( sum (xi-yi)^2) (the Euclidean distance)
sqrt means square root
Is d1 or d2 a metric that makes R^n a metric space?
Can you prove it?
Separate topics with commas, or by pressing return. Use the delete or backspace key to edit or remove existing topics.
You can leave an optional "tip" with Mahalo's virtual currency, Mahalo Dollars. If you are asking a difficult question that might require some research, or if you'd like a wide variety of feedback, a higher tip often leads to more answers to your question.
M$1 Answer
Here is my proposal: Let's verify the criteria for d1 and d2 to be a metric for R^n.Quite obviously d1 and d2 are applications from R^n to R+.Condition 1 is the separation condition:d1(x,y)=0 <=> sum (xi-yi)^2=0 <=> xi=yi for any (i) <=> x=y VERIFIEDd2(x,y)=0 <=> sqrt (sum (xi-yi)^2=0) <=> xi=yi for any (i) <=> x=y VERIFIED Condition 2 is the symmetry condition:d1(x,y) = sum (xi-yi)^2 = sum (yi-xi)^2 = d1(y,x) VERIFIEDd2(x,y) = sqrt(sum (xi-yi)^2) = sqrt(sum (yi-xi)^2) = d2(y,x) VERIFIEDCondtion 3 is the triangular inequality:d2(x,z)^2 = sum(xi-zi)^2 = sum(xi-yi+yi-zi)^2 = sum(xi-yi)^2+sum(yi-zi)^2 + 2 sum((xi-yi)*(yi-zi))d2(x,z)^2=d2(x,y)^2+d2(y,z)^2+2 sum((xi-yi)*(yi-zi))Using the Cauchy-Schwarz inequality on vectors (x-y) and (y-z) in space R^n endowed with scalar product = sum(ai*bi):d2(x,z)^2<=d2(x,y)^2+d2(y,z)^2+2* sqrt(sum xi-yi) * sqrt(sum (yi-zi))d2(x,z) <= d2(x,y) + d2(y,z) VERIFIEDThe same calculation can be performed with d1, using a different scalar product =sqrt sum(ai*bi) instead.All 3 criteria are fulfilled therefore both d1 and d2 can be declared as a metric for R^n.
You can leave an optional "tip" with Mahalo's virtual currency, Mahalo Dollars. If you are asking a difficult question that might require some research, or if you'd like a wide variety of feedback, a higher tip often leads to more answers to your question.
M$
I will prove d2 is a metric based on your idea; however d1 is not a metric
(d2(x,z))^2=sum (xi-zi)^2=sum (xi-yi+yi-zi)^2=sum(xi-yi)^2+sum(yi-zi)^2+2*sum(xi-yi)*(yi-zi)
Now from the Cauchy-Schwartz applied to the vectors (x-y) an (y-z) we get
sum (xi-yi)(yi-zi) <= sqrt( sum (xi-yi)^2)* sqrt (sum(yi-zi)^2)
so if we go back
(d2(x,z))^2=sum (xi-zi)^2=sum (xi-yi+yi-zi)^2=sum(xi-yi)^2+sum(yi-zi)^2+2*sum(xi-yi)*(yi-zi) <=sum(xi-yi)^2+sum(yi-zi)^2 + 2sqrt( sum (xi-yi)^2)* sqrt (sum(yi-zi)^2)=
=(sqrt(sum(xi-yi)^2)+sqrt(sum(yi-zi)^2))^2
by taking square roots we get
d2(x,z)<=d2(x,y)+d2(y,z)
As for d1, sqrt sum(xi*yi) is not a dot product
In fact, d1 is not a metric
for example if x=-1, z=1, y=0,
d1(x,z)=(x-z)^2=4 > d1(x,y)+d(y,z)=(x-y)^2+(y-z)^2=2
I agree with your point about d1. I switched too fast from d2 to d1 and was not careful enough.
It seems Cauchy-Schwarz is a roundabout but I was interested to see if they are indeed metrics and if Cauchy-Schwartz say so, it's fine
My answer appears in one block in my browser, I hope this is not the case for you, otherwise this is hardly readable...