From response vectors to a matrix
Vectors and linear combinations described each input by its complete response. With many inputs, we collect these response vectors as columns:
Column records the response to one unit of input . Row records how output depends on all inputs. These are two views of the same model.
A real matrix has rows and columns; its entry occupies row , column . When the matrix represents a response rule, rows count outputs and columns count inputs.
Matrix-vector multiplication combines the columns
If the columns of are and , define
The result belongs to . Componentwise,
For our example,
Dimensions must match because each column needs a coefficient. The matrix need not be square: two parameters may produce three observations.
Check dimensions before performing an operation
A matrix’s shape specifies which inputs and operations make sense. For , the product requires input components and produces output components. Addition requires two matrices of exactly the same shape; multiplication requires only the shared intermediate dimension to match.
If is and is , then is , while is undefined. Even when both matrices are square and both orders exist, equality is a separate question.
Equality of matrices requires equal shapes and equal corresponding entries. Matrix factors cannot be cancelled as casually as nonzero real numbers.
Zero, diagonal, and triangular matrices
The zero matrix has all entries zero and maps every input to zero. Its dimensions are usually inferred from context.
A diagonal matrix can have nonzero entries only on its main diagonal:
It scales coordinates separately, without mixing them. If , information about input coordinate disappears entirely.
An upper triangular matrix has zeros below the main diagonal; a lower triangular matrix has zeros above it. Their equations can be solved sequentially. In an upper triangular system, the last equation involves only the last unknown; after solving it, work upward. LU factorization exploits this structure.
Interpolation is linear in the coefficients
Suppose we want a polynomial of degree at most two whose values at the inputs are , respectively [1][1] X. Yang, “ENG1005 Week 3: Interpolation and Fitting, Personal Workshop Solutions,” 2024. Personal solutions to Monash ENG1005 workshop problems; source snapshot 77ebe58de2fea53d62533d6dd23caa16108ed109. Repository access may be restricted.. https://github.com/Eryc123Y/ENG1005-2024S2/blob/77ebe58de2fea53d62533d6dd23caa16108ed109/Source%20Code/W3.tex. Write
Evaluating at the three inputs gives
The columns sample , , and , respectively. Their coefficients combine the sample vectors into the target data.
Linearity concerns the unknown coefficients. A squared input variable does not prevent the coefficient-to-observation rule from being linear. Fixed sample locations determine ; new observations change only the right-hand side.
The coefficients are
Substitution yields . Linear systems and LU derives these coefficients by elimination.
Matrix multiplication composes two steps
Suppose first produces intermediate quantities, then produces the outputs. We want
Apply this requirement to each standard basis vector. Column of the product must be applied to column of , so
The formula adds the contributions through every intermediate coordinate. The product is ; the shared dimension is summed over.
Take
Then and , while
The input gives in the first case and in the second. Multiplication generally does not commute because order changes the result. In , the rightmost matrix acts first.
Grouping three steps differently leaves their order intact. Matrix multiplication is associative; entrywise, either grouping gives the finite sum
Three ways to read a product
For and , the entrywise formula is only one useful organization of the computation.
By columns: column of is . This reads the product as one transformation applied to several inputs.
By rows: row of is row of multiplied by . It combines intermediate output rules into the rule for final output .
By intermediate coordinates: if is column of and is row of , then
Each column times a row is an outer product. Its entry records the contribution through intermediate coordinate from input to output .
For example, take
Pair the first column with the first row, then the second column with the second row:
Compute the two outer products and add their entries:
All three views describe the same multiplication, organizing its sum around different structures.
Block multiplication preserves dimension matching
Split an input into two groups and partition the matrix’s columns accordingly:
More generally, compatible blocks satisfy
Blocks need not have equal sizes or be square. Their shared boundaries must match. This is ordinary multiplication organized around groups of variables.
Addition, identity, and inverses
Matrices of equal size add and scale entrywise. The column definition gives
The identity has ones on its diagonal and zeros elsewhere. Its columns are the standard basis, so .
A square matrix is invertible if a matrix satisfies both ; write . It recovers inputs from outputs. For example,
Multiplication in either order verifies this identity. When is invertible, every equation has the unique solution .
Conversely, suppose a square matrix gives a unique solution for every right-hand side. Solve and collect the solutions in , yielding . Since the homogeneous equation has only the zero solution, also implies , column by column. Thus invertibility means that every target is reachable with unique coefficients. In computation, elimination usually solves the system without constructing the entire inverse.
Cancellation requires an invertible factor
Take
Both matrices are nonzero, yet . A zero product therefore need not have a zero factor. Likewise, need not imply : may discard a nonzero difference .
If is invertible, multiplication on the left by does justify cancellation. To cancel a right factor, multiply its inverse on the right instead. The side matters because multiplication does not commute.
The inverse is unique. If are both inverses of , then
For a two-by-two matrix, direct multiplication gives a useful formula when :
The off-diagonal entries cancel and both diagonal entries become . This can be checked as a multiplication identity before studying determinants.
If , no inverse exists. When the first row is nonzero, the nonzero vector maps to zero. If only the second row is nonzero, use instead. If both rows vanish, every vector maps to zero. An invertible matrix cannot annihilate a nonzero input: applying its inverse would force that input to equal zero.
Transposition exchanges indices
The transpose swaps rows and columns:
It changes an matrix into an matrix and is generally different from the inverse. The product formula gives
because entry on the right is , exactly entry of . Matrix as Graph will use this distinction when interpreting directed edges.
Exercises
For
compute . Which input determines the third output?
Solution
The output is . The third row is , so only the second input contributes. Three outputs do not require three inputs.
If square matrices are invertible, prove .
Solution
Associativity gives ; the reverse product is also . Undo the last action, , before undoing .
For , find its transpose and inverse and explain their different roles.
Solution
The transpose is ; the inverse is . Transposition exchanges indices; inversion undoes the map. Symmetry alone does not make them equal.
A matrix maps to and to . Find its output for .
Solution
The known outputs are its columns, giving . The matrix has size .
References
- [1] X. Yang, “ENG1005 Week 3: Interpolation and Fitting, Personal Workshop Solutions,” 2024. Personal solutions to Monash ENG1005 workshop problems; source snapshot 77ebe58de2fea53d62533d6dd23caa16108ed109. Repository access may be restricted.. https://github.com/Eryc123Y/ENG1005-2024S2/blob/77ebe58de2fea53d62533d6dd23caa16108ed109/Source%20Code/W3.tex ↩
Comments