No BSD License  

Highlights from
Alternative Mathematics using MATLAB 7

image thumbnail

Alternative Mathematics using MATLAB 7

by

 

13 Mar 2003 (Updated )

Self-instructive text on undergraduate algebra, statistics, differential and integral calculus.

ex175.m
% ex175.m:  Binomial and Normal Distributions  
clear all
m0=100;						% Number of tosses per test
sdev=sqrt(m0)/2;					% Standard deviation of Ybd
for j=1:m0+1					% Binomial distribution
   m=j-1;
   Xm(j)=m;
   Ybd(j)=prod(1:m0)/prod(1:m)/prod(1:(m0-m))*0.5^m0;	% Binomial
   Nd(j)=1/sdev/sqrt(2*pi)* exp(-(m- m0/2)^2/2/sdev^2);	% Normal
end
figure(1),  plot(Xm,Ybd,'g',  Xm,Nd,'k:'),  grid on,  axis([0 100 0 0.09])
   title('Binomial and Normal Distributions')
   xlabel('number of heads'),  ylabel('probability')
figure(2),  plot(Xm,Ybd-Nd),  grid on,  axis([0 100 0 3e-4]);

Contact us