第一章:行列式
简单行列式:


三阶行列式:

n 阶行列式:



行列式的性质:






行列式的降阶(按行/按列展开):




![]()
1 import numpy as np
2 import pandas as pd
3 import matplotlib.pyplot as plt
4
5 if 0:
6 d = np.array([
7 [4, 1, 2, 4],
8 [1, 2, 0, 2],
9 [10, 5, 2, 0],
10 [0, 1, 1, 7]
11 ])
12 print(d)
13 print(np.linalg.det(d))
14 pass
15
16 if 1:
17 # 练习2
18 def createD(a, x, n):
19 # 构建函数,生成一个n阶的行列式,其中对角线值为x,其余为a
20 d = np.eye(n)
21 d = d * x
22 d[d == 0] = a
23 return d
24
25
26 d = createD(5, 20, 10)
27 print(d)
28 print(np.linalg.det(d))
29 pass
View Code