# Compute mean and variance waiting time of M/M/1 Queue

Jobs arrive at a machine following a Poisson process with rate λ. The machine processes jobs one at a time, and the processing times follow i.i.d. exponential distribution with mean 1/µ, independent of the arrival process. Suppose at t = 0, the machine is occupied, processing a job. Let Y be the number of jobs waiting in queue when the machine completes processing that job. Derive the mean and variance of Y.

• Not sure how to start this problem.. – MaximumBoy Mar 4 '17 at 22:59
• Do you know how to find $P(Y=k)$ if you know the machine finishes the job at time $t$ for sure? Extend this method by writing $P(Y=k)$ in terms of conditional probability – manofbear Mar 4 '17 at 23:04
• Only thing I gathered is the machine can process jobs only if $\lambda < \mu$ otherwise the queue keeps filling up. So I'm guessing at time t, Machine finishes the job if $\lambda < \mu$. What do I do next? – MaximumBoy Mar 4 '17 at 23:10
• You can write $Y=X+Z$ where $X$ is the random number of jobs in queue at time $0$, and $Z$ is the (independent) number of more jobs that arrive while the residual service time completes. I think you are supposed to assume that $X$ has a distribution derived by taking the steady state distribution adn conditioning on teh system being nonempty. – Michael Mar 4 '17 at 23:17
• The answer according to the professor is $\lambda/\mu$ for E(Y) and $\lambda/\mu +(\lambda/\mu)^2$ for Var(Y) – MaximumBoy Mar 4 '17 at 23:22