Math/Linear Algebra
Homogeneous and non-homogeneous systems of linear equations
Homogeneous system Definition Ax = 0 is called homogeneous. Note A homogeneous system always has the trivial solution x = 0. Thm If a homogeneous system has a non-zero solution, then it has $\infty$ solutions. proof. Let $x_0$ be a solution. Then $\alpha x_0$ is also a solution. $\square$ Summary In general, we have no / unique / $\infty$ solutions for sys of lin eqs. For a homogeneous system, w..
The number of solutions in a system of linear equations
Definition rank(A) : # of nonzero rows in a ref(A) A가 $n\times m$ 행렬이라고 할 때, REF의 모양을 생각해보면 rank(A) $\leq$ min(# of rows, # of columns) Note one can define column-operation, column echelon form, rank in terms of columns ... 하지만, 이렇게 정의하면 solution set이 바뀐다. 그럼에도 불구하고 the rank defined by row = the rank defined by columns. The number of solutions in a system of linear equation Let Ax = b be a syste..
Reduced Row Echelon Form (RREF) - Python
def rref(mat): a = [row[:] for row in mat] n, m = len(a), len(a[0]) # Step 1 : ref 만들기 pivot = 0 # 현재 pivot index 기록 for i in range(n): if a[i][pivot] == 0: while pivot < m: zero_column = True for i2 in range(i, n): if a[i2][pivot] != 0: zero_column = False a[i], a[i2] = a[i2], a[i] break if zero_column: pivot += 1 # 열이 모두 0일 경우 pivot을 오른쪽으로 한칸 옮기고 다시 조사 else: break if pivot == m: # 더 이상 pivot을 ..