114 年 國立臺灣大學工業工程學研究所碩士班產業與服務系統工程組《作業研究》

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

第 1 題30 分

  1. (30 points) Consider the following primal linear programming problem (P).
    Minimize z=c1x1+x2z = c_1 x_1 + x_2
    subject to
    −2x1−x2+x3=−6-2x_1 - x_2 + x_3 = -6
    x1+2x2+x4=6x_1 + 2x_2 + x_4 = 6
    x1,x2,x3,x4≥0x_1, x_2, x_3, x_4 \ge 0

(a) If c1=1c_1 = 1, find an initial feasible solution of (x1,x2,x3,x4)(x_1, x_2, x_3, x_4) by using Phase-I of the two-phase method.
(b) If c1=1c_1 = 1, find an optimal solution of (x1,x2,x3,x4)(x_1, x_2, x_3, x_4) by using the simplex method.
(c) Write the dual problem.
(d) If c1=1c_1 = 1, what is the optimal solution to the dual problem and its corresponding objective value of the dual problem?
(e) If c1=1c_1 = 1, find an optimal solution of (x1,x2,x3,x4)(x_1, x_2, x_3, x_4) to the primal problem (P) starting from a trivial infeasible solution, (x1,x2,x3,x4)=(0,0,−6,6)(x_1, x_2, x_3, x_4) = (0,0,-6, 6), by using the dual simplex method.
(f) Construct the allowable range of c1c_1 that the optimal solution obtained in (b) stays optimal.

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

這一題的完整詳解

核心觀念

本題整合線性規劃的幾項核心技巧:

  • 兩階段法 Phase-I:先加入人工變數,求得原問題的可行基底解。
  • 單純形法 Simplex Method:由可行基底解判斷是否仍有可改善的非基底變數。
  • 對偶問題 Dual Problem:依照原問題的最小化形式、等式限制與非負變數建立對偶。
  • 對偶單純形法 Dual Simplex Method:由「對偶可行但原始不可行」的基底解出發。
  • 目標係數允許範圍:保持目前基底解最適,必須使所有非基底變數的 reduced cost 維持最適條件。

(a) 使用 Phase-I 求初始可行解

原問題第一條限制式的右側為負,先將其乘以 −1-1:

2x1+x2−x3=62x_1+x_2-x_3=6

加入人工變數 a1a_1:

2x1+x2−x3+a1=62x_1+x_2-x_3+a_1=6

第二條限制式為:

x1+2x2+x4=6x_1+2x_2+x_4=6

Phase-I 的目標為最小化人工變數:

min⁡w=a1\min w=a_1

令 a1,x4a_1,x_4 為基底變數,其他變數設為 00:

a1=6,x4=6a_1=6,\qquad x_4=6

此時 x1=x2=x3=0x_1=x_2=x_3=0,故初始 Phase-I 解為:

(x1,x2,x3,x4,a1)=(0,0,0,0,6)(x_1,x_2,x_3,x_4,a_1)=(0,0,0,0,6)

由第一式可得:

a1=6−2x1−x2+x3a_1=6-2x_1-x_2+x_3

當 x1x_1 進入基底時,a1a_1 會先降至 00;由第二式可知 x4x_4 尚未先變成負值,因此令 a1a_1 離開基底。

由

2x1+x2−x3=62x_1+x_2-x_3=6

解出:

x1=3−12x2+12x3x_1=3-\frac{1}{2}x_2+\frac{1}{2}x_3

再代入第二式:

x4=6−x1−2x2=3−32x2−12x3x_4=6-x_1-2x_2 =3-\frac{3}{2}x_2-\frac{1}{2}x_3

令非基底變數 x2=x3=0x_2=x_3=0,得到:

x1=3,x4=3x_1=3,\qquad x_4=3

且人工變數 a1=0a_1=0,因此原問題的一組初始可行解為:

(x1,x2,x3,x4)=(3,0,0,3)\boxed{(x_1,x_2,x_3,x_4)=(3,0,0,3)}

(b) 使用單純形法求最適解

當 c1=1c_1=1 時,目標函數為:

min⁡z=x1+x2\min z=x_1+x_2

沿用 (a) 所得到的基底 x1,x4x_1,x_4,將限制式寫成字典形式:

x1=3−12x2+12x3x_1=3-\frac{1}{2}x_2+\frac{1}{2}x_3 x4=3−32x2−12x3x_4=3-\frac{3}{2}x_2-\frac{1}{2}x_3

代入目標函數:

z=x1+x2=3−12x2+12x3+x2=3+12x2+12x3\begin{aligned} z &=x_1+x_2\\ &=3-\frac{1}{2}x_2+\frac{1}{2}x_3+x_2\\ &=3+\frac{1}{2}x_2+\frac{1}{2}x_3 \end{aligned}

由於 x2,x3≥0x_2,x_3\ge 0,且目標函數中兩者的係數均為正值,因此增加任一非基底變數都會使 zz 增加。最小值在:

x2=x3=0x_2=x_3=0

時取得。

因此:

x1=3,x4=3x_1=3,\qquad x_4=3

最適解為:

(x1,x2,x3,x4)=(3,0,0,3)\boxed{(x_1,x_2,x_3,x_4)=(3,0,0,3)}

最適目標值為:

z∗=3\boxed{z^*=3}

(c) 建立對偶問題

原問題為:

min⁡c1x1+x2s.t.−2x1−x2+x3=−6x1+2x2+x4=6x1,x2,x3,x4≥0\begin{aligned} \min\quad & c_1x_1+x_2\\ \text{s.t.}\quad &-2x_1-x_2+x_3=-6\\ &x_1+2x_2+x_4=6\\ &x_1,x_2,x_3,x_4\ge 0 \end{aligned}

兩條限制式都是等式,因此先令對偶變數 y1,y2y_1,y_2 不受符號限制。

因為原問題是最小化問題,且所有原始變數均為非負,因此對偶限制式為「小於等於」。

對偶目標函數為:

max⁡ −6y1+6y2\max\ -6y_1+6y_2

逐一依照原始變數建立對偶限制式:

  • x1x_1 對應第一欄 (−2,1)(-2,1):
−2y1+y2≤c1-2y_1+y_2\le c_1
  • x2x_2 對應第二欄 (−1,2)(-1,2):
−y1+2y2≤1-y_1+2y_2\le 1
  • x3x_3 對應第三欄 (1,0)(1,0),其成本為 00:
y1≤0y_1\le 0
  • x4x_4 對應第四欄 (0,1)(0,1),其成本為 00:
y2≤0y_2\le 0

故對偶問題為:

max⁡−6y1+6y2s.t.−2y1+y2≤c1−y1+2y2≤1y1≤0y2≤0\boxed{ \begin{aligned} \max\quad & -6y_1+6y_2\\ \text{s.t.}\quad &-2y_1+y_2\le c_1\\ &-y_1+2y_2\le 1\\ &y_1\le 0\\ &y_2\le 0 \end{aligned} }

(d) c1=1c_1=1 時對偶問題的最適解

由 (b) 的原問題最適解:

(x1,x2,x3,x4)=(3,0,0,3)(x_1,x_2,x_3,x_4)=(3,0,0,3)

使用互補鬆弛條件。

因為 x4=3>0x_4=3>0,其對偶限制式必須為等式:

y2=0y_2=0

因為 x1=3>0x_1=3>0,其對偶限制式也必須為等式:

−2y1+y2=1-2y_1+y_2=1

代入 y2=0y_2=0:

−2y1=1-2y_1=1

因此:

y1=−12y_1=-\frac{1}{2}

對偶最適解為:

(y1,y2)=(−12,0)\boxed{(y_1,y_2)=\left(-\frac{1}{2},0\right)}

對偶目標值為:

w∗=−6y1+6y2=−6(−12)+6(0)=3\begin{aligned} w^* &=-6y_1+6y_2\\ &=-6\left(-\frac{1}{2}\right)+6(0)\\ &=3 \end{aligned}

因此:

w∗=3\boxed{w^*=3}

原問題與對偶問題的最適值相同,符合強對偶定理:

z∗=w∗=3z^*=w^*=3

(e) 使用對偶單純形法

題目指定起始解:

(x1,x2,x3,x4)=(0,0,−6,6)(x_1,x_2,x_3,x_4)=(0,0,-6,6)

由限制式表示基底變數:

x3=−6+2x1+x2x_3=-6+2x_1+x_2 x4=6−x1−2x2x_4=6-x_1-2x_2

目標函數為:

z=x1+x2z=x_1+x_2

此時:

  • x3=−6<0x_3=-6<0,所以原始解不可行;
  • x4=6≥0x_4=6\ge 0;
  • 目標函數中非基底變數 x1,x2x_1,x_2 的 reduced cost 均為非負,因此對偶可行。

這正是對偶單純形法的起始條件:原始不可行、對偶可行。

選擇離開基底的變數

選擇負的基底變數 x3x_3 離開基底:

x3=−6+2x1+x2x_3=-6+2x_1+x_2

為使 x3x_3 增加至非負,x1x_1 或 x2x_2 可進入基底。

依對偶單純形法的比值判定:

cˉ12=12,cˉ21=1\frac{\bar c_1}{2}=\frac{1}{2}, \qquad \frac{\bar c_2}{1}=1

因此選擇 x1x_1 進入基底。

由 x3x_3 方程解出 x1x_1:

x1=3+12x3−12x2x_1=3+\frac{1}{2}x_3-\frac{1}{2}x_2

代入 x4x_4:

x4=6−x1−2x2=6−(3+12x3−12x2)−2x2=3−12x3−32x2\begin{aligned} x_4 &=6-x_1-2x_2\\ &=6-\left(3+\frac{1}{2}x_3-\frac{1}{2}x_2\right)-2x_2\\ &=3-\frac{1}{2}x_3-\frac{3}{2}x_2 \end{aligned}

代入目標函數:

🔒

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

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

免費註冊

第 2 題20 分

  1. (20 points) Suppose you will choose 10 dishes from four meal types (pork, beef, vegitable, and grain). At least one dish from each meal type must be chosen. The 10 dishes are allocated to the four meal types in a manner that maximizes "nutrition." You measures nutrition on a 100-point scale as shown in the following table.
Meal types123456≥7
Pork25506080100100100
Beef207090100100100100
Vegitable406080100100100100
Grain10203040506070

How should you choose the dishes? Please answer the following questions.
(a) What are the stages and states for the dynamic programming formulation of this problem?
(b) Use dynamic programming to solve this problem.

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

這一題的完整詳解

核心觀念

本題考查動態規劃的階段、狀態與遞迴關係。將四種餐點依序分配菜色,每種至少選一道,且各種類的營養分數依所選數量查表。目標是使四種類的營養分數總和最大。

設 fi(x)f_i(x) 為第 ii 種餐點選 xx 道時的營養分數,則總分為四種餐點分數的加總。

(a) 階段與狀態

  • 階段:每個階段處理一種餐點,依序為豬肉、牛肉、蔬菜、穀類。
  • 狀態:已分配給目前及先前餐點的菜色總數。
  • 決策:在目前階段所處理的餐點選幾道;每種至少一道。

令 Di(t)D_i(t) 表示前 ii 種餐點共分配 tt 道菜時可得到的最高營養分數。初始條件為:

D1(t)=f1(t),t≥1D_1(t)=f_1(t), \qquad t\ge 1

對 i≥2i\ge 2,遞迴式為:

Di(t)=max⁡1≤x≤t−(i−1){Di−1(t−x)+fi(x)}D_i(t)=\max_{1\le x\le t-(i-1)} \left\{D_{i-1}(t-x)+f_i(x)\right\}

其中 xx 是第 ii 種餐點的菜數;上限 t−(i−1)t-(i-1) 確保前 i−1i-1 種餐點各至少有一道。最後求 D4(10)D_4(10)。

(b) 動態規劃求解

先合併豬肉與牛肉,計算 D2(t)D_2(t)。表中的配置欄列出達到最高分的一組豬肉、牛肉菜數。

總菜數 ttD2(t)D_2(t)最佳配置(豬肉、牛肉)
245(1,1)(1,1)
395(1,2)(1,2)
4120(2,2)(2,2)
5140(2,3)(2,3)
6150(2,4)(2,4)
7170(4,3)(4,3)
8190(5,3)(5,3)
9200(5,4)(5,4)

例如,兩種餐點合計選 55 道時:

D2(5)=max⁡{25+100, 50+90, 60+70, 80+20}=140D_2(5)=\max\{25+100,\ 50+90,\ 60+70,\ 80+20\}=140

此時豬肉選 22 道、牛肉選 33 道。

接著加入蔬菜,依遞迴式計算 D3(t)D_3(t):

總菜數 ttD3(t)D_3(t)一組最佳配置(豬肉、牛肉、蔬菜)
385(1,1,1)(1,1,1)
4135(1,2,1)(1,2,1)
5160(1,3,1)(1,3,1)
6180(2,3,1)(2,3,1)
7200(2,3,2)(2,3,2)
8220(2,3,3)(2,3,3)
9240(2,3,4)(2,3,4)

例如,前三種餐點合計選 99 道時,逐一比較蔬菜菜數 xx:

🔒

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

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

免費註冊

第 3 題30 分

  1. (30 points) Consider the following optimization problem
    min⁡(x,y)∈R2f(x,y)=x2+2xy+2y2+4x+6y+5\min_{(x,y) \in \mathbb{R}^2} f(x, y) = x^2 + 2xy + 2y^2 + 4x + 6y + 5
    subject to
    g1(x,y)=3−x−y≤0g_1(x,y) = 3 - x - y \le 0
    g2(x,y)=−y≤0g_2(x,y) = -y \le 0
    Answer the following questions.
    (a) Show that f(x,y)f(x, y) is convex.
    (b) Write down the Karush-Kuhn-Tucker (KKT) conditions necessary for solving this optimization problem.
    (c) Continuing with (b), can you find a feasible solution when both constraints g1g_1 and g2g_2 are "inactive"? Show the details.
    (d) Continuing with (b), identify the feasible solution(s) (x∗,y∗)(x^*, y^*) and check whether or not the Linear Independence Constraint Qualification (LICQ) holds at (x∗,y∗)(x^*, y^*).
    (e) Find the global minimizer and the optimal value of f(x,y)f(x,y).

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

這一題的完整詳解

【答案】
(a) 證明略,目標函數 f(x,y)f(x, y) 之 Hessian 矩陣 H=(2224)H = \begin{pmatrix} 2 & 2 \\ 2 & 4 \end{pmatrix} 各階領先主子式均為正,為正定矩陣,故 f(x,y)f(x, y) 為嚴格凸函數,亦為凸函數。
(b) 最佳化問題之 KKT 條件為:

  1. 梯度條件(Stationarity):2x+2y+4−μ1=02x + 2y + 4 - \mu_1 = 0 且 2x+4y+6−μ1−μ2=02x + 4y + 6 - \mu_1 - \mu_2 = 0
  2. 原問題可行性(Primal Feasibility):x+y≥3x + y \ge 3 且 y≥0y \ge 0
  3. 對偶可行性(Dual Feasibility):μ1≥0\mu_1 \ge 0 且 μ2≥0\mu_2 \ge 0
  4. 互補鬆弛條件(Complementary Slackness):μ1(3−x−y)=0\mu_1 (3 - x - y) = 0 且 μ2(−y)=0\mu_2 (-y) = 0
    (c) 不存在。當限制條件 g1,g2g_1, g_2 皆為非主動約束(inactive)時,μ1=μ2=0\mu_1 = \mu_2 = 0,解得無約束平穩點為 (x,y)=(−1,−1)(x, y) = (-1, -1),此點違反原問題可行性條件(−1−1=−2<3-1 - 1 = -2 < 3 且 −1<0-1 < 0),故無可行解。
    (d) 滿足 KKT 條件之唯一解為 (x∗,y∗)=(3,0)(x^*, y^*) = (3, 0),對應之拉格朗日乘子為 μ1=10,μ2=2\mu_1 = 10, \mu_2 = 2。該點處主動約束之梯度向量分別為 ∇g1=(−1,−1)T\nabla g_1 = (-1, -1)^T 與 ∇g2=(0,−1)T\nabla g_2 = (0, -1)^T,兩者線性獨立,故線性獨立限制條件資格(LICQ)在此點成立。
    (e) 全域極小點為 (x∗,y∗)=(3,0)(x^*, y^*) = (3, 0),全域最佳值為 f(3,0)=26f(3, 0) = 26。

詳解

本題考查非線性規劃與凸最佳化理論,涵蓋凸函數判定、Karush-Kuhn-Tucker(KKT)條件推導、主動約束分析、線性獨立限制條件資格(LICQ)檢驗,以及凸規劃全域最佳解之求取。

一、(a) 證明 f(x,y)f(x, y) 為凸函數
給定目標函數:

f(x,y)=x2+2xy+2y2+4x+6y+5f(x, y) = x^2 + 2xy + 2y^2 + 4x + 6y + 5

計算其一階偏導數:

∂f∂x=2x+2y+4\frac{\partial f}{\partial x} = 2x + 2y + 4 ∂f∂y=2x+4y+6\frac{\partial f}{\partial y} = 2x + 4y + 6

計算其二階偏導數並建立 Hessian 矩陣 HH:

∂2f∂x2=2,∂2f∂y2=4,∂2f∂x∂y=∂2f∂y∂x=2\frac{\partial^2 f}{\partial x^2} = 2, \quad \frac{\partial^2 f}{\partial y^2} = 4, \quad \frac{\partial^2 f}{\partial x \partial y} = \frac{\partial^2 f}{\partial y \partial x} = 2 H=(∂2f∂x2∂2f∂x∂y∂2f∂y∂x∂2f∂y2)=(2224)H = \begin{pmatrix} \frac{\partial^2 f}{\partial x^2} & \frac{\partial^2 f}{\partial x \partial y} \\ \frac{\partial^2 f}{\partial y \partial x} & \frac{\partial^2 f}{\partial y^2} \end{pmatrix} = \begin{pmatrix} 2 & 2 \\ 2 & 4 \end{pmatrix}

檢驗矩陣 HH 之領先主子式(Leading Principal Minors):

  • 一階領先主子式:D1=2>0D_1 = 2 > 0
  • 二階領先主子式:D2=det⁡(H)=(2)(4)−(2)(2)=8−4=4>0D_2 = \det(H) = (2)(4) - (2)(2) = 8 - 4 = 4 > 0
    因所有領先主子式皆嚴格大於零,Hessian 矩陣 HH 為正定矩陣(Positive Definite)。根據凸分析定理,二階連續可微函數在定義域上之 Hessian 矩陣處處正定,則該函數為嚴格凸函數(Strictly Convex),必然為凸函數。

二、(b) 寫出 KKT 條件
原最佳化問題標準形式為:

min⁡f(x,y)=x2+2xy+2y2+4x+6y+5\min f(x, y) = x^2 + 2xy + 2y^2 + 4x + 6y + 5 s.t. g1(x,y)=3−x−y≤0\text{s.t. } g_1(x, y) = 3 - x - y \le 0 g2(x,y)=−y≤0g_2(x, y) = -y \le 0

引入非負拉格朗日乘子 μ1≥0,μ2≥0\mu_1 \ge 0, \mu_2 \ge 0,定義拉格朗日函數:

L(x,y,μ1,μ2)=f(x,y)+μ1g1(x,y)+μ2g2(x,y)L(x, y, \mu_1, \mu_2) = f(x, y) + \mu_1 g_1(x, y) + \mu_2 g_2(x, y)

KKT 條件包含:

  1. 平穩性條件(Stationarity / 梯度條件):
∇f(x,y)+μ1∇g1(x,y)+μ2∇g2(x,y)=0\nabla f(x, y) + \mu_1 \nabla g_1(x, y) + \mu_2 \nabla g_2(x, y) = \mathbf{0}

因 ∇g1=(−1−1)\nabla g_1 = \begin{pmatrix} -1 \\ -1 \end{pmatrix},∇g2=(0−1)\nabla g_2 = \begin{pmatrix} 0 \\ -1 \end{pmatrix},分量式為:

2x+2y+4−μ1=02x + 2y + 4 - \mu_1 = 0 2x+4y+6−μ1−μ2=02x + 4y + 6 - \mu_1 - \mu_2 = 0
  1. 原問題可行性(Primal Feasibility):
3−x−y≤0  ⟺  x+y≥33 - x - y \le 0 \iff x + y \ge 3 −y≤0  ⟺  y≥0-y \le 0 \iff y \ge 0
  1. 對偶可行性(Dual Feasibility):
μ1≥0,μ2≥0\mu_1 \ge 0, \quad \mu_2 \ge 0
  1. 互補鬆弛條件(Complementary Slackness):
μ1(3−x−y)=0\mu_1 (3 - x - y) = 0 μ2(−y)=0\mu_2 (-y) = 0

三、(c) 當兩約束皆非主動(inactive)時尋找可行解
若限制條件 g1g_1 與 g2g_2 皆非主動約束,即 g1(x,y)<0g_1(x, y) < 0 且 g2(x,y)<0g_2(x, y) < 0。
由互補鬆弛條件可得拉格朗日乘子必為零:

μ1=0,μ2=0\mu_1 = 0, \quad \mu_2 = 0

將其代入平穩性條件:

2x+2y+4=0  ⟹  x+y=−22x + 2y + 4 = 0 \implies x + y = -2 2x+4y+6=0  ⟹  x+2y=−32x + 4y + 6 = 0 \implies x + 2y = -3

解此線性聯立方程組:第二式減第一式得 y=−1y = -1,代回第一式得 x=−1x = -1。
此平穩點為 (x,y)=(−1,−1)(x, y) = (-1, -1)。
檢驗可行性:

  • x+y=−1+(−1)=−2<3x + y = -1 + (-1) = -2 < 3(違反 x+y≥3x+y \ge 3)
  • y=−1<0y = -1 < 0(違反 y≥0y \ge 0)
🔒

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

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

免費註冊

第 4 題20 分

  1. (20 points) There is a small YouBike station on the NTU campus, which has a maximum capacity of 2 bike docks. Suppose time is divided into discrete slots 1, 2, ..., where at any point in time, the following 2 random events may occur:
    A bike is returned with probability p=0.4p = 0.4,
    A bike is rented with probability q=0.6q = 0.6.
    Define the state of the system as the number of bikes on the docks, then it can be modeled as a discrete-time Markov chain. Answer the following questions.
    (a) Identify the state space and the transition probability matrix of this Markov chain.
    (b) When a student arrives at the Youbike station to rent a bike, what is the probability that both docks are empty? (Hint: You can solve the steady-state probabilities from the flow balance equations.)
    (c) If a student arrives at the Youbike station, how many bikes does he expect to see on the docks?
    (d) A manager of YouBike company comes to observe the operation of this particular station. When he arrives at the station, both docks are empty. What is the expected number of time units until 2 bikes will be on the docks?

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

這一題的完整詳解

核心觀念

本題考察有限狀態離散時間馬可夫鏈,包括:

  • 狀態空間的建立
  • 轉移機率矩陣
  • 穩態機率與流量平衡
  • 穩態下的期望值
  • 首達時間的期望值

令狀態 XtX_t 表示第 tt 個時間槽結束時停放在站上的腳踏車數量。由於最多只有 22 個車位,因此狀態只可能為 0,1,20,1,2。

其中:

  • 歸還腳踏車的機率為 p=0.4p=0.4
  • 租借腳踏車的機率為 q=0.6q=0.6
  • p+q=1p+q=1

在狀態 00 時,雖然租借事件仍可能發生,但因為沒有腳踏車可租,系統仍停留在狀態 00。在狀態 22 時,雖然歸還事件仍可能發生,但因為車位已滿,系統仍停留在狀態 22。


(a) 狀態空間與轉移機率矩陣

狀態空間

S={0,1,2}\mathcal{S}=\{0,1,2\}

各狀態的轉移

由狀態 00:

  • 歸還一輛:0→10\to 1,機率 p=0.4p=0.4
  • 租借事件但無車可租:0→00\to 0,機率 q=0.6q=0.6

由狀態 11:

  • 歸還一輛:1→21\to 2,機率 p=0.4p=0.4
  • 租借一輛:1→01\to 0,機率 q=0.6q=0.6

由狀態 22:

  • 歸還事件但無空位:2→22\to 2,機率 p=0.4p=0.4
  • 租借一輛:2→12\to 1,機率 q=0.6q=0.6

依照狀態排列順序 (0,1,2)(0,1,2),轉移機率矩陣為

P=[qp0q0p0qp]=[0.60.400.600.400.60.4].P= \begin{bmatrix} q & p & 0\\ q & 0 & p\\ 0 & q & p \end{bmatrix} = \begin{bmatrix} 0.6 & 0.4 & 0\\ 0.6 & 0 & 0.4\\ 0 & 0.6 & 0.4 \end{bmatrix}.

每一列的總和皆為 11,符合轉移機率矩陣的要求。


(b) 租借學生遇到兩個車位皆空的機率

設穩態機率為

π=(π0,π1,π2),\boldsymbol{\pi}=(\pi_0,\pi_1,\pi_2),

其中 πi\pi_i 表示長期而言系統處於狀態 ii 的機率。

此題是出生—死亡型馬可夫鏈,利用相鄰狀態的流量平衡:

π0p=π1q.\pi_0p=\pi_1q.

因此

π1=pqπ0=0.40.6π0=23π0.\pi_1=\frac{p}{q}\pi_0 =\frac{0.4}{0.6}\pi_0 =\frac{2}{3}\pi_0.

同理,

π1p=π2q,\pi_1p=\pi_2q,

所以

π2=pqπ1=23π1=49π0.\pi_2=\frac{p}{q}\pi_1 =\frac{2}{3}\pi_1 =\frac{4}{9}\pi_0.

再利用機率總和為 11:

π0+π1+π2=1.\pi_0+\pi_1+\pi_2=1.

代入上式:

π0+23π0+49π0=1.\pi_0+\frac{2}{3}\pi_0+\frac{4}{9}\pi_0=1. 199π0=1,\frac{19}{9}\pi_0=1,

因此

π0=919.\pi_0=\frac{9}{19}.

當學生到站租借時,若系統處於穩態,遇到兩個車位皆空的機率就是處於狀態 00 的穩態機率:

π0=919≈0.4737.\boxed{\pi_0=\frac{9}{19}\approx 0.4737}.

因此,機率約為 47.37%47.37\%。


(c) 學生預期看到的腳踏車數量

穩態下,腳踏車數量的期望值為

E[X]=∑i=02iπi.E[X]=\sum_{i=0}^{2}i\pi_i.

由前面的計算,

π0=919,π1=619,π2=419.\pi_0=\frac{9}{19},\qquad \pi_1=\frac{6}{19},\qquad \pi_2=\frac{4}{19}.

因此

E[X]=0⋅919+1⋅619+2⋅419.E[X] =0\cdot\frac{9}{19} +1\cdot\frac{6}{19} +2\cdot\frac{4}{19}. E[X]=6+819=1419.E[X]=\frac{6+8}{19} =\frac{14}{19}.

所以學生預期看到的腳踏車數量為

E[X]=1419≈0.7368 輛.\boxed{E[X]=\frac{14}{19}\approx 0.7368\text{ 輛}}.

(d) 從兩個車位皆空到停滿兩輛的期望時間

令

  • E0E_0:從狀態 00 出發,首次到達狀態 22 所需的期望時間
  • E1E_1:從狀態 11 出發,首次到達狀態 22 所需的期望時間
  • E2=0E_2=0:已經在狀態 22,因此首達時間為 00

建立 E0E_0 的遞迴式

從狀態 00 出發:

  • 以機率 qq 留在狀態 00
  • 以機率 pp 到達狀態 11

每次轉移消耗一個時間單位,因此

E0=1+qE0+pE1.E_0=1+qE_0+pE_1.

代入 p=0.4p=0.4、q=0.6q=0.6:

E0=1+0.6E0+0.4E1.E_0=1+0.6E_0+0.4E_1.

整理得

0.4E0=1+0.4E1,0.4E_0=1+0.4E_1, E0=2.5+E1.E_0=2.5+E_1.
🔒

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

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

免費註冊

其他考古題

114 年臺灣大學的其他科目

臺灣大學《作業研究》其他年度