Finding the homogeneous solutions
This work by Jephian Lin is licensed under a Creative Commons Attribution 4.0 International License.
$\newcommand{\trans}{^\top} \newcommand{\adj}{^{\rm adj}} \newcommand{\cof}{^{\rm cof}} \newcommand{\inp}[2]{\left\langle#1,#2\right\rangle} \newcommand{\dunion}{\mathbin{\dot\cup}} \newcommand{\bzero}{\mathbf{0}} \newcommand{\bone}{\mathbf{1}} \newcommand{\ba}{\mathbf{a}} \newcommand{\bb}{\mathbf{b}} \newcommand{\bc}{\mathbf{c}} \newcommand{\bd}{\mathbf{d}} \newcommand{\be}{\mathbf{e}} \newcommand{\bh}{\mathbf{h}} \newcommand{\bp}{\mathbf{p}} \newcommand{\bq}{\mathbf{q}} \newcommand{\br}{\mathbf{r}} \newcommand{\bx}{\mathbf{x}} \newcommand{\by}{\mathbf{y}} \newcommand{\bz}{\mathbf{z}} \newcommand{\bu}{\mathbf{u}} \newcommand{\bv}{\mathbf{v}} \newcommand{\bw}{\mathbf{w}} \newcommand{\tr}{\operatorname{tr}} \newcommand{\nul}{\operatorname{null}} \newcommand{\rank}{\operatorname{rank}} %\newcommand{\ker}{\operatorname{ker}} \newcommand{\range}{\operatorname{range}} \newcommand{\Col}{\operatorname{Col}} \newcommand{\Row}{\operatorname{Row}} \newcommand{\spec}{\operatorname{spec}} \newcommand{\vspan}{\operatorname{span}} \newcommand{\Vol}{\operatorname{Vol}} \newcommand{\sgn}{\operatorname{sgn}} \newcommand{\idmap}{\operatorname{id}} \newcommand{\am}{\operatorname{am}} \newcommand{\gm}{\operatorname{gm}} \newcommand{\mult}{\operatorname{mult}} \newcommand{\iner}{\operatorname{iner}}$
from lingeo import random_good_matrix, betak_solver
Let $A$ be an $m\times n$ matrix and $\bb$ a vector in $\mathbb{R}^n$.
Recall that the homogeneous solutions are the solutions to $A\bx = \bzero$, which is irrelavent to $\bb$.
That is, the homogeneous solutions form the set $\ker(A)$.
Let $R$ be the reduced echelon form of $A$.
Suppose $x_{i_1},\ldots, x_{i_k}$ are the free variables.
For each $s = 1,\ldots, k$, we obtained $\bh_s$ as follows:
Then $\ker(A) = \vspan(\{\bh_1,\ldots,\bh_k\})$.
Since the set of solutions to $A\bx = \bb$ is $\bp + \ker(A)$ for some particular solution $\bp$, $$\{ \bx\in\mathbb{R}^n : A\bx = \bb \} = \{ \bp + c_1\bh_1 + \cdots + c_k\bh_k : c_1,\ldots,c_k\in\mathbb{R} \}.$$
Suppose $\bb\in\Col(A)$.
The following are equivalent:
Since $A\bx = \bzero$ always has a trivial solution $A\bzero = \bzero$, , the followin are equivalent:
執行下方程式碼。
矩陣 $R$ 是 $A$ 的最簡階梯形式矩陣。
利用 Main idea 中說明的方法找出 $\{\bh_1,\ldots,\bh_k\}$。
Run the code below. Let $R$ be the reduced echelon form of $A$. Use the instructions in Main ideato find $\{\bh_1,\ldots,\bh_k\}$.
### code
set_random_seed(0)
print_ans = False
A, R, pivots = random_good_matrix(3,5,2, return_answer=True)
print("A =")
show(A)
print("R =")
show(R)
if print_ans:
free = [i for i in range(5) if i not in pivots]
print("Free variables are xi with i =", free)
for i in range(len(free)):
hi = betak_solver(R, free, i+1)
print("h%s ="%(i+1), vector(hi))
令 $A$ 為一 $m\times n$ 矩陣而 $R$ 為其最簡階梯形式矩陣。
考慮方程式 $A\bx = \bzero$。
若 $R$ 有 $r$ 個軸﹐則可以算出 $\ker(A)$ 的生成集 $S = \{\bh_1,\ldots,\bh_{n-r}\}$。
令 $H$ 為一 $n\times (n-r)$ 矩陣其和行向量依序為 $S$ 中的各項量。
可以執行以下程式碼看例子。
Let $A$ be an $m\times n$ matrix and $R$ its reduced echelon form. Consider the equation $A\bx = \bzero$. Suppose $R$ has $r$ pivots. Then $\ker(A)$ can be spanned by a set $S = \{\bh_1,\ldots,\bh_{n-r}\}$. Let $H$ be the $n\times (n-r)$ matrix whose columns are vectors in $S$.
See some examples by running the code below.
### code
set_random_seed(0)
A, R, pivots = random_good_matrix(5,7,4,return_answer=True)
free = [i for i in range(7) if i not in pivots]
H = zero_matrix(QQ, 7, 3)
for i in range(3):
H[:,i] = betak_solver(R, free, i+1)
print("A =")
show(A)
print("R =")
show(R)
print("H =")
show(H)
把 $R$ 中的前 $r$ 列取出來
(也就是那些非零的列向量)、
再從中把對應到領導變數的那些行向量拿出來﹐
組成一個 $r\times r$ 矩陣。
這個矩陣長什麼樣子?說明為什麼?
Obtain the $r\times r$ matrix from $R$ by taking the first $r$ rows (i.e., those nonzero rows) and those columns corresponding to the leading variables. How does this matrix look like? Provide your reasons.
把 $H$ 對應到自由變數的那些列向量拿出來﹐
組成一個 $(n-r)\times (n-r)$ 矩陣。
這個矩陣長什麼樣子?說明為什麼?
Obtain the $(n-r)\times (n-r)$ matrix from $H$ by taking those rows corresponding to the free variables. How does this matrix look like? Provide your reasons.
把 $R$ 中的前 $r$ 列取出來
(也就是那些非零的列向量)、
再從中把對應到自由變數的那些行向量拿出來﹐
組成一個 $r\times (n-r)$ 矩陣、稱作 $R'$。
另一方面,把 $H$ 中對應到領導變數的列向量拿出來﹐
組成一個 $r\times (n-r)$ 矩陣、稱作 $H'$。
這兩個矩陣 $R'$ 和 $H'$ 有什麼關係?說明為什麼?
Let $R'$ be the $r\times (n-r)$ matrix obtained from $R$ by taking the first $r$ rows (i.e., those nonzero rows) and those columns corresponding to the free variables.
Let $H'$ be the $r\times (n-r)$ matrix obtained from $H$ by taking those rows corresponding to the leading variables.
Is there any relation between $R'$ and $H'$? Provide your reasons.
執行以下程式碼。
已知 $\bb\in\Col(A)$。
驗證以下關於唯一解的問題。
Run the code below. Suppose $\bb\in\Col(A)$. Verify the following statements regarding the uniqueness.
### code
set_random_seed(0)
A = random_good_matrix(5,3,3)
b = A * vector([1,1,1])
print("A =")
show(A)
print("b =", b)
若 $f(x) = c_0 + c_1 x + c_2 x^2$。
若 $f(1) = b_1$、
$f(2) = b_2$、
$f(3) = b_3$。
說明不論 $b_1$、$b_2$、$b_3$ 給的是多少﹐$c_0$、$c_1$、$c_2$ 都有唯一解。
Let $f(x) = c_0 + c_1 x + c_2 x^2$. Suppose $f(1) = b_1$, $f(2) = b_2$, and $f(3) = b_3$. Explain why $c_0$, $c_1$, and $c_2$ are solvable annd unique regardless the choice of $b_1$, $b_2$, and $b_3$.
若 $f(x) = c_0 + c_1 x + c_2 x^2$。
若 $x_1$、$x_2$、$x_3$ 為三相異實數且
$f(x_1) = b_1$、
$f(x_2) = b_2$、
$f(x_3) = b_3$。
說明不論 $b_1$、$b_2$、$b_3$ 給的是多少﹐$c_0$、$c_1$、$c_2$ 都有唯一解。
Let $f(x) = c_0 + c_1 x + c_2 x^2$. Suppose $x_1$, $x_2$, and $x_3$ are distinct real numbers and $f(1) = b_1$, $f(2) = b_2$, and $f(3) = b_3$. Explain why $c_0$, $c_1$, and $c_2$ are solvable annd unique regardless the choice of $b_1$, $b_2$, and $b_3$.