Find the average waiting time in M/M/1 Queue

506 Views Asked by At

Suppose that two types of customers arrive to a queue with a single server. Type $A$ customers arrive according to a Poisson process with on average $3$ minutes between customers, while type $B$ customers arrive according to a Poisson process with on average $4$ minute between customers. Both types experience exponential service times with mean $1.5$ minutes per person. As usual, customers enter service in the same order that they arrive, except now a type $B$ customer only enters into service if they have been waiting the longest and there are no other type $A$ customers in system. Find the average waiting time (in the queue) of a type $B$ customer.

I didn't understand how to use the fact except now a type $B$ customer only enters into service if they have been waiting the longest and there are no other type $A$ customers in system

Update

$\lambda_A=\frac13,\mu=\frac23$ hence $\rho_A=0.5$

Expected number of Type $A$ customers were, $L_{s_A}=\frac{\lambda_A}{\mu-\lambda_A}=\frac{\rho_A}{1-\rho_A}=1$. And expected time for total service, $W_{s_A}=\frac{L_{s_A}}{\lambda_A}=\frac{1}{\frac13}=3$

As the Type $B$ customer only enters into service if there are no other type $A$ customers in system, isn't the average waiting time of a type $B$ customer, $W_{q_B}=3+\frac{L_{q_B}}{\lambda_B}?$

Still couldn't understand the context "they have been waiting the longest".

Update 2

I have got the solution,

Let $W_{q_B}$ denote the average waiting time in queue of a type $B$ customer, $N_A$ and $N_B$ denote the average number of customers of each type already in system and served first, and $M_A$ the average number of type $A$ customers that arrive later and are served first. Then, observe that the average remaining service time is $\rho\left(\frac{1}{\mu}\right)$ (the probability someone is in service times the average service length, due to memoryless property). So, $$ W_{q_B}=\rho\left(\frac{1}{\mu}\right)+\frac{N_A+N_B+M_A}{\mu} $$

But isn't "$N_B$ shouldn't serve before $M_A$"? And what the average remaining service time mean here?