Create a function MeanDistance(v1,v2) that returns the normalized distance between
two vectors with elements between 0 and 1: The function should return 0 if the vectors
are the same, and 1 if they are maximally different. This function should be used to compute
the distance d between v1 and v2.
How do I go about doing this? Thanks!
I don’t think the question is asking you to normalize the vectors. It’s asking you to normalize the distance. To do that, calculate the distance between the two vectors using your favorite distance measure (Euclidean, Manhattan, etc.) and divide by a constant that represents the maximum distance that is possible. The distance measure to use depends on your application (the ones I gave as examples are the most common). The value of the constant also depends on your application (specifically, the limits of your co-ordinate space, which seem to be 0 and 1 for all dimensions).