Surely it’s not dimensions, since all of these examples were two-dimensional (x and y). So I’m a little lost here.
Surely it’s not dimensions, since all of these examples were two-dimensional (x and y). So I’m a little lost here.
So if you pick n=1 you get d(x, y) = |x| + |y|, which is the taxicab metric. You can apply this metric to a Euclidean space of whatever dimension you like, just substituting the appropriate definition of |x| and |y|. For 1-dimensional space you would use |x| = abs(x[0]), for 2-dimensional space you would use |x| = sqrt(x[0]**2 + x[1]**2), etcetera. Hope that helps.
So in 3-dimensional space, for n=3, the "length" of a vector u=(u_x, u_y, u_z) is: d(u) = (|u_x|^3 + |u_y|^3 + |u_z|^3)^(1/3)
In 2-dimensional space, for n=4 and u=(u_x, u_y) you get the following: d(u) = (|u_x|^4 + |u_y|^4)^(1/4)
If you want to use the norm as a metric to work out the "distance" between two vectors u and v then you just compute d(u-v) where u-v is ordinary vector subtraction.
0: https://en.wikipedia.org/wiki/Lp_space#The_p-norm_in_finite_...