Solutions

These solutions collect the exercise reasoning in one place.

MATH-C02-C-001

In:

v=[3,6]v = [-3, 6]

the second coordinate is 6.

MATH-C02-C-002

Add matching coordinates:

a+b=[2+5,1+4]=[7,3]a + b = [2 + 5, -1 + 4] = [7, 3]

The first coordinate is 7.

MATH-C02-C-003

Scale each coordinate:

3[4,2]=[12,6]3[4, -2] = [12, -6]

The first coordinate is 12.

MATH-C02-C-004

Multiply matching entries, then add:

ab=(1×2)+(3×5)=17a \cdot b = (1 \times 2) + (3 \times 5) = 17

MATH-C02-C-005

First compute the difference:

ba=[41,51]=[3,4]b - a = [4 - 1, 5 - 1] = [3, 4]

Then compute its length:

ba=32+42=5\|b-a\| = \sqrt{3^2 + 4^2} = 5

MATH-C02-C-006

The dot product is:

[1,0][0,1]=0[1,0]\cdot[0,1] = 0

Both vectors have length 1, so the cosine similarity is:

01×1=0\frac{0}{1\times1} = 0

MATH-C02-C-007

Projection onto [1,0][1,0] keeps the horizontal component:

proj[1,0]([7,2])=[7,0]\text{proj}_{[1,0]}([7,-2]) = [7,0]

MATH-C02-C-008

The dot product returns a scalar.

It multiplies matching entries, then adds the products into one number. That is why it can act as a score.

MATH-C02-C-009

The safer statement is:

Embeddings are learned coordinates whose directions and relationships can be useful.

An embedding can be useful without every coordinate having a simple human label.

MATH-C02-C-010

Cosine similarity compares direction after accounting for length:

abab\frac{a\cdot b}{\|a\|\|b\|}

That is why it is often used to compare embedding directions.

MATH-C02-C-011

Enter 1.

Both vectors have shape two, but the coordinate meanings do not match:

[rooms, distance_km]
[age_years, height_cm]

Adding them would mix unrelated quantities. Shape is necessary for vector addition, but meaningful addition also needs matching coordinate roles.

MATH-C02-C-012

Subtract the projected vector from the original vector:

[6,4][6,0]=[0,4][6,4] - [6,0] = [0,4]

The projection keeps the part along [1,0][1,0]. The residual is the part left over.