INAIO Guide Stage 1 11Matrices and Linear Transformations
11.2 Matrix operations
Check matrix shapes before adding, multiplying, or transposing, and compute products row by column.
In Module 11.1, a matrix was a labelled grid of numbers. Now we want to combine such grids. Adding matching entries combines two measurements of the same layout. Multiplying can connect two stages of a calculation: the first stage makes intermediate values, and the second stage uses them to make final values. The shapes tell us whether those intermediate values match up.
This is intermediate linear algebra. Work through OpenStax's matrix-operation examples after learning dimensions and indexing.
A basic idea: match the shapes
You may add two matrices only when they have the same shape, adding entries in matching positions. To multiply , imagine taking a vector with entries and producing intermediate values. Then turns those values into outputs. So has shape , has shape , and has shape . The two inner dimensions must match because every intermediate value needs a corresponding weight.
A quick tour of formulas
For equal-shaped matrices, . In a product, choose the row for the output and the column for the input. Multiply entries in matching intermediate positions and add them. For a valid product,
The transpose swaps rows and columns, so an matrix becomes and . This is useful when the same data need to be grouped by columns instead of rows. In general ; reversing the stages can change the result, or even make the product undefined.
Application 1: add and transpose data grids
Two measurement grids are and . Their sum is
Addition combines matching cells; transposition changes the orientation of the data.
Application 2: two operations in sequence
A matrix can also describe a rule that changes every point in the plane; Module 11.4 develops this view. Let rotate a vector a quarter-turn anticlockwise, and stretch its horizontal component. Then
For , while . The rightmost operation acts first, so changing order changes the result.
Resources
| Source | Title | Why read it |
|---|---|---|
| OpenStax | Matrices and matrix operations | Practise addition, products, and transposes. |
Finished this module? Mark it done.
Comments
Stuck on something, spotted a mistake, or found a resource that helped you? Tell us below.
Loading comments