Journal of Computational and Applied Mathematics

We consider a discrete-time Geo / G / 1 / ∞ system in which a customer that finishes its first essential service may opt to abandon the system, to receive a second optional service or to go at the head of the queue in order to receive another essential service. We study the Markov chain underlying the considered queueing system and its ergodicity condition. Using a generating function approach the distribution of the number of customers in the queue and in the system as well as their respective means are given. The busy period of an auxiliary system, that will be useful to study of the customers delay, is analysed. The distributions of the sojourn time of a customer in the server, the queue and the system are provided. In order to illustrate the effect of the parameters on several performance characteristics some numerical examples are given. Finally, a section of conclusions commenting the main research contributions of this paper is presented.


Introduction
Queueing systems constitute a central tool in modelling and performance analysis.These types of systems are in our everyday life activities, and the theory of queueing systems was developed to provide models for forecasting behaviours of systems subject to random demand.The practical and useful applications of the discrete-time retrial queues make the researchers to continue making an effort in analysing this type of models.Thus the present contribution relates to a discrete-time Geo/G/1 queue in which some customers may demand a second service time in addition to the first essential service.In day-to-day life, there are numerous examples of queueing situations (for example, manufacturing processes) where all the arriving customers require the main service and only some may require the subsidiary service provided by the server.As far as the authors know there are no such works on main queues but on retrials, see for example, [1] and [2].
Therefore we study a queueing system where the customers after the first (regular) service may choose for the second optional service or may leave the system forever.Thus, we specifically analyse a system where the customers service may be scheduled in two phases; that is, all the customers are processed in the first phase and only the customers who qualify are routed to the second phase.In terms of practical problems we have also considered, in order of decongestion, the possibilities of abandons the system.
If we focus on some variants on job processing we can consider that second optional service and abandons are just movement of jobs from one place to another one.In this case, performance prediction in communication switching queues, job processing in computers, etc., are always influenced by customers behaviour, and the provision of this additional information will be useful in upgrading the service.Therefore, in many real problems it is also interesting to consider the movement of jobs, customers, etc. from one place to another.This mechanism is called a synchronised or triggered motion (e.g., [3], [4] and [5]).If we take into account the inverse order discipline, that is, a Last-Come-First-served (LCFS), we refer to [6], [7] as well as [8].
If we assume that a vacation is considered as an interruption of the system we note that the pioneer paper is [9] and from another point of view of service interruptions between low and regular service state we recommend the paper [10] where the authors introduce a more flexible mechanism to enhance the practical value of a working vacation.
The rest of the paper is as follows.In the next section, we give the model description of the considered queueing system.In Section 3, we study the Markov chain and the stability condition of the system.Also, the distribution of the number of customers in the queue and in the system is obtained.In Section 4, the busy period of an auxiliary system, that will be useful in the study of the waiting time of a customer in the queue, is analysed.In Section 5, we find the GF's (Generating Functions) of the stationary distribution of the sojourn time of a customer in the server, the queue and in the system.Finally, we discuss numerical results in Section 6.

Description of the queueing system
We regard a discrete-time queueing system in which the time axis is segmented into a sequence of equal intervals, called slots.It should be pointed out that the discrete-time model differs from the corresponding continuous-time model in the sense that the probability of simultaneous arrival and departures is zero in continuous-time and positive in discretetime.That is why we must detail the order in which the arrivals and departures occur in case of simultaneity in a discrete-time system.
Let the time axis be marked by 0, 1, . . ., m, . ... Consider the epoch m and suppose that the departures occur in (m − , m) and the arrivals in (m, m + ).
The input stream into the system is described by means of a Bernoulli process with a as the probability that an arrival occurs in a slot.If an arriving customer finds the server idle, commences his service immediately.On completion of the first essential service, a customer decides with probability θ 1 to abandon the system, with probability θ 2 to go to the first place of the queue and with probability θ 3 to receive a second optional service.Once this optional service is ended the customer leaves the system, otherwise, if an arriving customer finds the server busy goes to the last place of the queue.Service times of the first (essential) and the second (optional) services are independent and arbitrarily distributed with distributions {s 1,i } ∞ i=1 and {s 2,i } ∞ i=1 respectively, and probability generating functions S 1 (x) and S 2 (x), x ∈ [0, 1], respectively.

The Markov chain
At time m + , the instant immediately after time slot m, the state of the system can be described by the process where C m denotes the state of the server, 0, 1 or 2 according to whether the server is free, busy providing a first essential service or busy providing a second optional service and N m is the number of customers in the queue.If C m ∈ {1, 2}, then ξ m denotes the remaining service time of the customer currently being served.
It can be shown that {X m : m ∈ N} is the Markov chain of our queueing system, whose states space is The system of equilibrium equations (SEE) for the stationary distribution of the system is given by: where ā = 1 − a and δ ab is the Kronecker's delta.
The normalisation condition is With the aim of solving Eqs. ( 1)-( 3) we introduce the following joint generating functions for x, z ∈ [0, 1] and the auxiliary generating functions Multiplying Eqs. ( 2) and ( 3) by z k , summing over k and taking into account Eq. ( 1), we get Next, multiplying Eqs. ( 4) and ( 5) by x i and summing over i, we obtain x Letting x = ā + az in ( 6) and ( 7), after some algebra, we have where By substituting the above expressions of ϕ 1,1 (z) and ϕ 2,1 (z) in ( 6) and ( 7) we finally get Using the normalisation condition, that can be written as π 0 + ϕ 1 (1, 1) + ϕ 2 (1, 1) = 1, we can find the unknown constant π 0 : Since π 0 > 0, we obtain that a necessary condition for the stability of the system is Let us show that D(z) > 0 for z ∈ [0, 1) if and only if the stability condition (10) is fulfilled.With this end in view we consider the following function: The function f (z) satisfies the following properties: If the stability condition ( 10) is satisfied, then f ′ (1) < 1 and the existence of z 0 ∈ (0, 1) with f (z 0 ) = z 0 would be in contradiction with the properties given before.On the other hand if the stability condition is not fulfilled, that is, if a[S ′ extended by continuity.The above results can be summarised in the following theorem: (10) is satisfied, the stationary distribution of the Markov chain {(C m , ξ m , N m ) : m ∈ N} has the following generating functions: where Corollary 1.
1.The probability generating function of the queue size (i.e., of the variable N) is given by 2. The probability generating function of the system size (i.e., of the variable L) is given by 1.The mean queue size is given by 2. The mean system size is given by

Busy period
In this paragraph we will study an auxiliary system, that differs from the original one by the fact that during the service times there are no arrivals in the system.
A busy period is defined as the period of time starting with the arrival of a customer who finds the system empty and ends at the first service completion epoch at which the system becomes empty again and no external customers arrive.
We will denote by h k , k ≥ 0, the probability that the busy period lasts k slots.Then we have: Let us comment the term aθ 2 The customer that opens the BP chooses an essential service of i slots, i = 1, . . ., k − 1 (with probability s 1,i ), once this service is finished the customer goes to the queue (with probability θ 2 ) and a new customer arrives to the system (with probability a) initiating a BP of length j slots, j = 1, . . ., k − i (with probability h j ), ended this BP the customer that was in the queue come back to the server opening a BP of length k − i − j slots (with probability h k−i−j ) The above formulae can be used recursively in k to calculate numerically the distribution {h k , k ≥ 0}, nevertheless with the aim of calculating the moments of the distribution we will use the GF h(x) = ∞ ∑ k=0 h k x k , that satisfies the following relation This expression shows that the GF h = h(x) satisfies the quadratic equation where Let us note that for any fix x 0 ∈ (0, 1) is The above relations show that for any x ∈ (0, 1) (14) has two solutions, h(x) and h * (x), satisfying the inequalities 0 < h(x) < 1 < h * (x) and given by where The GF of the busy period is defined by the first (minimal) solution h(x).It only remains to check that h(1) = 1.For x = 1 we have f (1) = 0, which means that at least one of the two solutions h(x) or h * (x) takes the value 1 for x = 1.Let us observe that the inequality h * (1) > 1 holds if and only if If the stability condition ( 10) is fulfilled the right hand side of the above inequality is negative and in consequence h * (1) > 1 and h(1) = 1, therefore the GF of the busy period is h(x).
The mean length of the busy period is given by ā − θ 2 .
In order to find the generating function of the sojourn time of a customer in the queue we need to consider the busy period which begins when the server is busy with an essential service and the remaining service time of the customer currently being served is i slots.Let us denote by h 1 (i, l) the probability that this busy period lasts l, l ≥ i, slots.Then Let us explain the term aθ 3 Once that the customer that opens the BP has finished the remaining i slots of its service, with probability θ 3 s 2,j , j = 1, . . ., l − i, initiates an optional service of j slots and then a new customer arrives opening a BP of length of l − i − j slots (with probability ah l−i−j ).
The corresponding GF is given by Now, let us consider the same busy period but considering an optional service instead of an essential service.Let us denote by h 2 (i, l) the probability that this busy period lasts l, l ≥ i, slots.Then and the corresponding GF is given by

Sojourn time of a customer in the server
Let us denote by b k the probability that the sojourn time of a customer in the server lasts k slots.The distribution The mean sojourn time of a customer in the server is given by b Let us note that the stability condition (10) can be written as ρ = a b < 1.

Sojourn time of a customer in the system
Finally, we will find the distribution of the period of time that a customer spends in the system from the beginning of its service till the moment of its departure.We let g k be the probability that this period of time lasts exactly k slots.Then we have

Let us explain the term aθ
The customer that enters in the system begins an essential service of i slots, i = 1, . . ., k − 1, (with probability s 1,i ) after what goes to the first place of the queue (with probability θ 2 ) and a new customer arrives initiating a BP (fictitious) of j slots, j = 1, . . ., k − i, (with probability ah j ), ended this BP the customer at the head of the queue goes to the server and abandon the system after k − i − j slots (with probability g k−i−j ). .
The mean length of the period of time that a customer spends from the beginning of its service till the moment of leaving the system is given by The stationary distribution of the waiting time that a customer spends in the queue until the beginning of his service has the following GF Let us explain the above formula: • A customer that enters in the system remains in the queue 0 slots with probability π 0 +(θ 1 +θ 2 ) • A customer that enters in the system will find the server busy serving an essential service with a remaining service time of i slots and k other customers in the queue with probability π 1,i+1,k .Then this customer will wait in the queue till the beginning of its service a period of time with GF h 1 (i, x) h(x) k .
• Similar explanation takes place if a customer who enters in the system finds the server busy with a second optional service and a remaining service time of i slots with other k customers in the queue.
• A customer that enters in the system will find k other customers in the queue and the server initiating a second optional service with probability θ 3 π 1,1,k .Once finished the second optional service there are two possibilities: • No customers enter in the system (with probability ā) and then the customer will wait in the queue till the beginning of its service a total period of time with GF S 2 (x) h(x) k , or, a new customer enters in the system (with probability a) initiating a BP with GF h(x).Then the total period of time that the customer remains in the queue till the beginning of its service has the GF S 2 (x) h(x) h(x) k .
Using the GF's introduced in Section 3 and the formulae ( 17) and ( 19) the above formula can be written in the form The corresponding mean time is given by The mean total time that a customer spends in the orbit is given by The GF, v(x), of the stationary distribution of a customer in the system is given by v(x) = w(x)g(x), and the mean sojourn time of a customer in the system is given by v = v ′ (1) = w + ḡ.

Numerical results
In this section, we present some numerical results to illustrate the effect of varying parameters on the main performance of the system.It will be supposed that essential and optional service times take exactly two and one slot respectively.Fig. 1 depicts the behaviour of π 0 against the parameter θ 2 .We have presented three graphics which correspond to θ 1 = 0, 0.5, 1, respectively.As we expect, the probability that the system is empty decreases when θ 2 increases and increases with values of θ 1 .Let us observe that in the case θ 1 = 0, when the variable t 2 approaches the stability condition the system becomes an unstable and hence the probability that the system is empty tends to 0. In Fig. 2, the behaviour of E[N] is plotted against the parameter θ 2 .We present three graphics corresponding to θ 1 = 0, 0.5, 1.As expected, E[N] increases with increasing values of the parameter θ 2 and decreases when θ 1 increases.In the case θ 1 = 0 when θ 2 tends to the stability condition the mean queue size diverges, as expected.

Conclusions and research results
In this paper a discrete-time Geo/G/1/∞ queueing system in which the arriving customers after an essential service completion may choose three different strategies: to abandon the system, to opt for a second optional service or to be placed at the head of the queue.A thorough study of the system has been carried out obtaining the generating functions of the number of customers in the queue and in the system, and its corresponding mean values.Besides, the stability condition is provided.
The busy period of an auxiliary system has been considered to study the customer's delay.One important research contribution of this paper is the analysis carried out to obtain the GF of the stationary distribution of the sojourn time that a customer spends in the queue and in the system.