Guest User

Untitled

a guest
Mar 21st, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. m = 10^5; n = 5; x = runif(m*n, 6, 12)
  2. MAT=matrix(x,nrow=m) # each row of matrix has sample of size 5
  3. p = apply(MAT, 1, prod) # products of values in each row
  4. mean(p)
  5. ## 59029.94 # aprx E(P) = 59049
Add Comment
Please, Sign In to add comment