Vector representation in $\mathbb{R}^n$
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_good_matrix
Recall that $\mathcal{E}_n = \{ \be_1, \ldots, \be_n \}$ is the standard basis of $\mathbb{R}^n$.
For any vector $\bv = (c_1, \ldots, c_n)\in\mathbb{R}^n$, it can be written as
Similarly, let $\beta = \{ \bu_1, \ldots, \bu_n \}$ be a basis of $\mathbb{R}^n$.
Every vector $\bv\in\mathbb{R}^n$ has a unique way to be written as a linear combination
We call the vector $(c_1,\ldots, c_n)\in\mathbb{R}^n$ the vector representation of $\bv$ with respect to the basis $\beta$, denoted as $[\bv]_\beta$.
Since every vector in $\mathbb{R}^n$ can be written as a linear combinatoin of $\beta$ and the way of writing it is unique, it is a one-to-one correspondence between $\bv$ and $[\bv]_\beta$.
Let let $\beta = \{ \bu_1, \ldots, \bu_n \}$ be a basis of $\mathbb{R}^n$ and
$A$ the $n\times n$ matrix whose columns are vectors in $\beta$.
Since $\beta$ is a basis, $A$ is invertible.
By definition,
When $\beta$ is the standard basis of $\mathbb{R}^n$, $A = I_n$ and $[\bv]_\beta = \bv$.
Therefore, our usual way of writting a vector is the vector representation with respect to the standard basis.
In the case when $\beta$ is an orthonormal basis, $A$ is an orthogonal matrix and $A^{-1} = A\trans$.
Therefore,
執行以下程式碼。
令 $\beta = \{ \bu_1, \ldots, \bu_3 \}$ 為 $A$ 的行向量且
已知其為 $\mathbb{R}^3$ 的基底。
### code
set_random_seed(0)
print_ans = False
m,n,r = 3,3,3
A = random_good_matrix(m,n,r, bound=3)
x1 = vector(random_int_list(n, 3))
x2 = vector(random_int_list(n, 3))
v1,v2 = A*x1, A*x2
k = choice([3,4,5])
print("A =")
show(A)
print("v1 =", v1)
print("v2 =", v2)
print("k =", k)
if print_ans:
Ainv = A.inverse()
print("[v1]_beta =", Ainv * v1)
print("[v2]_beta =", Ainv * v2)
print("[v1 + v2]_beta =", Ainv * (v1 + v2))
print("[v1]_beta + [v2]_beta =", Ainv * v1 + Ainv * v2)
print("[k * v1]_beta =", Ainv * (k*v1))
print("k * [v1]_beta =", k * Ainv * v1)
print("< [v1]_beta, [v2]_beta > =", (Ainv * v1).inner_product(Ainv * v2))
print("< v1, v2 > =", (v1).inner_product(v2))
求出 $[\bv_1]_\beta$ 及 $[\bv_2]_\beta$。
Find $[\bv_1]_\beta$ and $[\bv_2]_\beta$.判斷是否 $[\bv_1 + \bv_2]_\beta = [\bv_1]_\beta + [\bv_2]_\beta$。
Check if $[\bv_1 + \bv_2]_\beta = [\bv_1]_\beta + [\bv_2]_\beta$.判斷是否 $[k\bv_1]_\beta = k[\bv_1]_\beta$。
Check if $[k\bv_1]_\beta = k[\bv_1]_\beta$.判斷是否 $\inp{\bv_1}{\bv_2} = \inp{[\bv_1]_\beta}{[\bv_2]_\beta}$。
Check if $\inp{\bv_1}{\bv_2} = \inp{[\bv_1]_\beta}{[\bv_2]_\beta}$.已知
$$ A = \begin{bmatrix} 1 & 0 & 1 \\ -1 & 1 & -4 \\ 5 & -2 & 12 \end{bmatrix} $$的反矩陣為
$$ A^{-1} = \begin{bmatrix} 4 & -2 & -1 \\ -8 & 7 & 3 \\ -3 & 2 & 1 \end{bmatrix}. $$令 $\beta$ 為 $A$ 的行向量集合。
令 $\bv_1 = (1,1,1)$、
$\bv_2 = (1,2,3)$。
求 $[\bv_1]_\beta$ 和 $[\bv_2]_\beta$。
已知
$$ A = \begin{bmatrix} \frac{1}{\sqrt{3}} & \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}} \\ \frac{1}{\sqrt{3}} & -\frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}} \\ \frac{1}{\sqrt{3}} & 0 & -\frac{2}{\sqrt{6}} \end{bmatrix} $$為一垂直矩陣。
令 $\beta$ 為 $A$ 的行向量集合。
令 $\bv_1 = (1,1,1)$、
$\bv_2 = (1,2,3)$。
求 $[\bv_1]_\beta$ 和 $[\bv_2]_\beta$。
令 $\beta$ 為 $\mathbb{R}^n$ 中的一組基底。
定義
為一函數。
Let $\beta$ be a basis of $\mathbb{R}^n$. Define the function $$ \begin{aligned} f : \mathbb{R}^n &\rightarrow \mathbb{R}^n \\ \bv &\mapsto [\bv]_\beta \\ \end{aligned} $$驗證 $f$ 為一線性函數。
Verify that $f$ is linear.判斷 $f$ 是否是嵌射。
Is $f$ injective?判斷 $f$ 是否是映射。
Is $f$ surjective?求出 $f$ 的矩陣表示法 $[f]$。
Find the matrix representation $[f]$ of $f$.回顧一個內積 $\inp{\cdot}{\cdot}$ 必須符合以下的條件:
令 $\beta$ 為 $\mathbb{R}^n$ 中的一組基底。
定義一個新的雙變數函數 $\inp{\bx}{\by}_\beta = \inp{[\bx]_\beta}{[\by]_\beta}$﹐
其中 $\inp{[\bx]_\beta}{[\by]_\beta}$ 指的是 $\mathbb{R}^n$ 中的標準內積。
驗證 $\inp{\cdot}{\cdot}_\beta$ 也是 $\mathbb{R}^n$ 上的另一種內積。
證明當 $\beta$ 是單位長垂直基底時﹐任意向量都有 $\inp{\bx}{\by}_\beta = \inp{\bx}{\by}$。
Show that if $\beta$ is orthonormal, then $\inp{\bx}{\by}_\beta = \inp{\bx}{\by}$ for any vectors.