Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. diff(pbinom(c(44,55),100,.5))
  2. [1] 0.728747
  3.  
  4. diff(pbinom(c(449,550),1000,.5))
  5. [1] 0.9986083
  6.  
  7. par(mfrow=c(2,1))
  8.  
  9. x = 0:100; PDF = dbinom(x, 100, .5)
  10. plot(x, PDF, type="h", lwd=2, main="BINOM(100,.5) with Approx. Normal Density")
  11. abline(h = 0, col="green2")
  12. abline(v = c(44.5,55.5), col="red", lwd=2, lty="dotted")
  13. curve(dnorm(x, 50, 5), add=T, lwd=2, col="blue")
  14.  
  15. x = 400:600; PDF = dbinom(x, 1000, .5)
  16. plot(x, PDF, type="h", main="BINOM(1000,.5) with Approx. Normal Density")
  17. abline(h = 0, col="green2")
  18. abline(v = c(449.5,550.5), col="red", lwd=2, lty="dotted")
  19. curve(dnorm(x, 500, sqrt(250)), add=T, lwd=2, col="blue")
  20.  
  21. par(mfrow=c(1,1))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement