• Home
  • About R Trix
  • Teaching Resources
  • RTricks Library
  • Interactive Apps
  • Training Network
RTFR landingdist

R Code for Discrete Probability Example 1

money<-c(1,1,1,1000,1000,100000)

mean(money)

#Interpretation: If you were to play this game over and 
#   over (replacing the envelope after each play) then 
#   your average winnings would be $17, 000.50 in the long run.

mean(money+10000)  # Average, after adding 10000

mean(10*money)