About the quiz question in lecture "Manipulating Words in Vector Spaces"

Hi, @Jack_Changfan.

The question is made of two parts:

What country? - (for that use cosine similarity: Turkey 0.9899 vs Japan 0.9839)
What distance? - (Euclidean distance: Turkey 1.41 vs Japan 1)

  # country = Ankara(9,1) - Washington(10,5) + USA(5,6) = (4, 2)

  # Cosine similarity: country (4, 2); Turkey(3, 1) = 0.9899
  (4*3 + 2*1) / ((4**2 + 2**2)**0.5 * (3**2 + 1**2)**0.5)

  # Cosine similarity: country (4, 2); Japan(4, 3) = 0.9839
  (4*4 + 2*3) / ((4**2 + 2**2)**0.5 * (4**2 + 3**2)**0.5)

So the correct answer is Turkey (first part) with d=1.41 (second part).