What does the matrix-vector product Ax compute in terms of the columns of A?
answer
- the entries of x act as weights
- ask what A does to (1, 0)
- the output lives in the span of the columns
- columns are the images of the basis vectors
basics
~20 sAx is a linear combination of the columns of A, weighted by the entries of x. Applying A to the basis vector with a single 1 in slot j returns column j, so the columns are where the axes go.
solid answer
~50 sWrite `A` as columns `a_1, ..., a_n` and `x` as entries `x_1, ..., x_n`. Then `Ax = x_1*a_1 + ... + x_n*a_n` — the entries of `x` are the weights, so every output lies in the span of the columns. The special case makes it vivid: if `e_j` has a 1 in slot `j` and zeros elsewhere, then `A e_j` is exactly column `j`, so **the columns of A are the images of the coordinate axes**. That is why the identity matrix, whose columns are precisely `e_1, ..., e_n`, is the do-nothing map: `I x = x` for every `x`. There is a dual row reading — entry `i` of `Ax` is the dot product of row `i` with `x` — and the two agree; the column view explains what the map does, the row view is the recipe.
go deeper
Be able to compute Ax by hand both ways: dot each row of A with x, and check the answer as a weighted sum of the columns. Know that the identity matrix returns every vector unchanged.
Explain the column view and why applying A to a basis vector returns that column, and state the two linearity properties. Be able to construct a matrix from the images of the basis vectors on the spot.
Read structure off a matrix quickly: a zero column means an ignored input coordinate, duplicated columns mean a collapsed direction, and the reachable outputs are the span of the columns. Use these as fast diagnostics before any heavier analysis.
Be able to explain to a mixed audience why the columns-as-images picture is the right mental model, and when a modelling assumption of linearity is doing real work versus quietly failing because the true relationship bends or does not fix the origin.
## Two ways to read the same product Let `A` be `m x n` and let `x` be an `n x 1` column vector, so `Ax` is `m x 1`. **Row view (how to compute).** Entry `i` of `Ax` is the dot product of row `i` of `A` with `x`. This is the mechanical recipe: `m` dot products, each of length `n`. **Column view (what it means).** Split `A` into its columns `a_1, ..., a_n`, each a vector of length `m`. Then ``` Ax = x_1*a_1 + x_2*a_2 + ... + x_n*a_n ``` Every output is a weighted sum of the columns, with `x` supplying the weights. Both views give identical numbers; the column view is the one that explains behaviour, and it is the answer interviewers are usually fishing for. ## Where the columns come from Let `e_j` denote the standard basis vector with a 1 in position `j` and zeros elsewhere. Feeding it through the column formula, every weight is zero except the `j`-th, which is 1, so ``` A e_j = a_j = column j of A ``` **The columns of a matrix are the images of the coordinate axes.** That single sentence is the bridge between the array of numbers and the transformation it represents. Concretely, with ``` A = [[3, 1], [0, 2]] ``` we get `A e_1 = (3, 0)` and `A e_2 = (1, 2)`. The horizontal unit arrow is stretched to three times its length, and the vertical unit arrow is tilted to the right while growing. To find where any other vector lands, combine: for `x = (2, 5)`, ``` Ax = 2*(3,0) + 5*(1,2) = (11, 10) ``` and the row recipe agrees: `3*2 + 1*5 = 11` and `0*2 + 2*5 = 10`. This also gives a constructive procedure that comes up constantly: if you know what a linear transformation does to each basis vector, you build its matrix by writing those images down as columns, in order. Nothing else is needed, because linearity determines the rest. ## Linearity The operation `x -> Ax` satisfies two properties, and together they are the definition of a linear map: - `A(x + y) = Ax + Ay` — the image of a sum is the sum of the images. - `A(c x) = c (Ax)` for any number `c` — scaling the input scales the output identically. An immediate consequence is `A 0 = 0`: a linear map always fixes the origin. Both properties follow directly from the column formula, since the weights combine additively. Whenever a mapping bends lines, moves the origin, or squares an input, it cannot be written as a matrix-vector product. ## The identity matrix The `n x n` identity matrix `I` has ones on the main diagonal and zeros elsewhere; equivalently, its columns are exactly `e_1, ..., e_n`. Applying the column formula, `I x = x_1*e_1 + ... + x_n*e_n = x`. So `I` is the **do-nothing linear map**: it leaves every vector where it found it, and it plays the role that 1 plays for ordinary numbers, satisfying `A I = A` and `I A = A` at the matching sizes. Two practical notes: the identity must be the right size on the right side of a product, which for a non-square `A` means the `I` on the left and the `I` on the right are different-sized matrices; and a matrix full of ones is *not* the identity, a surprisingly common confusion. ## Reading structure off the columns Because the output is always a combination of columns, the set of achievable outputs — the column space — is precisely the span of the columns. That immediately explains several facts a candidate should be able to state: - If a column is all zeros, the matching input coordinate has no effect on the output whatsoever. - If one column is a multiple of another, the two corresponding input directions produce parallel effects, and the map collapses some direction; the outputs fill a smaller region than the input space. - The number of independent columns bounds how much of the output space the map can reach, no matter how large the matrix looks. ## Where the interpretation gets used Stacking columns as images of basis vectors is why composition of maps corresponds to multiplying matrices: column `j` of `AB` is `A` applied to column `j` of `B`, which is exactly "push the basis vector through `B`, then through `A`". It also gives a cheap consistency check when you write a transformation by hand — apply it to each basis vector, look at the results, and confirm they are the columns you wrote down. In interviews, the phrase to reach for is: **"Ax is a linear combination of the columns of A, with the entries of x as coefficients — and the columns are where the basis vectors go."** Then offer the row view as the computational recipe, and note that the identity matrix is the case where the basis vectors do not move at all.
- How do you build the matrix of a linear map if you only know where it sends each basis vector?Write those images as the columns, in order: the image of `e_1` is column 1, the image of `e_2` is column 2, and so on. Linearity then fixes the map everywhere else, because any input is a weighted sum of basis vectors and the output is the same weighted sum of the columns.
- For an unweighted adjacency matrix A of a small undirected graph, what does entry (i,j) of A squared count?The number of two-step walks from node `i` to node `j`. Entry `(i,j)` of `A*A` is the sum over `k` of `A[i,k]*A[k,j]`, and each term is 1 exactly when both the edge `i-k` and the edge `k-j` exist. In a 4-node graph with no self-loops, the diagonal entry `(i,i)` then counts the neighbours of `i` — its degree.
- What can you say about the map if one column of A is entirely zeros?The input coordinate matching that column has no influence on the output at all: its weight multiplies a zero vector. Different inputs therefore produce identical outputs, the map is not one-to-one, and the reachable outputs span fewer directions than the input space has.
Think of the columns of A as a fixed set of ingredients and the entries of x as the recipe quantities. The product is the blend; the identity matrix is the recipe that hands each ingredient straight back.
saying these in an interview costs you the question
- Says Ax multiplies A and x entry by entry
- Describes the columns as the images of the rows
- Thinks a matrix of all ones is the identity matrix
- Cannot state that A applied to a basis vector returns a column
- Claims the output can leave the span of A's columns