目录
  1. 矩阵转置的定义
  2. 矩阵转置的性质
    1. 1.(AT)T=A(A^T)^T=A(AT)T=A
    2. 2.(A+B)T=AT+BT(A+B)^T=A^T+B^T(A+B)T=AT+BT
    3. 3.(λA)T=λAT(\lambda A)^T=\lambda A^T(λA)T=λAT
    4. 4.(AB)T=BTAT(AB)^T=B^TA^T(AB)T=BTAT
    5. 5. 若方阵A满足AT=AA^T=AAT=A,则称A为对称矩阵。A=(aij)nA=(a_{ij})_nA=(aij​)n​为对称矩阵的充要条件是aij=aji(i,j=1,2,⋯ ,n)a_{ij}=a_{ji}(i, j=1, 2, \cdots, n)aij​=aji​(i,j=1,2,⋯,n)
【线代】矩阵转置性质及代码证明

矩阵转置的定义

定义: 把矩阵A的行换成同序列数的列得到一个新矩阵,叫做A的转置矩阵 ,记作ATA^T

矩阵转置的性质

1.(AT)T=A(A^T)^T=A

1
2
3
4
5
6
7
import numpy as np
A = np.random.randint(0, 100, [3, 3])
print((A.T).T == A)
[OUT]:
[[ True True True]
[ True True True]
[ True True True]]

2.(A+B)T=AT+BT(A+B)^T=A^T+B^T

1
2
3
4
5
6
7
8
import numpy as np
A = np.random.randint(0, 100, [3, 3])
B = np.random.randint(0, 100, [3, 3])
print((A+B).T==A.T+B.T)
[OUT]:
[[ True True True]
[ True True True]
[ True True True]]

3.(λA)T=λAT(\lambda A)^T=\lambda A^T

1
2
3
4
5
6
7
8
import numpy as np
A = np.random.randint(0, 100, [3, 3])
lambda_ = 3.14
print((lambda_*A).T == lambda_*A.T)
[OUT]:
[[ True True True]
[ True True True]
[ True True True]]

4.(AB)T=BTAT(AB)^T=B^TA^T

1
2
3
4
5
6
7
import numpy as np
A = np.random.randint(0, 100, [2, 4])
B = np.random.randint(0, 100, [4, 2])
print((A@B).T == B.T@A.T)
[OUT]:
[[ True True]
[ True True]]

5. 若方阵A满足AT=AA^T=A,则称A为对称矩阵。A=(aij)nA=(a_{ij})_n为对称矩阵的充要条件是aij=aji(i,j=1,2,,n)a_{ij}=a_{ji}(i, j=1, 2, \cdots, n)

1
2
3
4
5
6
7
8
9
10
11
12
13
import numpy as np

def symmetric(shape):
matrix = np.triu(np.random.randint(0, 100, shape))
matrix += matrix.T-np.diag(matrix.diagonal())
return matrix

A = symmetric([3, 3])
print(A.T == A)
[OUT]:
[[ True True True]
[ True True True]
[ True True True]]
文章作者: Haibei
文章链接: http://www.haibei.online/posts/540197836.html
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 Haibei的博客
打赏
  • 微信
  • 支付宝

评论