Exercise

Probability of losing money

In this exercise, we will use the DGP model to estimate probability.

As seen earlier, this company has the option of spending extra money, let's say $3000, to redesign the ad. This could potentially get them higher clickthrough and signup rates, but this is not guaranteed. We would like to know whether or not to spend this extra $3000 by calculating the probability of losing money. In other words, the probability that the revenue from the high-cost option minus the revenue from the low-cost option is lesser than the cost.

Once we have simulated revenue outcomes, we can ask a rich set of questions that might not have been accessible using traditional analytical methods.

This simple yet powerful framework forms the basis of Bayesian methods for getting probabilities.

Instructions

100 XP
  • Initialize cost_diff, the difference between the 'high' and 'low' cost options, to 3000.
  • Get the revenue for the high-cost option and assign it to rev_high.
  • Calculate the fraction of times when rev_high - rev_low is less than cost_diff. Call it frac and use it to print your results.