Advertisement
Guest User

Untitled

a guest
Jul 15th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
R 0.64 KB | None | 0 0
  1. # Problem:  Suppose a production process produces widgets with a weight distributed
  2. # as a normal variable with mean of 100 grams and standard deviation of 10 grams.
  3. # What is the probability of a random sample of size 25 having a mean value that is
  4. # outside 100 +- 2 grams?
  5.  
  6. cord.x <- c(-3, seq(-3, -2*(5)/10, 0.01), -2*(5)/10)
  7. cord.y <- c(0, dnorm(seq(-3, -2*(5)/10, 0.01),0,1), 0)
  8. cord.xx <- c(2*(5)/10, seq(2*5/10, +3, 0.01), +3)
  9. cord.yy <- c(0, dnorm(seq(2*5/10, +3, 0.01),0,1), 0)
  10. curve(dnorm(x,0,1),xlim=c(-3,3),main="Standard Normal Density", ylab = "density")
  11. polygon(cord.x,cord.y,col="skyblue")
  12. polygon(cord.xx,cord.yy,col="skyblue")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement