function [p_n] = mm1_queue_cap_N(lambda,mu,N) % MM1_QUEUE_CAP_N - Returns the M/M/1 queue steady state probability when we have a capacity of N % % Input: % lambda: arrival rate % mu: departure rate % N: the number of lines in the queue % % Output: % p_n: is the steady-state probabity we are in the state X(t)=n % % References: % % Introduction to Probability Models: Chapter 10 % by Roe Goodman % % Written by: % -- % John L. Weatherwax 2007-09-10 % % email: wax@alum.mit.edu % % Please send comments and especially bug reports to the % above email address. % %----- rho = lambda/mu; p_0 = ( ( 1-rho^(N+1) )/( 1-rho ) )^(-1); p_n = (rho.^(0:N))*p_0;