Week 03 - Matrix-Vector Operations

Week 3 - Matrix-Vector Operations #

  • element $a_{i,j}$: the ith row, jth column.

Special Matrices #

  • Special Vectors:

    • Unit Vector: Any vector of length one (unit length). For example, the vector $\begin{pmatrix}\frac{\sqrt{2}}{2} \\ \frac{\sqrt{2}}{2}\end{pmatrix}$ has length one.
    • Standard Unit Vector:

Triangular Matrices #

Transpose Matrix #

Symmetric Matrix #

Scaling a Matrix #

Adding Matrices #

Matrix-vector Multiplication #

    • where $\tilde{a}_i$ is the (column) vector which, when transposed($\tilde{a}_i^T$), becomes the ith row of the matrix.
    • $a_i = \begin{bmatrix} a_{0,i} \\ a_{1,i} \\ \vdots \\ a_{m-1,i} \end{bmatrix}$, $\tilde{a}_ {i} = \begin{bmatrix} a_{i,0} \\ a_{i,1} \\ \vdots \\ a_{i,n-1} \end{bmatrix}$, $\tilde{a}_ {i}^ {T} = \begin{bmatrix} a_{i,0} & a_{i,1} & \ldots & a_{i,n-1} \end{bmatrix},$

Cost of Matrix-Vector Multiplication #

  • Consider $y := Ax+y\\ \text{, where } A \in R^{m \times n}$ :
    • Notice that there is a multiply and an add for every element of A.
    • Since A has $m \times n = mn$ elements, $y := Ax+y$, requires mn multiplies and mn adds, for a total of 2mn floating point operations (flops).

Review Questions #

  1. what is zero/identity/diagonal matrix?
  2. what is triangular matrics?
    1. [strictly/unit] lower/upper triangular
  3. what is a symmetric matrix?
  4. how to calculate matrix-vector multiplication?
    1. the result is depended on matrix or vector?
    2. how many calculation does it take?