Computer Science, asked by Eshaan4063, 1 year ago

6 given two objects represented by the tuples (22, 1, 42, 10) and (20, 0, 36, 8): (a) compute the euclidean distance between the two objects. (b) compute the manhattan distance between the two objects. (c) compute the minkowski distance between the two objects, using q = 3. (d) compute the supremum distance between the two objects.

Answers

Answered by pesh20gathoni
44

Answer:

Explanation:

Given,

P = (22, 1, 42, 10)

Q = (20, 0, 36, 8)

a. Formula for Euclidean Distance :

distance = ((p1-q1)^2 + (p2-q2)^2 + ... + (pn-qn)^2)^(1/2)

Now,

distance = ( (22-20)^2 + (1-0)^2 + (42 - 36)^2 + (10-8)^2) ) ^(1/2)

=( (2)^2 + (1)^2 + (6)^2 + (2)^2 ) ) ^(1/2)

=(4+1+36+4)^(1/2)

=45^(1/2)

Distance = 6.7082

b.Manhattan distance :

d = |x1 - x2| + |y1 - y2|

d = |22- 20| + |1 - 0|

d = |2| + |1|

Similar questions