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 #
- what is zero/identity/diagonal matrix?
- what is triangular matrics?
- [strictly/unit] lower/upper triangular
- what is a symmetric matrix?
- how to calculate matrix-vector multiplication?
- the result is depended on matrix or vector?
- how many calculation does it take?