Math ClubMath Club
v1 · padrão canônico

Lesson 32 — Matrix Operations

Sum, scalar multiplication, matrix product. Multiplication as composition of linear transformations.

Used in: 1.º ano EM (álgebra linear elementar) · Equiv. Math I japonês cap. matrizes · Equiv. Klasse 11 alemã (Matrizen)

(AB)ij=k=1naikbkj(AB)_{ij} = \sum_{k=1}^{n} a_{ik} b_{kj}
Choose your door

Rigorous notation, full derivation, hypotheses

Operations

Sum and difference

For matrices of the same dimension: (A+B)ij=aij+bij(A + B)_{ij} = a_{ij} + b_{ij}

Scalar multiplication

(αA)ij=αaij(\alpha A)_{ij} = \alpha \cdot a_{ij}

Matrix product

Defined only when the number of columns of AA = number of rows of BB: Am×nBn×p=(AB)m×pA_{m \times n} \cdot B_{n \times p} = (AB)_{m \times p}

(AB)ij=k=1naikbkj\boxed{(AB)_{ij} = \sum_{k=1}^n a_{ik} b_{kj}}

Properties

OperationProperty
Sumcommutative, associative, identity OO
Scalardistributive: α(A+B)=αA+αB\alpha(A+B) = \alpha A + \alpha B
Productassociative: (AB)C=A(BC)(AB)C = A(BC)
Productdistributive: A(B+C)=AB+ACA(B+C) = AB + AC
ProductNOT commutative in general
IdentityAI=IA=AAI = IA = A
ZeroAO=OA=OAO = OA = O

Why the matrix product is "weird"

Because it corresponds to composition of linear transformations: applying first BB and then AA is the same as applying ABAB. Order matters because composition matters.

Powers

An=AAAA^n = A \cdot A \cdots A (nn times), A0=IA^0 = I. Defined only for square matrices.

Exercise list

46 exercises · 11 with worked solution (25%)

Application 27Understanding 5Modeling 10Challenge 3Proof 1
  1. Ex. 32.1Application
    Compute (1234)+(5102)\begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} + \begin{pmatrix} 5 & -1 \\ 0 & 2 \end{pmatrix}. (Ans: (6136)\begin{pmatrix} 6 & 1 \\ 3 & 6 \end{pmatrix}.)
  2. Ex. 32.2ApplicationAnswer key
    Compute 3(2110)3 \cdot \begin{pmatrix} 2 & 1 \\ -1 & 0 \end{pmatrix}.
  3. Ex. 32.3Application
    Compute (1234)(5678)\begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} \cdot \begin{pmatrix} 5 & 6 \\ 7 & 8 \end{pmatrix}. (Ans: (19224350)\begin{pmatrix} 19 & 22 \\ 43 & 50 \end{pmatrix}.)
  4. Ex. 32.4Application
    Compute (1234)(1001)\begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} \cdot \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix} — what do you get?
  5. Ex. 32.5ApplicationAnswer key
    Compute (1234)(0000)\begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} \cdot \begin{pmatrix} 0 & 0 \\ 0 & 0 \end{pmatrix}.
  6. Ex. 32.6Application
    Multiply a 2×32 \times 3 matrix by a 3×23 \times 2 — what is the result's dimension? (Ans: 2×22 \times 2.)
  7. Ex. 32.7Application
    Compute (123456)(789)\begin{pmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{pmatrix} \cdot \begin{pmatrix} 7 \\ 8 \\ 9 \end{pmatrix}. (Ans: (50122)\begin{pmatrix} 50 \\ 122 \end{pmatrix}.)
  8. Ex. 32.8Application
    Verify ABBAAB \neq BA for A=(1101)A = \begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix}, B=(1011)B = \begin{pmatrix} 1 & 0 \\ 1 & 1 \end{pmatrix}.
  9. Ex. 32.9ApplicationAnswer key
    A2A^2 for A=(0110)A = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}. (Ans: II.)
  10. Ex. 32.10Application
    Compute (A+B)2(A + B)^2 and (A2+2AB+B2)(A^2 + 2AB + B^2). When do they coincide? (When AB=BAAB = BA.)
  11. Ex. 32.11Application
    Compute (1234)2\begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}^2.
  12. Ex. 32.12Application
    Multiply (cosθsinθsinθcosθ)\begin{pmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{pmatrix} by (10)\begin{pmatrix} 1 \\ 0 \end{pmatrix}. (Ans: (cosθ,sinθ)T(\cos\theta, \sin\theta)^T.)
  13. Ex. 32.13ApplicationAnswer key
    Compute the product (1000)(0001)\begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix} \cdot \begin{pmatrix} 0 & 0 \\ 0 & 1 \end{pmatrix}.
  14. Ex. 32.14Application
    Verify distributivity: A(B+C)=AB+ACA(B+C) = AB + AC for A=(1201)A = \begin{pmatrix} 1 & 2 \\ 0 & 1 \end{pmatrix}, B,CB, C of your choice.
  15. Ex. 32.15Application
    For A2×3A_{2 \times 3} and B3×4B_{3 \times 4}, dimension of ABAB? And BABA? (BABA does not exist.)
  16. Ex. 32.16Application
    Compute (2003)(45)\begin{pmatrix} 2 & 0 \\ 0 & 3 \end{pmatrix} \cdot \begin{pmatrix} 4 \\ 5 \end{pmatrix}.
  17. Ex. 32.17ApplicationAnswer key
    Show that the product of two diagonal matrices is diagonal — compute explicitly.
  18. Ex. 32.18Application
    Compute (1201)3\begin{pmatrix} 1 & 2 \\ 0 & 1 \end{pmatrix}^3.
  19. Ex. 32.19Application
    Compute (1101)n\begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix}^n — find a general formula in terms of nn. (Ans: (1n01)\begin{pmatrix} 1 & n \\ 0 & 1 \end{pmatrix}.)
  20. Ex. 32.20ApplicationAnswer key
    For which A2×2A_{2\times 2} does A2=AA^2 = A hold? (Idempotent — projection.) Give two examples.
  21. Ex. 32.21Application
    Compute (2134)(1012)\begin{pmatrix} 2 & -1 \\ 3 & 4 \end{pmatrix} \begin{pmatrix} 1 & 0 \\ -1 & 2 \end{pmatrix}.
  22. Ex. 32.22Application
    Compute (123)(456)\begin{pmatrix} 1 \\ 2 \\ 3 \end{pmatrix} \begin{pmatrix} 4 & 5 & 6 \end{pmatrix} — outer product, dimension 3×33 \times 3.
  23. Ex. 32.23ApplicationAnswer key
    Compute (456)(123)\begin{pmatrix} 4 & 5 & 6 \end{pmatrix} \begin{pmatrix} 1 \\ 2 \\ 3 \end{pmatrix} — inner product, dimension 1×11 \times 1. (Ans: 3232.)
  24. Ex. 32.24Application
    Compute A4A^4 for A=(0110)A = \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix}. (Ans: II.)
  25. Ex. 32.25Application
    Find A2A^2 for A=(010001000)A = \begin{pmatrix} 0 & 1 & 0 \\ 0 & 0 & 1 \\ 0 & 0 & 0 \end{pmatrix}. And A3A^3? (Nilpotent.)
  26. Ex. 32.26Application
    Verify (AB)T=BTAT(AB)^T = B^T A^T for A=(1234)A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}, B=(0110)B = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}.
  27. Ex. 32.27Application
    Compute (cosαsinαsinαcosα)(cosβsinβsinβcosβ)\begin{pmatrix} \cos\alpha & -\sin\alpha \\ \sin\alpha & \cos\alpha \end{pmatrix} \begin{pmatrix} \cos\beta & -\sin\beta \\ \sin\beta & \cos\beta \end{pmatrix} — verify it gives a rotation by α+β\alpha + \beta.
  28. Ex. 32.28Understanding
    Show that multiplying by the identity matrix does not change the matrix. (Direct from the definition.)
  29. Ex. 32.29Understanding
    Show that the zero matrix multiplied gives the zero matrix.
  30. Ex. 32.30Understanding
    Show that if AA is diagonal and BB is diagonal, ABAB is diagonal and the diagonal entries multiply.
  31. Ex. 32.31UnderstandingAnswer key
    Show that if AA is upper-triangular and BB is upper-triangular, ABAB is upper-triangular.
  32. Ex. 32.32Understanding
    Show that tr(AB)=tr(BA)\text{tr}(AB) = \text{tr}(BA) even when ABBAAB \neq BA.
  33. Ex. 32.33Modeling
    On a team, players score goals GG and assists AA. Score: goal ×3\times 3 + assist ×1\times 1. Model as a matrix product.
  34. Ex. 32.34Modeling
    In a neural network, layer y=Wx+b\mathbf{y} = W\mathbf{x} + \mathbf{b}. For WM10×5W \in M_{10 \times 5}, what is the dimension of x\mathbf x and y\mathbf y?
  35. Ex. 32.35Modeling
    Markov chain: distribution π\pi' = πP\pi P. If π=(0.5,0.5)\pi = (0.5, 0.5) and P=(0.90.10.20.8)P = \begin{pmatrix} 0.9 & 0.1 \\ 0.2 & 0.8 \end{pmatrix}, compute π\pi'.
  36. Ex. 32.36Modeling
    Rotation in the plane: (cosθsinθsinθcosθ)(xy)\begin{pmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{pmatrix} \cdot \begin{pmatrix} x \\ y \end{pmatrix} rotates (x,y)(x, y) by θ\theta. Apply it to (1,0)(1, 0) with θ=π/2\theta = \pi/2.
  37. Ex. 32.37ModelingAnswer key
    PageRank iterates vn+1=Mvn\mathbf v_{n+1} = M \mathbf v_n with MM stochastic. What is the eigenvector of MM used for?
  38. Ex. 32.38Modeling
    In CG, 2D affine transformation: T(x)=Ax+tT(\mathbf x) = A\mathbf x + \mathbf t. How can it be represented via a 3×33\times 3 matrix applied to (x,y,1)T(x, y, 1)^T?
  39. Ex. 32.39ModelingAnswer key
    In economics, input-output matrix: x=Ax+d\mathbf x = A\mathbf x + \mathbf dx=(IA)1d\mathbf x = (I-A)^{-1}\mathbf d. What computational cost?
  40. Ex. 32.40ModelingAnswer key
    In finance, returns r=Rw\mathbf r = R \mathbf w where RR is the matrix of returns by asset × scenario. Model.
  41. Ex. 32.41Modeling
    RGB image H×W×3H \times W \times 3. Conversion to grayscale: g=0.299r+0.587g+0.114bg = 0.299 r + 0.587 g + 0.114 b. How to express it as a matrix product?
  42. Ex. 32.42Modeling
    In control, system xk+1=Axk+Buk\mathbf x_{k+1} = A\mathbf x_k + B\mathbf u_k. After 3 steps, x3\mathbf x_3 as a function of x0,u0,u1,u2\mathbf x_0, \mathbf u_0, \mathbf u_1, \mathbf u_2.
  43. Ex. 32.43Challenge
    Find A0A \neq 0 and B0B \neq 0 such that AB=0AB = 0 (matrix zero divisors).
  44. Ex. 32.44Challenge
    Find AIA \neq I such that A2=IA^2 = I (non-trivial involution).
  45. Ex. 32.45Challenge
    Show that if AB=IAB = I for square A,BA, B, then BA=IBA = I as well (not trivial — depends on finite dimensionality).
  46. Ex. 32.46Proof
    Prove associativity: (AB)C=A(BC)(AB)C = A(BC) via k\sum_k and switching order of sums.

Sources

Updated on 2026-04-30 · Author(s): Clube da Matemática

Found an error? Open an issue on GitHub or submit a PR — open source forever.