What is the system optimal production quantity and expected profit under global optimization?

Problem 1
Consider the following demand scenario:

Quantity               Probability
2000                           3%
2100                            8%
2200                          15%
2300                          30%
2400                           17%
2500                            12%
2600                             10%
2700                               5%
Suppose the manufacturer produces at a cost of $20/unit. The distributor sells to end customers for $50/unit during season and unsold units are sold for $10/unit after season.
a) What is the system optimal production quantity and expected profit under global
optimization?
b) Suppose the manufacturer is make-to-order (i.e., the distributor must order before it receives demand from end customers).
(i)
Suppose the manufacturer sells to the distributor at $40/unit, how much should the distributor order? What is the expected profit for the manufacturer? What is the expected profit for distributor?
(ii)
Find an option contract such that both the manufacturer and distributor enjoy a higher expected profit than (b)(i). What is the expected profit for the manufacturer and the distributor?