some efficient computational algorithms related to phase models

21
Acta Informatica27:157-177 (1989) InfUrinatica Springer-Verlag 1989 Some Efficient Computational Algorithms Related to Phase Models* Vernon Rego Department of Computer Sciences,Purdue University,West Lafayette, IN 47907, USA Summary. This paper develops efficient computational algorithms for some models that utilize phase type distributions. As in other instances, such as matrix-geometric methods, where the PH-distribution lends itself to useful and efficient computational methods, we examine how certain probabilities based on these distributions may be efficiently computed. The examples that we consider include token ring networks, simple multiqueues, and order statistics. By exploiting the geometric nature of PH-densities, it is shown that certain exponential time computations can be reduced to linear time, if recursive algorithms are used. We demonstrate speedup with the aid of a practical example, using a recursive as well as a nonrecursive algorithm, in verifying the stability of a queue on a token ring network. 1. Introduction and Motivation Practitioners of stochastic modelling in communications system design are well aware of the tremendous difficulties inherent to multiqueueing systems, the deter- mination of their stability, and analysis of their behaviour. When faced with concerns of dimensionality, or dependence between key random variables, it is not uncommon for a researcher to look for approximate or even asymptotic methods that would yield some insight into system behaviour. It is perhaps often that some useful computational stochastic models are overlooked in favour of simulations or asymptotics, due to a (sometimes cursory) sense of their high intrinsic dimensionality. Simulations of multidimensional queueing systems such as communication systems are usually not complete and sometimes impossible, without knowledge of the stable operating region of the system under consideration. Further, it is one matter to have knowledge of a system's stability condition, and quite another matter to be able to tell if a given system is operating in a stable fashion, for given system parameters. In most interesting systems, especially interference systems and systems with mixed (i.e., finite and infinite) buffers, the latter usually requires the computation of certain joint probabilities. Exam- * This researchwas supported in part by the National ScienceFoundation under grant NCR-8702!15 and in part by a 1987 Purdue XL grant

Upload: vernon-rego

Post on 06-Jul-2016

217 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Some efficient computational algorithms related to phase models

Acta Informatica 27:157-177 (1989) InfUrinatica �9 Springer-Verlag 1989

Some Efficient Computational Algorithms Related to Phase Models*

Vernon Rego Department of Computer Sciences, Purdue University, West Lafayette, IN 47907, USA

Summary. This paper develops efficient computational algorithms for some models that utilize phase type distributions. As in other instances, such as matrix-geometric methods, where the PH-distribution lends itself to useful and efficient computational methods, we examine how certain probabilities based on these distributions may be efficiently computed. The examples that we consider include token ring networks, simple multiqueues, and order statistics. By exploiting the geometric nature of PH-densities, it is shown that certain exponential time computations can be reduced to linear time, if recursive algorithms are used. We demonstrate speedup with the aid of a practical example, using a recursive as well as a nonrecursive algorithm, in verifying the stability of a queue on a token ring network.

1. Introduction and Motivation

Practitioners of stochastic modelling in communications system design are well aware of the tremendous difficulties inherent to multiqueueing systems, the deter- mination of their stability, and analysis of their behaviour. When faced with concerns of dimensionality, or dependence between key random variables, it is not uncommon for a researcher to look for approximate or even asymptotic methods that would yield some insight into system behaviour. It is perhaps often that some useful computational stochastic models are overlooked in favour of simulations or asymptotics, due to a (sometimes cursory) sense of their high intrinsic dimensionality.

Simulations of multidimensional queueing systems such as communication systems are usually not complete and sometimes impossible, without knowledge of the stable operating region of the system under consideration. Further, it is one matter to have knowledge of a system's stability condition, and quite another matter to be able to tell if a given system is operating in a stable fashion, for given system parameters. In most interesting systems, especially interference systems and systems with mixed (i.e., finite and infinite) buffers, the latter usually requires the computation of certain joint probabilities. Exam-

* This research was supported in part by the National Science Foundation under grant NCR-8702! 15 and in part by a 1987 Purdue XL grant

Page 2: Some efficient computational algorithms related to phase models

158 V. Rego

Poisson (X) IIIIIIII �9

Fig. 1. Single server queue

service time ffi X x - F(x)

pies of situations where these joint probabilities are required and also examples of (rare) cases where such joint probabilities may be ignored can be seen in [11]. Besides being important for ascertaining system stability, there are several reasons (for example, see [-4, 5]) why computational models are important. Albeit dimensionally small, one useful computational example of an otherwise intract- able class of token ring problems can be found in I-6].

Our work is strongly motivated by the need for efficient algorithmic methods of the kind pioneered by Neuts 1-5] in stochastic modelling. In this paper, we address computational algorithms for models that use the well known phase-type distributions [-5] in multidimensional settings. In each of the following three sections, we give examples of situations where certain probabilities in multidi- mensional systems can be computed efficiently through the use of recurrence equations. In order to demonstrate the degree of speedup obtained, we give the run-times of two different algorithms used to solve the same problem, for various parameters. The techniques used to obtain the fast, recursive algorithms, are mainly elementary generating function based methods, of the kind used in a somewhat similar application by Moore [3].

2. F r o m Exponential to Linear T ime

In an m + i state Markov chain on states {1, 2 . . . . . m + 1}, assume that states 1, 2 . . . . . m are all transient, so that absorption into state m + 1 from any initial state, is certain. Assuming the chain operates in continuous (discrete) time and the initial vector is (~, am+ 1), the time to absorption in the chain is known [5] as a continuous (discrete) phase type random variable.

In the continuous case, the probability distribution F(.) of this random variable is given by

F (x )= 1 --~ exp (Tx)e (2.1)

for x > 0, and in the discrete case, the probability density {Pk; k > 0} of this random variable is given by

Po = ~., + 1 (2.2) pm=atTk- l [J, k > l

where in each case (at, ~m+ 1) is an initial vector and T,/I are an appropriately defined m x m matrix and m x 1 vector, respectively. A brief description can be found in the appendix. In each case, (at, T) is said to be a representation of the PH distribution (i.e., phase type distribution) or PH density, respectively.

We next need a useful result relating queues, continuous PH random vari- ables and discrete PH random variables. In order to motivate our discussion, consider the scene depicting a single server queueing situation shown in Fig. 1.

Page 3: Some efficient computational algorithms related to phase models

Some Efficient Computational Algorithms Related 159

Assuming Poisson arrivals and continuous PH service-times, this queue is an M/PH/1 queue. In keeping with the usual departure instant based queueing chain construction for this M/GI/1 queue, define

ak = probability of k customer arrivals in a service time

= ~ e-a'(2t)~ dF(t) (2.3) k~ 0

for k > 0, with 2 as arrival rate. The following result [5] shows how the probabili- ty density {ak;k > 0} can be computed without numerical integration for a large class of distributions F(.).

Lemma 1. I f F(.) is a continuous PH distribution with the representation (~, K), then {ak;k>O} is a discrete PH density with representation (at, T), where at = 2 r ( 2 I - K ) - a , T = 2 ( 2 I - K ) -1, atm+~=~Cm+~+~t(2I-K)-~K ~ and T ~ - K) - 1 K o. [ ]

In applying the above result, only one computation of the matrix inverse is necessary and this does not pose a problem since it is required that T be substo- chastic, and thus ( I - T ) non-singular.

2.1 Applications

The extremely helpful result, as we shall see, given as Lemma 1 is our point of departure into some inefficient and efficient computational methods. To begin with, the quantity

N

C (n) = Y, [ I I-It.k = o~ c~k,m +1 + It.k > o~ aq T~ k-x ilk] (2.4) D(n) k = 1

defined with O(n)={(nl, ...,nN)lnj~O,l<_~j~N , ~ n j : n } , is both useful and 1

easy to compute, provided one constructs the computational procedure with some care. To demonstrate what we mean by this, consider the following brute- force algorithm for C(n):

C,=0; for nl .'=0 to n do

for nN.'=O to n do begin

if ((nl +--- + nN).eq.(n)) then C:=C +p(nI)* ... * p(nN);

end; end;

end." (2.5)

Page 4: Some efficient computational algorithms related to phase models

160

W 1 Service time

[ ] (9 xl Y1

D o

�9 | �9 �9

Fig. 2. Asymmetric token ring

v. Rego

Switching time

where

, , f~j,,n+X n i=O P~ni) = ~ T"~- t (2.6) j j flj n~>l

for 1 <j<N. Clearly the above algorithm has a run time complexity that is exponential in N, since it examines all possible decompositions of the number n into N integer summands, taking order into account as well. Before showing how the algorithm in (2.5) can be redevised to yield a complexity of O(N), we first demonstrate three applications of the quantity C (n) in (2.4).

Example 1. Token Ring Models Consider an N station token ring (see Fig. 2), with stations numbered 1 to N, where station N has an infinite capacity buffer and all other stations have unit capacity buffers. Such a model is useful in estimating the effect (on a ring) of traffic from a gateway into the ring, and is a basic unit in a system of rings linked via gateways. At present such phenomena are not well understood since asymmetric ring models have proven to be formidable modelling problems. At present, there is no known solution for mean delays and mean queue lengths on an asymmetric ring where the requirement is that each station transmits at most one packet on each token capture (for example, see I-7, 8]). The model that we propose, from [6], is a first step in obtaining performance estimates for this problem. Since phase-type random variables are known to approximate a variety of random variables satisfactorily in modelling applications, by using phase type random variables for quantities such as service times and token

Page 5: Some efficient computational algorithms related to phase models

Some Efficient Computational Algorithms Related 161

passing delays, we obtain very general solutions. Note that the exponential (geometric) is a simple continuous (discrete) phase type random variable.

Assume that packets arrive at station j according to a Poisson process of rate 2i, (i.e., an asymmetric system) and arrivals at different stations are indepen- dent. Packet transmissions from each station j require a random time X j, distrib- uted as Bj(.), I < j < N . The token is passed around the ring unidirectionally, and stations capturing the token are allowed to transmit at most one packet per token capture. We assume that it takes the token a small random time Yj, with distribution St( 0, to switch past an empty station j, 1 < j < N. Additional- ly, the token passing time from station j to station k = (j mod N) + 1, is a random time Wk, distributed as Vk('), 1 <j<N.

In the M/SM/1 type (Poisson arrival, semi-Markov service time) based token ring model developed in [6], an embedded semi-Markov chain is defined as follows. Let t~', 1 < j < N denote the m th token scan-instant at station j for m > 0. With the convention . . . . <tN<tl + 1 < , z~m) t 1 < t 2 < . . . . . . let denote the number of packets found queued by the token at station j at time t~". Then {Z,}, Z , ~ (ZT, Z~ . . . . , Z}) is viewed as an embedded semi-Markov chain. Stan- dard arguments lead to the M/G/1 block structured matrix transition probability matrix

p =

Bo B1 BE B3 Ao A1 A2 Aa 0 Ao A1 A2 0 0 Ao A1 0 0 0 Ao

(2.7)

describing a (queue length, cycle-type) process seen at token scans of station N. Here Ak=Ak('l'), and Bk=Bk('t') are 2 N-1 x2 N-1 substochastic matrices, given by

Bk(z'lz)=P [Z.+l = <z', k> lZ .= <z, 0>]

Ai+k- 1 (z'[ z)= P[Z.+ 1 = <z', k >l Z. = <z, i>3 (2.8)

with Z = ( Z 1 . . . . , zN-1), z'=(Z'x . . . . . z~r as ( N - l ) bit binary vectors, and i > O. It can be shown that the queue at station N is stable if and only if

p=lg (k~= 0 k Ak) e < l. (2.9)

where n is the left invariant vector of the stochastic matrix A = ~ ak, and k = 0

e is an m-vector with all entries set to 1. Further, if B~(-) and V~(-) are continuous

Page 6: Some efficient computational algorithms related to phase models

162 V. Rego

PH distributions with representations (b j, B j) and (vi, Vj), respectively, for 1 < j <N , then using Lemma 1, it follows that

A,((0, . . . , 0 ) l z ) = q [I( .k= o/O~k,m+ 1 + I(.k> 0) ~k Tff ~- 1 T o] E(n) k k = 1

""+k- T~ (2.10) . [I{nN+k=o}O~N+k,m+lq_i{nN+k>O}OCN+kT~q+k 1

where E(n)= (n l, ..., n2u)l n1 > 0, 1 < j < 2N, n i = n . Also from Lemma 1, we

obtain

N-1

~ : I ~ ~k,m+l"]~k,m+l (2.11) k=l

where

and

~k, m +1 = Zk [bk,m + 1 q- Ilk B~ + (1 -- Zk) [Sk, m +, -t- S k S ~

Vk,m+l=[Vk, , ,+l+VkVO], for l < k < _ N (2.12)

Tk = Ck [2N (2N I -- Z~ B k + (1 -- z'k) Sk) - a i , Ck = 2S/I- ~ 2 i] j=kmodN+ 1

~k = Zk [2 N b(2N I-- Bk)- 1] _~_ (1 - z~) [2N s(2N I - Sk)- 1].

ak. m + 1 = Z'k [bk.,, + 1 + b (2N I - BR)- 1 B o] + (1 -- Z'k) [Sk.,1 + 1 + S (2N I -- Sk) - 1 S o]

T ~ = z~ [(2N I - Bk)-~ B ~ + (1 -- z~) [(2N I-- Sk)-I So] (2.13)

for l < k < N - 1 , and finally, TN,~N,~N,r,+I,T ~ defined just as in (2.13), but with zN in place of z~, and zN set equal to one (since the A submatrices deal with a nonempty queue at station N). Similarly, to account for terms N + k, 1 < k < N, we have

TN+k=C k 2N(2 N I__Vk ) - 1 ~tN +k =,~ N Vk(2 N I__Vk ) - 1,

~ +~,, . + ~ = V~,m+ ~ + V(,~N I - - V~)- 1 V o ,

and

T~ ~ [] (2.14)

1 Remarks . 1. The notation 1-I Lk, which will appear later, is used to denote

k=N

the downward product L N ' L N - 1 ... L1. While the differentiation between a downward and an upward product is not important in the scalar case, the noncommutativity of matrices requires this distinction when Lk is a matrix, l < k < _ N .

2. In general, for such M/GI/1 block structured transition matrices, it is required that each submatrix A k, B k, k > O , be readily computable, so that P

Page 7: Some efficient computational algorithms related to phase models

Some Efficient Computational Algorithms Related 163

in (2.7) is "known". The usual iterative methods for steady state solutions [5] do not require that all of these submatrices be stored simultaneously. Only one, or at most a small number, is needed during iterative computation. The expression in (2.10) tells us how to compute a single element in each matrix A,, n>0 , namely the entry A,((0 . . . . ,0)lz), for an arbitrary ( N - 1 ) bit binary vector z. In 1-6] it is shown how the entire matrix A, (.I.), n > 0, can be generated once this entry is obtained. For completeness, we have included the complete algorithm in the appendix. Observe that the submatrices B,('I') are obtained in identical fashion, except that now, in defining (2.10), the quantities TN, atN, ~N,,,+I and T ~ are defined using zN in place of z~r and zN set equal to zero (since the B submatrices deal with an empty queue at station N).

3. The stability condition in (2.9) can be computed in a simpler manner I-4]. However, the problem of computing expressions like (2.9) or similar expres- sions (say, higher order moments), for such matrix sequences, still remains. This demonstrates the value of an expression such as C(n). []

It should be clear at this stage that the constant C(n) as defined in (2.4) is precisely the expression in (2.10), i.e., a transition probability, where N is replaced by 2N, and T ~ is denoted by ilk. Observe that a way to tell if the queue at station N is stable is to compute the expression for p in (2.9). Since it will always be the case that Ak, k>m, is a zero matrix for some number m, m>0, the summation in (2.9) is accurately given by a finite sum. However, the number m may be large, and this makes the computation of p time-consum- ing, especially for larger values of the index k.

Example 2. Finite Convolutions Consider a system of N independent single server queues. Customers from N independent Poisson processes, with rates 21, •2, " ' ' , '~N, arrive at N independent queueing stations. If the service time at queue k, 1 < k < N, is a continuous PH random variable with distribution Fk('), then Lemma 1 tells us that the density of the random variable describing the number of customer arrivals at queue k in a service time is a discrete PH density, say with representation (ark, Tk).

Let Xk be the random variable denoting the number of customer arrivals

at queue k, 1 < k < N, during a service time at queue k. The quantity X = ~ Xk k=l

describing the total number of customer arrivals at all the queues during their respective service times is a sum of random variables, and thus its density can be obtained as a finite convolution (see Remark below). This convolution can be expressed as

P[X=n] = ~ P[X 1 =nl ,X2=n2, ..., XN=nN] D ( n )

N

= ~ l--I [-/~,k=0/~k,m+l+I~,k>Ol~tkTZk-1/~k] (2.15) D (n ) k = 1

which is just C(n) as given by (2.4). []

Remark. As an alternative to the brute-force algorithm in (2.5), consider what may happen if we use the fact that the sum of phase-type random variables

Page 8: Some efficient computational algorithms related to phase models

164 V. Rego

q s!l $2

i

Xi,2 ~ . . . .

n ri= Z xi,j

j= l Fig. 3. Task T and subtasks

Xi'R ~ Q

is again a phase-type random variable (see [5]) in the computation of (2.4). For instance, in Example 2, X~ is a discrete phase-type random variable with

N representation (ai, Ti) for 1 < i < N. Then Y = ~ Xi is a discrete phase-type ran-

1 dom variable with some representation (fl, T). If each T~ is an order m submatrix, then T will be an order Nm submatrix. Consequently, computing P l Y = n ] directly (i.e. using (2.6)) would require roughly n(Nm) 3 operations. In contrast, using a recurrence obtained in Theorem 1, we obtain P l Y = n ] with roughly nN(ma), thus reducing effort by a factor of N 2. Clearly, as N increases, the savings also increases. Observe that the term m 3 appears in the operation count for both methods since the order m matrix T is the basic unit being multiplied. Clever matrix multiplication schemes [1] can reduce this from O(m 3) to 0(m2"376). [ ]

Example 3. Order Statistics Consider an example involving task execution sequences on a multiprocessor. Suppose that a given task T can be decomposed into n independent execution sequences S~, 1 _ i_< n. Further, for each i, assume that Si is a sequence of N subtasks <si,1, s~,2 . . . . . s~,,> as shown in Fig. 3. It is often the case in modelling applications that the execution time Xij of subtask s~j is taken to be a phase-type random variable, since a (sub)task can be modelled in some generality as a Markov chain with a set of absorbing states [9]. If X~j is a discrete phase type random variable whose matrix is of order m, then the random variable

N Y~= ~ X~j, representing the execution time of task S~, is also of phase-type

j = l [5], but with a matrix of order N m. Clearly, for Y~ to have a large matrix it is sufficient if either m or N is large. If this size is large enough, then the comments in Remark 2 apply, suggesting that a direct computation of probabili- ties using (2.6) is prohibitive.

Computation requirements can be shown to be immense in the case of order statistics, when a phase-type random variable's governing matrix is large. Sup- pose that Y(n)=max(Y~, Y2, ..., I1,) represents the maximum amount of time it takes task T to complete its execution, and suppose also that we are interested in estimating ElY(n)]. Such an estimate is useful in estimating the efficiency of multiprocessing schemes, the effects of synchronization, etc., especially if T is itself a subtask of a much larger task. From [5], Y(n) is a discrete phase-type

Page 9: Some efficient computational algorithms related to phase models

Some Efficient Computational Algorithms Related 165

random variable, but however, it has a governing matrix of order (Nm)"+ nNm. Clearly, such a view of Y(n) is hopeless for even moderately large values of N, m or n. For example, consider the storage and computational requirements for E[Y(n)] when N = 5 , m = 2 and n=10. First, we would require storage for a matrix P of size (101~ and next we would require to compute the fundamental matrix ( I - P)-1 in order to obtain E [Y(10)].

Consider an alternate scheme for obtaining E[Y(n)], via Theorem 1. If the X~, 1 <j < N, 1 < i < n are independent and identically distributed, then so also are the Y~, 1 < i< N. Each Y~ has some phase-type representation (~r T) where T is an order Nm matrix. From [23,

E[Y(n)]<a.+n ~ ( 1 - F ( k ) ) = r . (2.16) k = a ~ + 1

where a , = i n f MIc~,~+l+ ~ ~ T k - l p > l - - n -~ and T e + f l = e . The quantities k=l

a. and F(k) are easily obtained through a simple recursive computation (see Theorem 1 below). Thus, with a complexity of roughly nN m 3, we obtain a bound for E [Y(n)]. If T is irreducible, then each Y~ has a distribution that is asymptoti- cally exponential [5], and from [2] we can conclude that (r~-a.)-- ,0 as n ---* OO. [ ]

Having given some motivation for computing C(n) and showing that the run time complexity of a brute force algorithm is (exponentially) bad, we now show, using generating hmction methods (for example, see [3] or [103), that C(n) can be computed efficiently with some care. The idea is to exploit the relation between C(n) and its generating function, since C(n) is precisely a sum of terms that is the coefficient of the n th power of the generating function variable in its series representation.

Theorem 1. The quantity N

C(n)= ~' I--I [I{.k=O}O~k,m+l+I{nk>O~kT~,k-'flk3 D(n) k = 1

where (~k, Tk) is a discrete PH density of order m with initial vector (~k, ~k,..+ 1),

and D(n)= (nl . . . . , nN)lnj>0, 1 <=j<=N, ~ nj=n , is given by aN CN(n) ~1, via the 1

recurrence

C i ( j ) : T i C i ( j - 1 ) - l - d i A i C i _ l ( j ) - d i T i A i C i _ l ( j - 1 ) - i - A i C i _ l ( j - 1 ) (2.17)

for 2<i<_N, 1 <j<__n, where

Cl (j) =T1 ~-1 for j > l (2.18) Ci(O)=diAi ... dl A1 for l < i < N , (2.19)

A1 =I, Ai=fli~i_ l for 2 <-i< N, and di= Ui.m+ l for l < i< N. a[i ~ i

The run time complexity of this computation is O(N.n), where N is the number of PH densities considered.

Page 10: Some efficient computational algorithms related to phase models

166 V. Rego

Proof. Define the generating function

G(z)=(dNI+Iz+TNz2+ . . . ) A N ( d s _ I I + I z + T N _ I zZ+ . . . )As -1

�9 .. (dl I + I z + T l z2+ ...) A1 (2.20)

with At = fli ~tl- 1,2 < i < N, A 1 ----- I, and di = ~i.,, + 1 = -= ati fli ' 1 < i < N. It is instructive to

note that the coefficient of z ~ in G(z) is the product dN As dN- 1 A s - 1 -.. dl A~, and in general, the coefficient of z" in G(z) is the sum of all terms of the form,

1 1-[ [I{,~ = o} ~k.m + 1 + I{,~ > 0} T"~- 1 Ak], where n ~ + n2 + -.- + nN = n, with precisely

k = N

one term for each such configuration of (nl . . . . , nN). Clearly, we are interested in the coefficient of z" in G(z).

Defining C(k) to be coefficient of z k in G(z), we see that

G(z)= ~ C(k) z k (2.21) k=O

can alternately be viewed as the generating function of the sequence {C(k); k > 0}. Since each Tj is substochastic, we can write

(djI + Iz + Tjz2 + . . . )=dj I + z ( I - zTj) -1 (2.22)

for I < j < N. Defining the product

Gi(z )=[d i I+z( I - zT i ) -1] Ai ... [dl I + z ( I - z T l ) -1] AI (2.23)

for 1 < i<N, we see that GN(Z)= G(z). Using the generating functional form,

G~(z)= ~ Ci(k) z k (2.24) k = 0

for 1 < i < N, so that C(n)= CN(n). Using (2.23), one can develop a recurrence

Gi (z) = d i Ai Gi- 1 (z) + z (I - zTi)- 1 At Gt- 1 (z) (2.25)

for 2 < i < N , with G~(z) given by (2.23). Next, left multiplying both sides of (2.25) by ( I - z T t ) yields

Gt(z)=zTiGt(z )+diAiGt_l (z ) - -zTid iAiGi_l (z )+zAtGi_l (Z ) (2.26)

which, when related to (2.24) gives the recurrence

C i ( j ) = T i C ~ ( j - 1 ) + d i A ~ C , _ l ( j ) - d i T i A i C t - l ( j - 1 ) + A , C ~ _ l ( j - 1 ) (2.27)

for l < i < N , and l < j < n . From Gl(z) we obtain C I ( j ) = T i -1 for j > l , and since the coefficient of z ~ in G(z) is the product d N AN... dl A~, we obtain Ci(0)

Page 11: Some efficient computational algorithms related to phase models

Some Efficient Computational Algorithms Related

Table 1

n Brute-force algorithm Recursive algorithm

5 0.01667 - 10 0.11667 - 15 0.55000 20 1.60000 - 30 7.95000 0.03333 40 24.03333 0.03333 50 57.51667 0.050000 60 117.81667 0.050000 70 216.18333 0.050000 80 365.68332 0.050000 90 579.04999 0.06667

100 871.96667 0.06667

167

=diAi ... dl A1 for l<_i<N. The required quantity C(n) is finally given by �9 ~CN(n) pl. []

The recursive scheme outlined in Theorem 1 computes terms of the form C(i,j), where i and j are the indices of a rectangular matrix. The number of such terms is bounded by the quantity N. (n + 1), since 1 < i_< N and 0 < j =< n. Observe that except for di, all quantities involved in the recursion are m x m matrices. For a given value of n, n > 0, it should be clear from the above recursive scheme that the run time complexity is O(Nn) (i.e., increases linearly as the product Nxn .

2.2 Computational Results

In this section, we briefly report on our computational experience with the stability condition in (2.9) and the run-times of the brute-force algorithm (see (2.5)) and the simple recursive algorithm in Theorem 1. In Table 1, we have shown a comparison of the running-times of the brute-force and the recursive algorithm for 2 x 2 matrices Tk, 1 _< k < N, with N--3 . The table displays running- times in cpu seconds (i.e., time to compute each entry in A,) as measured by utility dtime (on a VAX8600 running 4.3 BSD Unix) versus n. It should be clear from this that the recursive scheme is vastly superior for the computation of C(n).

In order to study the convergence properties of the sequence {A, ;n__> 0}, define R

a sequence of matrices A(R), with A(R)= ~, A,. Noting that the stochastic n = O

matrix A = lira A(R), define the sequence {z(R) ;R>0} of error terms with R--* or9

z (R)= IIA--A(R)II. Here, we take [IBII = m a x {B(i,j); l< i , j<m} , for any order

Page 12: Some efficient computational algorithms related to phase models

168 V. Rego

200

160

120 r , -

8O

kO

o o.'o ' ' o.'o o.' o O.Ot~ 0.06 h3

Fig. 4. Arrival rate versus R for different tolerance levels, o - e & = 10 -2, l -m & = 10 -4, , - , & = 10 -8

1.0

0.8

0.6

0.4.

0.2

10 20 30 40 50 60 R

Fig. 5. Convergence of x(R) as a function of R. t - o 2 = 0.045, mm-m 2 = 0.090

M m a t r i x B. I n Fig. 4, we show tha t the r e l a t i o n s h i p b e t w e e n 2 N (i.e., the c u s t o m - er a r r iva l ra te a t s t a t i o n N, wi th N = 3) a n d R (i.e., the larges t poss ib le n u m b e r of c u s t o m e r a r r iva l s t ha t we need to c o n s i d e r in o rde r t ha t A(R) is a s t r ic t ly s tochas t ic ma t r ix ) is s t r ic t ly l inear . W e agree to call a m a t r i x A(R) str ic t ly s to- chas t ic if x ( R ) < 6, where de l t a is some specified t o l e r ance level. F i g u r e 4 shows a l i nea r r e l a t i o n s h i p b e t w e e n R a n d 2 3 for different va lues of 6. I n Fig. 5, we

Page 13: Some efficient computational algorithms related to phase models

Some Efficient Computational Algorithms Related 169

display the manner in which x(R) converges to zero as R increases for two different values of 2N-

Clearly, the amount of work involved in obtaining the stability boundary for station N's queue is not much (i.e., given by (2.9)). However, attempting to tell if station N's queue will be stable for a given set of system parameters is decidedly a nontrivial task, since p must now be computed. We have shown that use of the brute-force algorithm is terribly impractical in view of the conver- gence behaviour shown in Figs. 4 and 5. Additionally, it is easy to choose values of 2N (i.e., at the high end) for which the cost of using the brute-force algorithm is prohibitive.

2.3 Some Extensions

Suppose now that we wish to compute the probability that n N > 1, given that nl +n2 + ... + nN = n. Being a conditional probability, this is given by

P[nN > l , n l + ... +nN=n] P[nN > 1 In1 + ... + n u = n ] -- (2.28)

P[n l +n2 + ... +nN=n]

The denominator on the RHS of (2.28) is precisely Cu(n). The numerator, a joint probability, is computed via a small modification of Theorem 1. While Gi (z) in (2.23) remains unchanged for 1 < i < N - 1, when i = N we obtain

GN (z) = [z (I -- z TN)- 1] AN GN- 1 (Z) (2.29)

since dN=0 in this case. Consequently, the recurrence for Ci(j) [-see (2.27)] remains unchanged, i.e., Ci(jlnN> 1)=Ci(j) for 1 < j < n , 1 < i < N , while

C N ( j l n N > _ I ) = T N C N ( j - - l l n N > I ) + A N C N _ t ( j - - l l n N > I ) (2.30)

for i < j < N. The above modification gives us CN(nln N > 1), and consequently

~N CN(n l tiN>= 1) fll P[nN>= 1 In1 -F ... -F nN=n ] = (2.31)

~N CN(n) #1

The same idea can be used to obtain P[nN>=m[nl+n2-F ...-]-nN~n ] for any m, n > 1. The recurrence as given by (2.27) remains unchanged for Ci(Jl nN > m), l < i < N , l <j<=n. When i = N ,

G N (z) = [-Tff- 1 z m + T~ z m + 1 + . . . ] AN GN- x (z)

= [ I - ZTN] -1 z " T ~ - I AN GN-1 (Z) (2.32)

so that

CN(jlnN>-->_m)=TNCN(j-- I[nN>=m)W Tffv-I ANCN_I(j--mlnN>=m) (2.33)

Page 14: Some efficient computational algorithms related to phase models

170 v. Rego

for m =<j < n. Finally,

P[nN>mlnl + ... + n N = m ] - - ~N CN(nlnN>m)~l

(2.34)

where CN(nlnN>m) is defined by (2.33). In each of the cases, the boundary conditions are given by Theorem 1. Note that the same argument can be used to compute P [nk > m l nl + ... + nN = n] for any k, 1 < k < N, and m > 1. The easiest way to do this is by exchanging indices for (~k, Tk) and (~N, "IN).

As another example, let S be a proper subset of the set {1, 2 . . . . . N}. For given positive integers m j, j ~ S, the quantity P [nj > m j, j ~ S I n 1 + ... + nN = n] is computed by further extending the above arguments. For ir we use the recur- rence in (2.27), and for i tS we use

Ci(j[ nj> rnj,jeS)= I"/ Ci ( j - l lnj>mj,jeS)+Tr"-' Ai Ci- 1 U-rail n~> mj,js S) (2.35)

for mi<=j<=n, and l<i<=N. If 1r then cl( j lnj>mi, j~S)=Ti -1, otherwise Cl(jlnj>=rnj,jeS)=T~ 1+j-2, for j__> 1. Similarly Cl(O[nj>__mj,j~S)=d I A1 if 1r and Cl(Olnj>=mj,jeS)=I otherwise. In like fashion, for i>1 , C~(O[n i >=mj,j~S)=diAiCi_l(O[nj>mj,jeS) if ir and Ci(O[nj>rnj,jeS)=T~"-lAi Ci- 1 (0[ n j_>_ m j, j e S) otherwise.

3. Nonhomogeneous Transitions

The notion of a phase type random variable introduced in the previous section (from [-5]), can be generalised to include nonhomogeneous Markov chains. In this section, we consider such a case and then demonstrate how another useful and efficient computational scheme can be developed. As before, we restrict our attention to discrete time.

Let {Xr ; r > 0} be a nonhomogeneous Markov chain with one-step transition probability matrix at time r given by P(r)A-[pij(r,r+l)]. Denoting H(k, r) ~= [p~j(k, r)] as a multistep transition probability matrix, the Chapman- Kolmogorov equation can be written as

H(k,r)=n(k,q)H(q,r) (3.1)

for k_< q __< r, with H(r, r )= I. A direct application of the last equation yields

H ( O , r ) - P ( O ) P ( 1 ) ... P ( r - 1 ) (3.2)

for r > l . Assume now that the chain {xr ; r = 0 } is defined over the states {1, 2 . . . . , m

+1}, where states 1 through m are transient and state ( m + l ) is absorbing.

Page 15: Some efficient computational algorithms related to phase models

Some Efficient Computational Algorithms Related 171

Also, if absorption into state m + l can occur at any step r, then P(r) must take the form

a( r )= T(r) fl(1 r) (3.3) 0

where T(r) is m x m and fl(r) is m x 1. The density of the time to absorption for this nonhomogeneous Markov chain, is given by

p o = P [ X o = m + 1] =a, ,+l (3.4) p k = P E X k = m + I ] = a T ( O ) T ( 1 ) ... T ( k - 1) fl, k > l

where (~t, am+l) is the initial vector, and T(0)=I is an order m identity matrix. Note that in the homogeneous case, P ( r )=P for all r, and the density in (3.4) reduces to that given in (2.2).

Example 4. Nonhomogeneous Chains Let {Xn,k;n~O } be a nonhomogeneous Markov chain with initial vector (~tk, ak,,,+ 0 and transition matrix sequence {Pk(n);n>O}, for each k, l<k<_N. Corresponding to each matrix Pk(n), we have a matrix Tk(n) and vector Pk(n), n >_0.

Given N independent nonhomogeneous Markov chains {Xn,k;n~O , l < k <N}, let Yk be the time to absorption for the chain {X,,k} and define Y= I11 + Y2 + . . . + YN. The probability that all N chains require a total of n steps for their respective absorptions into state (re+l) is given by P ( Y = n ) = C ( n ) , where

C(n)=B~(n) FI (3.5)

which, like (2.4), requires an exponential algorithm if computed using brute force. []

In the following result, we demonstrate how (3.5) may be computed efficiently. The idea, like the one used in Theorem 1, exploits the generating function of {C(n)} and the representations of convolutions.

Theorem 2. The quantity

is given by CN(n), via the recurrence

CN (n) = L ~N AN (n -- k) •N CN- 1 (k) (3.6) k=O

with C O (0) = I, Co (k) = O, A k (0) = d k I, Ak (1) = T k (0) = I, and d k - ~k. m + x, f o r k > 1. Ogk [~k

Page 16: Some efficient computational algorithms related to phase models

172 v. Rego

Proof. Define the function

G (z) = ~N [dN I + T N (0) z + TN(1 ) z 2 "~...1 #N 0tN- 1 [dN- 1 I + TN- 1 (0) z +TN(1)Z2+ ""]/~N-1 "" ~q[d~I+Tl(O)z+Tl(1) z2+ - . . ] /~ (3.7)

and observe that just as in Theorem 1, CN(n) is given by the coefficient of z n in G(z). Defining C(k) to be the coefficient of z k in G(z),

G(z)= ~ C(k)z k (3.8) k = 0

is the generating function of {C(k); k>0}. Denoting the /-term version of (3.7) by Gi(z), clearly

Gi(z) = ~ti [di I + Ti(0) z + I"/(1) z 2 +. . . ] f l i Gi- 1 (z) (3.9)

for i> 1, with Go(Z)=I. Applying (3.8), we have

Gi(z)=~i [k~=O Ai(k) zk] fl i[,~ ~ Ci_ 1 (r) zq (3.10)

where Ai(O) = di I, Ai(1) = I, and Ai(k) = Ti(k) for i > 1, and k > 1. Rewriting (3.10) slightly differently,

Gi(z)= otiAi(k)z k #iCi_l(r)z r (3.11) r

and recognizing the last product to essentially be a convolution, we get

Gi(z)=r~'= k ~tiAi(r-k)[JiCi-l(k) zr' (3.12)

and thus

CN (n) = ~ ~N AN (n -- k) fin CN- 1 (k). (3.13) k = 0

The boundary conditions give us Co(0)=I, Co(k)=0, Ak(O) =~k'm+l I, and ~k flk

Ak(1)=Tk(0)=I for k > l . []

4. The Multivariate Case

In this section, we use arguments similar to the preceding sections to obtain some multivariate probabilities. As before, we motivate the discussion with an example. We are interested in a system of N queues, where each queue has

Page 17: Some efficient computational algorithms related to phase models

Some Efficient Computational Algorithms Related 173

0 0 0 0 Xl X 2 X 3 X N

Fig . 6. Mixed arrivals

arrivals coming from M different Poisson processes. The fact that the total arrival process will also be Poisson (with rate that is a sum of individual process rates) is not used for the probability that we wish to compute. Consider the following example for M = 2.

Example 5. Queues with Several Arrival Classes Consider the following extension of Example 2. At each of the N queues, custom- ers arrive according to a Poisson process of rate that is either 21 or ,~2 (see Fig. 6). Assume that the service time at queue k, 1 < k < N, is a continuous PH random variable with distribution Fk(') and representation (~'k, Sk). Let Xk(Yk) be the number of customers that arrive in a service time from process 1 (process 2) at queue k, 1 < k < N. Then

e-(Al +22)t(,~1 t )mk(~2 t)nk P(Xk=mk, Yk=nk)= j

o ink! rig! dF~

(mk +nk)! pmkqnk ? e-r +22)t]m~+,~

mk! nk ! 0 J (ink + nk) ! dFk (4.1)

where iv = - 2 1 + 2 2

and q = 1 -iv. Applying Lemma 1 to (4.1), we obtain

(mk + nk) ! P(Xk = mk, Yk = nk)--

mk ! nk ! {I{mk + nk = 0} ~k,m + 1 + I{mk + nk > 0} ~tk xrnk ynk ilk} (4.2)

where, with 2 = 21 + 22,

~k = 2~k( 2 I - Sk)- 1,

Xk = 21 (2I-- Sk)- 1,

1 o /k = ~-" S~

O~k,m+ 1 :~k,m+ 1 + ~k(2I-- Sk)- 1 S O,

Yk =)],2 ( ,~I-- Sk) -1 (4.3)

Page 18: Some efficient computational algorithms related to phase models

174 V. Rego

for each k, l <k < N. Now defining X = X I + ... + X N, Y = Y I + ... + YN, and integers a > 0 , b>0 , we have P ( X = a , Y=b)=C(a , b), where

N

C(a,b)= ~, I~ P(Xk=mk' Yk=nk) (4.4) F(a,b) k= 1

with

F ( a, b) = {(rag, nk) l mk >= O, nk >= O, l<-k<-N,~ mi=a,~]ni=b}. S=l i=1

[]

While one way to obtain C(a, b) is to use the results of Sect. 2, which will work due to independence arguments, an alternate method utilizing multino- mial-type expressions is as follows. Define the generating function G(Zl,Z2) = GN(zl, z2) as

1

G(ZI' g2) = H ['dk I + (X k 21 + Yk ZE) + (Xk Z~ + Yk Z2) z + ' " ] Ak k = N

= dkI+ (XkZl+YkZ2) j A k (4.5) j = l

where d k = O~k'm+ 1 for 1 ~ k-< N, A k : flk 0tk- I for 1 < k _-< N, and A~ = I. Observing O~k f lk

that the quantity we wish to compute, C ( a , b ) = P [ X = a , Y=b] , is given by the coefficient of z~ z~ in eN G(zl, ZE)fll, and defining CN(i,j) to be coefficient of z/1 z{ in G(zl, z2), we obtain

Ci(j, k) = (d l - 1) [Ai Cs- 1 (J, k) - X i Ai Ci- t ( J - 1, k) - Yi As Ci- 1 (J, k - 1)]

+ As C~_ ~ (j, k) + X s C i ( j - 1, k) + Y~ C~(j, k - i) (4.6)

for 1 _< i_< N, 1 _<__j =< a, 1 _ k_< b. With the aid of boundary conditions, we obtain the following theorem.

Theorem 3. The quantity

N

C(a,b)= Z I-[ {I{m~+"k=O}~tk.r~+l +I{r~+"k>O} ~ F(a,b) k = 1

is given by ~tN CN(a, b) igl via the recurrence

Ci(j, k) = X i [ Cs ( j - 1, k) + (1 - dl) Ai Ci- ~ ( j - 1, k)] + d~ A i Cs- 1 (J, k)

+ Ys [Ci(j, k - 1)+(1 -d i ) A~ Ci_ ~(j, k - 1)] (4.7)

for 1 <_i<_N, 1 <=j<a, 1 <_k<_b. The required quantities are given by d.-a. ,m+a ~n fin

for 1 <_ n _< N, A 1 = I, and A. = ft. ~,_ 1 for 1 < n < N. Finally, boundary conditions

Page 19: Some efficient computational algorithms related to phase models

Some Efficient Computat ional Algori thms Related 175

give Co(0,0)=I , C,(O, 0)= d, I ,C , (O ,k )=ykA , ,C , ( k ,O)=XkA , for l<_ i<N

and k>0. []

The last result is easily extended to the case where each queue has M Poisson inputs. Defining Xi. ~ to be the number of process i customers arriving at station j in a service time, 1 < i < M , 1 <j<=N, let Yi=Xi,~ + ... +Xi.N, for each arrival process i. It follows that P(Y~= n~, 1 < i< M ) = C(nl . . . . . riM), with

C(nl . . . . , riM)= ~ I0o O~k,m+ 1 "Jr 1191 IZk xnk' i ~k (4.8) F ( n l . . . . . riM) k = 1 i

where

F(nl . . . . . nu) = nk.1 . . . . . nk,M) k = l

n k , i = n i , l <-i<_M},

Oo = {n~ + ... + nu = 0}, O1 = {nl + ... + nu > 0}. A straightforward application of the arguments given for Theorem 3 yields the recurrence

where

Ci(jl . . . . , JM) = dl A i C i_ x (Jl, ..., JM) + f (M) (4.9)

M

f ( M ) = ~ X, [C(j l . . . . . Jk-- 1 . . . . ,jM)+(1 --d,) A, C,_, (Jl . . . . . Jk-- 1 . . . . ,JM)] k = l

(4.10)

for 1 <_i<_N, 1 <jk<=nk, and 1 < k < M , so that C(nl . . . . . nu) =~N CN(nl . . . . . nN)fll. As before, the boundary conditions give us Co(0, ..., 0)

=I,C~(O . . . . . 0)= d i I,C~(jl . . . . . jM)=XJkAifOr jk+O, and j .=O, l<_n<_M,

n+k.

Appendix

1 Phase Type Distributions

Consider a Markov process on the states {i, 2 . . . . , m + 1} with infinitesimal gen- erator

,111,

where the m x m matrix T satisfies Tu < 0, for 1 _< i___ m and T~j__> 0 for i :#j. Also T e + T ~ where e=(1, 1 . . . . . 1) is an m-vector. The initial probability vector of Q is given by (~,em+l), with ~ e + e m + l = l . We assume that the states

Page 20: Some efficient computational algorithms related to phase models

176 V. Rego

1, 2 . . . . . m are transient and state (m + 1) is an absorbing state. The probability distribution F(.) of the time until absorption in the state (m + 1) given an initial probability vector (~, am+ 1) is given by

F ( x ) = l - - ~ e x p ( T x ) e , x>O. (A.1.2)

The distribution F(-) is said to be a phase-type distribution with the representa- tion (~,, T).

The probability density {Pk}, given by

p0=~m+l p k = ~ T k - l T ~ k > l (A.1.3)

is said to be a discrete PH density when T is a substochastic matrix, and T O has nonnegative entries, such that T e + T ~ The density in (A.1.3) is the time until absorption in state (m + 1) in a Markov chain

P = O T~ (A.1.4)

and with initial vector (~, ~m+0, this density is said to have the representation (~, T). In the body of the paper we frequently use the notation /I in place of T O"

2 Transition Probabilities for the Token Ring Example

Let ON-1 denote the set of all ( N - 1 ) bit binary vectors. Let Zo,Zl . . . . , zM denote the elements of ON-~ given in lexicographic order with M = 2 N - ~ - 1. That is Zo=(0,0, ..., 0), z l = ( 0 , 0 . . . . , 1 ) . . . . . zM=(1, 1 . . . . . 1). Also, let zi(k) denote the k th bit (counting from left to right) of the vector zi, l < k < N - 1 , zie ON- 1. Finally, define

n,(zil z j) & Z*((0, 0, ..., 0)[zj) (A.2.1)

where A*((0, 0 . . . . . O)zj) is given by (2.10)-(2.14), with the added restriction that 2k is replaced by [ 1 - zi(k)] 2k, 1--< k-< N--1, for this computation.

For any given value of n,n__>0, the substochastic matrix A,=A.( . [ . ) can be computed using the following recursive scheme:

begin forj.'=O to M do begin

compute A* (zolzj); for i..=1 to M do begin

compute H,, (zi[ z i); a,,(zilzj),=n,,(zilzj)- ~ a,,(ZmlZj)

raeR(i)

end; end;

end.

The set R (i) is defined with R (i) = {k I 0 < k < i - 1, Zk ^ Zi 4: 0}, for 1 < i < N-- 1.

(A.2.2)

Page 21: Some efficient computational algorithms related to phase models

Some Efficient Computational Algorithms Related 177

Since the B,=B,( -I - ) submatrices are computed using a slight variation of (2.10)-(2.14), the above algorithm can also be used to compute the sequence {B, ; n > 0} (see Sect. 2.2).

References

1. Coppersmith, D., Winograd, S.: Matrix multiplication via arithmetic progessions. Proceedings of the 19th Annual ACM Symposium on Theory of Computing, pp. 1-6 (1987)

2. Lai, T.L., Robbins, H.: A class of dependent random variables and their maxima. Z. Wahrschein- lichkeitstheorie Verw. Geb. 42, 89-111 (1978)

3. Moore, F.: Computational model of a closed queueing network with exponential servers. IBM J. Res. Develop. 16, 567-572 (1972)

4. Neuts, M.F.: Matrix-analytic methods in queueing theory. Eur. J. Operational Res. 15, 2-12 (1984)

5. Neuts, M.F.: Matrix-geometric solutions in stochastic models: An algorithmic approach. First Ed. Baltimore: The Johns Hopkins University Press 1981

6. Rego, V.J., Szpankowski, W.: On the quality of approximations for high speed rings. Proceedings of the International Symposium on High Performance Computer Systems, Paris, France, 14--16 December 1987. Gelenbe, E. (ed.) Amsterdam: North Holland, p. 179-193 (1988)

7. Rego, V.J., Ni, L.M.: Analytic models of cyclic service systems and their application to token- passing local networks. IEEE Trans. Comput. 37, 1224-1234 (1988)

8. Takagi, H.: Analysis of polling systems, First Ed. M.I.T. Press: Cambridge, MA 1986 9. Trivedi, K.S.: Probability and statistics with reliability. Queueing, Comput. Sci. Appl. Englewood

Cliffs, NJ: Prentice Hall 1982 10. Williams, A., Bhandiwad, R.: A generating function approach to queueing network analysis of

multiprogrammed computers. Networks 6, 1-22 (1976) 11. Szpankowski, W., Rego, V.J.: Ultimate stability conditions for some multidimensional distributed

systems. Purdue CSD-TR 715, October 1987

Received January 19, 1988 / March 15, 1989