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)}

對偶目標值為:

🔒

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

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

免費註冊

第 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):

🔒

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

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

免費註冊

第 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).

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

這一題的完整詳解

本題考驗凸優化理論,包含凸函數判定、KKT 条件、约束最优化中的正規性条件 (LICQ) 以及寻找全局最优解。

(a) 證明 f(x,y)f(x, y) 是凸函數:
一個二次函數 f(x)=xTQx+LTx+cf(\mathbf{x}) = \mathbf{x}^T Q \mathbf{x} + L^T \mathbf{x} + c 是凸函數,若且唯若其 Hessian 矩陣 QQ 是半正定的 (positive semi-definite)。
對於 f(x,y)=x2+2xy+2y2+4x+6y+5f(x, y) = x^2 + 2xy + 2y^2 + 4x + 6y + 5,我們可以寫成向量形式。
x=(xy)\mathbf{x} = \begin{pmatrix} x \\ y \end{pmatrix}
f(x,y)=(xy)(1112)(xy)+(46)(xy)+5f(x, y) = \begin{pmatrix} x & y \end{pmatrix} \begin{pmatrix} 1 & 1 \\ 1 & 2 \end{pmatrix} \begin{pmatrix} x \\ y \end{pmatrix} + \begin{pmatrix} 4 & 6 \end{pmatrix} \begin{pmatrix} x \\ y \end{pmatrix} + 5
Hessian 矩陣為 H=(∂2f∂x2∂2f∂x∂y∂2f∂y∂x∂2f∂y2)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}。
∂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
∂2f∂x2=2\frac{\partial^2 f}{\partial x^2} = 2
∂2f∂y2=4\frac{\partial^2 f}{\partial y^2} = 4
∂2f∂x∂y=2\frac{\partial^2 f}{\partial x \partial y} = 2
∂2f∂y∂x=2\frac{\partial^2 f}{\partial y \partial x} = 2
所以 Hessian 矩陣為 H=(2224)H = \begin{pmatrix} 2 & 2 \\ 2 & 4 \end{pmatrix}。
要判斷 HH 是否為半正定,我們檢查其特徵值或主子式。
主子式:
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)。
正定矩陣意味著函數 f(x,y)f(x, y) 是嚴格凸函數 (strictly convex)。嚴格凸函數也是凸函數。
因此,f(x,y)f(x, y) 是凸函數。

(b) KKT 条件:
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  ⟹  x+y≥3\text{s.t. } g_1(x,y) = 3 - x - y \le 0 \implies x + y \ge 3
g2(x,y)=−y≤0  ⟹  y≥0g_2(x,y) = -y \le 0 \implies y \ge 0
引入拉格朗日乘子 μ1≥0\mu_1 \ge 0 和 μ2≥0\mu_2 \ge 0。
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}
    ∇f=(2x+2y+42x+4y+6)\nabla f = \begin{pmatrix} 2x + 2y + 4 \\ 2x + 4y + 6 \end{pmatrix}
    ∇g1=(−1−1)\nabla g_1 = \begin{pmatrix} -1 \\ -1 \end{pmatrix} (對應 g1=3−x−yg_1 = 3 - x - y)
    ∇g2=(0−1)\nabla g_2 = \begin{pmatrix} 0 \\ -1 \end{pmatrix} (對應 g2=−yg_2 = -y)
    所以,
    2x+2y+4−μ1(1)−μ2(0)=0  ⟹  2x+2y+4−μ1=02x + 2y + 4 - \mu_1(1) - \mu_2(0) = 0 \implies 2x + 2y + 4 - \mu_1 = 0
    2x+4y+6−μ1(1)−μ2(1)=0  ⟹  2x+4y+6−μ1−μ2=02x + 4y + 6 - \mu_1(1) - \mu_2(1) = 0 \implies 2x + 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):
    μ1g1(x,y)=0  ⟹  μ1(3−x−y)=0\mu_1 g_1(x,y) = 0 \implies \mu_1 (3 - x - y) = 0
    μ2g2(x,y)=0  ⟹  μ2(−y)=0\mu_2 g_2(x,y) = 0 \implies \mu_2 (-y) = 0

(c) 在 g1g_1 和 g2g_2 都不活跃 (inactive) 时寻找可行解:
若 g1g_1 和 g2g_2 都不活跃,则意味着:
g1(x,y)<0  ⟹  3−x−y<0  ⟹  x+y>3g_1(x,y) < 0 \implies 3 - x - y < 0 \implies x + y > 3
g2(x,y)<0  ⟹  −y<0  ⟹  y>0g_2(x,y) < 0 \implies -y < 0 \implies y > 0
并且,根据互补松弛性条件:
μ1g1(x,y)=0  ⟹  μ1=0\mu_1 g_1(x,y) = 0 \implies \mu_1 = 0 (因为 g1<0g_1 < 0)
μ2g2(x,y)=0  ⟹  μ2=0\mu_2 g_2(x,y) = 0 \implies \mu_2 = 0 (因为 g2<0g_2 < 0)

此时 KKT 条件简化为:

  1. 梯度条件:
    2x+2y+4−0=0  ⟹  2x+2y=−4  ⟹  x+y=−22x + 2y + 4 - 0 = 0 \implies 2x + 2y = -4 \implies x + y = -2
🔒

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

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

免費註冊

第 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}.

因此

🔒

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

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

免費註冊

其他考古題

114 年臺灣大學的其他科目

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