$\mathbb{R}^n$ 中的矩陣表示法¶

Matrix representation in $\mathbb{R}^n$

Creative Commons License
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}}$

In [ ]:
from lingeo import random_int_list, random_good_matrix

Main idea¶

Recall that if $f : \mathbb{R}^n \rightarrow \mathbb{R}^m$ is a linear function and $\{ \be_1,\ldots, \be_n\}$ is the standard basis of $\mathbb{R}^n$, then the matrix

$$ [f] = \begin{bmatrix} | & ~ & | \\ f(\be_1) & \cdots & f(\be_n) \\ | & ~ & | \\ \end{bmatrix} $$

has the property that $f(\bb) = [f]\bb$ for all $\bb\in\mathbb{R}^n$.

Sometimes $f(\be_i)$ cannot be easily found, while the function $f$ is described by the bases of $\mathbb{R}^n$ and $\mathbb{R}^m$ instead.
Let $f : \mathbb{R}^n \rightarrow \mathbb{R}^m$ be a linear function,
$\alpha = \{ \bv_1, \ldots, \bv_n \}$ be a basis of $\mathbb{R}^n$, and
$\beta$ a basis of $\mathbb{R}^m$.
Then the matrix

$$ [f]_\alpha^\beta = \begin{bmatrix} | & ~ & | \\ [f(\bv_1)]_\beta & \cdots & [f(\bv_n)]_\beta \\ | & ~ & | \\ \end{bmatrix} $$

has the property that $[f(\bb)]_\beta = [f]_\alpha^\beta [\bb]_\alpha$.
Therefore, we call $[f]_\alpha^\beta$ the matrix representation of $f$ with respect to $\alpha$ and $\beta$.

The equality can be visualized by the following diagram.

$$ \begin{array}{ccc} \bb & \xrightarrow{f} & f(\bb) \\ \downarrow & ~ & \downarrow \\ [\bb]_\alpha & \xrightarrow{[f]_\alpha^\beta\cdot\square} & [f(\bb)]_\beta \\ \end{array} $$

Let $\mathcal{E}_n$ and $\mathcal{E}_m$ be the standard basis of $\mathbb{R}^n$ and $\mathbb{R}^m$, respectively. Since we know

  • $[f]\bb =f(\bb)$,
  • $[\idmap]_{\mathcal{E}_n}^\alpha \bb = [\bb]_\alpha$,
  • $[\idmap]_{\mathcal{E}_m}^\beta f(\bb) = [f(\bb)]_\beta$.

We know $[f] = ([\idmap]_{\mathcal{E}_m}^\beta)^{-1} [f]_\alpha^\beta [\idmap]_{\mathcal{E}_n}^\alpha = [\idmap]_\beta^{\mathcal{E}_m} [f]_\alpha^\beta ([\idmap]_\alpha^{\mathcal{E}_n})^{-1}$.

Side stories¶

  • projection

Experiments¶

Exercise 1¶

執行以下程式碼。
已知 $f$ 為 $\mathbb{R}^3$ 到 $\mathbb{R}^2$ 的線性函數﹐
而 $\alpha$ 和 $\beta$ 分別為 $\mathbb{R}^3$ 和 $\mathbb{R}^2$ 的一組基底。

Run the code below. Let $f: \mathbb{R}^3 \rightarrow \mathbb{R}^2$ be a linear function. Let $\alpha$ and $\beta$ be bases of $\mathbb{R}^3$ and $\mathbb{R}^2$, respectively.
In [ ]:
### code
set_random_seed(0)
print_ans = False
m,n = 2,3
alpha = random_good_matrix(n,n,n, bound=3)
beta = random_good_matrix(m,m,m, bound=3)
A = matrix(m, random_int_list(m*n))
v = vector(random_int_list(n, 3))
b = alpha * v

print("alpha contains %s vectors:"%n)
for j in range(n):
    print("v%s ="%(j+1), alpha.column(j))

print("beta contains %s vectors:"%m)
for i in range(m):
    print("u%s ="%(i+1), beta.column(i))

for j in range(n):
    print( "f(v%s) = "%(j+1) + " + ".join("%s u%s"%(A[i,j],i+1) for i in range(m)) )
    
print("b =", b)

if print_ans:
    print("[b]_alpha =", v)
    print("[f(b)]_beta =", A*v)
    print("f(b) =", beta * A * v)
    print("[f]_alpha^beta =")
    show(A)
    print("[f] =")
    show(beta * A * alpha.inverse())
Exercise 1(a)¶

求 $[\bb]_\alpha$、$[f(\bb)]_\beta$、及 $f(\bb)$。

Find $[\bb]_\alpha$, $[f(\bb)]_\beta$, and $f(\bb)$.
Exercise 1(b)¶

求 $[f]_\alpha^\beta$ 及 $[f]$。

Find $[f]_\alpha^\beta$ 及 $[f]$.

Exercises¶

Exercise 2¶

令 $f : \mathbb{R}^n \rightarrow \mathbb{R}^m$ 為一線性函數、
$\alpha = \{\bv_1, \ldots, \bv_n\}$ 為 $\mathbb{R}^n$ 的一組基底、
$\beta = \{\bu_1, \ldots, \bu_m\}$ 為 $\mathbb{R}^m$ 的一組基底。

Let $f : \mathbb{R}^n \rightarrow \mathbb{R}^m$ be a linear function, $\alpha = \{\bv_1, \ldots, \bv_n\}$ a basis of $\mathbb{R}^n$, and $\beta = \{\bu_1, \ldots, \bu_m\}$ a basis of $\mathbb{R}^m$.
Exercise 2(a)¶

令 $m = n = 3$ 且
$\alpha = \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} $$

的各行向量。
已知
$f(\bv_1) = \bu_1$、
$f(\bv_2) = \bu_2$、
$f(\bv_3) = \bzero$。
求 $[f]_\alpha^\beta$ 及 $[f]$ 並說明 $f$ 的作用。

Let $m = n = 3$ and $\alpha = \beta$ the columns of $$ 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}. $$ Suppose $f(\bv_1) = \bu_1$, $f(\bv_2) = \bu_2$, and $f(\bv_3) = \bzero$. Find $[f]_\alpha^\beta$ and $[f]$. Then describe the effect of $f$.
Exercise 2(b)¶

令 $m = n = 3$ 且
$\alpha = \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} $$

的各行向量。
已知
$f(\bv_1) = \bu_1$、
$f(\bv_2) = \bu_2$、
$f(\bv_3) = -\bu_3$。
求 $[f]_\alpha^\beta$ 及 $[f]$ 並說明 $f$ 的作用。

Let $m = n = 3$ and $\alpha = \beta$ the columns of $$ 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}. $$ Suppose $f(\bv_1) = \bu_1$, $f(\bv_2) = \bu_2$, and $f(\bv_3) = -\bu_3$. Find $[f]_\alpha^\beta$ and $[f]$. Then describe the effect of $f$.
Exercise 2(c)¶

令 $m = n = 3$ 且
$\alpha = \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} $$

的各行向量。
已知
$f(\bv_1) = \bu_2$、
$f(\bv_2) = -\bu_1$、
$f(\bv_3) = \bu_3$。
求 $[f]_\alpha^\beta$ 及 $[f]$ 並說明 $f$ 的作用。

Let $m = n = 3$ and $\alpha = \beta$ the columns of $$ 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} $$ Suppose $f(\bv_1) = \bu_2$, $f(\bv_2) = -\bu_1$, and $f(\bv_3) = \bu_3$. Find $[f]_\alpha^\beta$ and $[f]$. Then describe the effect of $f$.
Exercise 2(d)¶

令 $m = 3$、$n = 2$ 且
$\alpha$ 為

$$ 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$ 為

$$ B = \begin{bmatrix} 1 & 1 \\ 0 & 1 \\ \end{bmatrix} $$

的各行向量。
已知
$f(\bv_1) = 3\bu_1$、
$f(\bv_2) = 4\bu_2$、
$f(\bv_3) = \bzero$。
求 $[f]_\alpha^\beta$ 及 $[f]$。

Let $m = 3$, $n = 2$, $\alpha$ the columns of $$ 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} $$ and $\beta$ the columns of $$ B = \begin{bmatrix} 1 & 1 \\ 0 & 1 \\ \end{bmatrix} $$ Suppose $f(\bv_1) = 3\bu_1$, $f(\bv_2) = 4\bu_2$, and $f(\bv_3) = \bzero$. Find $[f]_\alpha^\beta$ and $[f]$. Then describe the effect of $f$.
Exercise 3¶

若 $f : \mathbb{R}^n \rightarrow \mathbb{R}^m$ 為一線性函數。
而 $\mathcal{E}_n$ 和 $\mathcal{E}_m$ 分別為 $\mathbb{R}^n$ 和 $\mathbb{R}^m$ 的一組基底。
說明 $[f]$ 就是 $[f]_{\mathcal{E}_n}^{\mathcal{E}_m}$。

Let $f : \mathbb{R}^n \rightarrow \mathbb{R}^m$ be a linear function. Let $\mathcal{E}_n$ and $\mathcal{E}_m$ be the standard bases of $\mathbb{R}^n$ and $\mathbb{R}^m$, respectively. Verify that $[f]$ is indeed $[f]_{\mathcal{E}_n}^{\mathcal{E}_m}$.