178k views
3 votes
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.

User Sujatha
by
5.2k points

1 Answer

5 votes

Answer:

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|

Step-by-step explanation:

User Rbedger
by
4.5k points