Vectors
What’s the geometric interpretation of the dot product of two vectors?
The dot product (or inner product) between two vector and is considered as the projection of onto multiplied by the length of , i.e. .
Given a vector , find a vector of unit length such that the dot product of and is maximum.
Since has unit length, , then which is optimized when , i.e. when .
Given two vectors a=[3,2,1] and b=[−1,0,1]. Calculate the outer product ?
.
So .
Give an example of how the outer product can be useful in ML.
Check here. TLDR; Outer product is used in a lot of applications for ML, e.g. in MLP the input (a vector) is multiplied with the matrix of weights using outer product.
What does it mean for two vectors to be linearly independent?
Two vectors are linearly independent if the only linear combination of the vectors that is equal to 0 is the trivial one (with all coefficients equal to 0).
Given two sets of vectors and , how do you check that they share the same basis?
If we can write each vector in the second set as linear combinations of the vectors in the first, then the two sets belong to the same basis.
Given vectors, each of dimensions. What is the dimension of their span?
The span of a set S of vectors, denoted span(S) is the set of all linear combinations of those vectors.
What's a norm? What is ?
A norm is a real-valued function , where is a vector space over a subfield of the Complex numbers, with the following characteristics:
- Triangle inequality: ;
- Non-negativity: and ;
- Absolute homogeneity: , where is the absolute value of a scalar .
A norm can be considered as a way to measure the total length of a vector. There are several ways to measure the magnitude of a vector:
- : it corresponds to the total number of nonzero elements in a vector;
- : it is known as Manhattan Distance. It is the sum of thee magnitudes of the vectors in a space. Example: Given the vector X=(3,4), then ;
- : It is known as Euclidean norm, i.e. the shortest way to go from one point to another. $||X||2=\sqrt{\sum{i=1}^{N}(x_i^2)}$;
- : it gives the largest magnitude among each element of a vector. Having X=(-6,5,2), it returns 6.
How do norm and metric differ? Given a norm, make a metric. Given a metric, can we make a norm?
A norm measures the size of a vector, while a distance is measuring the distance between two vectors.
If we have a vector space with a norm , it is always possible to define a metric in terms of that norm by putting . But not every metric is defined in terms of a norm, or even can be defined in terms of a norm. An example is the metric: , this is not a norm, in fact if we take a scalar such that and , by choosing x, y such that we must have that which is a contradiction. (Reference: here)