Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- m = 10^6; lam=5; bet = 1/50; t = numeric(m)
- for (i in 1:m) {
- n = rpois(1, lam); t[i] = sum(rexp(n+1,bet))
- }
- mean(t); sd(t); mean(t > 600)
- ## 299.7921 # aprx E(T) = 300
- ## 165.8158 # aprx SD(T) = 165.83
- ## 0.053278 # aprx P(X > 600)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement