Vectors and Matrices (Notes — DL-Feb-2019 OneFourthLabs)
# Introduction to Vectors
What is a Euclidean space?
A coordinate system where each vector represents the distance from all the dimensions of the space.
How magnitude of the vectors are calculated and what it is called?
The square root of summation of squared values of each coordinate.
Also known as the L2 norm of the vector.
How do subtraction & addition of the vectors work? What is the intuition of these operations?
Both the operations are performed element-wise.
The intuition → Result of these operations represents the diagonal of a parallelogram starting from the origin of Euclidean space created using these vectors.
What is the Geometric representation of a vector?
A ray connecting the origin of the Euclidean Space to the vector.
What significance of the negative prefix to a vector is?
Negative prefix will change the quadrant of the vector.
# Dot product of vectors
What is a dot product of the vectors?
Element-wise multiplication of 2 vectors which is always a scalar quantity.
The intuition of dot product
# Unit vectors
What is a unit vector?
A vector with magnitude = 1 is a unit vector.
Some unit vectors: (1, 0), (0, 1), (1/√2 , 1/√2), (1, 0, 0), (0, 1, 0), (0, 0, 0)
How to convert a non-unit vector to a unit vector?
By dividing every element of the vector by its L2 Norm.
# Projection of vectors
What is the projection of a vector?
Wikipedia: The vector projection of a vector a on a nonzero vector b is the orthogonal projection of a onto a straight line parallel to b. It is a vector parallel to b.
Mathematical representation of vector projection:
# Angle between 2 vectors
How to calculate the angle between 2 vectors?
Condition for orthogonality between 2 vectors:
Dot product of those vectors will be zero.
i.e. 90 = 1/cos(0)
# Introduction to Matrices
Properties of a matrix:
- Collection of row vectors & column vectors
- Addition & subtraction between 2 matrices are performed element-wise, given that both matrices have same dimension
- Symbolic representation:
# Multiplying a vector by a matrix
What is matrix-vector multiplication?
Linear combination of elements of the vector and the columns of the matrix.
Condition to multiply a vector by a matrix.
Number of columns of the matrix should be same as number or rows of the vector. Result will be another vector with dimensions as (num of rows of matrix, 1).
Effect of matrix-vector multiplication on vector.
Results in scaling or shrinking of the vector. i.e. the vector is transformed & strays from the original path.
# Multiplying a matrix by another matrix
What is matrix-matrix multiplication and what is the required condition for it?
A dot product of row vectors of the 1st matrix to the column vector of the another.
The condition required for matrix-matrix multiplication:
Num of columns of 1st matrix == Num of rows of 2nd matrix
# Alternate way of multiplying 2 matrices
How to represent matrix-vector multiplication as linear combination?
Output is a linear combination of the columns of the matrix and the elements of the vector (weights).