Guest User

Untitled

a guest
Aug 25th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. set.seed(12)
  2. (money=sort(round(rlnorm(100,6,4)))+1)
  3. sinh(mean(asinh(money))) #gives 393.7934
  4. exp(mean(log(money))) #gives 391.2577
  5. prod(money)^(1/length(money)) #gives 391.2577 but can overflow
  6. median(money) #261.5
  7.  
  8. set.seed(12)
  9. (money=sort(round(rlnorm(100,6,4))))
  10. sinh(mean(asinh(money))) #gives 369.4342
  11. exp(mean(log(money))) #gives 0
  12. prod(money)^(1/length(money)) #gives 0
  13. median(money) #260.5
  14.  
  15. set.seed(12)
  16. (money=sort(round(rlnorm(100,6,4)))-10000)
  17. sinh(mean(asinh(money))) #gives -201.5435
  18. exp(mean(log(money))) #gives NaN
  19. prod(money)^(1/length(money)) #gives Inf so WRONG due to overflow
  20. median(money) #-9739.5
  21.  
  22. set.seed(12)
  23. (money=sort(round(rlnorm(100,6,4)))*-1)
  24. sinh(mean(asinh(money))) #gives -369.4342
  25. exp(mean(log(money))) #gives NaN
  26. prod(money)^(1/length(money)) #gives 0
  27. median(money) #-260.5
Add Comment
Please, Sign In to add comment