No BSD License  

Highlights from
Queueing Systems Toolbox

from Queueing Systems Toolbox by Bill Higley
These deal with an M/M/c queue and a finite source queue

fsqfindpn(lambda,mu,c,m,n)
%fsqfindpn(lambda,mu,c,m,n)
%   This function finds the probability there are n machines down
%   (in the system) for a machine repair problem (finite source queue).

function out = fsqfindpn(lambda,mu,c,m,n)

p0 = fsqfindp0(lambda,mu,c,m);

if n == 0
    pn = p0;
end

if n >= 1
    if n < c
        pn = nchoosek(m,n)*(lambda/mu)^n*p0;
    end
end

if n >= c
    if n <= m
        pn = nchoosek(m,n)*(lambda/mu)^n*p0*factorial(n)/(factorial(c)*c^(n-c));
    end
end

if n > m
    pn = 0;
end

out = pn;

Contact us at files@mathworks.com