# Repair systems with exchangeable items and the longest queue mechanism

- First Online:

- Received:
- Revised:

DOI: 10.1007/s11134-012-9319-5

- Cite this article as:
- Ravid, R., Boxma, O.J. & Perry, D. Queueing Syst (2013) 73: 295. doi:10.1007/s11134-012-9319-5

## Abstract

We consider a repair facility consisting of one repairman and two arrival streams of failed items, from bases 1 and 2. The arrival processes are independent Poisson processes, and the repair times are independent and identically exponentially distributed. The item types are exchangeable, and a failed item from base 1 could just as well be returned to base 2, and vice versa. The rule according to which backorders are satisfied by repaired items is the *longest queue* rule: At the completion of a service (repair), the repaired item is delivered to the base that has the largest number of failed items.

We point out a direct relation between our model and the classical longer queue model. We obtain simple expressions for several probabilities of interest, and show how all two-dimensional queue length probabilities may be obtained. Finally, we derive the sojourn time distributions.

### Keywords

Repair systemLongest queueQueue lengthsSojourn time### Mathematics Subject Classification

60K2590B22## 1 Introduction

In this paper, we consider a repair facility consisting of one repairman and two arrival streams of failed items, from bases 1 and 2. The arrival processes are independent Poisson processes with rates *λ*_{1} and *λ*_{2}. The repair times are independent and identically distributed, with exp(*μ*) distribution regardless of the type of failed item. The item types are exchangeable, and a failed item from base 1 could just as well be returned to base 2, and vice versa. The rule according to which backorders are satisfied by repaired items is the *longest queue* rule: At the completion of a service (repair), the repaired item is delivered to the base that has the largest number of failed items. In case of a tie, the item will be delivered to base 1 or base 2 with probability \(\frac{1}{2}\).

We are interested in key performance measures of this repair facility, such as the (joint) queue length distribution of failed items of both types, and their sojourn time distribution (the time between arrival and departure of a failed item). In the literature, several studies have appeared about the so-called longest queue system. That is a queueing system with one server and (typically) two queues with customers of two different types; the server choosing a customer from the longest queue upon service completion. Cohen [2] has studied the case of two customer types with Poisson arrival streams with rates *λ*_{1} and *λ*_{2}, having service time distributions *B*_{1}(⋅) and *B*_{2}(⋅). If the server has completed a service, then the next customer to be served is the one at the head of the longest queue if the queue lengths are not equal; if both queues have equal length, then the next customer in service is of type *i* with some probability *α*_{i}. He determines the generating function of the joint steady-state queue length distribution right after service completions, by solving a boundary value problem of Riemann–Hilbert type.

Zheng and Zipkin [9] consider the completely symmetric exponential case (*λ*_{1}=*λ*_{2}; \(\alpha_{1} = \alpha_{2} = \frac{1}{2}\); *B*_{1}(*x*)=*B*_{2}(*x*)=1−e^{−μx}). They calculate the steady-state distribution of the difference between the two queue lengths, and they provide a recursive scheme for the calculation of the joint queue length distribution and the marginal distributions. They also briefly consider the case that *λ*_{1}≠*λ*_{2}. Flatto [5] also considers the symmetric exponential case. He allows preemption, and derives an expression for the probability generating function of the joint queue length distribution. He uses this expression to derive asymptotic results.

Van Houtum et al. [7] also focus on the completely symmetric exponential model. They consider two variants: a longest queue system with threshold rejection of customers and one with threshold addition of customers. They show that these systems can be analyzed in detail using matrix-geometric methods, and that this provides lower and upper bounds for the longest queue system.

The repair facility with exchangeable items, that is the subject of our paper, has already been studied by Daryanani and Miller [4]. Using taboo sets and taboo probabilities, they derive various relations between the steady-state queue length probabilities; however, they do not solve those equations.

### Remark 1

While the above described classical longer queue model is closely related to the model studied in [4] and the present paper, there are significant differences. To demonstrate these, let us consider the classical system and our repair system, receiving exactly the same input and having exactly the same service times. Suppose both systems start empty, and then a type-1 item arrives. The server starts serving. During the service, there are no type-1 arrivals and three type-2 arrivals. In the classical system, the type-1 customer leaves and the server starts serving the first of the three type-2 customers. The state of the classical system now is (0,3): one type-2 customer is just entering service and the other two type-2 customers are waiting.

In our repair system, the items are exchangeable. The repaired item is assigned to the first type-2 customer, even though it was brought as a type-1 item. Hence, the state of the system right after the repair is (1,2): there is still one waiting type-1 customer and there are two waiting type-2 customers.

### Motivation

The longer queue model is related to the join-the-shortest-queue model: both models feature a mechanism that tends to equate the queue lengths. The longer queue model is a very natural one, but it has received much less attention than the join-the-shortest-queue model. We believe our paper yields valuable new insight into the longer queue model and a variant of it.

### Contributions

Our main contributions are: (i) We point out a direct relation between our model and the classical longer queue model of Cohen [2]; (ii) we obtain simple expressions for several probabilities of interest, and we show how all two-dimensional probabilities may be obtained; (iii) we derive the sojourn time distributions—this performance measure was not studied in the papers mentioned above; and (iv) we present some methodological ideas which might be more broadly applicable; one example is the use of the “difference busy period.”

### Organization of the paper

In Sect. 2, we first give the balance equations for the joint steady-state queue length distribution. We then study its generating function (GF), deriving various special results like the distribution of the difference of the two queue lengths and the probability that there are *n*_{1} customers of one type and none of the other type. Then we point out a direct relation between Cohen’s model and our model, which in principle allows us to use his results for obtaining the GF of the joint queue length distribution. However, we are interested in providing explicit results for the probabilities *P*(*i*,*i*) of having *i* customers of either type, *i*=1,2,…, which will also give us the marginal distributions explicitly. These probabilities are studied in Sect. 3; in that section, we also give an iterative method for obtaining all queue length probabilities. Finally, Sect. 4 is devoted to the determination of the sojourn time distribution of a customer of either type.

## 2 Queue lengths—a generating function approach

*N*

_{i}(

*t*) denote the number of failed items of type

*i*=1,2 at time

*t*. Clearly, {(

*N*

_{1}(

*t*),

*N*

_{2}(

*t*)),

*t*≥0} is a Markov process. We restrict ourselves to the case that the total load \(\rho := \frac{\lambda_{1} + \lambda_{2}}{ \mu} < 1\). Then the limiting distribution

*P*(

*n*

_{1},

*n*

_{2})=

*P*(

*N*

_{1}=

*n*

_{1},

*N*

_{2}=

*n*

_{2}):=lim

_{t→∞}

*P*(

*N*

_{1}(

*t*)=

*n*

_{1},

*N*

_{2}(

*t*)=

*n*

_{2}|

*N*

_{1}(0)=

*k*

_{1},

*N*

_{2}(0)=

*k*

_{2}) exists and is independent of the initial state; indeed, notice that the total number of customers has the same distribution as the number of customers in an

*M*/

*M*/1 queue with arrival rate

*λ*

_{1}+

*λ*

_{2}and service rate

*μ*. The

*P*(

*n*

_{1},

*n*

_{2}) satisfy the following balance equations: for

*n*

_{1},

*n*

_{2}≥1, with

*I*(⋅) denoting an indicator function, For

*n*

_{1}=0 and/or

*n*

_{2}=0, the same equations hold with minor adaptations. Multiplying these equations with \(z_{1}^{n_{1}}z_{2}^{n_{2}}\) and summing, one gets: We delay the solution of this equation, first showing how one can derive various special probabilities from this equation.

### 2.1 *P*(*N*_{1}+*N*_{2}=*n*)

*z*

_{1}=

*z*

_{2}=

*z*in (2), it easily follows that

*z*=1) that

*P*(0,0)=1−

*ρ*, and that the total number of customers is geom(

*ρ*) distributed. This confirms that the total number of customers behaves as if the system is an

*M*/

*M*/1 queue with arrival rate

*λ*

_{1}+

*λ*

_{2}and service rate

*μ*.

### 2.2 The probabilities *P*(*n*_{1},0) and *P*(0,*n*_{2})

*z*

_{1}=

*z*and

*z*

_{2}=0 in (2), we obtain by carefully considering the 1/

*z*terms: Hence,

*C*

_{1}and

*C*

_{2}remain to be determined. From

*M*/

*M*/1 theory (cf. Cohen [1], Chap. II.4), it follows that the zero

*z*

_{−}with “minus the square root” of the denominator of (6) is the Laplace–Stieltjes transform (LST) with argument

*λ*

_{2}of the length of the busy period

*P*

_{1}in an

*M*/

*M*/1 queue with arrival rate

*λ*

_{1}and service rate

*μ*: \(z_{-} = E[\mathrm{e}^{-\lambda_{2} P_{1}}]\). It may also be interpreted as the probability of zero arrivals from base 2 during a busy period of type 1. Since this zero

*z*

_{−}has absolute value less than one, and the left-hand side of (6) is analytic inside the unit circle,

*C*

_{2}must be zero. The product of

*z*

_{+}and

*z*

_{−}is

*μ*/

*λ*

_{1}>1, so

*z*

_{+}has absolute value larger than one. Hence, we conclude that the probabilities

*P*(

*N*

_{1}=

*n*

_{1},

*N*

_{2}=0), for

*n*

_{1}>0, are geometric with parameter \(\frac{1}{z_{+}} = \frac{\lambda_{1} z_{-}}{\mu}\):

*j*=1,2,…, where \(\tilde{z}_{+}\) is obtained from

*z*

_{+}by interchanging

*λ*

_{1}and

*λ*

_{2}. It remains to determine the constants

*C*

_{1}and \(\tilde{C}_{1} \). We shall return to this in Sect. 3.2, where an expression for all

*P*(

*i*+1,

*i*) and

*P*(

*i*,

*i*+1) is derived (cf. (27)). An alternative approach to determining these two constants is to use the two equations

*P*(1,0)+

*P*(0,1)=

*ρ*(1−

*ρ*) and

*P*(2,0)+

*P*(1,1)+

*P*(0,2)=

*ρ*

^{2}(1−

*ρ*) (cf. Sect. 2.1), in combination with an expression for

*P*(1,1) which will be obtained in Sect. 3.1. One thus gets two equations for

*P*(1,0)=

*C*

_{1}and \(P(0,1) = \tilde{C}_{1}\).

### 2.3 *P*(*N*_{1}−*N*_{2}=*n*|*N*_{1}>*N*_{2}) and *P*(*N*_{2}−*N*_{1}=*n*|*N*_{2}>*N*_{1})

*z*

_{1}=

*z*=1/

*z*

_{2}in (2), we get a relation between the generating functions \(E[z^{N_{1}-N_{2}}I(N_{1}>N_{2})]\) and \(E[z^{N_{1}-N_{2}}I(N_{2}>N_{1})]\): Now observe that the terms in the left-hand side are analytic in

*z*for |

*z*|<1, whereas the term in the right-hand side is analytic in

*z*for |

*z*|>1. Application of Liouville’s theorem, using the fact that the right-hand side has a finite limit for |

*z*|→∞, yields that both sides are equal to a constant, say

*C*, respectively, for |

*z*|<1 and for |

*z*|>1. In particular, taking

*y*=1/

*z*,

*N*

_{2}−

*N*

_{1}, when positive, is geom(\(\frac{\lambda_{2}}{\lambda_{1}+\mu}\)) distributed. By symmetry (or by studying the left-hand side of (9), which equals

*C*for |

*z*|<1, and by considering the

*z*

^{0}terms in the left-hand side) one may conclude that

*N*

_{1}−

*N*

_{2}, when positive, is geom(\(\frac{\lambda_{1}}{\lambda_{2}+\mu}\)) distributed. In the symmetric case

*λ*

_{1}=

*λ*

_{2}, this was already observed in [9]. Below we would like to interpret this result. Consider the system from the moment

*N*

_{2}reaches the value

*N*

_{1}+

*k*for some positive

*k*, until the level

*N*

_{1}+

*k*−1 is reached again for the first time. In between, the server will invariably be giving repaired items back to base 2, and never to base 1. The value

*k*, when positive, plays no role in this. Hence,

*N*

_{2}−

*N*

_{1}, when positive, is memoryless:

*P*(

*N*

_{2}−

*N*

_{1}≥

*k*+

*l*|

*N*

_{2}−

*N*

_{1}≥

*k*)=

*P*(

*N*

_{2}−

*N*

_{1}≥

*l*). In fact, all the time that

*N*

_{2}−

*N*

_{1}≥

*k*, the system behaves like an

*M*/

*M*/1 queue with arrival rate

*λ*

_{2}and service rate

*λ*

_{1}+

*μ*: the difference

*N*

_{2}−

*N*

_{1}decreases with rate

*λ*

_{1}+

*μ*. The events when both queues are of equal length will be particularly important; in the next section, we shall derive

*P*(

*N*

_{1}=

*N*

_{2}=

*i*),

*i*=0,1,….

So far, we have not yet tackled the general problem of finding \(E[z_{1}^{N_{1}}z_{2}^{N_{2}}]\); we only showed that various relevant performance measures have a geometric distribution. The natural approach to the general solution of (2) seems to be to translate the problem into a boundary value problem, like a Riemann–Hilbert problem (cf. [3]). That was also the approach chosen by Cohen [2] in his analysis of the two-dimensional queue length process right after departures in the case of Poisson arrivals and *generally* distributed service times; see also Flatto [5] for the case of exponential service times.

When we compared (2) with formula (1.7) of Cohen [2], we came to the conclusion that his formula for exp(*μ*) service times reduces to our formula (2). This is surprising in view of Remark 1, where it is explained that the exchangeability feature of our repair system leads to different queue length behavior in both models. Below we shall show that, despite that different behavior, the steady-state joint queue length distributions in both models are *the same*.

*i*arrivals during the (

*n*+1)th service (actually, he distinguishes between arrivals during a service of type 1 and type 2, but we assume all service times are exp(

*μ*)). He has similar equations for the other cases. In particular, if \(x_{n}^{(1)} = x_{n}^{(2)} = 0\), then \(x_{n+1}^{(i)} = \nu_{n+1}^{(i)}\),

*i*=1,2.

*N*

_{1},

*N*

_{2}), where

*N*

_{i}is the steady-state number of type-

*i*requests. Let us, however, instead look at subsequent departure epochs (i.e., repair completion epochs), with one significant difference: Remove the idle periods of the system. Moreover, ignore the customer who is the first to arrive after such an idle period (both his arrival and his departure). Call the numbers of requests waiting just

*before*the

*n*th departure epoch: \((N_{n}^{(1)},N_{n}^{(2)})\). Since we now view the system at independent exp(

*μ*) intervals, PASTA (Poisson Arrivals See Time Averages) applies [8]. PASTA states that the distribution of (

*N*

_{1},

*N*

_{2}) equals the distribution of numbers of requests just before those exp(

*μ*) departure intervals. We claim that those satisfy exactly the same recursion as Cohen’s \(x_{n}^{(i)}\). Indeed, one may easily verify that,

*exactly*as for the \(x_{n}^{(i)}\) in (11), one has: If \(N_{n}^{(1)} > N_{n}^{(2)}\) then

*i*=1,2. The tricky case is when we have (1,0) or (0,1) just

*before*a service completion. Now an idle period will start. It will be ended with an arrival. As said before, we ignore the idle period

*and*the arrival that ends it. Just before the end of the next exp(

*μ*), we shall have \((\nu_{n+1}^{(1)},\nu_{n+1}^{(2)})\) plus that one ignored customer. However, as he is ignored, we have exactly the same recursion relations for \((N_{n}^{(1)},N_{n}^{(2)})\) as Cohen [2] gets for \((x_{n}^{(1)},x_{n}^{(2)})\).

So, although Cohen [2] and we study different quantities (cf. Remark 1), the above reasoning shows that in the case of exp(*μ*) service times, his \((x_{n}^{(1)},x_{n}^{(2)})\) and our (*N*_{1}(*t*),*N*_{2}(*t*)) have the same limiting distribution. This is confirmed by the fact that Cohen’s formula (1.7) for the generating function, when taking exp(*μ*) service times, agrees with our formula (2).

For general service times, this reasoning fails because then successive service times do not generate a Poisson process, and PASTA cannot be applied.

## 3 Queue lengths—a probabilistic approach

In this section, we shall first determine the probabilities *P*(*i*,*i*), and then present a procedure to obtain all *P*(*i*,*j*).

### 3.1 Determination of *P*(*i*,*i*)

We use an argument from Markov renewal theory to derive an expression for (the generating function of) *P*(*i*,*i*).

*Step 1: relate**P*(*i*,*i*) *to the steady-state probabilities**π*_{i}*of an underlying Markov chain.*

*BC*is the sum of an idle period and consecutive busy period of the server, constitute renewal cycles. Let

*θ*

_{i}denote the mean number of visits to state (

*i*,

*i*) during a cycle. Since the mean visit time to state (

*i*,

*i*) equals \(\frac{1}{\lambda_{1} +\lambda_{2} +\mu}\) for

*i*≥1, we have

*K*:={

*K*

_{n},

*n*=0,1,…}, with state space {(0,0),(1,1),…,(

*i*,

*i*),…}, and with transition probabilities

*P*

_{(j,j),(k,k)}which will be determined in step 2. This is a Markov chain where we only consider the states where both queue lengths are equal. Its limiting distribution is

*π*

_{i}:=lim

_{n→∞}

*P*(

*K*

_{n}=

*i*). Clearly,

*π*

_{i}is proportional to

*θ*

_{i}for

*i*≥1. More specifically, since the state (0,0) is visited exactly once per busy cycle, we have

*Step 2: determination of the*

*π*

_{i}

*.*

*K*satisfies the normalizing condition \(\sum_{i=0}^{\infty} \pi_{i} = 1\) and the balance equations

*P*

_{(k,k),(i,i)}. Suppose that the original queue length process is in state (

*k*,

*k*). There are three possible events: an arrival from base 1, an arrival from base 2, and a service completion.

- (i)
An arrival from base 1 occurs first. As indicated in the previous section, one may argue that this arrival starts a busy period, call it

*B*_{1}, with arrival rate*λ*_{1}and service rate*λ*_{2}+*μ*. Indeed, all the time until equality of the two queue lengths occurs again for the first time (at some level (*i*,*i*)), repaired items will be handed back to base 1 and not to base 2, since queue 1 is the longer queue. Notice that the stability condition*λ*_{1}+*λ*_{2}<*μ*implies that*λ*_{1}<*λ*_{2}+*μ*. - (ii)
Similarly, if an arrival from base 2 occurs first when the queue length process is in state (

*k*,*k*), then it takes a busy period*B*_{2}with arrival rate*λ*_{2}and service rate*λ*_{1}+*μ*until the system is back at some state (*i*,*i*) with equal queue lengths. - (iii)
Finally, if a service completion occurs first, then with probability \(\frac{1}{2}\) the queue length process moves to (

*k*,*k*−1), respectively, to (*k*−1,*k*), and again a busy period*B*_{1}respectively*B*_{2}occurs. We shall sometimes speak of a ‘difference busy period’.

We now determine the probability that the underlying Markov chain jumps from (*k*,*k*) to (*i*,*i*), in each of these three possible events.

*L*

^{(m)}as the number of arrivals from base 3−

*m*during

*B*

_{m},

*m*=1,2. Furthermore, define

*K*

^{(m)}as the number of services in the busy period

*B*

_{m},

*m*=1,2; it is the

*sum*of the number of arrivals

*L*

^{(m)}and the number of item departures during

*B*

_{m}. Since

*K*

^{(m)}is the number of customers served in a busy period of an

*M*/

*M*/1 queue with arrival rate

*λ*

_{m}and service rate

*λ*

_{3−m}+

*μ*, it follows from

*M*/

*M*/1 theory (cf. Chap. II.4 of Cohen [1]) that, for

*m*=1,2,

*K*

^{(m)}=

*j*, we have that \(L^{(m)}= \mathrm{bin}(j,\frac{\lambda_{3-m}}{\lambda_{3-m}+\mu })\): The key observation in determining the transition probabilities

*P*

_{(k,k),(i,i)}in case (i) (so via a difference busy period

*B*

_{1}) is the following. During the difference busy period there is no equality of queue lengths. If the busy period starts from (

*k*+1,

*k*) and

*L*

^{(1)}=

*i*−

*k*, then there have been

*i*−

*k*arrivals from base 2 during

*B*

_{1}, and none of these is served in

*B*

_{1}. Hence, the next level at which there are equal queue lengths is level

*i*(in state (

*i*,

*i*)). Using similar reasonings in cases (ii) and (iii) finally results in the following transition probabilities of the Markov chain

*K*: Introducing

*a*

_{i}:=

*P*

_{(0,0),(i,i)}, and

*b*

_{l}:=

*P*

_{(k,k),(k+l−1,k+l−1)},

*l*≥0,

*k*≥1, we notice that we have an

*M*/

*G*/1-type Markov chain that satisfies (cf. (15)) the following balance equations:

*π*

_{0}follows by applying l’Hopital’s formula to (20):

*P*(

*i*,

*i*) using (13) and (14): In particular, it follows that

### Remark 2

*λ*

_{1}=

*λ*

_{2}, give a relation between the probabilities

*P*(

*i*,

*i*) and the

*marginal queue lengths*

*P*(

*N*

_{1}=

*i*) in that symmetric case:

### 3.2 Determination of *P*(*i*+1,*i*) and *P*(*i*,*i*+1)

In Sects. 2.1, 2.2, and 2.3, we successively derived simple geometric expressions for *P*(*N*_{1}+*N*_{2}=*n*), *P*(*n*_{1},0) and *P*(0,*n*_{2}), and for *P*(*N*_{1}−*N*_{2}=*n*|*N*_{1}>*N*_{2}) and *P*(*N*_{2}−*N*_{1}=*n*|*N*_{2}>*N*_{1}). In Sect. 3.1, we obtained a slightly more complicated expression for the (GF of) *P*(*i*,*i*). In the present subsection, we shall determine *P*(*i*+1,*i*) and *P*(*i*,*i*+1); that is an important building block for obtaining all *P*(*i*,*j*). Once more, there is a crucial role for the idea of having a “difference busy period” that starts at the moment the queue length vector leaves the state (*i*,*i*), and that lasts until equality is reached again. In the next subsection, we shall subsequently show how all *P*(*i*,*j*) can be determined once we know the above mentioned probabilities.

*S*

^{∗}consists of the states (

*i*,

*i*), (

*i*+1,

*i*) and (

*i*,

*i*+1),

*i*=0,1,…. It has the following one-step transition probabilities:

*i*=1,2,…, The last line perhaps requires an explanation. If a type-1 arrival occurs in state (

*i*+1,

*i*), then the difference becomes 2. It now takes a “difference busy period” until the difference returns to 1. With probability

*P*(

*L*

^{(1)}=

*l*),

*l*customers of type 2 arrive during this busy period, so in the discrete-time Markov chain under consideration we then move from state (

*i*+1,

*i*) to state (

*i*+

*l*+1,

*i*+

*l*).

*π*(

*i*+1,

*i*),

*π*(

*i*,

*i*+1) and

*π*(

*i*,

*i*),

*i*=0,1,…. Since 1/

*π*(0,0) is the expected number of visits in states of

*S*

^{∗}during the server busy period, we get that \(\frac{\pi(i,i)}{\pi(0,0)}\), \(\frac{\pi(i+1,i)}{\pi(0,0)}\) and \(\frac{\pi(i,i+1)}{\pi(0,0)}\),

*i*=1,2,… are, respectively, the expected numbers of visits to states (

*i*,

*i*), (

*i*+1,

*i*), and (

*i*,

*i*+1) during the server busy period. Notice that, hence,

*π*(

*i*,

*i*)/

*π*(0,0) is identical to the

*π*

_{i}/

*π*

_{0}of the previous subsection; they both represent the mean number of visits to state (

*i*,

*i*) during a server busy period. Let us concentrate on

*P*(

*i*+1,

*i*);

*P*(

*i*,

*i*+1) then follows by symmetry (interchanging

*λ*

_{1}and

*λ*

_{2}). We find for

*i*=0,1,…: Dividing both sides by

*π*(0,0) and introducing \(F_{+}(z) := \sum_{i=0}^{\infty} \frac{\pi(i+1,i)}{\pi(0,0)} z^{i}\) and \(\varTheta(z) := \sum_{i=0}^{\infty} \theta_{i} z^{i}\) where, as before,

*θ*

_{i}=

*π*

_{i}/

*π*

_{0}=

*π*(

*i*,

*i*)/

*π*(0,0), we find after a straightforward calculation:

*F*

_{+}(

*z*) of the \(\frac{\pi(i+1,i)}{\pi(0,0)}\) now follows from the known expressions for \(E[z^{L^{(1)}}]\) (cf. (17)) and for

*Θ*(

*z*) (via

*Π*(

*z*), cf. (20)).

*P*(

*i*+1,

*i*). Remembering that \(\frac{\pi(i+1,i)}{\pi(0,0)}\) is the expected number of visits to state (

*i*+1,

*i*) during the server busy period, and using Markov renewal theory, it follows that, like in (13),

*P*(

*i*+1,

*i*), this determines all

*P*(

*i*+1,

*i*) for

*i*=0,1,…, and by symmetry the

*P*(

*i*,

*i*+1) also follow. Notice that

*P*(

*j*,0) and

*P*(0,

*j*) were given in Sect. 2.2

*up to a multiplicative constant*; that constant now follows since

*P*(1,0) also is given by (27).

### 3.3 Determination of *P*(*i*,*j*)

*P*(

*i*,

*j*),

*j*≥

*i*+2, and

*i*≥

*j*+2. By symmetry, we can concentrate on the former case. First, we indicate how to obtain all

*P*(1,

*j*),

*j*≥3;

*P*(1,2) follows from the results of the previous subsection. From (1), we have

*j*=2, this immediately determines

*P*(1,3) as we know all other terms:

*P*(0,2) from Sect. 2.2,

*P*(1,1) from Sect. 3.1 and

*P*(1,2) from Sect. 3.2. For

*j*≥3, one can now use (28) to get

*P*(1,

*j*+1) once we have

*P*(1,

*j*−1) and

*P*(1,

*j*). We refrain from giving details, but we would like to observe the following. Equation (28) is an inhomogeneous second-order difference equation. The general solution of the

*homogeneous*second-order difference equation reads \(K_{1} a_{+}^{j} + K_{2} a_{-}^{j}\),

*j*≥2, where 1/

*a*

_{+}and 1/

*a*

_{−}are the two zeros of the equation

*λ*

_{2}

*x*

^{2}−(

*λ*

_{1}+

*λ*

_{2}+

*μ*)

*x*+

*μ*=0. We already encountered this expression, with

*λ*

_{1}and

*λ*

_{2}interchanged, in the denominator of (6). There we concluded that one of the two roots has absolute value smaller than one. Accordingly, we may conclude that the general solution of the homogeneous second-order differential equation reads \(K_{1} a_{+}^{j}\),

*j*≥2. Turning to the inhomogeneous equation, it should be observed that \(P(0,j) = \tilde{C}_{1} a_{+}^{j}\), with exactly the same parameter

*a*

_{+}as for the homogeneous equation. This follows, by symmetry, from (8). The theory of inhomogeneous difference equations now implies that the general solution of (28) is given by \((L_{0} + L_{1} j) a_{+}^{j-1}\). This would also readily follow via an approach with generating functions, expressing ∑

*P*(1,

*j*)

*z*

^{j}into ∑

*P*(0,

*j*)

*z*

^{j}.

*P*(

*i*,

*j*),

*i*≥2,

*j*≥

*i*+2. From (1), we have

*P*(

*i*,

*j*−1) and

*P*(

*i*,

*j*), and the (lower level)

*P*(

*i*−1,

*j*), the

*P*(

*i*,

*j*+1) follow. Again observe that (29) is an inhomogeneous second-order difference equation of exactly the same form as (28). By induction, one may show that its solution has the form:

*h*

_{m}.

### Remark 3

An interesting feature of the present model is that, for general service times, it has only been solved via the boundary value method (cf. Cohen [2]). In almost all two-dimensional queueing problems which have been solved via the boundary value method, taking exponential service times does not simplify the problem to such an extent that one no longer needs to rely on that method. In the present problem, though, there seems to be so much structure that, in the exponential case, the *P*(*i*,*j*) have the nice form indicated in (30).

### 3.4 Numerical example

*P*(

*i*,

*j*), as outlined above, in MATLAB. We have first computed the

*P*(

*i*,

*j*) in a completely symmetric case (

*λ*

_{1}=

*λ*

_{2}) that was already studied in [9], and we verified that we obtained the same numbers as in their Table III. Next, we took an asymmetric case:

*λ*

_{1}=2,

*λ*

_{2}=1 and

*μ*=4; so the load

*ρ*=0.75. The results are presented in Table 1. First observe that

*P*(0,0)=1−

*ρ*=0.25. Next, one may observe that \(\sum_{j=0}^{i}P(j,i-j)=(1-\rho )\rho^{i}\) (Sect. 2.1) and that the

*P*(

*i*,0) and

*P*(0,

*j*) decrease geometrically fast (Sect. 2.2). We have computed the

*P*(

*i*,

*i*) using (22). Notice that

*P*(1,1) was used in calculating the constants

*C*

_{1}=

*P*(1,0) and \(\tilde{C}_{1}=P(0,1)\) as outlined at the end of Sect. 2.2. Next, we determined

*P*(

*i*+1,

*i*) and

*P*(

*i*,

*i*+1) using (25) and (27). Finally, we have computed

*P*(

*i*,

*j*) for |

*i*−

*j*|≥2 using (28)–(30). Notice that

*P*(

*i*,

*j*)>

*P*(

*j*,

*i*) for

*i*>

*j*; this makes sense as

*λ*

_{1}>

*λ*

_{2}.

Queue length probabilities *P*(*i*,*j*) for the case *λ*_{1}=2, *λ*_{2}=1, *μ*=4

| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
---|---|---|---|---|---|---|---|---|

0 | 0.250000 | 0.066432 | 0.010425 | 0.001636 | 0.000257 | 0.000040 | 0.000006 | 0.000001 |

1 | 0.121068 | 0.086662 | 0.030848 | 0.005411 | 0.000938 | 0.000161 | 0.000028 | 0.000005 |

2 | 0.043537 | 0.057328 | 0.043391 | 0.015993 | 0.002840 | 0.000502 | 0.000088 | 0.000015 |

3 | 0.015657 | 0.024413 | 0.030185 | 0.023189 | 0.008623 | 0.001531 | 0.000271 | 0.000048 |

4 | 0.005630 | 0.010145 | 0.013431 | 0.016414 | 0.012686 | 0.004734 | 0.000838 | 0.000149 |

5 | 0.002025 | 0.004139 | 0.005875 | 0.007430 | 0.009052 | 0.007018 | 0.002624 | 0.000464 |

6 | 0.000728 | 0.001665 | 0.002532 | 0.003326 | 0.004131 | 0.005028 | 0.003906 | 0.001462 |

7 | 0.000262 | 0.000662 | 0.001076 | 0.001473 | 0.001871 | 0.002305 | 0.002805 | 0.002182 |

### Remark 4

In the case of equal arrival rates, the computation of the steady-state probabilities simplifies a bit. In particular, one now has *P*(*i*,*j*)=*P*(*j*,*i*). *P*(*j*,0)=*P*(0,*j*) follow as before from (8). The *P*(*i*,*i*) follow from (22). *P*(*i*,*i*+1)=*P*(*i*+1,*i*) follow using the relations (2*λ*+*μ*)*P*(*i*,*i*)=2*λP*(*i*−1,*i*)+2*μP*(*i*+1,*i*). Note that *P*(1,0)=*P*(0,1) were already determined. Finally. *P*(*i*,*j*)=*P*(*j*,*i*) follow for |*i*−*j*|≥2 as in Sect. 3.3.

## 4 Sojourn times

The main purpose of this section is to express the LST of the sojourn time distribution of a customer into the joint queue length distribution that was derived in the previous sections. We focus on a customer who has brought a failed item of type 1; by interchanging indices 1 and 2 (in particular, the arrival rates), we then also obtain the sojourn time LST for items of type 2.

### 4.1 The LST of the sojourn time distribution

Let *X*_{k,j}:= sojourn time of a type-1 customer who increases the number of customers waiting in line 1 from *j*−1 to *j*, and whose arrival increases the difference between numbers of waiting customers in lines 1 and 2 from *k*−1 to *k*, *k*≥1, *j*≥1. We similarly define *X*_{k,j} for *k*≤0; in that case, the difference between lines 1 and 2 again decreases from *k*−1 to *k*. Define \(\varPsi_{k,j}(\alpha) := E[\mathrm{e}^{-\alpha X_{k,j}}]\).

*Case I:**k*≥0

*k*≥1,

*j*≥1. Notice that

*X*

_{k,j}lasts until the moment that

*j*items have been returned to base 1. Conditioning on the amount of time until the first event occurs, we can write for

*k*≥1,

*j*≥1: Here, we define

*Ψ*

_{k,0}=1,

*k*≥1. Similarly, we obtain for

*k*=0,

*j*≥1: We shall solve this set of recurrence relations using generating functions. Let Multiplying both sides of (31) by \(z_{1}^{k}z_{2}^{j}\) and summing over

*k*≥1,

*j*≥1 yields: We need to determine

*G*

_{0}(

*z*

_{2};

*α*) and

*G*

_{1}(

*z*

_{2};

*α*). One relation between these two functions is obtained via (32). First, we rewrite that equation by observing that

*M*/

*M*/1 queue with arrival rate

*λ*

_{2}and service rate

*λ*

_{1}+

*μ*. The idea behind (37) is the following. If the tagged type-1 customer arrives to find

*j*−1 customers in

*Q*

_{1}and

*j*+1 customers in

*Q*

_{2}, leading to a state (

*j*,

*j*+1), then it first takes a difference busy period

*B*

_{2}until the two queue lengths are again equal. No type-1 items are returned during that busy period. At the end of

*B*

_{2}, the state has become (

*j*+

*m*,

*j*+

*m*) for some

*m*≥0, with the tagged customer still in position

*j*of

*Q*

_{1}. For the sojourn time of the tagged customer, it makes no difference whether the system is in state (

*j*+

*m*,

*j*+

*m*) or in state (

*j*,

*j*).

### Remark 5

To see that it indeed makes no difference for the sojourn time of the tagged customer whether the system is in state (*j*+*m*,*j*+*m*) or in state (*j*,*j*), suppose that a type-1 customer (just for convenience we refer to this customer as the *red customer*), arrives to find the system at state (*j*−1,*j*). That means that he finds *j*−1 type-1 customers in front of him in line and also *j* type-2 customers; however, it is not yet determined how many of them are *served* before him. The reason for that is that in principle, the sojourn time of the *red customer* depends on future arrivals of both types of customers. After the admittance of the *red customer*, the state of the system becomes (*j*,*j*), and the LST of the sojourn time of the *red customer* is *Ψ*_{0,j}(*α*). However, the latter dependence on future arrivals has a special regenerative property. For example, suppose that *m* type-1 customers and *m* type-2 customers were admitted to the system after the arrival of the *red customer* and before the service completion of the item being served. Then, by the memoryless property of the service, the residual sojourn time of the *red customer* (the time it takes from the arrival of the above 2*m*th customer until the red customer leaves the system), is stochastically equal to the sojourn time of the red customer. Thus, the LST of the above residual sojourn time is also *Ψ*_{0,j}(*α*).

*j*=1: and for

*j*≥2: or equivalently, for

*j*≥2: Multiplying the terms of the last equation by \(z_{2}^{j}\) and summing over

*j*≥1 gives: Subsequently, we derive a second relation between

*G*

_{0}(

*z*

_{2};

*α*) and

*G*

_{1}(

*z*

_{2};

*α*). We first rewrite (36), by grouping all

*G*(

*z*

_{1},

*z*

_{2};

*α*) terms, and multiplying all terms by

*μ*+

*λ*

_{1}+

*λ*

_{2}+

*α*: Consider the factor in front of

*G*(

*z*

_{1},

*z*

_{2};

*α*) in the left-hand side of (42). Multiplying this factor by

*z*

_{1}and equating the result to zero yields the following quadratic equation in

*z*

_{1}:

*K*

^{(1)}−

*L*

^{(1)}equals the number of item departures during the difference busy period

*B*

_{1}. This interpretation immediately shows that this

*y*lies inside the unit circle. The sum of the two

*y*-roots equals \(\frac{\mu +\lambda_{1}+\lambda_{2}+\alpha }{\lambda_{1}}\), which in absolute value is at least 2 since

*λ*

_{1}+

*λ*

_{2}<

*μ*. Hence, one

*y*-root is inside the unit circle and the other one lies outside, implying that the same holds for the roots of (43).

*G*(

*z*

_{1},

*z*

_{2};

*α*) is analytic in

*z*

_{1}for |

*z*

_{1}|<1, the right-hand side of (42) must be zero for \(z_{1} = z_{1}^{+}\). This yields a second relation between

*G*

_{0}(

*z*

_{2};

*α*) and

*G*

_{1}(

*z*

_{2};

*α*): We are thus able to determine those functions, and finally

*G*(

*z*

_{1},

*z*

_{2};

*α*) follows from (42).

In this way, we find the double GF of the sojourn time LST for a customer of type 1 who arrives to find *j*−1 customers waiting at *Q*_{1}, and whose arrival increases the difference between numbers of waiting customers in lines 1 and 2 from *k*−1 to *k*, for both *k*≥1 and *k*=0 (see *G*_{0}(*z*_{2};*α*)).

*Case II:**k*<0

*k*<0, we use the same argument as in (37): if a customer arrives at base 1 and finds there

*j*−1 waiting customers while the difference with the queue length in

*Q*

_{2}decreases to

*k*<0, then

*j*+

*m*,

*j*+

*m*), but for the tagged customer in position

*j*of

*Q*

_{1}, the value of

*m*≥0 is irrelevant.

We thus obtain all conditional sojourn time LST’s. Multiplying by the probabilities *P*(*j*−1,*j*−*k*) as seen by an arriving customer (use PASTA to conclude that these arrival probabilities are exactly the probabilities which were calculated in Sects. 2 and 3) and summing yields the unconditional sojourn time LST.

### 4.2 Further results for the sojourn time distribution

One might use the results of the previous subsection to obtain mean conditional sojourn times *E*(*X*_{k,j}). In the present subsection, we present an alternative approach for obtaining those means.

Let *T*_{j} be the number of arrivals into base 1 minus the number of arrivals into base 2 that occur between the (*j*−1)th and the *j*th departure. Clearly, {*T*_{j};*j*≥1} is a sequence of i.i.d. random variables; let *T* be the generic random variable of the sequence.

### Lemma 1

*where*

### Proof

*V*

_{i}be the number of arrivals into base

*i*(

*i*=1,2) between two successive departures and let

*X*be the generic service time of an item. By conditioning on

*X*, \(V_{i\text{ }}\) is a Poisson random variable with mean

*λ*

_{i}/

*μ*. We have for

*n*=0,±1,±2,… where \(I_{n}(y)=\sum_{k=0}^{\infty }\frac{(y/2)^{n+2k}}{k!(k+n)!}\) is the Bessel function (of order

*n*) of a purely imaginary argument. Using [6], we get

*Ψ*

_{k,j},

*k*≥0,

*j*≥1. The relations are computed via a recursive algorithm that will be implemented to compute

*E*

_{k,j}:=

*E*(

*X*

_{k,j}).

*k*≥1,

*α*=0 in the first derivative of (51) and (52), we obtain

*k*≥1 Note that in the first phase we compute

*E*

_{0,1}and

*E*

_{1,1}. Then, in the second phase, the

*E*

_{k,1}for

*k*≥2 are obtained recursively.

*Ψ*

_{0,j}(

*α*),

*j*≥1:

*α*=0 in the first derivative) Substituting

*α*=0 in the first derivative of (40), we get for

*j*≥2:

*E*

_{k,2}for

*k*≥0, substitute (55) in (57) and use (58).

### 4.3 Numerical example

*E*

_{k,j}, as outlined above, in MATLAB. We have taken

*λ*

_{1}=2,

*λ*

_{2}=1 and

*μ*=4. The results are displayed in Table 2.

Conditional expected sojourn time *E*_{k,j} for the case *λ*_{1}=2, *λ*_{2}=1, *μ*=4

| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
---|---|---|---|---|---|---|---|

0 | 0.379555 | 0.811411 | 1.224560 | 1.631373 | 2.035292 | 2.437686 | 2.839205 |

1 | 0.269332 | 0.627366 | 1.031134 | 1.434780 | 1.837252 | 2.238883 | 2.639965 |

2 | 0.252885 | 0.531077 | 0.873868 | 1.256923 | 1.649990 | 2.046662 | 2.444902 |

3 | 0.250430 | 0.506422 | 0.788239 | 1.119573 | 1.486777 | 1.869373 | 2.259407 |

4 | 0.250064 | 0.501170 | 0.759749 | 1.042309 | 1.364878 | 1.719494 | 2.092150 |

5 | 0.250009 | 0.500022 | 0.752156 | 1.011815 | 1.294536 | 1.609989 | 1.954075 |

6 | 0.250001 | 0.500000 | 0.750332 | 1.000703 | 1.263822 | 1.545459 | 1.854200 |

7 | 0.250000 | 0.500000 | 0.750039 | 1.000000 | 1.252476 | 1.515039 | 1.792684 |

One can see that for a constant *j*, as *k* increases, the expected sojourn time *E*_{k,j}, tends to *j*/4 which is the expectation of the *Erlang*(*j*,4) random variable. This is not surprising, since as *k* gets larger, the probability that repaired items will be released only to base 1 during the customer’s sojourn time, is getting closer to 1.

### Open Access

This article is distributed under the terms of the Creative Commons Attribution License which permits any use, distribution, and reproduction in any medium, provided the original author(s) and the source are credited.