9. For the following vectors, x and y, calculate the indicated similarity or distance measures. a. (a) x : (0,0,1,1), y : (2,2,2,2) cosine, correlation, Euclidean b. (b) x : (0,1,0,1), y : (0,1,0,1) cosine, correlation, Euclidean, Jaccard c. (c) x : (1,1,0,1), y : (-1,0,-1,0) cosine, correlation, Euclidean d. (d) x : (1,0,0,1,0,1), y : (0,1,1,0,0,1) cosine, correlation, Jaccard e. (e) x : (2,1,0,2,0,3), y : (1,1,1,0,0,1) cosine, correlation

Respuesta :

Answer:

The answer to this question can be defined as follows:

a)

cosine: 0.707

correlation: 0

Euclidean: 3.16

b)

cosine: 1

correlation: 1

Euclidean: 0

Jaccard: 1

c)

cosine: -0.4082

correlation: 0.5774

Euclidean: 2.64

d)

cosine: -0.333

correlation:  -0.3333

Jaccard: 0.5

e)

cosine: -0.7075

correlation: 0.2132

Step-by-step explanation:

a) cosine:

[tex]x \times y( 0 \times 2+ 0 \times 2 +1 \times 2+1 \times 2) = 4\\\\ x= \sqrt{2} = 1.414\\\\y= \sqrt(16)=4\\\\\cos (x\times y) = \frac{x\times y}{x\times y}\\\\\cos (x\times y) = \frac{4}{1.414\times 4}\\\\= 0.707[/tex]

correlation:

[tex]\ corr(x,y) =[\frac{covariance (x,y)}{standec(x) \times standdev(y)}]\\X \ mean = 0.5\\Y \ mean = 2\\covariance (x,y) = 0\\standdev(x) = 0.5774\\standdev(y) = 0\\corr(x,y) = 0[/tex]

Euclidean:

[tex]d(x,y) = \sqrt((0-2)^2+(0-2)^2+(1-2)^2+(1-2)^2)\\d(x,y) = 4+4+1+1\\d(x,y)= \sqrt(10)\\d(x,y)= 3.16\\[/tex]

by applying above formula we get all the values.

b)

cosine: 1

correlation: 1

Euclidean: 0

Jaccard: 1

c)

cosine: -0.4082

correlation: 0.5774

Euclidean: 2.64

d)

cosine: -0.333

correlation: -0.3333

Jaccard: 0.5

e)

cosine: -0.7075

correlation: 0.2132