Exercises

Use these exercises to check the chapter ideas. Work by hand first.

Points And Distance

MATH-C04-C-001Exercise: Point plus direction

Start at p = (1, 4) and move by d = [2, -3].

What point do you reach?

Compute it first, then check your number.

HintAdd coordinates

Add matching coordinates.

SolutionPoint reached

A direction tells how to move from the starting point. Add matching coordinates:

(1,4)+[2,3]=(3,1)(1,4) + [2,-3] = (3,1)

The reached point is (3, 1).

MATH-C04-C-002Exercise: Distance

Let a = (2, 1) and b = (8, 9).

Compute the Euclidean distance between them.

Compute it first, then check your number.

HintDifference first

Compute b - a first. The difference should make a familiar triangle.

SolutionDistance computation

Distance between two points is the length of their difference vector. Compute the displacement first:

ba=[82,91]=[6,8]b-a = [8-2, 9-1] = [6,8]

Then measure that vector:

d(a,b)=62+82=10d(a,b) = \sqrt{6^2 + 8^2} = 10

Angles And Projection

MATH-C04-C-003Exercise: Orthogonality

Let u = [3, 1] and v = [1, -3].

Compute u . v.

Compute it first, then check your number.

HintDot product

Multiply matching entries and add. Orthogonal vectors give zero.

SolutionOrthogonality check

Use the dot product test:

uv=3(1)+1(3)=0u\cdot v = 3(1) + 1(-3) = 0

The zero result means the two nonzero vectors are orthogonal.

MATH-C04-C-004Exercise: Projection

Let a = [6, 2] and u = [1, 0].

Compute proj_u(a).

Compute it first, then check your number.

HintHorizontal component

The vector u = [1, 0] keeps the horizontal component.

SolutionProjection onto x-axis

Since u = [1, 0] is the horizontal unit direction, the dot product keeps the horizontal component:

au=6a\cdot u = 6

Multiply that scalar by the direction:

proju(a)=6[1,0]=[6,0]\operatorname{proj}_u(a) = 6[1,0] = [6,0]

Boundaries And Spaces

MATH-C04-C-005Exercise: Boundary score

Let w = [1, 2], b = -5, and x = [3, 1].

Compute w . x + b.

Compute it first, then check your number.

HintDot product plus bias

Compute the dot product first, then add the bias.

SolutionBoundary score

Compute the dot product and then add the bias:

wx+b=1(3)+2(1)5=0w\cdot x+b = 1(3) + 2(1) - 5 = 0

A score of 0 means the point lies exactly on the decision boundary.

MATH-C04-C-006Exercise: Subspace zero check

Enter 1 if the shifted line y = 2x + 1 contains the zero vector, or 0 if it does not.

Compute it first, then check your number.

HintCheck zero

Test whether [0,0] satisfies the equation.

SolutionZero vector fails

At [0,0], the left side is 0, but the right side is 1. The shifted line does not contain the zero vector.

MATH-C04-C-007Exercise: Basis failure

Enter 1 if [1,0] and [2,0] form a basis for the full plane, or 0 if they do not.

Compute it first, then check your number.

HintSame direction

Ask whether these directions can reach points with nonzero vertical coordinate.

SolutionNot enough directions

Enter 0. Both vectors lie on the horizontal axis, so they do not span the whole plane.

Interpretation

MATH-C04-C-008Exercise: Embedding interpretation

Enter 1 if nearby embeddings are useful evidence, but not a complete explanation by themselves.

Compute it first, then check your number.

HintEvidence, not full proof

A nearest neighbor can show a relationship under the model's representation, but it does not prove why the model learned that relationship.

SolutionCareful embedding reading

Enter 1. Nearby embeddings are useful because they show similarity under the model's learned representation, but they are not a complete explanation of the model.

MATH-C04-C-009Exercise: High-dimensional caution

Enter 1 if low-dimensional drawings should be checked against formulas or code when reasoning about high-dimensional spaces.

Compute it first, then check your number.

HintPicture plus computation

Use drawings for intuition and computation for the actual space.

SolutionUse both

Enter 1. A diagram helps build intuition, but high-dimensional behavior should be checked with formulas or code.

MATH-C04-C-010Exercise: Question to keep

Enter 1 if a good geometry question is:

What is this operation
doing to the space?

Compute it first, then check your number.

HintMain habit

Geometry gives shape to vector and matrix computation.

SolutionKeep the question nearby

Enter 1. The habit is to ask what a vector or matrix operation is doing to the space.

MATH-C04-C-011Exercise: Projection residual

A vector a = [5, 2] is projected onto the horizontal unit direction u = [1, 0], giving proj_u(a) = [5, 0].

What is the residual a - proj_u(a)?

Compute it first, then check your number.

HintOriginal minus projection

Compute [5, 2] - [5, 0].

SolutionResidual

The residual is the part left after subtracting the kept projection:

[5,2][5,0]=[0,2][5,2] - [5,0] = [0,2]

The projection kept the horizontal part [5, 0]. The residual [0, 2] is the part not kept by that projection.

MATH-C04-C-012Exercise: Boundary scaling

A classifier uses score s(x) = w . x + b. A second classifier uses 2s(x).

Enter 1 if both classifiers have the same decision boundary.

Compute it first, then check your number.

HintSame zeros

If s(x) = 0, then 2s(x) = 0 too.

SolutionSame boundary

Enter 1. The decision boundary is the zero set. Multiplying the whole score by a positive constant changes raw scores, but not which points have score zero.

MATH-C04-C-013Exercise: Nonstandard coordinates

A basis uses b_1 = [1, 1] and b_2 = [0, 1].

What standard vector is described by the basis coordinates [2, 3]?

Compute it first, then check your number.

HintUse the basis

Compute 2[1, 1] + 3[0, 1].

SolutionCoordinates in a frame

Coordinates are weights on the basis vectors. Use the provided basis, not the standard axes by habit:

2[1,1]+3[0,1]=[2,2]+[0,3]=[2,5]2[1,1] + 3[0,1] = [2,2] + [0,3] = [2,5]

So the coordinate list [2, 3] describes the vector [2, 5] in this basis.

Use the hints only after you have tried the exercises. Use the solutions after you can explain where you got stuck.