% Comparison of binomial and Poisson PMFs
%
% R. Kozick, ELEC 471

% Poisson parameters

alpha = 12;
x = 0:30;

% Binomial parameters

n = 100;
p = alpha/n;

% Evaluate PMFs (requires Matlab's Statistics Toolbox)

binopmf = binopdf(x, n, p);
poisspmf = poisspdf(x, alpha);

% Plot PMFs

figure(1)
plot(x, binopmf, 'bo-', x, poisspmf, 'rs:')
legend('BINOMIAL', 'POISSON')
s = sprintf('alpha = %f, n = %d, p = %f', alpha, n, p);
title(s)
xlabel('NUMBER OF ARRIVALS')
ylabel('PROBABILITY')

