Linear Algebra Lecture 11: Linear Independence, Unit Vectors, Orthogonality, Norms, Determinants, Eigenvalues and Eigenvectors
Definition
Linear Algebra studies vectors, matrices, and transformations. In this lecture, we focus on:
- Linear independence and dependence of vectors
- Unit vectors and normalization
- Orthogonal and orthonormal vectors
- Norms for measuring vector and matrix size
- Determinants and their importance
- Eigenvalues and eigenvectors
These concepts are fundamental in computer science, machine learning, artificial intelligence, and data science.
Linear Independence and Linear Dependence
Definition
A set of vectors:
is linearly independent if the equation:
has only the trivial solution:
This means no vector in the set can be created by combining the other vectors.
A set of vectors is linearly dependent if there is at least one non-zero solution:
Meaning one or more vectors can be represented as a combination of other vectors.
Key Points
Linear Independence
A set of vectors is independent when:
- No vector is redundant
- Every vector contributes new information
- The null space contains only the zero vector
Mathematically:
has only:
solution.
Linear Dependence
A set of vectors is dependent when:
- Some vectors contain repeated information
- At least one vector can be generated from others
- The null space has non-zero solutions
Example
Given:
Notice:
and
Therefore:
are linearly dependent.
Explanation
The vectors contain the same direction and information.
For example:
already describes the direction.
The other vectors are only scaled versions.
Therefore, keeping all vectors creates redundancy.
Output
The vectors are:
Common Mistakes
- Thinking different-looking vectors are always independent
- Forgetting that scalar multiples create dependence
- Checking only the number of vectors instead of solving equations
Short Exam Notes
- Independent vectors → only trivial solution exists
- Dependent vectors → non-zero solution exists
- Dependent vectors contain redundancy
- Independence is related to null space
Why Linear Independence is Important
Definition
Linear independence is important because it helps us find the minimum number of vectors needed to represent data.
In data science:
- Independent vectors remove redundancy
- Independent bases make calculations easier
- Redundant information can be compressed
Example
Matrix:
The columns are:
But:
So all columns depend on one vector.
Explanation
Although the matrix has five columns, the actual information is only one direction.
This means the matrix has redundancy.
Removing redundant vectors gives a smaller basis.
Short Exam Notes
- Independent basis = no repeated information
- Redundancy allows compression
- Rank represents independent directions
Unit Vectors
Definition
A unit vector is a vector whose length (magnitude) is exactly 1.
For vector:
the length is:
A unit vector satisfies:
Unit Vector Formula
Definition
To convert any vector into a unit vector, divide it by its magnitude.
Formula:
This process is called:
Example
Given:
Find its unit vector.
Step 1: Calculate length
Step 2: Divide vector by length
Therefore:
Explanation
The direction of the vector stays the same.
Only the length changes.
Original vector:
Normalized vector:
Output
The normalized vector:
Common Mistakes
- Dividing each element separately by different values
- Forgetting to calculate the vector length first
- Assuming every vector is already a unit vector
Short Exam Notes
- Unit vector length = 1
- Normalization creates unit vectors
- Formula:
Orthogonality
Definition
Two vectors are orthogonal if their dot product is zero.
For vectors:
they are orthogonal when:
Key Points
Orthogonal vectors:
- Are perpendicular
- Have an angle of 90°
- Have zero dot product
Formula:
Example
Given:
Dot product:
Therefore:
Orthonormal Vectors
Definition
A set of vectors is orthonormal when:
- Every vector has length 1
- Every pair of vectors is orthogonal
Meaning:
and:
Example
Two vectors:
They are orthonormal if:
and:
Explanation
Orthonormal bases are preferred because calculations become easier.
For an orthonormal matrix:
Instead of computing a complicated inverse, we only transpose the matrix.
Short Exam Notes
- Orthogonal → dot product = 0
- Orthonormal → orthogonal + unit length
- Orthonormal matrix:
Norms
Definition
A norm is a mathematical function that measures the size or length of a vector or matrix.
The norm tells us how large a vector or matrix is.
The notation for a norm is:
For vectors, norms measure distance from the origin.
For matrices, norms measure the overall magnitude of all elements.
L1 Norm (Manhattan Norm)
Definition
The L1 norm is the sum of the absolute values of all vector components.
Formula:
It is also called:
- Manhattan distance
- Taxicab norm
Example
Given:
The L1 norm is:
Explanation
The L1 norm ignores direction and only measures total magnitude.
It is commonly used in:
- Machine learning regularization
- Sparse data problems
- Feature selection
Short Exam Notes
- L1 norm = sum of absolute values
- Formula:
L2 Norm (Euclidean Norm)
Definition
The L2 norm is the normal length of a vector.
It calculates the shortest distance between the vector and the origin.
Formula:
Example
Given:
Length:
Explanation
The L2 norm is the most commonly used vector length.
Applications:
- Geometry
- Machine learning
- Optimization
- Distance calculations
Short Exam Notes
- L2 norm = Euclidean distance
- Formula:
- Unit vectors have:
Frobenius Norm
Definition
The Frobenius norm is the matrix version of the L2 norm.
It measures the size of a matrix by treating all elements like components of a vector.
Formula:
Meaning:
- Square every element
- Add all values
- Take square root
Example
Given:
The Frobenius norm is:
Explanation
For a vector:
The L2 norm is:
For a matrix, Frobenius norm applies the same idea to every matrix element.
Short Exam Notes
- Frobenius norm = matrix equivalent of L2 norm
- Formula:
- Square all elements and add them
Determinant of a Matrix
Definition
The determinant is a scalar value associated with a square matrix.
It gives important information about:
- Invertibility
- Linear dependence
- Solutions of equations
The determinant is written as:
Determinant of a 2×2 Matrix
Formula
For:
The determinant is:
Example
Given:
Then:
Explanation
The determinant compares the product of the main diagonal with the opposite diagonal.
Determinant of a 3×3 Matrix
Definition
For:
The determinant is calculated using expansion:
Example
Given:
Expansion:
First minor:
Second:
Third:
Therefore:
Importance of Determinant
Key Points
If:
then:
1. No unique solution exists
The system:
does not have one unique answer.
2. Matrix is Singular
A singular matrix:
- Has no inverse
- Cannot be inverted
3. Columns are Linearly Dependent
If:
then the columns contain redundancy.
Example
Matrix:
Determinant:
Therefore:
- Matrix is singular
- Columns are dependent
- No inverse exists
Common Mistakes
- Calculating determinant for non-square matrices
- Forgetting the negative sign in expansion
- Confusing determinant with matrix magnitude
Short Exam Notes
- Determinant exists only for square matrices
- If:
matrix has inverse.
- If:
matrix is singular.
Eigenvalues and Eigenvectors
Definition
Eigenvalues and eigenvectors describe special directions of a matrix transformation.
Normally:
changes both the direction and length of a vector.
However, some special vectors only change their length.
These special vectors are called:
The scaling values are called:
Eigenvalue Equation
Formula
The fundamental equation is:
Where:
- (A) = matrix
- (v) = eigenvector
- (\lambda) = eigenvalue
Explanation
When matrix (A) multiplies eigenvector (v):
- Direction stays the same
- Only magnitude changes
The matrix behaves like a scalar multiplier.
Example of Eigenvectors
Given:
Consider:
Multiplication:
Result:
Therefore:
Eigenvalue:
Another vector:
Then:
Therefore:
Explanation
The vectors:
and
are special because matrix multiplication only scales them.
Applications of Eigenvalues and Eigenvectors
Key Points
Eigenvalues and eigenvectors are used in:
- Data compression
- Machine learning
- Principal Component Analysis (PCA)
- Image processing
- Computer vision
- Dimensionality reduction
Data Compression Idea
Suppose we have:
100 basis vectors.
After eigen decomposition:
Small eigenvalues contribute very little.
Therefore, we can remove them.
This reduces dimensions while keeping important information.
Short Exam Notes
- Eigenvector:
- Eigenvector → special direction
- Eigenvalue → scaling factor
- Large eigenvalues represent important directions
- Used in PCA and compression
Complete Lecture 11 Summary
- Linear independence removes redundancy.
- Unit vectors have length 1.
- Normalization converts vectors into unit vectors.
- Orthogonal vectors have dot product zero.
- Orthonormal vectors are perpendicular unit vectors.
- L1 norm measures absolute sum.
- L2 norm measures Euclidean distance.
- Frobenius norm measures matrix size.
- Determinant determines invertibility.
- Determinant zero means singular matrix.
- Eigenvectors keep their direction after transformation.
- Eigenvalues describe scaling.
- Eigen decomposition helps compression and dimensionality reduction.