function CI=LMTheorem050301_4th(k,n,alpha)
% format CI=LMtheorem050301_4th(k,n,alpha)
% Larsen & Marx (2006) Introduction to Mathematical Statistics, 4th edition
% Theorem 5.3.1 p.369
% Confidence limits for binomial proportion, k/n
% input alpha, e.g., alpha=0.05 for 95% CI's
% output CI    [Lower CI p Upper CI]
z=norminv(1-alpha/2);
CI=zeros(1,3);
p=k/n;
CI(2)=p;
halfCI=z*sqrt(p*(1-p)/n);
CI(1)=p-halfCI;
CI(3)=p+halfCI;