Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- m = 10^5; n = 5; x = runif(m*n, 6, 12)
- MAT=matrix(x,nrow=m) # each row of matrix has sample of size 5
- p = apply(MAT, 1, prod) # products of values in each row
- mean(p)
- ## 59029.94 # aprx E(P) = 59049
Add Comment
Please, Sign In to add comment