Guest User

Untitled

a guest
Sep 20th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. a <- runif(1000, 8, 10) # A deliveries
  2. b <- runif(1000, 9, 11) # B deliveries
  3. # [1] 9.485513 8.665070 8.488481 8.840332 8.755384 9.448949 # A deliveries for example
  4.  
  5. prob <- sum(b < a)/1000
  6. #[1] 0.112 # almost 1/8
  7.  
  8. plot(a, b)
  9. polygon(c(9, 10, 10, 9),
  10. c(9, 9, 10, 9), density = 10, angle = 135)
  11.  
  12. se <- sqrt(prob * (1 - prob) / 1000)
  13. #[1] 0.009972763
  14.  
  15. prob - 1.96*se
  16. #[1] 0.09245338 lower bound
  17. prob + 1.96*se
  18. #[1] 0.1315466 upper bound
Add Comment
Please, Sign In to add comment