## A bookstore offers a chemistry textbook for $159 and a book
## supplement for $41. From past experience, they know about 25% of
## chemistry students just buy the textbook while 60% buy both the
## textbook and supplement. We are interested in the expected
## revenue from this course.
## Create two vectors to represent this random random variable: x,
## which holds all the values the random variable might take on, and
## px the probabilities associated with each value in x.
## Use R to calculate the expected revenue from the chemistry course.
## Use R to calculate the standard deviation of revenue in dollars.
## Now, let's add some data.
## Use R to sample() 1001 observations from the random variable above.
## Approximate the expected revenue based on your sample.
## Approximate the standard deviation based on your sample.
## Approximatre P(X > 0) based on your sample.
## Does your approximation to P(X > 0) make sense, given the random
## variable above?