115 年 國立成功大學資訊工程系碩士班《計算機數學》

📄 試題原卷 免費註冊後即可對照原始考卷 PDF免費註冊
📄 以下 2 題共用同一段題幹

Consider all simple (loop-free), undirected graphs on a set of 55 distinct labeled vertices V={1,2,3,4,5}V=\{1,2,3,4,5\}. Every edge connects two distinct vertices, and multiple edges are not allowed. Assume that no vertex is isolated (i.e., every vertex has degree at least 11).

第 1-(a) 題10 分

How many such graphs have exactly one connected component (i.e., the graph is connected)?

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

這一題的完整詳解

核心觀念

連通圖中每個頂點都至少與一條邊相接,因此「圖連通」已經保證沒有孤立點。題目等同於計算 55 個標號頂點上的連通簡單無向圖數。

對 nn 個標號頂點,簡單無向圖總數為 2(n2)2^{\binom n2}:每一對不同頂點之間的邊都可選擇存在或不存在。接著用遞迴扣除不連通的圖。

解題方法

令 cnc_n 表示 nn 個標號頂點上的連通圖數。固定一個頂點,依它所在連通分量的頂點數 kk 分類。不連通時,1≤k≤n−11\le k\le n-1,故

cn=2(n2)−∑k=1n−1(n−1k−1)ck 2(n−k2).c_n = 2^{\binom n2} - \sum_{k=1}^{n-1} \binom{n-1}{k-1}c_k\,2^{\binom{n-k}{2}}.

其中,(n−1k−1)\binom{n-1}{k-1} 是選出包含固定頂點的 kk 個頂點的方法數;這些頂點之間須形成連通圖,有 ckc_k 種;其餘 n−kn-k 個頂點之間的邊則任意選擇,有 2(n−k2)2^{\binom{n-k}{2}} 種。

🔒

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

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

免費註冊

第 1-(b) 題10 分

How many such graphs have exactly two connected components?

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

這一題的完整詳解

核心觀念

圖恰有兩個連通分量,表示頂點集合可分成兩個互不相交的部分,且每一部分誘導出的子圖都必須連通。又因為沒有孤立點,每個連通分量至少有 22 個頂點。

解題方法

將 55 個頂點分成兩個大小都至少為 22 的連通分量,唯一可行的大小分配是 2+32+3。

先從 55 個標記頂點中選出屬於二頂點分量的兩個頂點:

(52)=10.\binom{5}{2}=10.

這兩個頂點要形成連通分量,彼此之間必須有一條邊,因此只有 11 種接法。

🔒

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

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

免費註冊

第 2 題10 分

A network engineer is designing a fault-tolerant routing backbone for a data-center fabric. The backbone consists of 2020 routers, arranged physically in a 4×54\times5 cylindrical grid. There are 44 horizontal layers (“rings”), each containing 55 routers. Horizontally, each layer forms a 55-router cycle (i.e., the leftmost and rightmost routers are connected). Vertically, each of the 55 columns also forms a 44-router cycle (i.e., the top and bottom switches are connected). Thus, every router has degree 44: two connections within its horizontal ring, and two within its vertical ring.

Determine whether this cylindrical multi-ring backbone HH can be embedded on a flat PCB without wiring intersections. Justify your answer using only Euler’s formula and girth-based edge bounds. In graph theory, the girth of an undirected graph is the length of the shortest cycle contained in the graph.

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

這一題的完整詳解

核心觀念

本題用平面圖的歐拉公式與「最短環長度(girth)」導出的邊數上界,判斷網路圖能否平面嵌入。若圖有 nn 個頂點、mm 條邊,且每個面的邊界長度至少為 gg,則平面圖必須滿足

m≤gg−2(n−2).m \leq \frac{g}{g-2}(n-2).

解題方法

先計算頂點數、邊數與 girth,再代入平面圖邊數上界。

題目給出 44 層、每層 55 個路由器,因此頂點數為

n=4⋅5=20.n=4\cdot 5=20.

每個路由器的度數都是 44。由握手定理,度數總和等於邊數的兩倍:

2m=∑v∈Vdeg⁡(v)=20⋅4=80,m=40.2m=\sum_{v\in V}\deg(v)=20\cdot 4=80, \qquad m=40.

圖中沒有長度為 33 的環:每一步只會改變所在層或所在欄;若三步都改變同一座標,必須在該座標的環上形成三角形,但 C4C_4 與 C5C_5 都沒有三角形;若分散在兩個座標,至少一個座標只移動一步,無法回到起點。

🔒

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

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

免費註冊
📄 以下 2 題共用同一段題幹

A self-organizing ad-hoc satellite network consists of multiple satellites placed at arbitrary integer coordinates in 3-dimensional space. Each satellite is modeled as a point Ai∈Z3A_i\in\mathbb{Z}^3. A secure communication link may be established between satellites AiA_i and AjA_j only if the midpoint of the segment AiAjA_iA_j also lies on an integer lattice point. Equivalently, all three coordinate-wise averages must be integers:
xi+xj2, yi+yj2, zi+zj2∈Z.\frac{x_i+x_j}{2},\ \frac{y_i+y_j}{2},\ \frac{z_i+z_j}{2}\in\mathbb{Z}.

第 3-(a) 題10 分

The Space Agency wants to guarantee that even without knowing the positions of the satellites beforehand, there must exist at least one secure link.

Determine the smallest integer NN such that, no matter how the NN satellites are placed in Z3\mathbb{Z}^3, there is always at least one pair whose midpoint is a lattice point (i.e., at least one secure link always exists).

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

這一題的完整詳解

核心觀念

兩點的中點是整數格點,等價於兩點在每個座標上的奇偶性都相同。也就是說,若
Ai=(xi,yi,zi)A_i=(x_i,y_i,z_i)、Aj=(xj,yj,zj)A_j=(x_j,y_j,z_j),則必須有

(xi,yi,zi)≡(xj,yj,zj)(mod2).(x_i,y_i,z_i)\equiv(x_j,y_j,z_j)\pmod 2.

每個座標只有奇、偶兩種奇偶性,因此三維空間共有 23=82^3=8 種奇偶組合,可視為 8 個奇偶類別。

解題方法

將每顆衛星依其座標的奇偶性分類。若兩顆衛星落在同一類別,三個座標各自同奇偶,兩座標相加皆為偶數,因此其中點的三個座標都是整數,兩顆衛星之間便有安全鏈路。

🔒

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

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

免費註冊

第 3-(b) 題10 分

Now modify the secure-link condition. A link is allowed if the total coordinate sum of the two satellites is even, i.e.,
xi+xj+yi+yj+zi+zj≡0(mod2).x_i+x_j+y_i+y_j+z_i+z_j\equiv0\pmod{2}.

Under this new rule, determine the new minimum number of satellites guaranteeing that at least one secure link must exist.

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

這一題的完整詳解

核心觀念

將每顆衛星的三個座標和對 22 取餘數,分成兩類:

  • 偶類:xi+yi+zi≡0(mod2)x_i+y_i+z_i\equiv 0\pmod 2
  • 奇類:xi+yi+zi≡1(mod2)x_i+y_i+z_i\equiv 1\pmod 2

新連線條件可改寫為

xi+xj+yi+yj+zi+zj≡(xi+yi+zi)+(xj+yj+zj)≡0(mod2).x_i+x_j+y_i+y_j+z_i+z_j \equiv (x_i+y_i+z_i)+(x_j+y_j+z_j) \equiv 0\pmod 2.

兩個整數的和為偶數,表示它們同奇偶。因此,兩顆衛星能建立安全連線,恰好在它們的座標總和同奇偶時成立。

解題方法

🔒

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

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

免費註冊

第 4 題10 分

Consider the recurrence:
En=4En−1−4En−2+2n+3n,E_n=4E_{n-1}-4E_{n-2}+2^n+3^n,
with initial values E0=2, E1=10E_0=2,\ E_1=10. Estimate the smallest nn such that En>107E_n>10^7.

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

這一題的完整詳解

核心觀念

這題考二階線性常係數非齊次遞迴。先解特徵方程,再依右側的指數項找特解。當非齊次項 2n2^n 對應的底數 22 是特徵根,且重根次數為 22 時,特解須乘上 n2n^2。

解題方法

先解齊次遞迴

En−4En−1+4En−2=0.E_n-4E_{n-1}+4E_{n-2}=0.

特徵方程為

r2−4r+4=(r−2)2=0,r^2-4r+4=(r-2)^2=0,

因此齊次解為 (A+Bn)2n(A+Bn)2^n。

對 2n2^n 項,因 22 是二重特徵根,設特解為 Cn22nC n^2 2^n。將 En=2np(n)E_n=2^n p(n) 代入遞迴左側,可得

En−4En−1+4En−2=2n(p(n)−2p(n−1)+p(n−2)).E_n-4E_{n-1}+4E_{n-2} =2^n\bigl(p(n)-2p(n-1)+p(n-2)\bigr).

取 p(n)=n2p(n)=n^2 時,括號內的二階差分為 22,故 C=12C=\frac12。

對 3n3^n 項,設特解為 D3nD3^n。代入左側得

D3n−4D3n−1+4D3n−2=D93n.D3^n-4D3^{n-1}+4D3^{n-2} =\frac{D}{9}3^n.

令其等於 3n3^n,得到 D=9D=9。因此通解為

En=(A+Bn)2n+12n22n+9⋅3n.E_n=(A+Bn)2^n+\frac12 n^2 2^n+9\cdot 3^n.
🔒

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

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

免費註冊
📄 以下 2 題共用同一段題幹

You are designing the firmware logic for a high-security electronic lock. The lock receives a stream of binary signals (00 or 11) from a keypad. Draw the state transition diagrams for two different versions of the security protocol. Use the Moore Machine model for both versions. Specifically, use circles to represent states with labels SiS_i where ii is the index starting from 00, use arrows to represent transitions, use an arrow to point to the start state, and mark the "Unlock" state as double circles.

第 5-(a) 題10 分

The Standard "Header-Trailer" Protocol Specification:

  1. Start-up Check: When the system first turns on, it must check for a specific "Header." The very first two signals received must be a 11 followed by another 11.
  2. Security Violation: If the first two signals are anything other than a pair of 11s, the system detects a hack. It must immediately enter a Permanent Lockout state where it ignores all future input and never unlocks.
  3. Monitoring: Once the valid header (1111) is received, the system waits. It ignores the specific pattern of the signals in the middle.
  4. Unlocking: The door should unlock if and only if the last two signals received were a 00 followed by another 00.
  5. Relocking: If the system receives more signals after unlocking that break the "00" ending, the door must lock again and go back to monitoring for a new "00" ending.

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

這一題的完整詳解

核心觀念

本題考查 Moore Machine(摩爾機):輸出由目前所在狀態決定,而不是由「狀態與輸入」共同決定。因此,解鎖狀態要以一個專屬狀態表示,並標示為雙圓。

設計狀態時,追蹤兩件事:

  1. 開機後是否已依序收到標頭 1111;若前兩個訊號不符合,就進入永久鎖定狀態。
  2. 標頭通過後,追蹤目前連續收到幾個 00。連續收到兩個 00 時解鎖;收到 11 會中斷結尾的 0000,回到監控狀態。

解題方法

各狀態定義如下:

  • S0S_0:起始狀態,尚未收到訊號。
  • S1S_1:第一個訊號是 11,等待第二個訊號。
  • S2S_2:永久鎖定狀態,忽略後續輸入。
  • S3S_3:標頭 1111 已通過,最近訊號不是 00,目前沒有連續結尾 00。
  • S4S_4:標頭已通過,最近剛收到一個 00。
  • S5S_5:標頭已通過,最近收到至少兩個連續 00,輸出「解鎖」。

轉移如下:

  • S0S_0 收到 11 轉到 S1S_1;收到 00 轉到 S2S_2。
  • S1S_1 收到 11,標頭成立,轉到 S3S_3;收到 00,轉到 S2S_2。
  • S2S_2 對 00、11 都留在 S2S_2。
  • S3S_3 收到 11 留在 S3S_3;收到 00 轉到 S4S_4。
  • S4S_4 收到 00 轉到解鎖狀態 S5S_5;收到 11 回到 S3S_3。
  • S5S_5 收到 00 留在 S5S_5,因為結尾仍是 0000;收到 11 回到 S3S_3,等待新的 0000 結尾。
🔒

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

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

免費註冊

第 5-(b) 題10 分

The Advanced "Strict Rhythm" Protocol Specification:

We request a security update to the logic designed in (a). Modify your Finite State Machine to incorporate the following three specific changes. All other behaviors (like the "11" start-up check) remain the same.

  1. Enforce Alternating Data: Instead of ignoring the signals between the header and the unlock command, the system must now strictly enforce an alternating "0, 1, 0, 1, ..." pattern.
  2. Immediate Lockout on Error: If this alternating rhythm is broken (for example, if two 11s appear consecutively after the header), the system must immediately enter the Permanent Lockout state.
  3. One-Time Access: The "Relock" feature is removed. Once the door unlocks (upon receiving the "00" suffix), any further input signals are considered a security violation and must trigger the Permanent Lockout state.

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

這一題的完整詳解

核心觀念

Moore 機的輸出只由目前狀態決定,所以「解鎖」要是一個獨立狀態(雙圓)。本小題在 (a) 的基礎上改三件事:

  1. 標頭 11 之後的資料必須嚴格交替 0,1,0,1,…;
  2. 節奏一被打破就立刻進入永久鎖定;
  3. 取消重新上鎖:解鎖後再收到任何訊號都視為違規,進入永久鎖定。

其餘行為與 (a) 相同——前兩個訊號必須是 11,否則永久鎖定。

解題方法

狀態定義:

狀態意義輸出
S0S_0起始,尚未收到訊號鎖定
S1S_1收到標頭第一個 1鎖定
S2S_2標頭 11 完成,等待交替資料的 0鎖定
S3S_3最近收到交替序列中的 0(下一個應為 1,或再一個 0 構成解鎖命令)鎖定
S4S_4最近收到交替序列中的 1,下一個必須是 0鎖定
S5S_5解鎖(雙圓)解鎖
S6S_6永久鎖定(吸收狀態)鎖定

轉移表:

目前狀態輸入 0輸入 1
S0S_0(起始)S6S_6S1S_1
S1S_1S6S_6S2S_2
S2S_2S3S_3S6S_6
S3S_3S5S_5S4S_4
S4S_4S3S_3S6S_6
S5S_5S6S_6S6S_6
S6S_6S6S_6S6S_6
🔒

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

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

免費註冊
📄 以下 3 題共用同一段題幹

By factoring AA into LULU, the LU decomposition allows solving Ax=bAx=b by first solving Ly=bLy=b, followed by Ux=yUx=y, each requiring only a single triangular solve. Thus, computing A=LUA=LU is crucial in large-scale computer engineering applications.

Algorithm 1. LU Decomposition Without Pivoting

Require: Matrix A∈Rn×nA\in\mathbb{R}^{n\times n}
Ensure: Lower triangular matrix LL, upper triangular matrix UU such that A=LUA=LU

  1. Initialize L←In, U←0n×nL\leftarrow I_n,\ U\leftarrow 0_{n\times n}.
  2. For k=1k=1 to nn do:
    1. For j=kj=k to nn do:
      Uk,j←Ak,j−∑s=1k−1Lk,s⋅Us,j.U_{k,j}\leftarrow A_{k,j}-\sum_{s=1}^{k-1}L_{k,s}\cdot U_{s,j}.
    2. End for.
    3. For i=k+1i=k+1 to nn do:
      Li,k←1Uk,k(Ai,k−∑s=1k−1Li,s⋅Us,k).L_{i,k}\leftarrow\frac{1}{U_{k,k}}\left(A_{i,k}-\sum_{s=1}^{k-1}L_{i,s}\cdot U_{s,k}\right).
    4. End for.
  3. End for.
  4. Return (L,U)(L,U).

Algorithm 2. Speed-Improved Block LU Decomposition

Require: Matrix A∈Rn×nA\in\mathbb{R}^{n\times n}, where nn is a power of 22
Ensure: Matrices L,UL,U with A=LUA=LU

  1. Function SpeedImprovedBlockLU⁡(A)\operatorname{SpeedImprovedBlockLU}(A):
  2. Let n←n\leftarrow size of AA.
  3. If n=1n=1, then return ([1],[A11])([1],[A_{11}]).
  4. Partition AA into blocks:
    A=[A11A12A21A22].A=\begin{bmatrix}A_{11}&A_{12}\\A_{21}&A_{22}\end{bmatrix}.
  5. (L11,U11)←SpeedImprovedBlockLU⁡(A11)(L_{11},U_{11})\leftarrow\operatorname{SpeedImprovedBlockLU}(A_{11}).
  6. U12←SISolve⁡(L11,A12,lower)U_{12}\leftarrow\operatorname{SISolve}(L_{11},A_{12},\mathrm{lower}).
  7. L21←SISolve⁡(U11,A21,upper)L_{21}\leftarrow\operatorname{SISolve}(U_{11},A_{21},\mathrm{upper}).
  8. S←A22−SIMultiply⁡(L21,U12)S\leftarrow A_{22}-\operatorname{SIMultiply}(L_{21},U_{12}).
  9. (L22,U22)←SpeedImprovedBlockLU⁡(S)(L_{22},U_{22})\leftarrow\operatorname{SpeedImprovedBlockLU}(S).
  10. Construct:
    L=[L110L21L22],U=[U11U120U22].L=\begin{bmatrix}L_{11}&0\\L_{21}&L_{22}\end{bmatrix},\qquad U=\begin{bmatrix}U_{11}&U_{12}\\0&U_{22}\end{bmatrix}.
  11. Return (L,U)(L,U).
  12. End function.

Algorithm 3. SISolve⁡(T,B,type)\operatorname{SISolve}(T,B,\mathrm{type})

  1. If n=1n=1, then return B/TB/T.
  2. Partition T,BT,B into blocks:
    T=[T11T12T21T22],B=[B1B2].T=\begin{bmatrix}T_{11}&T_{12}\\T_{21}&T_{22}\end{bmatrix},\qquad B=\begin{bmatrix}B_1\\B_2\end{bmatrix}.
  3. If type=lower\mathrm{type}=\mathrm{lower}:
    X1←SISolve⁡(T11,B1),X_1\leftarrow\operatorname{SISolve}(T_{11},B_1),
    X2←SISolve⁡(T22,B2−T21X1).X_2\leftarrow\operatorname{SISolve}(T_{22},B_2-T_{21}X_1).
  4. Else:
    X2←SISolve⁡(T22,B2),X_2\leftarrow\operatorname{SISolve}(T_{22},B_2),
    X1←SISolve⁡(T11,B1−T12X2).X_1\leftarrow\operatorname{SISolve}(T_{11},B_1-T_{12}X_2).
  5. Return [X1X2]\begin{bmatrix}X_1\\X_2\end{bmatrix}.
  6. End function.

Algorithm 4. SIMultiply⁡(A,B)\operatorname{SIMultiply}(A,B)

  1. If n=1n=1, then return A⋅BA\cdot B.
  2. Partition A,BA,B into blocks:
    A=[A11A12A21A22],B=[B11B12B21B22].A=\begin{bmatrix}A_{11}&A_{12}\\A_{21}&A_{22}\end{bmatrix},\qquad B=\begin{bmatrix}B_{11}&B_{12}\\B_{21}&B_{22}\end{bmatrix}.
  3. Compute:
    M1←(A11+A22)(B11+B22),M_1\leftarrow(A_{11}+A_{22})(B_{11}+B_{22}),
    M2←(A21+A22)B11,M_2\leftarrow(A_{21}+A_{22})B_{11},
    M3←A11(B12−B22),M_3\leftarrow A_{11}(B_{12}-B_{22}),
    M4←A22(B21−B11),M_4\leftarrow A_{22}(B_{21}-B_{11}),
    M5←(A11+A12)B22,M_5\leftarrow(A_{11}+A_{12})B_{22},
    M6←(A21−A11)(B11+B12),M_6\leftarrow(A_{21}-A_{11})(B_{11}+B_{12}),
    M7←(A12−A22)(B21+B22).M_7\leftarrow(A_{12}-A_{22})(B_{21}+B_{22}).
  4. Compute:
    C11←M1+M4−M5+M7,C_{11}\leftarrow M_1+M_4-M_5+M_7,
    C12←M3+M5,C_{12}\leftarrow M_3+M_5,
    C21←M2+M4,C_{21}\leftarrow M_2+M_4,
    C22←M1−M2+M3+M6.C_{22}\leftarrow M_1-M_2+M_3+M_6.
  5. Return C=[C11C12C21C22]C=\begin{bmatrix}C_{11}&C_{12}\\C_{21}&C_{22}\end{bmatrix}.
  6. End function.

第 6-(a) 題10 分

Give the complexity of the classic LU decomposition shown in Algorithm 1.

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

這一題的完整詳解

核心觀念

本題考查經典 LULU 分解的時間複雜度。演算法依序計算 UU 的上三角元素與 LL 的下三角元素;每個元素的計算都包含一段長度隨目前列數增加的求和,因此總運算量需將各階段的求和次數加總。

解題方法與推導

固定第 kk 輪:

  • Uk,jU_{k,j} 對每個 j=k,…,nj=k,\ldots,n 計算一次,內積包含 k−1k-1 項,共有 n−k+1n-k+1 個元素。
  • Li,kL_{i,k} 對每個 i=k+1,…,ni=k+1,\ldots,n 計算一次,內積同樣包含 k−1k-1 項,共有 n−kn-k 個元素。

因此,所有內積的乘積項數為

🔒

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

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

免費註冊

第 6-(b) 題10 分

An improvement of (a) based on the block matrix multiplication is shown in Algorithm 2. Give the complexity of the speed-improved LU decomposition.

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

這一題的完整詳解

核心觀念

Algorithm 2 以分塊方式計算 LU 分解,並用 Algorithm 4 的 Strassen 矩陣乘法加速主要矩陣運算。令

ω=log⁡27≈2.807\omega=\log_2 7\approx 2.807

Strassen 乘法每層只遞迴計算 77 個大小為 n/2n/2 的乘法,另花 Θ(n2)\Theta(n^2) 做矩陣加減,因此其時間滿足

M(n)=7M(n/2)+Θ(n2)=Θ(nω).M(n)=7M(n/2)+\Theta(n^2)=\Theta(n^\omega).

解題方法

先分析分塊三角求解 SISolve。每次遞迴將問題分成兩個大小為 n/2n/2 的三角求解,並執行一次矩陣乘法及矩陣加減,所以

S(n)=2S(n/2)+Θ(M(n/2))+Θ(n2).S(n)=2S(n/2)+\Theta(M(n/2))+\Theta(n^2).

代入 M(n)=Θ(nω)M(n)=\Theta(n^\omega),得

S(n)=2S(n/2)+Θ(nω)=Θ(nω).S(n)=2S(n/2)+\Theta(n^\omega)=\Theta(n^\omega).

再分析 LU 分解。大小為 nn 的問題會遞迴分解左上角區塊與 Schur complement,各一次;另外進行兩次三角求解、一次 Strassen 矩陣乘法,以及區塊加減。

🔒

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

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

免費註冊

第 6-(c) 題10 分

Given
A=[4363],A=\begin{bmatrix}4&3\\6&3\end{bmatrix},
compute the LU decomposition A=LUA=LU using the speed-improved LU decomposition method in (b). List the key intermediate results from Algorithm 2 to receive full credit.

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

這一題的完整詳解

核心觀念

分塊 LU 分解將矩陣寫成

A=[A11A12A21A22]=[L110L21L22][U11U120U22].A= \begin{bmatrix} A_{11}&A_{12}\\ A_{21}&A_{22} \end{bmatrix} = \begin{bmatrix} L_{11}&0\\ L_{21}&L_{22} \end{bmatrix} \begin{bmatrix} U_{11}&U_{12}\\ 0&U_{22} \end{bmatrix}.

比較區塊可得

A11=L11U11,A12=L11U12,A21=L21U11,A_{11}=L_{11}U_{11},\qquad A_{12}=L_{11}U_{12},\qquad A_{21}=L_{21}U_{11},

而右下角區塊由 Schur 補數給出:

S=A22−L21U12=L22U22.S=A_{22}-L_{21}U_{12}=L_{22}U_{22}.

本題的矩陣大小為 22,分塊後各區塊都是純量,因此遞迴呼叫都會直接使用純量基底情況。

解題方法與中間結果

將題目矩陣分成四個純量區塊:

A11=4,A12=3,A21=6,A22=3.A_{11}=4,\qquad A_{12}=3,\qquad A_{21}=6,\qquad A_{22}=3.

1. 分解左上區塊 A11A_{11}

依演算法 2 第 5 步,對 A11=[4]A_{11}=[4] 呼叫遞迴。純量基底情況回傳:

L11=1,U11=4.L_{11}=1,\qquad U_{11}=4.

2. 計算右上區塊 U12U_{12}

演算法 2 第 6 步呼叫下三角解法:

L11U12=A12.L_{11}U_{12}=A_{12}.

因此

U12=A12L11=31=3.U_{12}=\frac{A_{12}}{L_{11}}=\frac{3}{1}=3.

3. 計算左下區塊 L21L_{21}

演算法 2 第 7 步呼叫上三角解法:

L21U11=A21.L_{21}U_{11}=A_{21}.

因此

L21=A21U11=64=32.L_{21}=\frac{A_{21}}{U_{11}}=\frac{6}{4}=\frac{3}{2}.
🔒

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

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

免費註冊
📄 以下 2 題共用同一段題幹

Let A∈Rm×nA\in\mathbb{R}^{m\times n} with m>nm>n, and assume that AA is rank-deficient, i.e., rank⁡(A)<n\operatorname{rank}(A)<n. ATAA^\mathsf{T}A is positive semi-definite.

第 7-(a) 題10 分

Let λ>0\lambda>0. Show that the matrix ATA+λIA^\mathsf{T}A+\lambda I is positive definite.

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

這一題的完整詳解

核心觀念

對稱矩陣 MM 正定的定義是:對每個非零向量 xx,都有 xTMx>0x^\mathsf{T}Mx>0。本題利用

xTATAx=(Ax)T(Ax)=∥Ax∥22≥0x^\mathsf{T}A^\mathsf{T}Ax=(Ax)^\mathsf{T}(Ax)=\|Ax\|_2^2\ge 0

以及 λ>0\lambda>0,證明加上 λI\lambda I 後,二次型對所有非零向量皆嚴格大於零。

解題方法

令 x∈Rnx\in\mathbb{R}^n 為任意非零向量。計算矩陣 ATA+λIA^\mathsf{T}A+\lambda I 的二次型:

🔒

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

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

免費註冊

第 7-(b) 題10 分

Derive the closed-form solution for
x∗=arg⁡min⁡x∈Rn∥Ax−b∥2+λ∥x∥2,λ>0.x^*=\arg\min_{x\in\mathbb{R}^n}\|Ax-b\|^2+\lambda\|x\|^2,\qquad\lambda>0.

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

這一題的完整詳解

核心觀念

這題考的是正則化最小平方法(ridge regression)。目標函數由殘差平方和 ∥Ax−b∥2\|Ax-b\|^2,加上懲罰項 λ∥x∥2\lambda\|x\|^2 組成;其中 λ>0\lambda>0 用來抑制解的大小。

由於 AA 欠秩,ATAA^\mathsf{T}A 是半正定矩陣,單靠最小平方法未必能得到唯一解。加入 λI\lambda I 後,矩陣 ATA+λIA^\mathsf{T}A+\lambda I 會成為正定矩陣,因此目標函數有唯一的全域最小值。

解題方法

將目標函數寫成

f(x)=∥Ax−b∥2+λ∥x∥2=(Ax−b)T(Ax−b)+λxTx.f(x)=\|Ax-b\|^2+\lambda\|x\|^2 =(Ax-b)^\mathsf{T}(Ax-b)+\lambda x^\mathsf{T}x.

展開後,

f(x)=xTATAx−2bTAx+bTb+λxTx.f(x)=x^\mathsf{T}A^\mathsf{T}Ax-2b^\mathsf{T}Ax+b^\mathsf{T}b +\lambda x^\mathsf{T}x.

對 xx 求梯度:

∇f(x)=2ATAx−2ATb+2λx.\nabla f(x)=2A^\mathsf{T}Ax-2A^\mathsf{T}b+2\lambda x.

令梯度為零,得到正則化常態方程:

(ATA+λIn)x=ATb.(A^\mathsf{T}A+\lambda I_n)x=A^\mathsf{T}b.
🔒

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

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

免費註冊

其他考古題