Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % When population size is much larger than number of samples drawn n>>m
- x = 0:4;
- m= 300;
- k= 100;
- n= 4;
- Px= hygepdf(x,m,k,n);
- p= k/m;
- Px2= binopdf(x,n,p);
- plot(Px,'r');
- hold
- plot(Px2,'b');
- title('WHEN POPULATION SIZE IS MUCH LARGER THAN SAMPLE');
- legend('Hypergeometric','Binomial');
- xlabel('Number of samples --->');
- ylabel('Probability --->');
- % When Population size is near to the number of samples drawn
- figure;
- x2= 0:150;
- m2=300;
- k2=100;
- n2=150;
- Px3= hygepdf(x2,m2,k2,n2);
- p2= k2/m2;
- Px4= binopdf(x2,n2,p2);
- plot(Px3,'r');
- hold
- plot(Px4,'b');
- title('WHEN POPULATION SIZE IS CLOSER TO SAMPLE');
- legend('Hypergeometric','Binomial');
- xlabel('Number of samples --->');
- ylabel('Probability --->');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement