112 年 國立臺灣大學資料科學碩士學位學程《工程數學(D)》

📄 試題原卷 免費註冊後即可對照原始考卷 PDF免費註冊

第 1. 題

  1. (Basis and Dimension) This problem concerns the basic definition of vector space, and its basis
    and dimension.
    (a) (5%) Let Zn:={0,1}nZ_n := \{0,1\}^n the set of all n-bit strings for any integer n. The set ZnZ_n forms a
    vector space over Z2Z_2. For example, for vectors 101,001∈Zn101, 001 \in Z_n and scalars 0,1∈Z20,1 \in Z_2, we
    have
    101+001(mod2):=(1+0)(0+0)(1+1)=100∈Zn101 + 001 \pmod 2 := (1+0)(0+0)(1+1) = 100 \in Z_n;
    101⋅1:=(1⋅1)(0⋅1)(1⋅1)=101∈Zn101 \cdot 1 := (1\cdot 1)(0\cdot 1)(1\cdot 1) = 101 \in Z_n;
    101⋅0:=(1⋅0)(0⋅0)(1⋅0)=000∈Zn101 \cdot 0 := (1\cdot 0)(0\cdot 0)(1\cdot 0) = 000 \in Z_n.
    What is the dimension of the vector space ZnZ_n over Z2Z_2? Give a basis of the vector space ZnZ_n over Z2Z_2.
    (b) (5%) We denote '†' by a conjugate transpose. For example:
A=(11+i1−2+i5−i)∈C3×2,A = \begin{pmatrix} 1 & 1+i \\ 1 & -2+i \\ 5 & -i \end{pmatrix} \in \mathbb{C}^{3 \times 2},

then

A†=(1151−i−2−i−i)∈C2×3.A^\dagger = \begin{pmatrix} 1 & 1 & 5 \\ 1-i & -2-i & -i \end{pmatrix} \in \mathbb{C}^{2 \times 3}.

A (possibly complex) matrix A is Hermitian if and only if A†=AA^\dagger = A. Consider a vector
space {A∈Cn×n:A†=A}\{A \in \mathbb{C}^{n \times n} : A^\dagger = A\} over field of real numbers. What is its dimension?

登入後即可作答並保存紀錄。

這一題的完整詳解

核心觀念

本題考查:

  • 向量空間的基底與維度。
  • 向量是否能由一組基底唯一表示。
  • Hermitian 矩陣的定義與自由參數數量。
  • 複數向量空間與實數向量空間的差異。

(a) ZnZ_n over Z2Z_2

解題方法

Zn={0,1}nZ_n=\{0,1\}^n 中的每個元素都是長度為 nn 的二元向量,向量加法採逐項模 22 運算。

取標準單位向量:

e1=(1,0,…,0),e2=(0,1,…,0),…,en=(0,0,…,1).e_1=(1,0,\ldots,0),\quad e_2=(0,1,\ldots,0),\quad \ldots,\quad e_n=(0,0,\ldots,1).

對任意向量

x=(x1,x2,…,xn)∈Zn,x=(x_1,x_2,\ldots,x_n)\in Z_n,

都有

x=x1e1+x2e2+⋯+xnen,x=x_1e_1+x_2e_2+\cdots+x_ne_n,

其中係數 xi∈Z2x_i\in Z_2。

因此,{e1,e2,…,en}\{e_1,e_2,\ldots,e_n\} 可以生成 ZnZ_n。

再檢查線性獨立性。若

c1e1+c2e2+⋯+cnen=0,c_1e_1+c_2e_2+\cdots+c_ne_n=0,

其中 ci∈Z2c_i\in Z_2,比較各座標可得

c1=c2=⋯=cn=0.c_1=c_2=\cdots=c_n=0.

所以這組向量線性獨立,構成 ZnZ_n 的一組基底。

解題技巧

ZnZ_n 的元素共有 2n2^n 個,但「元素個數」不是維度。對有限域 Z2Z_2 而言,若維度為 nn,向量空間元素個數才是 2n2^n。

此處每一個座標都需要一個獨立方向,因此維度為 nn。


(b) Hermitian 矩陣空間 over R\mathbb{R}

核心觀念

Hermitian 矩陣滿足

A†=A,A^\dagger=A,

其中 A†A^\dagger 是共軛轉置。

令

A=(aij)∈Cn×n.A=(a_{ij})\in\mathbb{C}^{n\times n}.

Hermitian 條件等價於

aij=aji‾.a_{ij}=\overline{a_{ji}}.

這個矩陣集合是定義在實數上的向量空間,因此每個複數自由參數要拆成實部與虛部計算。

自由參數計數

1. 對角線元素

當 i=ji=j 時,

aii=aii‾.a_{ii}=\overline{a_{ii}}.

只有實數符合此條件,所以每個對角線元素都是一個實數。

共有

nn

個實數自由參數。

2. 非對角線元素

對每一組 i<ji<j,可任取

aij=xij+iyij,xij,yij∈R.a_{ij}=x_{ij}+iy_{ij}, \qquad x_{ij},y_{ij}\in\mathbb{R}.

由 Hermitian 條件,

aji=aij‾=xij−iyij.a_{ji}=\overline{a_{ij}} =x_{ij}-iy_{ij}.
🔒

後續完整解題步驟與【答案】

免費註冊,享三天全站完整詳解閱覽。

免費註冊

第 2. 題

  1. (Matrix Inversion)
    (a) (5%) Let A be an n×nn \times n non-singular matrix that satisfies A3−4A2+3A−5I=0A^3 - 4A^2 + 3A - 5I = 0.
    Calculate the inverse of A in terms of a polynomial of A.
    (b) (5%) Let ω:=e2πi/n\omega := e^{2\pi i / n} for some integer n and let
B:=(111…11ωω2…ωn−11ω2ω4…ω2(n−1)⋮⋮⋮⋱⋮1ωn−1ω2(n−1)…ω(n−1)(n−1))B := \begin{pmatrix} 1 & 1 & 1 & \dots & 1 \\ 1 & \omega & \omega^2 & \dots & \omega^{n-1} \\ 1 & \omega^2 & \omega^4 & \dots & \omega^{2(n-1)} \\ \vdots & \vdots & \vdots & \ddots & \vdots \\ 1 & \omega^{n-1} & \omega^{2(n-1)} & \dots & \omega^{(n-1)(n-1)} \end{pmatrix}

Calculate the inverse of B. Express your answer in the most simplified form.
(c) (5%) Justify your answers to Problem (b).

登入後即可作答並保存紀錄。

這一題的完整詳解

核心觀念

本題考查兩種矩陣反矩陣的求法:

  1. 利用矩陣滿足的多項式關係,將高次方程式整理成 A−1A^{-1}。
  2. 利用離散傅立葉矩陣的根單位性質,透過幾何級數證明其反矩陣。

(a)利用多項式關係求 A−1A^{-1}

已知 AA 為非奇異矩陣,因此 A−1A^{-1} 存在,且

A3−4A2+3A−5I=0.A^3-4A^2+3A-5I=0.

右乘 A−1A^{-1},得

A3A−1−4A2A−1+3AA−1−5IA−1=0.A^3A^{-1}-4A^2A^{-1}+3AA^{-1}-5IA^{-1}=0.

因為矩陣 AA 的各次方彼此可交換,所以

A2−4A+3I−5A−1=0.A^2-4A+3I-5A^{-1}=0.

移項後得到

5A−1=A2−4A+3I.5A^{-1}=A^2-4A+3I.

因此

A−1=15(A2−4A+3I).\boxed{A^{-1}=\frac{1}{5}\left(A^2-4A+3I\right)}.

解題技巧

看到題目給出

p(A)=0p(A)=0

且常數項非零時,可先將等式乘上 A−1A^{-1},直接降一階。此題的關鍵是常數項為 −5I-5I,因此最後能解出 A−1A^{-1}。


(b)求矩陣 BB 的反矩陣

令矩陣的列、欄編號皆從 00 開始,則 BB 的第 rr 列第 kk 欄元素為

Brk=ωrk,0≤r,k≤n−1.B_{rk}=\omega^{rk}, \qquad 0\leq r,k\leq n-1.

考慮矩陣 CC,其元素定義為

Cks=ω−ks.C_{ks}=\omega^{-ks}.

則矩陣乘積 BCBC 的第 rr 列第 ss 欄元素為

(BC)rs=∑k=0n−1BrkCks=∑k=0n−1ωrkω−ks.(BC)_{rs} = \sum_{k=0}^{n-1}B_{rk}C_{ks} = \sum_{k=0}^{n-1}\omega^{rk}\omega^{-ks}.

整理指數可得

(BC)rs=∑k=0n−1ω(r−s)k.(BC)_{rs} = \sum_{k=0}^{n-1}\omega^{(r-s)k}.

當 r=sr=s 時,

(BC)rr=∑k=0n−11=n.(BC)_{rr} = \sum_{k=0}^{n-1}1 = n.

當 r≠sr\neq s 時,由於 r−sr-s 不是 nn 的倍數,且 ωn=1\omega^n=1,使用幾何級數公式:

∑k=0n−1ω(r−s)k=1−(ωr−s)n1−ωr−s=1−11−ωr−s=0.\sum_{k=0}^{n-1}\omega^{(r-s)k} = \frac{1-\left(\omega^{r-s}\right)^n} {1-\omega^{r-s}} = \frac{1-1}{1-\omega^{r-s}} = 0.

因此

BC=nI.BC=nI.

所以

B−1=1nC.B^{-1}=\frac{1}{n}C.

矩陣 CC 可寫成

🔒

後續完整解題步驟與【答案】

免費註冊,享三天全站完整詳解閱覽。

免費註冊

第 3. 題

  1. (5%) Suppose columns of a matrix A are n vectors in RmR^m. Answer the following questions.
    (Getting 5 points if all answers are correct. Otherwise, 0 point.)
    (a) (True or False) A is an n×mn \times m matrix.
    (b) If the columns are linear independent, what is the rank of A?
    (c) If the columns span RmR^m, what is the rank of A?
    (d) If the columns form a basis for RmR^m, what can you say about the rank, n, and m?
    (e) Suppose A has rank r, it means that A has r ____ columns?
    (f) (True or False) The map T:Rn→RmT: R^n \rightarrow R^m defined by T(x):=AxT(x) := Ax is a linear transform.

登入後即可作答並保存紀錄。

這一題的完整詳解

核心觀念

本題考查線性代數中矩陣維度、行向量(Column Vectors)與秩(Rank)、**基底(Basis)以及矩陣變換之線性性(Linearity)**的基本定義與關聯定理:

  1. 矩陣維度定義:若矩陣 AA 由 nn 個行向量組成,且每個向量屬於 Rm\mathbb{R}^m(即每個向量有 mm 個分量,對應矩陣的列數),則 AA 的維度為 m×nm \times n。
  2. 行空間與秩(Column Space and Rank):
    • 矩陣 AA 的秩定義為其行空間(Column Space, Col⁡(A)\operatorname{Col}(A))的維度,亦即線性獨立行向量的最大數量: rank⁡(A)=dim⁡(Col⁡(A))\operatorname{rank}(A) = \dim(\operatorname{Col}(A))
    • 行滿秩(Full column rank):若 AA 的 nn 個行向量線性獨立,則 rank⁡(A)=n\operatorname{rank}(A) = n。
    • 列滿秩(Full row rank):若 AA 的行向量生成(span)整個 Rm\mathbb{R}^m,即 Col⁡(A)=Rm\operatorname{Col}(A) = \mathbb{R}^m,則 dim⁡(Col⁡(A))=m\dim(\operatorname{Col}(A)) = m,亦即 rank⁡(A)=m\operatorname{rank}(A) = m。
  3. 基底的充要條件:Rm\mathbb{R}^m 的基底是由 mm 個線性獨立且生成 Rm\mathbb{R}^m 的向量所組成的集合。因此,若 nn 個向量構成 Rm\mathbb{R}^m 的基底,則必有 n=mn = m 且 rank⁡(A)=m\operatorname{rank}(A) = m。
  4. 線性變換(Linear Transformation):對於任意 m×nm \times n 實數矩陣 AA,定義映射 T:Rn→RmT: \mathbb{R}^n \rightarrow \mathbb{R}^m 為 T(x)=AxT(x) = Ax。由矩陣乘法對純量乘法與加法的分配律可直接滿足線性性質: T(cx+y)=A(cx+y)=c(Ax)+Ay=cT(x)+T(y)T(c x + y) = A(c x + y) = c(Ax) + Ay = c T(x) + T(y)

解題方法與小題分析

本題為全對才給分的連鎖概念題,每一小題的詳細推導與分析如下:

  • (a) (True or False) AA is an n×mn \times m matrix.

    • 分析:False。
    • 原因:題目指出「columns of a matrix AA are nn vectors in Rm\mathbb{R}^m」,表示矩陣共有 nn 行(columns),且每個行向量均有 mm 個元素(即有 mm 列 rows)。因此,矩陣 AA 的大小為列數乘行數,即 m×nm \times n,而非 n×mn \times m。
  • (b) If the columns are linear independent, what is the rank of AA?

    • 分析:nn。
    • 原因:矩陣的秩 rank⁡(A)\operatorname{rank}(A) 等於其行空間的維度,亦即極大線性獨立行向量的個數。已知此 nn 個行向量線性獨立,因此行空間的維度即為向量個數 nn,故 rank⁡(A)=n\operatorname{rank}(A) = n。
  • (c) If the columns span Rm\mathbb{R}^m, what is the rank of AA?

    • 分析:mm。
    • 原因:AA 的行向量所張成的空間即為 AA 的行空間 Col⁡(A)\operatorname{Col}(A)。
🔒

後續完整解題步驟與【答案】

免費註冊,享三天全站完整詳解閱覽。

免費註冊

第 4. 題

  1. (Eigenvalues and Eigenvectors)
    (a) (5%) Let
A:=(31−113−1−1−13)A := \begin{pmatrix} 3 & 1 & -1 \\ 1 & 3 & -1 \\ -1 & -1 & 3 \end{pmatrix}

Write down the 3 eigenvalues of A with multiplicity in the decreasing order.
(b) (10%) Suppose that an n×nn \times n matrix B satisfies

B:=(abb…bbab…bbba…b⋮⋮⋮⋱⋮bbb…a)B := \begin{pmatrix} a & b & b & \dots & b \\ b & a & b & \dots & b \\ b & b & a & \dots & b \\ \vdots & \vdots & \vdots & \ddots & \vdots \\ b & b & b & \dots & a \end{pmatrix}

where a>0a > 0 and b>0b > 0. Write down all the eigenvalues of B with multiplicity in the
decreasing order in terms of a, b, and n.
(c) (5%) Write down all the eigenvectors associated with the above eigenvalues of B. Note
that each eigenvector has to be normalized to have a unit Euclidean norm.

登入後即可作答並保存紀錄。

這一題的完整詳解

核心觀念

本題考查矩陣的特徵值與特徵向量:

  • 特徵值 λ\lambda 與特徵向量 x≠0\boldsymbol{x}\neq \boldsymbol{0} 滿足
    Ax=λx.A\boldsymbol{x}=\lambda\boldsymbol{x}.
  • 對稱矩陣的不同特徵值所對應的特徵向量互相正交。
  • 形如
    B=(a−b)I+bJB=(a-b)I+bJ
    的矩陣,其中 JJ 為全元素皆為 11 的矩陣,可利用全 11 向量與其正交補空間快速求得特徵值。

解題方法

(a) 矩陣 AA 的特徵值

題目給定

A=(31−113−1−1−13).A= \begin{pmatrix} 3&1&-1\\ 1&3&-1\\ -1&-1&3 \end{pmatrix}.

由於前兩列、前兩行具有對稱性,先考慮向量

v1=(1−10).\boldsymbol{v}_1= \begin{pmatrix} 1\\-1\\0 \end{pmatrix}.

計算得

Av1=(3−11−3−1+1)=(2−20)=2v1.A\boldsymbol{v}_1 = \begin{pmatrix} 3-1\\ 1-3\\ -1+1 \end{pmatrix} = \begin{pmatrix} 2\\-2\\0 \end{pmatrix} = 2\boldsymbol{v}_1.

因此,22 是一個特徵值。

接著考慮第一、二個分量相同的向量

v=(11t).\boldsymbol{v}= \begin{pmatrix} 1\\1\\t \end{pmatrix}.

則

Av=(2−t2−t−2+3t).A\boldsymbol{v} = \begin{pmatrix} 2-t\\ 2-t\\ -2+3t \end{pmatrix}.

若其為特徵向量,必須滿足

Av=λ(11t).A\boldsymbol{v} = \lambda \begin{pmatrix} 1\\1\\t \end{pmatrix}.

因此

λ=2−t,\lambda=2-t,

且

−2+3t=λt=(2−t)t.-2+3t=\lambda t=(2-t)t.

整理得

−2+3t=2t−t2,-2+3t=2t-t^2, t2+t−2=0,t^2+t-2=0, (t−1)(t+2)=0.(t-1)(t+2)=0.

當 t=1t=1

λ=2−1=1.\lambda=2-1=1.

對應特徵向量為

(111).\begin{pmatrix}1\\1\\1\end{pmatrix}.

當 t=−2t=-2

λ=2−(−2)=4.\lambda=2-(-2)=4.

對應特徵向量為

(11−2).\begin{pmatrix}1\\1\\-2\end{pmatrix}.

所以三個特徵值按照遞減順序為

4, 2, 1.\boxed{4,\ 2,\ 1}.

(b) 矩陣 BB 的特徵值

矩陣 BB 為

B=(ab⋯bba⋯b⋮⋮⋱⋮bb⋯a).B= \begin{pmatrix} a&b&\cdots&b\\ b&a&\cdots&b\\ \vdots&\vdots&\ddots&\vdots\\ b&b&\cdots&a \end{pmatrix}.

可寫成

B=(a−b)I+bJ,B=(a-b)I+bJ,

其中 II 為 n×nn\times n 單位矩陣,JJ 為所有元素皆為 11 的矩陣。

令全 11 向量為

e=(11⋮1).\boldsymbol{e}= \begin{pmatrix} 1\\1\\\vdots\\1 \end{pmatrix}.

由於每一列的元素總和為 a+(n−1)ba+(n-1)b,因此

Be=(a+(n−1)b)e.B\boldsymbol{e} = \bigl(a+(n-1)b\bigr)\boldsymbol{e}.

所以

λ1=a+(n−1)b\lambda_1=a+(n-1)b

是一個特徵值。

再考慮任意滿足分量總和為 00 的向量

x=(x1x2⋮xn),x1+x2+⋯+xn=0.\boldsymbol{x}= \begin{pmatrix} x_1\\x_2\\\vdots\\x_n \end{pmatrix}, \qquad x_1+x_2+\cdots+x_n=0.

矩陣乘法的第 ii 個分量為

(Bx)i=axi+b∑j≠ixj.(B\boldsymbol{x})_i =ax_i+b\sum_{j\ne i}x_j.

因為

∑j≠ixj=−xi,\sum_{j\ne i}x_j=-x_i,

所以

(Bx)i=axi−bxi=(a−b)xi.(B\boldsymbol{x})_i =ax_i-bx_i =(a-b)x_i.

因此

Bx=(a−b)x.B\boldsymbol{x}=(a-b)\boldsymbol{x}.

滿足分量總和為 00 的向量形成一個 n−1n-1 維空間,所以 a−ba-b 的代數重數為 n−1n-1。

又因為 a>0a>0、b>0b>0,

a+(n−1)b>a−b,a+(n-1)b>a-b,

故遞減排列為

🔒

後續完整解題步驟與【答案】

免費註冊,享三天全站完整詳解閱覽。

免費註冊

第 5. 題

  1. Consider a random variable X and E[∣X∣]<∞E[|X|] < \infty. Hence, its expectation E[X]E[X] exists. Let us
    denote E[X]E[X] as μX\mu_X for notational simplicity. The absolute deviation from the mean is ∣X−μX∣|X-\mu_X|,
    and its expectation is denoted as
dX:=E[∣X−μX∣].d_X := E[|X - \mu_X|].

Let σX\sigma_X denote the standard deviation of X if it exists.
(a) (5%) Suppose the probability density function of X, fX(t)f_X(t), is proportional to e−∣t∣e^{-|t|}, for
some α>0\alpha > 0. Derive dXd_X in terms of σX\sigma_X.
(b) (5%) Let X be a normal random variable. Derive dXd_X in terms of σX\sigma_X.
(c) (5%) Is it true that for any random variable X with finite variance, dX≤σXd_X \le \sigma_X? If your
answer is "yes", prove it. If your answer is "no", give a counter example.

登入後即可作答並保存紀錄。

這一題的完整詳解

核心觀念

本題比較兩種離均差:

dX=E[∣X−μX∣]d_X=E\left[|X-\mu_X|\right]

與標準差:

σX=E[(X−μX)2].\sigma_X=\sqrt{E\left[(X-\mu_X)^2\right]}.

主要使用:

  1. 對稱分布的平均數為對稱中心。
  2. 常態分布的絕對值期望公式。
  3. Cauchy–Schwarz 不等式:
(E[∣Y∣])2≤E[Y2].\left(E[|Y|]\right)^2\leq E[Y^2].

(a) 機率密度函數與 e−∣t∣e^{-|t|} 成正比

設

fX(t)=αe−∣t∣,α>0.f_X(t)=\alpha e^{-|t|},\qquad \alpha>0.

由機率密度函數總積分必須為 11:

1=∫−∞∞αe−∣t∣ dt=2α∫0∞e−t dt=2α.1=\int_{-\infty}^{\infty}\alpha e^{-|t|}\,dt =2\alpha\int_0^\infty e^{-t}\,dt =2\alpha.

因此

α=12.\alpha=\frac12.

故 XX 的密度函數為

fX(t)=12e−∣t∣.f_X(t)=\frac12e^{-|t|}.

此分布關於 00 對稱,所以

μX=E[X]=0.\mu_X=E[X]=0.

因此

dX=E[∣X∣]=∫−∞∞∣t∣12e−∣t∣ dt.d_X=E[|X|] =\int_{-\infty}^{\infty}|t|\frac12e^{-|t|}\,dt.

利用對稱性:

dX=2∫0∞t12e−t dt=∫0∞te−t dt.d_X =2\int_0^\infty t\frac12e^{-t}\,dt =\int_0^\infty te^{-t}\,dt.

分部積分得

∫0∞te−t dt=[−te−t]0∞+∫0∞e−t dt=1.\int_0^\infty te^{-t}\,dt =\left[-te^{-t}\right]_0^\infty+\int_0^\infty e^{-t}\,dt =1.

接著計算變異數:

σX2=E[X2]=∫−∞∞t212e−∣t∣ dt=∫0∞t2e−t dt.\sigma_X^2=E[X^2] =\int_{-\infty}^{\infty}t^2\frac12e^{-|t|}\,dt =\int_0^\infty t^2e^{-t}\,dt.

由 Gamma 積分公式:

∫0∞t2e−t dt=2!=2.\int_0^\infty t^2e^{-t}\,dt=2!=2.

所以

σX=2.\sigma_X=\sqrt2.

因此

dX=1=σX2.\boxed{d_X=1=\frac{\sigma_X}{\sqrt2}}.

(b) XX 為常態隨機變數

設

X∼N(μX,σX2).X\sim N(\mu_X,\sigma_X^2).

令

Z=X−μXσX,Z=\frac{X-\mu_X}{\sigma_X},

則 Z∼N(0,1)Z\sim N(0,1),且

X−μX=σXZ.X-\mu_X=\sigma_X Z.

因此

dX=E[∣X−μX∣]=σXE[∣Z∣].d_X=E[|X-\mu_X|] =\sigma_XE[|Z|].

標準常態密度為

🔒

後續完整解題步驟與【答案】

免費註冊,享三天全站完整詳解閱覽。

免費註冊

第 6. 題

  1. Let X be continuous random variable with cumulative distribution function FX(t)F_X(t), t ∈ R and
    probability density function fX(t)f_X(t), t ∈ R. Furthermore, fX(t)=fX(−t)f_X(t) = f_X(-t) for any t ∈ R, and
    E[X2]<∞E[X^2] < \infty. Let Y be another random variable, independent of X, that takes values at 1 or
    -1 with equal probability, that is,
Y={1,with probability 1/2−1,with probability 1/2Y = \begin{cases} 1, & \text{with probability } 1/2 \\ -1, & \text{with probability } 1/2 \end{cases}

Let Z = XY, the product of X and Y.
(a) (5%) Are X and Z correlated? Justify your answer rigorously by deriving the covariance
between X and Z.
(b) (5%) Are X and Z independent? Justify your answer rigorously by deriving the joint
cumulative distribution function of X and Z.

登入後即可作答並保存紀錄。

這一題的完整詳解

核心觀念

本題考查:

  • 對稱機率密度函數所造成的分布與期望性質。
  • 共變異數的定義:
    Cov⁡(X,Z)=E[XZ]−E[X]E[Z].\operatorname{Cov}(X,Z)=E[XZ]-E[X]E[Z].
  • 不相關與獨立的區別:獨立一定不相關,但不相關不必然代表獨立。
  • 聯合累積分布函數:
    FX,Z(x,z)=P(X≤x, Z≤z).F_{X,Z}(x,z)=P(X\le x,\ Z\le z).

由 fX(t)=fX(−t)f_X(t)=f_X(-t),可知 XX 的分布關於 00 對稱,因此

FX(−t)=1−FX(t),F_X(-t)=1-F_X(t),

且

E[X]=0.E[X]=0.

又因為 YY 與 XX 獨立,且 YY 以相同機率取 1,−11,-1,所以

E[Y]=0,E[Y2]=1.E[Y]=0,\qquad E[Y^2]=1.

(a) XX 與 ZZ 是否相關?

解題方法

先利用 Z=XYZ=XY 計算 E[Z]E[Z] 與 E[XZ]E[XZ],再代入共變異數公式。

由 XX 與 YY 獨立,

E[Z]=E[XY]=E[X]E[Y]=0.E[Z]=E[XY]=E[X]E[Y]=0.

另一方面,

XZ=X(XY)=X2Y.XZ=X(XY)=X^2Y.

因為 X2X^2 是 XX 的函數,仍與 YY 獨立,故

E[XZ]=E[X2Y]=E[X2]E[Y]=0.E[XZ]=E[X^2Y]=E[X^2]E[Y]=0.

題目給定 E[X2]<∞E[X^2]<\infty,因此上述期望皆存在。代入共變異數:

Cov⁡(X,Z)=E[XZ]−E[X]E[Z]=0−0⋅0=0.\begin{aligned} \operatorname{Cov}(X,Z) &=E[XZ]-E[X]E[Z]\\ &=0-0\cdot 0\\ &=0. \end{aligned}

因此 XX 與 ZZ 不相關。

解題技巧

看到 Z=XYZ=XY 且 YY 是獨立、平均值為 00 的隨機符號時,可直接注意到

E[XZ]=E[X2Y]=E[X2]E[Y]=0.E[XZ]=E[X^2Y]=E[X^2]E[Y]=0.

但必須注意:共變異數為 00 只能得到「不相關」,不能直接推論「獨立」。


(b) XX 與 ZZ 是否獨立?

第一步:求聯合累積分布函數

由 YY 只可能取 11 或 −1-1,分情況計算:

當 Y=1Y=1 時,Z=XZ=X;當 Y=−1Y=-1 時,Z=−XZ=-X。因此

FX,Z(x,z)=P(X≤x, Z≤z)=12P(X≤x, X≤z)+12P(X≤x, −X≤z).\begin{aligned} F_{X,Z}(x,z) &=P(X\le x,\ Z\le z)\\ &=\frac12P(X\le x,\ X\le z) +\frac12P(X\le x,\ -X\le z). \end{aligned}

第一項為

P(X≤x, X≤z)=P(X≤min⁡{x,z})=FX(min⁡{x,z}).P(X\le x,\ X\le z)=P(X\le \min\{x,z\}) =F_X(\min\{x,z\}).

第二項中,−X≤z-X\le z 等價於 X≥−zX\ge -z,因此

P(X≤x, −X≤z)=P(−z≤X≤x).P(X\le x,\ -X\le z) =P(-z\le X\le x).

因為 XX 為連續型隨機變數,

P(−z≤X≤x)={FX(x)−FX(−z),x≥−z,0,x<−z.P(-z\le X\le x) = \begin{cases} F_X(x)-F_X(-z), & x\ge -z,\\ 0, & x<-z. \end{cases}

所以聯合累積分布函數為

🔒

後續完整解題步驟與【答案】

免費註冊,享三天全站完整詳解閱覽。

免費註冊

第 7. 題

  1. Let U be an uniform random variable over the interval (0,1). Given U = u, X1,X2,…X_1, X_2, \dots are
    independent and identically distributed Bernoulli u random variables. Let WnW_n denote the
    number of "1"s in the length-n sequence (X1,X2,…,Xn)(X_1, X_2, \dots, X_n).
    (a) (5%) Derive the conditional probability mass function of (X1,X2,…,Xn,Wn)(X_1, X_2, \dots, X_n, W_n) given U:
    PX1,X2,…,Xn,Wn∣U(x1,x2,…,xn,w∣u)P_{X_1,X_2,\dots,X_n, W_n | U}(x_1, x_2, \dots, x_n, w | u).
    (b) (5%) Derive the conditional probability mass function of (X1,X2,…,Xn)(X_1, X_2, \dots, X_n) given WnW_n:
    PX1,X2,…,Xn∣Wn(x1,x2,…,xn∣w)P_{X_1,X_2,\dots,X_n | W_n}(x_1, x_2, \dots, x_n | w).
    (c) (5%) Derive the moment generating function of WnW_n.
    (d) (5%) Derive the probability mass function of WnW_n.
    (e) (5%) Derive the joint probability mass function of (X1,X2,…,Xn)(X_1, X_2, \dots, X_n):
    PX1,X2,…,Xn(x1,x2,…,xn)P_{X_1,X_2, \dots, X_n}(x_1, x_2, \dots, x_n).

登入後即可作答並保存紀錄。

這一題的完整詳解

核心觀念

本題主要考查以下觀念:

  1. 給定 U=uU=u 時,X1,…,XnX_1,\dots,X_n 為條件獨立且同分布的 Bernoulli(u)(u) 隨機變數。
  2. WnW_n 是前 nn 個觀察值中出現「1」的次數,因此
    Wn=∑i=1nXi.W_n=\sum_{i=1}^{n}X_i.
  3. 利用全機率公式,對 U∼Uniform⁡(0,1)U\sim\operatorname{Uniform}(0,1) 積分,可得到 X1,…,XnX_1,\dots,X_n 與 WnW_n 的邊際分布。
  4. 給定 Wn=wW_n=w 後,所有含有 ww 個「1」的長度 nn 序列具有相同機率。

以下令 xi∈{0,1}x_i\in\{0,1\},並記

wx=∑i=1nxi.w_x=\sum_{i=1}^{n}x_i.


(a)求 (X1,…,Xn,Wn)(X_1,\dots,X_n,W_n) 給定 UU 的條件機率質量函數

給定 U=uU=u 時,各個 XiX_i 條件獨立,且

P(Xi=xi∣U=u)=uxi(1−u)1−xi.P(X_i=x_i\mid U=u)=u^{x_i}(1-u)^{1-x_i}.

因此,

P(X1=x1,…,Xn=xn∣U=u)=∏i=1nuxi(1−u)1−xi.P(X_1=x_1,\dots,X_n=x_n\mid U=u) = \prod_{i=1}^{n}u^{x_i}(1-u)^{1-x_i}.

又因為

Wn=∑i=1nXi,W_n=\sum_{i=1}^{n}X_i,

所以當 x1,…,xnx_1,\dots,x_n 給定時,WnW_n 的值被完全決定。故

P(Wn=w∣X1=x1,…,Xn=xn,U=u)={1,w=∑i=1nxi,0,其他情形.P(W_n=w\mid X_1=x_1,\dots,X_n=x_n,U=u) = \begin{cases} 1, & w=\displaystyle\sum_{i=1}^{n}x_i,\\ 0, & \text{其他情形}. \end{cases}

因此聯合條件機率質量函數為

PX1,…,Xn,Wn∣U(x1,…,xn,w∣u)={∏i=1nuxi(1−u)1−xi,w=∑i=1nxi,0,w≠∑i=1nxi.\begin{aligned} &P_{X_1,\dots,X_n,W_n\mid U}(x_1,\dots,x_n,w\mid u)\\ &\quad= \begin{cases} \displaystyle\prod_{i=1}^{n}u^{x_i}(1-u)^{1-x_i}, & w=\displaystyle\sum_{i=1}^{n}x_i,\\[2ex] 0, & w\ne\displaystyle\sum_{i=1}^{n}x_i. \end{cases} \end{aligned}

也可以寫成

PX1,…,Xn,Wn∣U(x1,…,xn,w∣u)=1{w=∑i=1nxi}u∑i=1nxi(1−u)n−∑i=1nxi.P_{X_1,\dots,X_n,W_n\mid U}(x_1,\dots,x_n,w\mid u) = \mathbf{1}_{\left\{w=\sum_{i=1}^{n}x_i\right\}} u^{\sum_{i=1}^{n}x_i}(1-u)^{n-\sum_{i=1}^{n}x_i}.

其中 1{⋅}\mathbf{1}_{\{\cdot\}} 為指示函數。


(b)求 (X1,…,Xn)(X_1,\dots,X_n) 給定 WnW_n 的條件機率質量函數

考慮一組固定序列 (x1,…,xn)(x_1,\dots,x_n),且其中恰有 ww 個「1」。此時

∑i=1nxi=w.\sum_{i=1}^{n}x_i=w.

先計算該序列的邊際機率:

P(X1=x1,…,Xn=xn)=∫01P(X1=x1,…,Xn=xn∣U=u) du=∫01uw(1−u)n−w du.\begin{aligned} P(X_1=x_1,\dots,X_n=x_n) &=\int_{0}^{1} P(X_1=x_1,\dots,X_n=x_n\mid U=u)\,du\\ &=\int_{0}^{1}u^w(1-u)^{n-w}\,du. \end{aligned}

此積分為 Beta 函數:

∫01uw(1−u)n−w du=B(w+1,n−w+1)=w!(n−w)!(n+1)!.\int_{0}^{1}u^w(1-u)^{n-w}\,du = B(w+1,n-w+1) = \frac{w!(n-w)!}{(n+1)!}.

而 Wn=wW_n=w 的事件共有

(nw)\binom{n}{w}

組不同序列。故

P(Wn=w)=(nw)w!(n−w)!(n+1)!=1n+1.P(W_n=w) = \binom{n}{w}\frac{w!(n-w)!}{(n+1)!} = \frac{1}{n+1}.

因此,對於含有 ww 個「1」的序列,

PX1,…,Xn∣Wn(x1,…,xn∣w)=P(X1=x1,…,Xn=xn)P(Wn=w)=w!(n−w)!(n+1)!1n+1=w!(n−w)!n!=1(nw).\begin{aligned} &P_{X_1,\dots,X_n\mid W_n}(x_1,\dots,x_n\mid w)\\ &\quad= \frac{P(X_1=x_1,\dots,X_n=x_n)}{P(W_n=w)}\\ &\quad= \frac{\displaystyle\frac{w!(n-w)!}{(n+1)!}} {\displaystyle\frac{1}{n+1}}\\ &\quad= \frac{w!(n-w)!}{n!}\\ &\quad= \frac{1}{\binom{n}{w}}. \end{aligned}

所以完整答案為

PX1,…,Xn∣Wn(x1,…,xn∣w)={1(nw),xi∈{0,1}, ∑i=1nxi=w,0,其他情形.P_{X_1,\dots,X_n\mid W_n}(x_1,\dots,x_n\mid w) = \begin{cases} \displaystyle\frac{1}{\binom{n}{w}}, & x_i\in\{0,1\},\ \displaystyle\sum_{i=1}^{n}x_i=w,\\[2ex] 0, & \text{其他情形}. \end{cases}

這表示:給定 Wn=wW_n=w 後,所有含有 ww 個「1」的序列等可能。


(c)求 WnW_n 的動差生成函數

動差生成函數定義為

MWn(t)=E[etWn].M_{W_n}(t)=E[e^{tW_n}].

給定 U=uU=u 時,

Wn∣U=u∼Binomial⁡(n,u),W_n\mid U=u\sim\operatorname{Binomial}(n,u),

因此其條件動差生成函數為

MWn∣U(t∣u)=(1−u+uet)n.M_{W_n\mid U}(t\mid u) = (1-u+ue^t)^n.

由全期望公式,

MWn(t)=E[MWn∣U(t∣U)]=∫01(1−u+uet)n du.M_{W_n}(t) = E\left[M_{W_n\mid U}(t\mid U)\right] = \int_{0}^{1}(1-u+ue^t)^n\,du.

令

z=1+(et−1)u,du=dzet−1.z=1+(e^t-1)u, \qquad du=\frac{dz}{e^t-1}.

當 u=0u=0 時,z=1z=1;當 u=1u=1 時,z=etz=e^t。因此

🔒

後續完整解題步驟與【答案】

免費註冊,享三天全站完整詳解閱覽。

免費註冊

其他考古題

112 年臺灣大學的其他科目

臺灣大學《工程數學》其他年度