2 ms·
Matrix-vector multiplication works correctly when the vector is an Nx1 matrix, but if it's a 1xN matrix you need to take its transpose. That's not just a mecha
by nerdponx 4y ago
Matrix-vector multiplication works correctly when the vector is an Nx1 matrix, but if it's a 1xN matrix you need to take its transpose.
That's not just a mechanical computational consideration. One important interpretation of matrix-matrix multiplication is composition of linear transformations. When multiplying AB, you apply multiply matrix A by each column (vector) of B, and concatenate them to form the columns of the result AB. This corresponds to applying the transformation represented by A to a set of basis vectors. This correspondence is essential to the interpretation of matrix multiplication as a linear transformation, so it's important that it work out without additional manipulation.
Matrix-vector multiplication is more or less the heart of linear algebra, so in general it needs to be an elegant sensible operation.
- sfpotter 4y agoThis is a little confused. Matrix multiplication is defined as follows: if A is an m x n matrix and B is an n x p matrix, then the (i, j)th entry of C = AB is: \sum_{k=1}^p A_{ik} B_{kj} This definition works whether you think of a column vector as a vector and a row vector as a linear functional or vice versa. How you interpret "what's happening" (whether you're expanding in a basis or taking dot products with basis vectors) depends on how you interpret the rows and columns of a matrix, regardless of the "orientation".
- nerdponx 4y ago> depends on how you interpret the rows and columns of a matrix I assume you know everything I am writing below, but maybe it's a clearer version of what I was trying to say in my other post. Computationally, the definition of matrix multiplication AB = C is identical to multiplying A by each column of B, and concatenating the results as columns of C. The definition works both ways as you said, but this specific interpretation is one consequence of that definition. Ax is a linear combination of the columns of A, with the values of x as coefficients. This is a direct translation of plugging the x values into a system of linear equations where the coefficients of each equation in the system form the rows of A: a11 * x1 + a12 * x2 = y1 a21 * x1 + a22 * x2 = y2 [ a11 a12 ; a21 a22 ] [ x1 ; x2 ] = [ y1 ; y2 ] Moreover, in a matrix that corresponds to a system of non-redundant linear equations, the columns correspond to a basis for the image of the linear transformation represented by A. This follows immediately from the definition of a basis. You can go on like this, but the overall idea is that if you define "a matrix" such that each row contains the coefficients of one equation in a system of linear equations, then you are setting up row vectors to correspond to transformations (as in, y = a1x1 + a2x2), and then it becomes very ergonomic and natural to represent vectors as column vectors. In short: if transformations go on the left and vectors go on the right, then transformations are rows and vectors are columns.