Lesson 3 Matrix Operations

3.2 Lecture Notes

3.2.1 Matrix Notation: \(A_{m \times n}\)

  • A matrix is a rectangular array of numbers arranged in rows and columns.
  • The notation \(A_{m \times n}\) refers to a matrix with:
    • \(m\) rows
    • \(n\) columns
  • Example: \[ A_{2 \times 3} = \begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{bmatrix} \]

3.2.2 Notation for Matrix Entries: \(a_{ij}\)

  • Each element in a matrix is denoted as \(a_{ij}\):
    • \(i\) is the row number
    • \(j\) is the column number
  • Example: \[ A = \begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{bmatrix}, \] then \[ a_{23} = 6 \;\;\;\;\; \text{and} a_{12} = 2. \]

3.2.3 Matrix Addition and Subtraction

  • Two matrices can only be added or subtracted if they have the same dimensions.
  • Add/subtract corresponding elements: \[ A + B = \begin{bmatrix} a_{ij} + b_{ij} \end{bmatrix} \]
  • Example: \[ \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} + \begin{bmatrix} 5 & 6 \\ 7 & 8 \end{bmatrix} = \begin{bmatrix} 6 & 8 \\ 10 & 12 \end{bmatrix} \]

3.2.4 Scalar Multiplication

  • Multiply each element of a matrix by a scalar value \(c\): \[ cA = \begin{bmatrix} c \cdot a_{ij} \end{bmatrix} \]
  • Example: \[ 3 \cdot \begin{bmatrix} 2 & -1 \\ 0 & 4 \end{bmatrix} = \begin{bmatrix} 6 & -3 \\ 0 & 12 \end{bmatrix} \]

3.2.5 Matrix Multiplication

  • To multiply \(A_{m \times n}\) by \(B_{n \times p}\), the number of columns of A must equal the number of rows of B.
  • The result is a matrix \(C_{m \times p}\).
  • Each element \(c_{ij}\) is computed by the dot product of row \(i\) of \(A\) and column \(j\) of \(B\): \[ c_{ij} = \sum_{k=1}^n a_{ik} b_{kj} \]
  • Example: \[ \begin{bmatrix} 2 & -1 \\ 0 & 4 \end{bmatrix} \cdot \begin{bmatrix} 6 & -3 \\ 0 & 12 \end{bmatrix} = \begin{bmatrix} 2 \cdot 6 + (-1) \cdot 0 & 2 \cdot (-3) + (-1) \cdot 12 \\ 0 \cdot 6 + 4 \cdot 0 & 0 \cdot (-3) + 4 \cdot 12 \end{bmatrix} = \begin{bmatrix} 6 & -18 \\ 0 & 48 \end{bmatrix} \]

3.2.6 Matrix Transpose

  • The transpose of a matrix \(A\) is denoted \(A^T\).
  • Rows become columns and columns become rows: \[ A = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} \quad \Rightarrow \quad A^T = \begin{bmatrix} 1 & 3 \\ 2 & 4 \end{bmatrix} \]

3.2.7 \(a_{ij}\) Notation for Operations

  • This is used to define operations element by element:
    • Addition: \((A + B)_{ij} = a_{ij} + b_{ij}\)
    • Scalar multiplication: \((cA)_{ij} = c \cdot a_{ij}\)
    • Transpose: \((A^T)_{ij} = a_{ji}\)

3.3 Examples

3.3.1 Addition and Subtraction

Video: Solutions

  1. Evaluate:

\[ \begin{bmatrix} 15 & -10 \\ 11 & -2 \end{bmatrix} \quad + \quad \begin{bmatrix} 18 & 2 \\ 5 & -4 \end{bmatrix} \]

  1. Given the matrices, find \(A + B\):

\[ A = \begin{bmatrix} 0 & 4 \\ 4 & 0 \end{bmatrix} \quad\text{and}\quad B = \begin{bmatrix} 5 & 5 \\ 1 & 4 \end{bmatrix} \]

  1. Add:

\[ \begin{bmatrix} 7 & 4 & 5 \\ -6 & -3 & 3 \\ -1 & 8 & 3 \end{bmatrix} \quad + \quad \begin{bmatrix} 6 & 3 & 0 \\ -2 & -5 & 2 \\ -5 & 7 & 7 \end{bmatrix} \]

  1. Evaluate:

\[ \begin{bmatrix} -7 & -4 \\ -9 & 4 \end{bmatrix} - \begin{bmatrix} x & y \\ z & w \end{bmatrix} = \begin{bmatrix} -16 & -12 \\ 1 & -2 \end{bmatrix} \]

  1. Let:

\[ D = \begin{bmatrix} 3 & 1 & -7 & 2 \\ 4 & -4 & 10 & -1 \\ -5 & -9 & 6 & -10 \end{bmatrix}. \]

Find \(2D\).

  1. Given:

\[ A = \begin{bmatrix} -11 & -2 & -3 \\ -5 & -1 & 0 \\ 5 & 1 & 1 \end{bmatrix}, \]

find \(A^T\) (the transpose of \(A\)).


3.3.2 Multiplication

Video: Solutions

  1. Suppose matrix \(P\) is \(2 \times 3\), \(C\) is \(2 \times 2\), and \(A\) is \(2 \times 3\).

Which of the following may be possible to compute?

  1. \(P(A + C)\)
  2. \(PA\)
  3. \(AP\)
  4. \(PC\)
  5. \(A^T\)
  6. \(CA\)
  7. \(P(AC)\)
  8. \(A^{-1}\)
  1. Compute: \[ \begin{bmatrix} 2 & 1 \\ 5 & 1 \end{bmatrix} \begin{bmatrix} 0 & 5 \\ 5 & -1 \end{bmatrix} \]

  2. Compute:

\[ \begin{bmatrix} -3 & 1 & -3 \\ -2 & -2 & 2 \\ -5 & -3 & 1 \end{bmatrix} \begin{bmatrix} 4 & 0 & -2 \\ 3 & -1 & 2 \\ -3 & -1 & -3 \end{bmatrix} \]

  1. Find \(AB\), given \[ A = \begin{bmatrix} 1 & -2 \\ -5 & -2 \\ 0 & 1 \\ -4 & -2 \end{bmatrix}, \quad \text{and} \quad B = \begin{bmatrix} -4 & -5 & 3 & 1 \\ 2 & 5 & 0 & 4 \end{bmatrix} \]

  2. Find \(AB\) and \(BA\), given \[ A = \begin{bmatrix} 1 \\ 0 \\ 4 \\ -2 \end{bmatrix}, \quad B = \begin{bmatrix} 6 & -7 & -1 & 8 \end{bmatrix} \]

  3. Let: \[ M = \begin{bmatrix} 4 & -3 & 0 \\ 2 & -1 & 5 \end{bmatrix} \]

    1. If \(A = M + M^T\), then \(A\) is a symmetric matrix. Yes / No
    2. If \(B = M \cdot M^T\), then \(B\) is a symmetric matrix. Yes / No
    3. Find \(B\).

3.4 Practice Problems

  1. Let
    \[ A = \begin{bmatrix} 0 & -1 \\ 1 & 0 \\ -1 & 2 \end{bmatrix}, \quad B = \begin{bmatrix} 0.25 & -1 \\ 0 & 0.5 \\ -1 & 3 \end{bmatrix}, \quad C = \begin{bmatrix} 1 & -1 \\ 1 & 1 \\ -1 & -1 \end{bmatrix} \] Calculate:

    1. \(A + B\)
    2. \(A - C\)
    3. \(3A\)
    4. \(2A + 0.5C\)
    5. \(C^T + B^T\)
  2. A matrix is symmetric if it equals its transpose. Give examples of nonzero symmetric \(2 \times 2\) and \(3 \times 3\) matrices.

  3. Compute (if possible):
    \[ \begin{bmatrix} 0 & 1 & -1 \\ 3 & 1 & -1 \end{bmatrix} \times \begin{bmatrix} 1 & 1 \\ 4 & 2 \\ 0 & 1 \end{bmatrix} \]

  4. Compute (if possible):
    \[ \begin{bmatrix} 0 & 1 & -1 & 2 \end{bmatrix} \times \begin{bmatrix} 1 & -2 & 1 \\ 0 & 1 & 3 \\ 6 & 0 & 2 \\ -1 & -2 & 11 \end{bmatrix} \]

  5. Let
    \[ A = \begin{bmatrix} 0 & 1 & 1 & 1 \\ 0 & 0 & 1 & 1 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 0 & 0 \end{bmatrix} \]
    Compute \(A^2\), \(A^3\), \(A^4\), and \(A^{100}\).

  6. (Applied) Left Coast Bookstore has two stores with inventory of hardcover, softcover, and plastic books. Given starting stock, sales, and restocking monthly amounts,

    1. Find total sales over 6 months by store and book type.
    2. Find inventory at the end of June.
    3. Compute total revenue if hardcover sells for $30, softcover for $10, plastic for $15.

3.5 Self-Assessment

Time yourself and solve within 20 minutes:

  1. Given matrices \(A, B, C\) from earlier, calculate:

    1. \(A + B - C\)
    2. \(3B^T\)
    3. \(A^T + C^T\)
    4. \(3A^T - 2C^T\)
    5. \(2A + 3B\)
  2. A matrix is skew-symmetric if it equals the negative of its transpose. Give examples of nonzero skew-symmetric \(2 \times 2\) and \(3 \times 3\) matrices.

  3. Explain why this product is impossible:
    \[ \begin{bmatrix} 0 & 2 & -1 \end{bmatrix} \times \begin{bmatrix} 1 & -2 & 1 \\ -1 & -2 & 11 \end{bmatrix} \]

  4. Compute the product:
    \[ \begin{bmatrix} 1 & 1 & -7 & 0 \\ -1 & 0 & -2 & 1 \\ 1 & -1 & 1 & 1 \end{bmatrix} \times \begin{bmatrix} 1 \\ -3 \\ 2 \\ 1 \end{bmatrix} \]

  5. Karen Sandberg sold various T-shirts. Use matrix operations to compute her total revenue.


3.6 Lesson Checklist

This checklist is designed to help you keep track of what you need to work on. The main goal is to be aware of what you need to focus more attention on. Place an \(X\) in the appropriate box beside the skill below.

\[\begin{align*} &\textbf{Developing (D):} &&\textrm{You still need to work on this skill.}\\ &\textbf{Consistent (CON):} &&\textrm{You use the skill correctly most of the time.}\\ &\textbf{Competent (COM):} &&\textrm{You show mastery of the skill.} \end{align*}\]

Skill D CON COM
Addition, subtraction, scalar multiplication
Matrix multiplication
Applied problems using matrices