🔢

Understanding Matrix and Vector Operations

Aug 3, 2024

Matrix and Vector Operations

Introduction to Matrices

  • Definition: A matrix is an array of numbers, specifically a two-dimensional array.
  • Dimensions: An m by n matrix has:
    • m: Number of rows
    • n: Number of columns

Structure of a Matrix

  • General form of an m x n matrix A:
    • A = [ a<sub>11</sub> a<sub>12</sub> ... a<sub>1n</sub>
      a<sub>21</sub> a<sub>22</sub> ... a<sub>2n</sub>
      ...
      a<sub>m1</sub> a<sub>m2</sub> ... a<sub>mn</sub> ]
  • Total Entries: The total number of entries in the matrix = m * n*

Matrix-Vector Multiplication

  • The operation we will focus on is multiplying a matrix A by a vector x.

Conditions for Multiplication

  • The vector x must have the same number of components (n) as the number of columns in matrix A.
  • Vector Form: x = [ x<sub>1</sub>, x<sub>2</sub>, ..., x<sub>n</sub> ]

Definition of Matrix-Vector Product

  • The product A * x results in a new vector b:
    • b<sub>1</sub> = a<sub>11</sub>x<sub>1</sub> + a<sub>12</sub>x<sub>2</sub> + ... + a<sub>1n</sub>x<sub>n</sub>
    • b<sub>2</sub> = a<sub>21</sub>x<sub>1</sub> + a<sub>22</sub>x<sub>2</sub> + ... + a<sub>2n</sub>x<sub>n</sub>
    • ...
    • b<sub>m</sub> = a<sub>m1</sub>x<sub>1</sub> + a<sub>m2</sub>x<sub>2</sub> + ... + a<sub>mn</sub>x<sub>n</sub>*

Resulting Vector

  • The resulting vector b has m entries, one for each row of the matrix A.

Dot Product Relation

  • The product can be viewed as the dot product of row vectors of the matrix A with the vector x.
  • This can be formally viewed using transposes:
    • A = [ a<sub>1</sub> a<sub>2</sub> ... a<sub>m</sub> ]
    • a<sub>i</sub> is the i-th row vector of A.
    • The operation A * x = a<sub>1</sub> • x, a<sub>2</sub> • x, ..., a<sub>m</sub> • x*

Example Calculation

  • Given a matrix A and vector x:
    • A = [ [-3, 0, 3, 2], [1, 7, -1, 9] ]
    • x = [2, -3, 4, -1]
  • Calculation of A * x:
    • b<sub>1</sub> = -6 + 0 + 12 - 2 = 4
    • b<sub>2</sub> = 2 - 21 - 4 - 9 = -32
    • Result: b = [4, -32]*

Interpretation of Matrix-Vector Products

  • Two interpretations:
    1. Dot Product Interpretation: Each entry of the resulting vector is a dot product of a row vector from A with vector x.
    2. Linear Combination Interpretation: The product A * x can be viewed as a linear combination of the column vectors of A, weighted by the components of vector x.*

Conclusion

  • Understanding matrix-vector multiplication provides insight into how matrices can transform vectors and the underlying operations involved.