MathClario
← Back to College prep
College prepπŸ”€Algebra●●●○○· 6 min
πŸ”’

Matrices: addition, multiplication, transpose

The 3 basic matrix operations. Dimension rules, non-commutativity, transpose.

Addition: same dimension

A+BA + B makes sense only if AA and BB have the same dimension. Add coefficient by coefficient.

(1234)+(5678)=(681012)\begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} + \begin{pmatrix} 5 & 6 \\ 7 & 8 \end{pmatrix} = \begin{pmatrix} 6 & 8 \\ 10 & 12 \end{pmatrix}

Properties: commutative, associative, neutral element 00 (zero matrix).

Scalar multiplication

Ξ»A\lambda A: multiply every coefficient by Ξ»\lambda.

3Γ—(1234)=(36912)3 \times \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} = \begin{pmatrix} 3 & 6 \\ 9 & 12 \end{pmatrix}

Matrix product: compatible dimensions

AΓ—BA \times B makes sense iff columns of AA = rows of BB.

If AA is (n,p)(n, p) and BB is (p,q)(p, q), then ABAB is (n,q)(n, q).

Formula: (AB)ij=βˆ‘k=1paikbkj(AB)_{ij} = \sum_{k=1}^{p} a_{ik} b_{kj} (row ii of AA Γ— column jj of BB).

Example (2,2)Γ—(2,2)(2,2) \times (2,2)

(1234)Γ—(5678)=(19224350)\begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} \times \begin{pmatrix} 5 & 6 \\ 7 & 8 \end{pmatrix} = \begin{pmatrix} 19 & 22 \\ 43 & 50 \end{pmatrix}

Detail: 1Γ—5+2Γ—7=191 \times 5 + 2 \times 7 = 19, 1Γ—6+2Γ—8=221 \times 6 + 2 \times 8 = 22, etc.

⚠️ Non-commutativity

AB≠BAAB \neq BA in general! Even when both products exist.

(0100)(0010)=(1000)\begin{pmatrix} 0 & 1 \\ 0 & 0 \end{pmatrix} \begin{pmatrix} 0 & 0 \\ 1 & 0 \end{pmatrix} = \begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix}

(0010)(0100)=(0001)\begin{pmatrix} 0 & 0 \\ 1 & 0 \end{pmatrix} \begin{pmatrix} 0 & 1 \\ 0 & 0 \end{pmatrix} = \begin{pmatrix} 0 & 0 \\ 0 & 1 \end{pmatrix}

Transpose: ATA^T

Swap rows and columns. If AA is (n,p)(n, p), ATA^T is (p,n)(p, n).

A=(123456),AT=(142536)A = \begin{pmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{pmatrix}, \quad A^T = \begin{pmatrix} 1 & 4 \\ 2 & 5 \\ 3 & 6 \end{pmatrix}

Properties:

  • (A+B)T=AT+BT(A + B)^T = A^T + B^T
  • (Ξ»A)T=Ξ»AT(\lambda A)^T = \lambda A^T
  • (AB)T=BTAT(AB)^T = B^T A^T (reversed order!)
  • (AT)T=A(A^T)^T = A

Common mistakes

  1. Adding A(2,3)+B(3,2)A(2,3) + B(3,2): different dimensions, impossible.
  2. Writing AB=BAAB = BA: false except in special cases.
  3. (AB)T=ATBT(AB)^T = A^T B^T: NO, it’s BTATB^T A^T.
  4. Forgetting row Γ— column in the matrix product.
?Γ€ toi de jouer

A is (3, 2) and B is (2, 4). Dimension of AB?

Mini-quiz

Question 1 / 3

A is (2, 3) and B is (3, 5). Dimension of AB?

#matrix#matrix product#transpose#linear algebra

You might also like