Linear independence
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, random_int_list, kernel_matrix
Let $S = \{\bu_1,\ldots,\bu_k\}$ be a set of finite many vectors.
We say $S$ is linearly independent if the only coefficients $c_1,\ldots, c_k\in\mathbb{R}$ satisfying
$$c_1\bu_1 + \cdots + c_k\bu_k = \bzero$$
is $c_1 = \cdots = c_k = 0$.
(A infinite set of vectors is linearly independent if any finite subsut of it is linearly independent.)
The following are equivalent:
Therefore, intuitively, $S$ is linearly independent means every vector in it is important.
There are other equivalent conditions that is easier to check.
Let $S$ be a set of vectors and $A$ the matrix whose columns are vectors in $S$.
The following are equivalent:
That is, if $\bb = c_1\bu_1 + \cdots + c_k\bu_k = d_1\bu_1 + \cdots + d_k\bu_k$, then $c_1 = d_1$, $\ldots$, and $c_k = d_k$.
3. For any $\bb\in\Col(A)$, the solution to $A\bx = \bb$ is unique.
4. $\ker(A) = \{\bzero\}$.
執行下方程式碼。
矩陣 $\left[\begin{array}{c|c} R & \br \end{array}\right]$ 是 $\left[\begin{array}{c|c} A & \bb \end{array}\right]$ 的最簡階梯形式矩陣。
令 $\bu_1,\ldots,\bu_5$ 為 $A$ 的各行向量。
Run the code below. Let $\left[\begin{array}{c|c} R & \br \end{array}\right]$ be the reduced echelon form of $\left[\begin{array}{c|c} A & \bb \end{array}\right]$. Let $\bu_1,\ldots,\bu_5$ be the columns of $A$.
### code
set_random_seed(0)
print_ans = False
m,n,r = 3,5,2
A = random_good_matrix(m,n,r)
v = vector(random_int_list(5))
b = A * v
Ab = A.augment(b, subdivide=True)
Rr = Ab.rref()
print("[ A | b ] =")
show(Ab)
print("[ R | r ] =")
show(Rr)
if print_ans:
c = kernel_matrix(A).transpose()[0]
print("{} u1 + {} u2 + {} u3 + {} u4 + {} u5 = 0".format(*c))
print("b = {} u1 + {} u2 + {} u3 + {} u4 + {} u5".format(*v))
print("b = {} u1 + {} u2 + {} u3 + {} u4 + {} u5".format(*(v+c)))
for i in range(5):
if c[i] != 0:
first = i
break
print("u%s = -( "%(i+1) +
" + ".join("%s u%s"%(c[i]/c[first], i+1) for i in range(5) if i != first) + " )")
找一群不是全為 $0$ 的數字 $c_1,\ldots,c_5$﹐
使得 $c_1\bu_1 + \cdots + c_5\bu_5 = \bzero$。
Find some numbers $c_1, \ldots, c_5$ that are not all zeros such that $c_1\bu_1 + \cdots + c_5\bu_5 = \bzero$.
已知 $\bb \in \Col(A)$。
找兩群相對應數字不完全一樣的數字 $c_1,\ldots,c_5$ 和 $d_1,\ldots,d_5$﹐
使得 $c_1\bu_1 + \cdots + c_5\bu_5 = d_1\bu_1 + \cdots + d_5\bu_5$。
Suppose $\bb\in\Col(A)$. Find two different sets of numbers $c_1,\ldots,c_5$ and $d_1,\ldots,d_5$ such that $c_1\bu_1 + \cdots + c_5\bu_5 = d_1\bu_1 + \cdots + d_5\bu_5$.
將 $A$ 的其中一個行向量寫成其它行向量的線性組合。
Find a column of $A$ that can be written as a linear combination of other columns.
執行以下程式碼。
令 $S = \{ \bu_1, \bu_2, \bu_3 \}$ 為矩陣 $A$ 的各行向量。
問 $S$ 是否線性獨立。
若是,將 $\bb$ 寫成 $S$ 的線性組合。
若否,找到一個 $S$ 中的向量將其寫成其它向量的線性組合。
Run the code below. Let $S = \{ \bu_1, \bu_2, \bu_3 \}$ be the columns of $A$. Is $S$ linearely independent? If yes, write $\bb$ as a linear combination of $S$. If not, find a vector in $S$ that can be written as a linear combination of other vectors in $S$.
### code
set_random_seed(0)
print_ans = False
ind = choice([True, False])
m,n,r = 5,3,3 if ind else 2
A = random_good_matrix(m,n,r)
print("A =")
show(A)
v = vector(random_int_list(3))
b = A * v
print("b =", b)
if print_ans:
print("Linearly independent?", ind)
if ind:
print("b = " + " + ".join("%s u%s"%(v[i], i+1) for i in range(3)))
else:
c = kernel_matrix(A).transpose()[0]
for i in range(3):
if c[i] != 0:
first = i
break
print("u%s = -( "%(i+1) +
" + ".join("%s u%s"%(c[i]/c[first], i+1) for i in range(3) if i != first) + " )")
以下的例子說明了多項式也有類似地「表示法唯一」的性質。
(有沒有辦法把多項式寫成向量的樣子?)
The following examples demonstrate that a polynomial can be uniquely represented as a linear combination of some given set of polynomials. This is analogous to the fact that a vector can be uniquely represented as a linear combination of a linearly independent set of vectors. (Can you translate a polynomial into a vectors?)
證明一個二次多項式 $f(x)$ 如果可以寫成 $c_0 + c_1(x-1) + c_2(x-1)^2$ 的樣子。
則 $c_0,c_1,c_2$ 的選擇唯一。
Show that if a polynomial $f(x)$ of degree at most $2$ can be written as $c_0 + c_1(x-1) + c_2(x-1)^2$, then the choice of $c_0, c_1, c_2$ is unique.
令
$$ \begin{aligned} f_1(x) &= \frac{(x-2)(x-3)}{(1-2)(1-3)}, \\ f_2(x) &= \frac{(x-1)(x-3)}{(2-1)(2-3)}, \\ f_3(x) &= \frac{(x-1)(x-2)}{(3-1)(3-2)}. \\ \end{aligned} $$證明一個二次多項式 $f(x)$ 如果可以寫成 $c_1f_1(x) + c_2f_2(x) + c_3f_3(x)$ 的樣子。
則 $c_1,c_2,c_3$ 的選擇唯一。
Let
$$ \begin{aligned} f_1(x) &= \frac{(x-2)(x-3)}{(1-2)(1-3)}, \\ f_2(x) &= \frac{(x-1)(x-3)}{(2-1)(2-3)}, \\ f_3(x) &= \frac{(x-1)(x-2)}{(3-1)(3-2)}. \\ \end{aligned} $$Show that if a polynomial $f(x)$ of degree at most $2$ can be written as $c_1f_1(x) + c_2f_2(x) + c_3f_3(x)$, then the choice of $c_1, c_2, c_3$ is unique.
證明以下敘述等價:
Show that the following are equivalent:
證明以下敘述等價:
That is, if $\bb = c_1\bu_1 + \cdots + c_k\bu_k = d_1\bu_1 + \cdots + d_k\bu_k$, then $c_1 = d_1$, $\ldots$, and $c_k = d_k$.
3. For any $\bb\in\Col(A)$, the solution to $A\bx = \bb$ is unique.
4. $\ker(A) = \{\bzero\}$.
Show that the following are equivalent:
That is, if $\bb = c_1\bu_1 + \cdots + c_k\bu_k = d_1\bu_1 + \cdots + d_k\bu_k$, then $c_1 = d_1$, $\ldots$, and $c_k = d_k$.
3. For any $\bb\in\Col(A)$, the solution to $A\bx = \bb$ is unique.
4. $\ker(A) = \{\bzero\}$.
若 $A$ 是一個 $2\times 2$ 的矩陣且 $\det(A) \neq 0$。
證明 $A$ 的行向量所形成的集合是線性獨立的。
Suppose $A$ is a $2\times 2$ matrix with $\det(A) \neq 0$. Show that the columns of $A$ form a linearly independent set.
若 $A$ 是一個 $3\times 3$ 的矩陣且 $\det(A) \neq 0$。
證明 $A$ 的行向量所形成的集合是線性獨立的。
Suppose $A$ is a $3\times 3$ matrix with $\det(A) \neq 0$. Show that the columns of $A$ form a linearly independent set.