This is problem teach you why is important to define well the probability distribution of a random variable before starting to compute expected value or the standard deviation.
The Problem is the following:
A bakery stocks daily four gourmet fancy fruit-topped cakes. All the cakes that are not sold during the day are thrown away, and the bakery restocks the next day with new cakes, bringing the in-stock level up to four at the beginning of each day. If daily demand is greater than the four cakes in stock the bakery loses sales. The special cake sells for $32 and costs the store $10. The probability distribution of daily demand for the cake is as shown below.
a) What is the expected daily demand for the cake?
b) What is the expected daily profit from the sale of the cake?
c) On average, how much profit is lost each day because the cake is not available when demanded?