不管是 discrete() or continuous parameter time() 的 Stochastic Process,只要滿足以下式子,即可稱為一個 Markov Process:
a Stochastic Process is best defined as a family of random variables, , defined over some index set or parameter space . The set is sometimes also called the time range, and denotes the state of the process at time t.
在日後的課程中我們會學到 Birth-Death Processes,而 Birth-Death Process 即具有 Markovian property,也就是滿足上式的定義。
而這個學期我們會學到的大部分 Queue 都是以 Birth-Death Process 為基礎,故在 Queueing Theory 中,我們可以使用 discrete-time Markov Chain 或者 continuous-time Markov Process 來分析 各種 Queue 的 long term behavior。
以下說明不會著重在詳細數學證明,而是僅在邏輯層面上做整理,釐清各個 distribution (長期來說)的關係。
對 Markov Chian 來說,觀察 long-term behavior 有三種,第一是 stationary distribution,第二是 limiting distribution,第三是 ergodicity。
首先定義 Communicating Classes,我們說 state i & j communicate 代表雙方都一定可以經過 state transition 到達對方的 state,而若整個 Markov Chain 的 state 都互相 communicate,我們說這個 Markov Chain 是 irreducible。
接著定義 Recurrence & Transience,Recurrence & Transience 代表一個 state 回到自己的可能性。定義如下:
let , where 代表從 state j 開始經過 n 個 transitions 回到 state j 的機率。若 ,我們說 j 是 recurrent state,若 ,我們說 j 是 transient state。
transient 簡單來說就是對 state j 而言,長期來說,從 state j 跑去別的 state 然後不回來是必然,Markov Chain 在跑的過程中經過 state j 的次數的期望值會是 finite。
反之 recurrent 代表長久來看是一定會回來的,經過 state j 的次數的期望值會是 infinite。
當 state i 的 (recurrent state),即可定義 , 代表state j 回到自己的平均 transitions 數,也稱為 mean recurrence time。
若 ,我們說state j 為 positive recurrent,也就是我們會在一定數量的 transitions 內回到自己。若 ,我們說 state j 為 null recurrent,代表有機率回到自己這個 state,但是不知道需要多久。
而 period 為從state j 開始回到自己的 transition 數(可能有很多個)的最大公因數(GCD),若為1 稱為 aperiodic,反之稱為 periodic。
我們說一組互相 communicate 的 state 為一個 Communicating Class,若這個Communicating Class 中的 state 都無法到達任何外界的 state(也就是說繞來繞去都在這個 Communicating Class 中),稱為 closed Communicating Class,反之稱為 open。
若將這個 closed 概念類比到一個 state,則稱這個state 為 absorbing state,代表一旦 Markov Chain 進入這個state,就無法再出來了。(從 state diagram 來看,一個簡單的例子就是只有一個單向箭頭進入的 node)
一個 Markov Chain 可能會具有多個 Communicating Class,每個 class 中的 state 都互相communicate,但是不和其他 class communicate,而同一個 Communicating Class 當中的 state 以下幾項性質都會相同: period, transient / null recurrent / positive recurrent。
因為同個 Communicating Class 中的 state 會有相同性質,所以我們藉由觀察其中一個 state,看這個 state 是否為 positive recurrent 還是 null recurrent 或 transient,就知道整個 Communicating Class 具有怎樣的性質。
當一個 Communicating Class 是 positive recurrent,就有 unique 的 stationary probability distribution:
其中 為 state i 的 expected return time。
若整個 Markov Chain 為 irreuducible,代表只有一個 Communicating Class,也就是說這個 Markov Chain具有唯一解的 Stationary Distribution。
若 Communicating Class 為 null recurrent 或者 transient,則沒有 stationary distribution。
我們說一個 process 是 stationary 代表 independent of time,但是若將 initial state(Markov Chain 的起始點)對 long-term behavior 的影響考慮進來,就是以下要介紹的limiting distribution。
補充:
下面定理可以幫助我們在已知為 irreducible, aperiodic 時判斷一個 Markov Chain 是否為 positive recurrent:
若一個 Markov Chain 為 irreducible, aperiodic,若存在一個 nonnegative solution 滿足 such that ,則這個 Markov Chain 為 positive recurrent。
當一個 Communicating Class 為 positive recurrent 且 aperiodic,我們說 limiting distribution exists,且會和 stationary distribution 相等。
代表 initial state 的影響 in the long run 來看已不存在,顯示了 lack of memory 的性質。
將沒有影響這件事寫成數學式:,代表 in the long run,此 process 會在 state j 的機率,這個機率和 starting state i 沒有關係。矩陣 可寫成如下:
where
若為 null recurrent 或 transient,則
若一個 Markov Chain 有多個 Communicating Class, 的每個橫軸(index )就對應state 所在的Communicating Class 的 limiting distribution。
Limiting distribution 觀察的是 state 在很久以後的一個時間點 n 的表現,而 Ergodicity 觀察的是在一段很長的時間裡面,state 的平均表現怎麼樣。
我們說一個 process 具有 Ergodicity ,代表對於所有 moment,都具有 Time Average = Ensemble Average 這個性質,也就是
代表這個 process 的 moments are independent of time(但是不一定和 initial state 無關)。也代表 process 的 moments 都有極限(finite)。
當具有 ergodicity ,就具有以下性質,定義 total number of visits to state j up to time n,給定一個 irreducible 的 Markov Chain:
若為 positive recurrent & irreducible 則 (almost surely)
若為 null recurrent 或者 transient 則 (almost surely)
當一個 Markov Chain 是 irreducible 且 positive recurrent 時就會有 stationary distribution,如果今天再加上 all moments are finite 這個條件,就會是 ergodic,如果再加上是 aperiodic 就會具有 limiting distribution。
所以說,stationary, ergodic, limiting distribution 這三個條件的強度(需要的條件數量)為:limiting distribution > ergodic > stationary。
我們可以根據上述的定理以及性質,判斷 Markov Chain 具有哪些性質(irreducible / positive recurrent, …),即可知道 Limiting Distribution / stationary distribution 等等存不存在,接著即可用 來求解(看是 discrete / continuous)。
在本課程中探討的 Markovian Queue 幾乎都會是有解的(要不然你們就沒辦法算 ,考試就不用考了),不過了解上述分析,對於日後若研究有要用到 Markovian Queue 相關分析時會有幫助。
若說 若滿足:
我們稱之為一個 discrete Markov Chain, 為此 Markov Chain 在 時的 state()。
為從 state 跳到 state 的機率(transition probability):
假設一個 Markov Chain 的 state space ,將所有 transition probability 結合起來可以寫成一個矩陣 (transition probability matrix):
即代表此 Markov Chain 做 次 transition 的 probability matrix,其中 代表經過 step 後從 state 跳到 state 的機率:
Markov Chain 的 state 會隨著時間而變化,而長期來說,如果這個 Markov Chain long-term behavior 是穩定的,我們就可以求出其 steady state probability,也就是説讓這個 Markov Chain 跑一段時間後,我們對其經過的 state 的歷史進行觀察,可以看出其處於各個不同的 state 的機率分別是多少。
我們稱「處於各個不同的 state 的機率」為 Markov Chain 的 steady state probability。
令 steady state probability ,代表 Markov Chain 長期來說在 state , state ,以此類推,的機率。
可由以下公式解聯立方程式求出:
where ,其中第一式的意義為:steady state 的機率是穩定的,就算再多經過一次 transition 也不會改變。第二式的意義為機率合為 。
在 Continuous-time Markov Process中,系統處於每一個 state 的時間都是一個 exponential random variable。
和 Discrete-time Markov Chain 類似,假設 state space ,我們定義 transition matrix ,我們稱 為 generator matix:
其中 為此 Markov Process(Chain) 在 內從 state 跳到 state 的機率。
,代表 matrix 的每一個 row 的 sum 都是 。關於 的意義請見下方連立方程式的說明。
給定一個 state transition diagram,寫出 的步驟就是先把非對角線的 通通填完,最後利用 row sum 將對角線填上。
令 steady state probability matrix ,,可由下式求出 steady state probability:
其中第一式代表的意義為:對於任一一個 state 而言,從自己跳出去到別的 state 的機率的總和,會和其他人跳進來的機率總和相等(系統達到穩定、平衡的狀態),至於為何會相等,可以直觀來解釋:因為若不相等,跳進來的不等於跳出去的,那麼 state probability 就還會變動。
將跳出去等於跳進來這件事寫成數學式:
其中 可解釋為何 matrix 要如此定義(row sum = 0)。
若 Continuous-time Markov Chain 觀察的角度是錄影,那麼 Embedded Markov Chain 就是在照相(只是照很多張而已)。
If we observe the system state right after a state transition in continuous-time Markov Chain. Let be the -th observed state, then is called embedded Markov Chain(a discrete-time Markov Chain).
在一個 continuous-parameter 的 Markov Chain 中,只觀察系統 state 變化的時刻(就是在照相),觀察的結果為一個 discrete-parameter 的 Markov Chain,我們稱之為 Embedded Markov Chain。
而我們在照相完之後,會有很多照片,分析這些照片代表的意義,就可以定義 transition probability 。
代表的意義為,從 state i 要跳到 state j 的機率,可寫成
也就是從state i 跳到 j 的機率除以所有從 state i 出去(到除了 state j 以外的 state)的機率的總和。(這裡的 和 continuous-time Markov Chain 裡的是一樣的定義)
每個 state 的 holding time 會是一個 exponential r.v.,其期望值(mean holding time)為
以 Birth-Death Processes 為例,其 可表示成
,
將所有 綜合起來寫成矩陣 ,即可用聯立方程式求解 steady state probability :
where
若一個 coninuous-time Markov Chain 的 Embedded Markov Chain 為 irreducible 且 positive recurrent,我們就說這個 continuous-time Markov Chain 也是 irreducible 且 positive recurrent。
至於要判斷是否具有 stationary solution, limiting distribution, ergodicity 的話,會需要知道是否為 aperiodic。
判斷 aperiodic 的方法為:判斷其 Embedded Markov Chain 的 mean holding time 是否為bounded,若是,就如同這個 Continuous-time Markov Chain 為 aperiodic 一樣。
在理解 Embedded Markov Chain & Continuous-time Markov Chain 各自的定義以及如何求解之後,我們來比較他們兩個之間的異同以及其關聯性。
是 Continuous-time Markov Chain 求出來的解,而 是 Embedded Markov Chain 求出來的解,他們各自代表的意義如下:
: represents the ratio of visit state among all state
: represents the time ratio that system stays at state in a long term observation period.
Embedded Markov Chain 就像是在對系統進行拍照,而 Continuous-time Markov Chain就像是在對系統進行錄影,兩者所得出的結果 , 的值理所當然會不一樣,因為觀察角度不同,至於要用哪個角度觀察,會因觀察的需求不同而定。
兩者之間的關係可以透過下式得到:
where is the mean holding time at state i
因為 代表是在 state 的平均停留時間,結合上面對於 和 所代表的意義的說明,上式的意義就很直觀明瞭了(時間 x 比例 = 時間比例,time x ratio = time ratio)
Consider an queue with arrival rate and service rate .
Please write down the generator matrix for its continuous time Markov Chain, which represents its system size(the number of customers in the system). (4%)
Please then solve its steady-state probability for using the generator matrix obtained in 1. (6%)
let
solve:
Derive the embedded Markov chain of this queue and obtain its steady state probability for . (6%)
The transition matrix
let
solve:
Please determine the mean holding time for state 0,1,2, and 3.(4%)
let denote the mean holding time for state .
Use the results of in 3. and the mean holding time in 4. to derive the formula for the steady-state probability .(Hint: the results should be the same as in 2.)(6%)
Use
Compute
then 可如法炮製,一場混戰之後會發現,結果和 2. 的結果相同。(NOTE: 同學在考試時不可以寫如法炮製,要實際算出來)