Exercises
Use these exercises to check the chapter ideas. Work by hand first.
Points And Distance
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:
The reached point is (3, 1).
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:
Then measure that vector:
Angles And Projection
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:
The zero result means the two nonzero vectors are orthogonal.
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:
Multiply that scalar by the direction:
Boundaries And Spaces
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:
A score of 0 means the point lies exactly on the decision boundary.
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.
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
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.
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.
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.
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:
The projection kept the horizontal part [5, 0]. The residual [0, 2] is
the part not kept by that projection.
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.
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:
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.