Repair systems with exchangeable items and the longest queue mechanism

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.


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 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 ; α 1 = α 2 = 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.1 P (N 1 + N 2 = n) Taking z 1 = z 2 = z in (2), it easily follows that This implies (by taking 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 ) Taking z 1 = z and z 2 = 0 in (2), we obtain by carefully considering the 1/z terms: Hence, (6) Consider the denominator of the right-hand side of (6). Partial fraction yields where 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 μ: 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 1 z + = λ 1 z − μ : Similarly, P (0, j) =C 1 ( 1 z + ) j −1 , j = 1, 2, . . . , wherez + is obtained from z + by interchanging λ 1 and λ 2 . It remains to determine the constants C 1 andC 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) =C 1 .

P (N
Taking z 1 = z = 1/z 2 in (2), we get a relation between the generating functions 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, implying that N 2 − N 1 , when positive, is geom( λ 2 λ 1 +μ ) 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( λ 1 λ 2 +μ ) 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: 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 ( ; 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.
Cohen [2] studies (x (1) n , x (2) n ), where these are the numbers of customers of types 1 and 2 right after a service completion. He states in his formula (1.6): If x (1) n > x (2) n , then where the ν (i) n+1 are numbers of type-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 (1) n = x (2) In our repair system, we study (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 nth departure epoch: (N (1) n , N (2) n ). 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 (i) n . Indeed, one may easily verify that, exactly as for the x (i) n in (11), one has: If N (1) n > N (2) n then and other similar equations hold; in particular, if N (1) 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 (ν (1) n+1 , ν (2) n+1 ) plus that one ignored customer. However, as he is ignored, we have exactly the same recursion relations for (N (1) n , N (2) n ) as Cohen [2] gets for (x (1) n , x (2) n ). 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 (1) n , x (2) n ) 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.

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

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. The successive busy cycles, where a busy cycle 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 1 λ 1 +λ 2 +μ for i ≥ 1, we have where Now consider a discrete-time Markov chain 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 . The steady-state solution of the Markov chain K satisfies the normalizing condition ∞ i=0 π i = 1 and the balance equations Let us now determine the transition probabilities 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 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.  [1]) that, for m = 1, 2, E[z L (m) ] now follows, since given K (m) = j , we have that L (m) = bin(j, λ 3−m λ 3−m +μ ): 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: Here, (2) , π 0 follows by applying l'Hopital's formula to (20): where (2) , Finally, let us determine the GF of P (i, i) using (13) and (14): In particular, it follows that Remark 2 Zheng and Zipkin [9], studying the fully symmetric case with λ 1 = λ 2 , give a relation between the probabilities P (i, i) and the marginal queue lengths P (N 1 = i) in that symmetric case: and . It is trivial to use (24) to establish a relation between ∞ i=0 z i P (i, i) and ∞ i=0 z i P (N 1 = i); the latter GF now follows from (22).

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.
We finally obtain P (i + 1, i). Remembering that π(i+1,i) π(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), Using (26), which gives the GF of 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).

Determination of P (i, j)
We now describe a recipe to find the remaining 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 For 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) =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 .
Next, we indicate how to obtain all P (i, j), i ≥ 2, j ≥ i + 2. From (1), we have After having obtained 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: In fact, in the completely symmetric case this was proven in [9], and an algorithm was provided to determine the 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).

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.

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 Ψ k,j (α) := E[e −αX k,j ].
Case I: k ≥ 0 Let us first concentrate on the case 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 k 1 z j 2 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 where Γ (α) = E[e −αB 2 ], the LST of the difference busy period corresponding to an 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 2mth 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 (α).
Thus, rewriting (32) yields for j = 1: and for j ≥ 2: or equivalently, for j ≥ 2: Multiplying the terms of the last equation by z j 2 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 : We shall show that this equation has one root z + 1 (z 2 ) inside the unit circle, and one root z − 1 (z 2 ) outside the unit circle. Notice that 1/z + 1 (z 2 ) and 1/z − 1 (z 2 ) are the two roots of the equation Following the reasoning that led to (16) and (17), it can be shown that the minus root of (44) is given by (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 , 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).
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 In handling the case 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 Indeed, Γ (α) k = (E[e −αB 2 ]) k is the LST of the time it takes to reduce the difference between the two queue lengths to zero. Of course, during that process the queue lengths move to some state (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.

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
Proof Let 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 is a Poisson random variable with mean λ i /μ. We have for n = 0, ±1, ±2, . . .
By using Lemma 1, we derive some relevant relations for Ψ 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 ).

Numerical example
We have implemented the formulas and algorithms for calculating E k,j , as outlined above, in MATLAB. We have taken λ 1 = 2, λ 2 = 1 and μ = 4. The results are displayed in Table 2.
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.