返回题库

矩阵迹

交换律

专题
General / 综合
难度
L4

题目详情

量化面试题:证明:tr⁡(AB)=tr⁡(BA)\operatorname{tr}(AB)=\operatorname{tr}(BA)。

英文原题

Let AA and BB be square matrices of the same size. Show that the traces of the matrices ABAB and BABA are equal.

解析

按定义

tr⁡(AB)=∑i(AB)ii=∑i∑jAijBji.\operatorname{tr}(AB)=\sum_i (AB)_{ii}=\sum_i\sum_j A_{ij}B_{ji}.

交换求和顺序:

∑i∑jAijBji=∑j∑iBjiAij=∑j(BA)jj=tr⁡(BA).\sum_i\sum_j A_{ij}B_{ji}=\sum_j\sum_i B_{ji}A_{ij}=\sum_j(BA)_{jj}=\operatorname{tr}(BA).

故 tr⁡(AB)=tr⁡(BA)\boxed{\operatorname{tr}(AB)=\operatorname{tr}(BA)}。


英文解析

By definition
tr⁡(AB)=∑i(AB)ii=∑i∑jAijBji.\operatorname{tr}(AB)=\sum_i (AB)_{ii}=\sum_i\sum_j A_{ij}B_{ji}.
Swap the order of summation:
∑i∑jAijBji=∑j∑iBjiAij=∑j(BA)jj=tr⁡(BA).\sum_i\sum_j A_{ij}B_{ji}=\sum_j\sum_i B_{ji}A_{ij}=\sum_j(BA)_{jj}=\operatorname{tr}(BA).
Thus tr⁡(AB)=tr⁡(BA)\boxed{\operatorname{tr}(AB)=\operatorname{tr}(BA)}.