Selling Newspapers:
An Example Problem with Probability

You run a newspaper stand.  You cannot predict exactly how many copies of the Daily Blab newspaper you will be able to sell each day, but you have observed the following historical demand pattern:
 

    Demand     Percentage of the Time
20 1%
21 2%
22 3%
23 4%
24 5%
25 6%
26 6%
27 7%
28 7%
29 7%
30 7%
31 7%
32 7%
33 6%
34 5%
35 4%
36 4%
37 3%
38 3%
39 3%
40 3%

Each copy of the Daily Blab costs you $0.35 and sells for $0.45.  You must place your order for the papers the night before they are sold, before you know exactly how many copies you will be able to sell.  Unsold copies may be returned to the publisher at the end of the day for a credit of $0.05 each.  What is the right number of papers to order each night so as to maximize your average daily profit?