114 年 國立臺灣大學工業工程學研究所碩士班產業與服務系統工程組《作業研究》
第 1 題30 分
- (30 points) Consider the following primal linear programming problem (P).
Minimize
subject to
(a) If , find an initial feasible solution of by using Phase-I of the two-phase method.
(b) If , find an optimal solution of by using the simplex method.
(c) Write the dual problem.
(d) If , what is the optimal solution to the dual problem and its corresponding objective value of the dual problem?
(e) If , find an optimal solution of to the primal problem (P) starting from a trivial infeasible solution, , by using the dual simplex method.
(f) Construct the allowable range of that the optimal solution obtained in (b) stays optimal.
登入後即可作答並保存紀錄。
核心觀念
本題整合線性規劃的幾項核心技巧:
- 兩階段法 Phase-I:先加入人工變數,求得原問題的可行基底解。
- 單純形法 Simplex Method:由可行基底解判斷是否仍有可改善的非基底變數。
- 對偶問題 Dual Problem:依照原問題的最小化形式、等式限制與非負變數建立對偶。
- 對偶單純形法 Dual Simplex Method:由「對偶可行但原始不可行」的基底解出發。
- 目標係數允許範圍:保持目前基底解最適,必須使所有非基底變數的 reduced cost 維持最適條件。
(a) 使用 Phase-I 求初始可行解
原問題第一條限制式的右側為負,先將其乘以 :
加入人工變數 :
第二條限制式為:
Phase-I 的目標為最小化人工變數:
令 為基底變數,其他變數設為 :
此時 ,故初始 Phase-I 解為:
由第一式可得:
當 進入基底時, 會先降至 ;由第二式可知 尚未先變成負值,因此令 離開基底。
由
解出:
再代入第二式:
令非基底變數 ,得到:
且人工變數 ,因此原問題的一組初始可行解為:
(b) 使用單純形法求最適解
當 時,目標函數為:
沿用 (a) 所得到的基底 ,將限制式寫成字典形式:
代入目標函數:
由於 ,且目標函數中兩者的係數均為正值,因此增加任一非基底變數都會使 增加。最小值在:
時取得。
因此:
最適解為:
最適目標值為:
(c) 建立對偶問題
原問題為:
兩條限制式都是等式,因此先令對偶變數 不受符號限制。
因為原問題是最小化問題,且所有原始變數均為非負,因此對偶限制式為「小於等於」。
對偶目標函數為:
逐一依照原始變數建立對偶限制式:
- 對應第一欄 :
- 對應第二欄 :
- 對應第三欄 ,其成本為 :
- 對應第四欄 ,其成本為 :
故對偶問題為:
(d) 時對偶問題的最適解
由 (b) 的原問題最適解:
使用互補鬆弛條件。
因為 ,其對偶限制式必須為等式:
因為 ,其對偶限制式也必須為等式:
代入 :
因此:
對偶最適解為:
對偶目標值為:
第 2 題20 分
- (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 types | 1 | 2 | 3 | 4 | 5 | 6 | ≥7 |
|---|---|---|---|---|---|---|---|
| Pork | 25 | 50 | 60 | 80 | 100 | 100 | 100 |
| Beef | 20 | 70 | 90 | 100 | 100 | 100 | 100 |
| Vegitable | 40 | 60 | 80 | 100 | 100 | 100 | 100 |
| Grain | 10 | 20 | 30 | 40 | 50 | 60 | 70 |
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.
登入後即可作答並保存紀錄。
核心觀念
本題考查動態規劃的階段、狀態與遞迴關係。將四種餐點依序分配菜色,每種至少選一道,且各種類的營養分數依所選數量查表。目標是使四種類的營養分數總和最大。
設 為第 種餐點選 道時的營養分數,則總分為四種餐點分數的加總。
(a) 階段與狀態
- 階段:每個階段處理一種餐點,依序為豬肉、牛肉、蔬菜、穀類。
- 狀態:已分配給目前及先前餐點的菜色總數。
- 決策:在目前階段所處理的餐點選幾道;每種至少一道。
令 表示前 種餐點共分配 道菜時可得到的最高營養分數。初始條件為:
對 ,遞迴式為:
其中 是第 種餐點的菜數;上限 確保前 種餐點各至少有一道。最後求 。
(b) 動態規劃求解
先合併豬肉與牛肉,計算 。表中的配置欄列出達到最高分的一組豬肉、牛肉菜數。
| 總菜數 | 最佳配置(豬肉、牛肉) | |
|---|---|---|
| 2 | 45 | |
| 3 | 95 | |
| 4 | 120 | |
| 5 | 140 | |
| 6 | 150 | |
| 7 | 170 | |
| 8 | 190 | |
| 9 | 200 |
例如,兩種餐點合計選 道時:
此時豬肉選 道、牛肉選 道。
接著加入蔬菜,依遞迴式計算 :
第 3 題30 分
- (30 points) Consider the following optimization problem
subject to
Answer the following questions.
(a) Show that 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 and are "inactive"? Show the details.
(d) Continuing with (b), identify the feasible solution(s) and check whether or not the Linear Independence Constraint Qualification (LICQ) holds at .
(e) Find the global minimizer and the optimal value of .
登入後即可作答並保存紀錄。
本題考驗凸優化理論,包含凸函數判定、KKT 条件、约束最优化中的正規性条件 (LICQ) 以及寻找全局最优解。
(a) 證明 是凸函數:
一個二次函數 是凸函數,若且唯若其 Hessian 矩陣 是半正定的 (positive semi-definite)。
對於 ,我們可以寫成向量形式。
Hessian 矩陣為 。
所以 Hessian 矩陣為 。
要判斷 是否為半正定,我們檢查其特徵值或主子式。
主子式:
由於所有主子式都大於零,Hessian 矩陣 是正定的 (positive definite)。
正定矩陣意味著函數 是嚴格凸函數 (strictly convex)。嚴格凸函數也是凸函數。
因此, 是凸函數。
(b) KKT 条件:
KKT 条件是約束最优化问题寻找最优解的必要条件(对于凸问题,也是充分条件)。
原问题是:
引入拉格朗日乘子 和 。
KKT 条件包括:
-
梯度条件 (Stationarity):
(對應 )
(對應 )
所以,
-
可行性条件 (Primal Feasibility):
-
对偶可行性条件 (Dual Feasibility):
-
互补松弛性条件 (Complementary Slackness):
(c) 在 和 都不活跃 (inactive) 时寻找可行解:
若 和 都不活跃,则意味着:
并且,根据互补松弛性条件:
(因为 )
(因为 )
此时 KKT 条件简化为:
- 梯度条件:
第 4 題20 分
- (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 ,
A bike is rented with probability .
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?
登入後即可作答並保存紀錄。
核心觀念
本題考察有限狀態離散時間馬可夫鏈,包括:
- 狀態空間的建立
- 轉移機率矩陣
- 穩態機率與流量平衡
- 穩態下的期望值
- 首達時間的期望值
令狀態 表示第 個時間槽結束時停放在站上的腳踏車數量。由於最多只有 個車位,因此狀態只可能為 。
其中:
- 歸還腳踏車的機率為
- 租借腳踏車的機率為
在狀態 時,雖然租借事件仍可能發生,但因為沒有腳踏車可租,系統仍停留在狀態 。在狀態 時,雖然歸還事件仍可能發生,但因為車位已滿,系統仍停留在狀態 。
(a) 狀態空間與轉移機率矩陣
狀態空間
各狀態的轉移
由狀態 :
- 歸還一輛:,機率
- 租借事件但無車可租:,機率
由狀態 :
- 歸還一輛:,機率
- 租借一輛:,機率
由狀態 :
- 歸還事件但無空位:,機率
- 租借一輛:,機率
依照狀態排列順序 ,轉移機率矩陣為
每一列的總和皆為 ,符合轉移機率矩陣的要求。
(b) 租借學生遇到兩個車位皆空的機率
設穩態機率為
其中 表示長期而言系統處於狀態 的機率。
此題是出生—死亡型馬可夫鏈,利用相鄰狀態的流量平衡:
因此
同理,
所以
再利用機率總和為 :
代入上式:
因此
當學生到站租借時,若系統處於穩態,遇到兩個車位皆空的機率就是處於狀態 的穩態機率:
因此,機率約為 。
(c) 學生預期看到的腳踏車數量
穩態下,腳踏車數量的期望值為
由前面的計算,
因此