Column space of a matrix
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, draw_span
Let
$$A = \begin{bmatrix}
| & ~ & | \\
\bu_1 & \cdots & \bu_n \\
| & ~ & | \\
\end{bmatrix}$$
be an $m\times n$ matrix and
$$\bv = \begin{bmatrix} c_1 \\ \vdots \\ c_n \end{bmatrix}$$
a vector in $\mathbb{R}^n$.
Then
$$A\bv = c_1\bu_1 + \cdots + c_n\bu_n.$$
Thus,
$$\{A\bv: \bv\in\mathbb{R}^n\} = \vspan(\{\bu_1, \ldots, \bu_n\}),$$
which is called the column space $\Col(A)$ of $A$.
Therefore,
the equation $A\bv = \bb$ has a solution if and only if $\bb\in\Col(A)$.
A \ b
執行下方程式碼。
令 $\bu_1$ 及 $\bu_2$ 為 $A$ 的行向量。
原點為橘色點、
從原點延伸出去的紅色向量和淡藍色向量分別為 $\bu_1$ 和 $\bu_2$。
黑色向量為 $\bb$。
問 $A\bv = \bb$ 的 $\bv$ 是否有解?
若有解﹐求 $\bv$。
Run the code below. Let $\bu_1$ and $\bu_2$ be the column vectors of $A$. Let the origin be the oragne point. Let $\bu_1$ and $\bu_2$ be the red and blue vectors with its tails at the origin. Let $\bb$ be the black vector. Is there a solution for $\bv$ to $A\bv = \bb$? If yes, find $\bv$.
### code
set_random_seed(0)
print_ans = False
while True:
l = random_int_list(9)
Ae = matrix(3, l)
if Ae.det() != 0:
break
u1 = vector(Ae[:,0])
u2 = vector(Ae[:,1])
u3 = vector(Ae[:,2])
A = Ae[:,:2]
inside = choice([0,1,1])
coefs = random_int_list(2, 2)
if inside:
b = coefs[0]*u1 + coefs[1]*u2
else:
b = coefs[0]*u1 + coefs[1]*u2 + 3*u3
print("A =")
print(A)
print("b =", b)
pic = draw_span([u1,u2])
pic += arrow((0,0,0), b, width=5, color="black")
show(pic)
if print_ans:
if inside:
print("It has a solution v = %s."%vector(coefs[:2]))
else:
print("It has no solution.")
令
$$ A = \begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{bmatrix}\text{ and } \bb = \begin{bmatrix}3\\9\\15\end{bmatrix}. $$判斷 $\bb$ 是否在 $\Col(A)$ 中、
並給出說明。
Let
$$ A = \begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{bmatrix}\text{ and } \bb = \begin{bmatrix}3\\9\\15\end{bmatrix}. $$Determine if $\bb$ is in $\Col(A)$. Provide your reasons.
令
$$ A = \begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{bmatrix}\text{ and } \bb = \begin{bmatrix}1\\1\\1\end{bmatrix}. $$判斷 $\bb$ 是否在 $\Col(A)$ 中、
並給出說明。
Let
$$ A = \begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{bmatrix}\text{ and } \bb = \begin{bmatrix}1\\1\\1\end{bmatrix}. $$Determine if $\bb$ is in $\Col(A)$. Provide your reasons.
令
$$ A = \begin{bmatrix} 0 & 1 & 0 & 1 \\ 1 & 0 & 1 & 0 \\ 0 & 1 & 0 & 1 \\ 1 & 0 & 1 & 0 \\ \end{bmatrix}\text{ and } \bb = \begin{bmatrix}2\\2\\2\\2\end{bmatrix}. $$判斷 $\bb$ 是否在 $\Col(A)$ 中、
並給出說明。
Let
$$ A = \begin{bmatrix} 0 & 1 & 0 & 1 \\ 1 & 0 & 1 & 0 \\ 0 & 1 & 0 & 1 \\ 1 & 0 & 1 & 0 \\ \end{bmatrix}\text{ and } \bb = \begin{bmatrix}2\\2\\2\\2\end{bmatrix}. $$Determine if $\bb$ is in $\Col(A)$. Provide your reasons.
令
$$ A = \begin{bmatrix} 1 & 2 \\ 1 & 2 \\ \end{bmatrix}\text{ and } \bb = \begin{bmatrix}3\\4\end{bmatrix}. $$給出一些直覺的敘述﹐說明 $\bb\notin\Col(A)$。
Let
$$ A = \begin{bmatrix} 1 & 2 \\ 1 & 2 \\ \end{bmatrix}\text{ and } \bb = \begin{bmatrix}3\\4\end{bmatrix}. $$Give some intuitive reason showing that $\bb\notin\Col(A)$.
令
$$ A = \begin{bmatrix} 1 & 1 \\ 1 & 1 \\ -1 & -1 \\ -1 & -1 \\ \end{bmatrix}\text{ and } \bb = \begin{bmatrix}0\\0\\1\\2\end{bmatrix}. $$給出一些直覺的敘述﹐說明 $\bb\notin\Col(A)$。
Let
$$ A = \begin{bmatrix} 1 & 1 \\ 1 & 1 \\ -1 & -1 \\ -1 & -1 \\ \end{bmatrix}\text{ and } \bb = \begin{bmatrix}0\\0\\1\\2\end{bmatrix}. $$Give some intuitive reason showing that $\bb\notin\Col(A)$.
令
$$ A = \begin{bmatrix} -1 & -1 & -1 \\ 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \\ \end{bmatrix}\text{ and } \bb = \begin{bmatrix}-4\\1\\1\\1\end{bmatrix}. $$給出一些直覺的敘述﹐說明 $\bb\notin\Col(A)$。
Let
$$ A = \begin{bmatrix} -1 & -1 & -1 \\ 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \\ \end{bmatrix}\text{ and } \bb = \begin{bmatrix}-4\\1\\1\\1\end{bmatrix}. $$Give some intuitive reason showing that $\bb\notin\Col(A)$.
以下的小題探討哪些向量刪除以後不會影響生成出來的子空間。
令
且 $S = \{\bu_1,\ldots,\bu_4\}$ 為 $A$ 的所有行向量。
The following problems studies the columns whose removal will not change the column space. Let
$$ A = \begin{bmatrix} 1 & -1 & 1 & 0 \\ 1 & 1 & 0 & -1 \\ 1 & 0 & -1 & 1 \\ \end{bmatrix} $$and $S = \{\bu_1,\ldots,\bu_4\}$ the columns of $A$.
對 $S$ 中的每一個 $\bu_i$ 逐個檢查﹐
哪一個 $\bu_i \in \vspan(S\setminus\{\bu_i\})$。
根據上一節的練習﹐
如果扣掉一個這樣的 $\bu_i$ 並不會影響生成出來的子空間。
For each vector $\bu_i$ in $S$, check if $\bu_i$ is in $\vspan(S\setminus\{\bu_i\})$.
According to the previous section, the removal of such $\bu_i$ will not change the column space.
經過計算﹐
$$ A \begin{bmatrix}0\\1\\1\\1\end{bmatrix} = \bzero. $$也就是 $1\bu_2 + 1\bu_3 + 1\bu_4 = \bzero$。
用這個等式來說明
$\bu_2, \bu_3, \bu_4$ 中刪掉任何一個都不會影響生成出來的子空間。
By direct computation, we know
$$ A \begin{bmatrix}0\\1\\1\\1\end{bmatrix} = \bzero. $$That is, $1\bu_2 + 1\bu_3 + 1\bu_4 = \bzero$. Use this equality to explain that the removal of any of $\bu_2$, $\bu_3$, or $\bu_4$ will not change the column space.
令 $A'$ 為 $A$ 的前三行組成的矩陣。
我們己知 $\Col(A') = \Col(A)$。
經過解方程式的計算可以發現 $\ker(A') = \{\bzero\}$。
利用這個性質說明 $A'$ 的行之中
沒辦法再拿掉任何一行
但同時保持行空間。
Let $A'$ be the matrix induced on the first three columns of $A$. Recall that $\Col(A') = \Col(A)$. By solving the equation $A\bx = \bzero$, we know that $\ker(A') = \{\bzero\}$. Use this property to show that the removal of any column in $A'$ will change the column space.
令 $A$ 為任一矩陣且
$S = \{\bu_1,\ldots,\bu_n\}$ 為其所有行向量。
證明以下敘述等價:
Let $A$ be a matrix and $S = \{\bu_1,\ldots,\bu_n\}$ its columns. Prove that the following are equivalent:
令 $A = \begin{bmatrix}
a & b \\
c & d \\
\end{bmatrix}$。
定義 $\det(A) = ad - bc$。
說明若 $\det(A) \neq 0$﹐則 $\Col(A) = \mathbb{R}^2$ 。
Let $A = \begin{bmatrix} a & b \\ c & d \\ \end{bmatrix}$. Define $\det(A) = ad - bc$. Show that if $\det(A) \neq 0$ then $\Col(A) = \mathbb{R}^2$.
令 $A = \begin{bmatrix}
a & b & c \\
d & e & f \\
i & j & k \\
\end{bmatrix}$。
定義 $\det(A) = aek + bfi + cdj - cei - dbk - afj$。
說明若 $\det(A) \neq 0$﹐則 $\Col(A) = \mathbb{R}^3$ 。
Let $A = \begin{bmatrix} a & b & c \\ d & e & f \\ i & j & k \\ \end{bmatrix}$. Define $\det(A) = aek + bfi + cdj - cei - dbk - afj$. Show that if $\det(A) \neq 0$ then $\Col(A) = \mathbb{R}^3$.