Matrix Operations

  1. Examples:

    1. $\text{tr}\Big(\begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix}\Big) = 1 + 1 + 1 = 3.$

    2. $\text{tr}\Big(\begin{bmatrix} \log 5 & 0 & 0 & 0 \\ 7 & 1.11 & 0 & 0 \\ 0 & \frac{1}{2} & 2^{100} & 0 \\ 0.4 & 9e2 & 0 & 1\end{bmatrix}\Big) = \log 5 + 1.11 + 2^{100} + 1 \approx 2^{100}.$

    Fun Class Activity:
    1. We defined the trace operation on square matrices only. Suggest a trace definition for non-square matrices $A_{n \times m}$:
      • First, describe it shortly using words (still without math symbols).
      • Next, use math symbols to explain how the trace is computed.
      • Finally, analyze the runtime of your algorithm.