GenAI Basics · Question 7 · Medium

What is the cosine similarity between the vectors (3, 4) and (6, 8)?

  1. 0.5
  2. 1
  3. 0
  4. 10
Answer and explanation

Answer: B. 1

Explanation: Cosine similarity = (a·b) / (|a||b|) = (18 + 32) / (5 × 10) = 50 / 50 = 1. The vectors point in the same direction, so the similarity is the maximum value even though their lengths differ.

Previous: What is a text embedding? · Next: What does Retrieval-Augmented Generation (RAG) do?

Practise genai basics

Try a fresh set of genai basics questions with an explanation after every answer, free and without signing up: GenAI Basics practice. Or sit a full placement mock test.

More genai basics questions

More technical & programming practice

Pseudo-code · C Programming · Java · Python · Data Structures · Algorithms · Object-Oriented Programming · DBMS

LogicWiz Exams home · All practice topics · Placement mock tests · Daily 10 challenge