Advertisement
Sri27119

binomial

May 19th, 2024
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.36 KB | None | 0 0
  1. x=2; % Num of pollutant
  2. n=18; % Num of samples
  3. p=0.1; % P(sample contains pollutant)
  4. Px1 = binopdf(x,n,p); % P(exactly 2 samples contain pollutant)
  5. plot(0:18,binopdf(0:18,n,p));
  6. title("BINOMIAL PROBABILITY DISTRIBUTION");
  7. xlabel('Number of Pollutants --->');
  8. ylabel('Probability --->')
  9. Px2 = binocdf(3,n,p);
  10. r = 1-Px2; % P(at least 4 samples contain pollutant)
  11.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement