Solution set of $A{\bf x} = {\bf b}$
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_int_list, random_ref
Let $A$ be an $m\times n$ matrix and $\bb$ a vector in $\mathbb{R}^n$.
Recall that $A\bx = \bb$ is equivalent to a system of linear equation.
When $\bb = \bzero$, the system is said to be homogeneous, and
$$\ker(A) = \{\bx\in\mathbb{R}^n : A\bx = \bzero\}.$$
Let $U = \{\bx\in\mathbb{R}^n : A\bx = \bb\}$ be the set of all solutions.
Then $U$ is an affine subspace in $\mathbb{R}^n$.
In fact, $U$ can be written as $\bp + \ker(A)$, where $\bp$ can be any vector in $U$.
We call $U$ the set of general solutions.
When one element is chosen from $U$, it is called a particular solution.
And $\ker(A)$ is called the set of homogeneous solutions.
Equivalently, the solutions set of $A\bx = \bb$ is of the form:
general solutions = particular solution + homogeneous solutions
(a shifted space) (a vector) (a space)
A.nullspace()
### code
set_random_seed(0)
print_ans = False
A = random_ref(3,5,2)
p = vector(random_int_list(5))
b = A * p
h = A.right_kernel().basis()[0]
p1 = p + h
print("A =")
show(A)
print("b =", b)
print("p =", p)
print("h =", h)
print("p1 =", p1)
利用題目給的向量及矩陣,
確認 $\bh$ 在 $\ker(A)$ 中。
計算 $\bp + \bh$ 並驗證它符合 $A(\bp + \bh) = \bb$。
Use the given vectors and matrix and double-check if $\bh$ is in $\ker(A)$. Then compute $\bp + \bh$ and verify $A(\bp + \bh) = \bb$.
如果已知 $A\bp = \bb$。
證明對任意 $\ker(A)$ 中的向量 $\bh$﹐
都有 $A(\bp + \bh) = \bb$。
Suppose $A\bp = \bb$. Show that $A(\bp + \bh) = \bb$ for any $\bh\in\ker(A)$.
利用題目給的向量及矩陣,
確認它符合 $A\bp_1 = \bb$。
計算 $\bp_1 - \bp$ 並驗證它在 $\ker(A)$ 中。
Use the given vectors and matrix and double-check if $A\bp_1 = \bb$. Then compute $\bp_1 - \bp$ and verify it is in $\ker(A)$.
如果已知 $A\bp = \bb$。
證明對任意符合 $A\bp_1 = \bb$ 的向量 $\bp_1$﹐
都有 $\bp_1 - \bp\in\ker(A)$。
Suppose $A\bp = \bb$. Show that $\bp_1 - \bp\in\ker(A)$ for any $\bp_1$ satisfying $A\bp_1 = \bb$.
給定矩陣 $A$ 和向量 $\bb$。
令 $U = \{ \bx: A\bx = \bb \}$。
證明 $V = \{ \bp_1 - \bp_2 : \bp_1, \bp_2 \in U \}$ 是一個子空間。
(因此 $U$ 是一個仿射子空間。)
Let $A$ be a matrix and $\bb$ a vector. Let $U = \{ \bx: A\bx = \bb \}$. Show that $V = \{ \bp_1 - \bp_2 : \bp_1, \bp_2 \in U \}$ is a subspace. (Therefore, $U$ is an affine subspace.)
### code
set_random_seed(0)
A = random_ref(3,5,2)
b = vector(random_int_list(2) + [0])
b1 = b + vector([0,0,1])
print("A =")
show(A)
print("b =", b)
print("b1 =", b1)
湊出一個 $A\bx = \bb$ 的解,稱之作 $\bp$。
Try any method to find a solution to $A\bx = \bb$. Let's call it $\bp$.
利用參數式的方法找出 $\bh_1$、$\bh_2$、$\bh_3$
使得 $\ker(A) = \vspan(\{\bh_1, \bh_2, \bh_3\})$。
Parametrize the equations to find $\bh_1$, $\bh_2$, and $\bh_3$ so that $\ker(A) = \vspan(\{\bh_1, \bh_2, \bh_3\})$.
說明 $A\bx = \bb_1$ 無解。
(儘管 $\ker(A)$ 中有很多向量。)
Explain why $A\bx = \bb_1$ has no solution, even if $\ker(A)$ has infinitely many vectors.
我們現階段對解集合的理解
已經可以告訴我們一些有趣的性質。
Based on what we have so far, we have the following interesting properties.
令 $V$ 為一子空間。
若 $V$ 中至少有兩個向量,
$V$ 中向量的個數是否有可能是有限個?
Let $V$ be a subspace. If $V$ contains at least two vectors, is it possible that $V$ contains only finitely many vectors?
若 $A\bx = \bb$ 至少有兩個解,
全部解的個數是否有可能是有限個?
If $A\bx = \bb$ contains at least two vector, is it possible that the equation has only finitely many solutions?