ML Foundations

Learn / ML Foundations

ML Foundations: Vectors and Geometry

Foundational quiz on vectors, norms, dot products, cosine similarity, orthogonality, and projections.

Learning path

0%

0 of 4 sections marked complete · about 25 minutes

Learning objectives

What you will be able to explain

  • What is a vector in the context of ML math?
  • Add two vectors
  • Compute a Euclidean norm
  • Match each concept to its formula
  • Compute a dot product
  • When are two vectors orthogonal?

Section 01

What is a vector in the context of ML math? to Compute a Euclidean norm

01

What is a vector in the context of ML math?

Vectors are ordered collections of numbers. In ML they often represent features, parameters, gradients, or embedded points in space.

Guided checkpoint

Choose the best description.

02

Add two vectors

Vector addition is component-wise: (1+4,2+0,3+(1))=(5,2,2)(1 + 4, -2 + 0, 3 + (-1)) = (5, -2, 2). This operation is used constantly for feature and parameter updates.

Guided checkpoint

Compute u+vu + v for u=(1,2,3)u = (1, -2, 3) and v=(4,0,1)v = (4, 0, -1).

03

Compute a Euclidean norm

The Euclidean norm is x2=32+42=25=5\|x\|_2 = \sqrt{3^2 + 4^2} = \sqrt{25} = 5. Norms measure vector magnitude and are central in distances and regularization.

Guided checkpoint

Compute the L2L_2 norm of x=(3,4)x = (3, 4).

Section 02

Match each concept to its formula to When are two vectors orthogonal?

01

Match each concept to its formula

The L1L_1, L2L_2, and LL_\infty norms measure magnitude in different ways, while cosine similarity measures alignment of directions rather than scale.

Guided checkpoint

Match the vector quantity to the corresponding formula.

02

Compute a dot product

The dot product is 13+20+(1)4=3+04=11 \cdot 3 + 2 \cdot 0 + (-1) \cdot 4 = 3 + 0 - 4 = -1. Dot products appear in linear models, projections, and similarity computations.

Guided checkpoint

Compute xyx^\top y for x=(1,2,1)x = (1, 2, -1) and y=(3,0,4)y = (3, 0, 4).

03

When are two vectors orthogonal?

Orthogonality means the vectors meet at a right angle, which algebraically is captured by a zero dot product.

Guided checkpoint

Choose the defining condition.

Section 03

What does cosine similarity equal to 1 mean? to Vector facts: true or false

01

What does cosine similarity equal to 1 mean?

Cosine similarity compares angle, not scale. A value of 1 means the angle is zero, so the vectors are perfectly aligned.

Guided checkpoint

Choose the best interpretation.

02

Normalize a vector

Since x2=5\|x\|_2 = 5, the normalized vector is x/x2=(3/5,4/5)=(0.6,0.8)x / \|x\|_2 = (3/5, 4/5) = (0.6, 0.8). Normalization removes scale while keeping direction.

Guided checkpoint

Normalize x=(3,4)x = (3, 4) to unit length in the L2L_2 sense.

03

Vector facts: true or false

These are core vector-space facts: the dot product is symmetric over real vectors, norms are nonnegative, and scalar multiplication by 0 collapses any vector to the origin.

Guided checkpoint

Mark each statement as true or false.

Section 04

Which formula projects uu onto the direction of vv?

01

Which formula projects uu onto the direction of vv?

Projection scales the direction vector vv by the coefficient uvvv\frac{u^\top v}{v^\top v}. This gives the component of uu lying along vv.

Guided checkpoint

Choose the standard projection formula.

Knowledge check

Turn understanding into recall.

The quiz now follows the same concepts in scored form. You can return to this lesson from the quiz whenever a gap appears.