## An airline charges the following baggage fees: $20 for the first
## bag and $40 for the second -- hence $60 total for two bags. Suppose
## 45% of passengers have no checked luggage, 33% have one piece of
## checked luggage and 22% have two pieces. We assume a negligible
## portion of people check more than two bags. We are interested in
## the expected revenue.
## Create two vectors to represent this 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 checked luggage.
## Use R to calculate the standard deviation of revenue in dollars.
## Use R to calculate the expected revenue from checked luggage in
## euros, where the conversion is $1 = euros0.89 (hence multiply
## dollars by .89).
## Use R to calculate the standard deviation from checked luggage in
## euros.
## Look at your R code above and try to simplify the expressions above
## using properties of algebra. Can you simply convert your final
## calculations in dollars to euros?
## 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?