Recommended resources
The freely available resources this lesson will direct you to.
Introduction
In our last lesson, we investigated the determinant, a single number that reveals how a linear transformation scales the space it acts upon. We saw it as a measure of change in area or volume. Today, we shift our focus from the properties of the transformation to the properties of the objects themselves—the vectors and matrices. Our goal is to understand and compute various norms, which are functions that measure the "size," "length," or "magnitude" of these objects.
This lesson will address the learning outcome: Compute and compare L1, L2, and Frobenius norms for vectors and matrices. We'll start from the first principles that define what a norm is, then explore the most common vector and matrix norms, paying close attention to their distinct geometric interpretations and practical implications, particularly in machine learning and optimization. This provides a crucial foundation before we move on to decomposing matrices into their fundamental components.
What is a Norm? The Axiomatic Foundation
Before we start calculating different types of norms, it's essential to establish what properties a function must have to be considered a norm in the first place. Much like how we derived the determinant from a few core axioms about signed volume, we can define a norm by four fundamental rules. A function that maps a vector to a real number is a norm, denoted , if it satisfies these conditions for any vectors and any scalar .
To see these properties laid out formally, please review this brief section from the Stanford CS229 linear algebra notes.
Linear Algebra Review and Reference
This document from Stanford provides concise, formal definitions for key linear algebra concepts.
Read the short section beginning with "More formally...". Focus on understanding the four properties listed: Non-negativity: The length must be non-negative. Definiteness: Only the zero vector has zero length. Homogeneity: Scaling a vector by a factor t scales its length by |t|. Triangle Inequality: The distance from A to C is never greater than the distance from A to B plus B to C. This is a cornerstone of any geometric distance measure.
Any function that satisfies these four axioms can be considered a valid norm. While there are infinitely many such functions, a few stand out for their utility in mathematics and machine learning.
Vector Norms: The Family
The most common vector norms belong to the family, defined by the general formula:
By varying the value of , we get different ways of measuring a vector's length. Let's examine the three most important cases: , , and the limit as .
Lecture 8: Norms of Vectors and Matrices
Professor Gilbert Strang's lecture from the MIT OpenCourseWare series provides a deep dive into these concepts. We'll start with his introduction to the main vector norms.
Watch the segment from this lecture, where he defines the L_2, L_1, and L_\infty norms. Note his emphasis on the L_1 norm's growing importance in modern applications like compressed sensing.
Let's break these down:
-
The Norm (Euclidean Norm):
When , we get the familiar Euclidean distance from the origin.
This is the "as the crow flies" distance and is the most intuitive notion of length. -
The Norm (Manhattan or Taxicab Norm):
When , the norm is the sum of the absolute values of the components.
This is called the Manhattan distance because it's analogous to navigating a grid-like street layout, where you can only travel along the axes. -
The Norm (Max Norm):
In the limit as , the largest component of the vector dominates the sum. The norm is simply the maximum absolute value of any element in the vector.
The Geometry of Norms: Unit Balls
The differences between these norms become visually apparent when we plot all the vectors for which the norm is equal to 1. This set of vectors forms the unit ball (or unit circle in 2D) for that norm.

Notice the sharp corners of the unit ball, which lie on the axes. The unit ball, in contrast, is perfectly round.
This next video provides an excellent visualization of how these shapes are formed and how they relate.
Lecture 8: Norms of Vectors and Matrices
Let's return to Professor Strang's lecture for the geometric interpretation.
Watch the segment from here. He draws the unit balls for the L_1, L_2, and L_\infty norms and explains how the shape "swells" from a diamond to a circle to a square as p increases.
The geometric shape of the unit ball is not just a curiosity; it has profound implications for optimization problems, which are at the heart of machine learning.
Consider an optimization problem where we must find the "smallest" vector (as measured by some norm) that also satisfies a linear constraint, like . Geometrically, this is like finding the point on a line that is closest to the origin. To find this point, we can imagine inflating the unit ball of our chosen norm until it just touches the line.
Question: Looking at the shapes of the (diamond) and (circle) unit balls, where would you expect the point of contact to be for each norm? How might the "pointiness" of the ball affect the solution you find?
Hint
A smooth, round object like the $L_2$ ball is likely to touch the line at a unique point somewhere in the middle. A pointy object like the $L_1$ ball is more likely to make first contact at one of its corners.This difference is precisely why the norm is so important in modern machine learning.
Lecture 8: Norms of Vectors and Matrices
Professor Strang provides a beautiful geometric argument for this.
Watch this segment from the lecture. He shows that when you blow up the L_1 diamond, it will most likely hit the constraint line at one of its corners, which lie on the axes. A point on an axis has one of its components equal to zero.
This tendency to produce solutions with zero-valued components is called sparsity. By minimizing the norm of a vector of model weights (a technique called L1 regularization or LASSO), we encourage the model to set unimportant weights to exactly zero. This effectively performs feature selection, making the model simpler and more interpretable. The norm, by contrast, prefers to shrink all weights towards zero without making them exactly zero, resulting in a dense solution.
Matrix Norms
Just as we measure the size of vectors, we often need to measure the size of matrices. This is crucial in many areas, for instance, in quantifying the error between a target matrix and its approximation, or analyzing how a transformation amplifies noise.
A key resource for this section is this text, which frames matrix norms from a practical, engineering-oriented perspective.
MATRIX NORMS – Linear Algebra and Applications - Pressbooks
This resource from Pressbooks motivates the need for matrix norms.
Read the motivating example in the first section. It poses a great question: if there's noise in our input vector, how can we quantify the resulting noise in the output? This sets the stage for why we need a single number to describe the "amplification factor" of a matrix.
The Frobenius Norm
The most straightforward way to define a matrix norm is to treat the matrix as a long vector with elements and then calculate its norm. This is called the Frobenius norm.
For a matrix , the Frobenius norm is:
The tr denotes the trace of the matrix (the sum of its diagonal elements).
The Frobenius norm measures the "average gain" of the matrix.
MATRIX NORMS – Linear Algebra and Applications - Pressbooks
This text provides a clear definition and interpretation.
Read the section on the Frobenius norm. Notice its interpretation as a measure of the root-mean-square (RMS) gain.
Operator Norms: The Matrix 2-Norm
A more sophisticated approach is to define a matrix norm based on how much it can "stretch" a vector. This gives rise to operator norms, which are "induced" by vector norms. The general form is:
This definition asks: what is the maximum length the output vector can have, given that the input vector has a length of 1?
When the vector norm used is the norm, the induced matrix norm is called the matrix 2-norm or spectral norm. It turns out that this value is precisely the largest singular value () of the matrix. We will explore singular values in depth in the next module, but for now, the key takeaway is its interpretation.
MATRIX NORMS – Linear Algebra and Applications - Pressbooks
Let's continue with the Pressbooks text for a practical view on this norm.
Read the section titled "Peak gain". Contrast this norm with the Frobenius norm. While Frobenius gives an average gain, the 2-norm gives the peak or worst-case gain. This is critical for robust system design where you need to guard against the maximum possible error amplification.
Conclusion
In this lesson, we have moved from the abstract definition of a norm to a concrete understanding of the most common types used for vectors and matrices.
Key Takeaways:
- Norms as Measures of Size: A norm is a function that assigns a strictly positive "length" to every vector or matrix, with the zero vector/matrix being the only exception.
- Vector Norms: The (Euclidean) norm is our standard notion of distance. The (Manhattan) norm measures path length on a grid and is crucial for promoting sparsity in machine learning models due to the "pointy" shape of its unit ball. The norm simply captures the largest component.
- Matrix Norms: The Frobenius norm is the matrix equivalent of the vector norm, treating the matrix as a flattened vector. It can be interpreted as the average (RMS) gain of the transformation. The matrix 2-norm (spectral norm) is an operator norm that measures the maximum possible "stretching" factor, or the peak gain, and is vital for worst-case analysis.
Understanding these different ways to measure "size" is fundamental. In optimization, norms define the objective functions we seek to minimize (e.g., minimizing the norm of the error vector in least squares). In regularization, they are added as penalties to prevent model weights from growing too large.
In our next lesson, we will begin a new module on geometric decompositions. We will start with eigenvalues and eigenvectors, which reveal the intrinsic axes of a linear transformation and form the bedrock for understanding more advanced techniques like Singular Value Decomposition (SVD). This will also fully illuminate why the matrix 2-norm is equal to the largest singular value.