1. The problem statement, all variables and given/known data A company incurs manufacturing costs of $q per item. The product is sold at a retail price of $p per item with p > q. The customer demand K (e.g. number of items that will be sold when the number of items offered is large enough) is a discrete random variable in N. The probabilities P[K = k] = pk for all k in N is known through empirical analysis. How many items should the company produce to maximize the expectation value of its profit? 2. Relevant equations 3. The attempt at a solution So i started with setting up a profit function G = pK - qx, where x is the number of items to be produced. I then take the expectation value of the profit = E(G) = E(pK - qx) = pE(K) - qE(x) now what? I wanted to differentiate w.r.t. x but this won't help here. I also don't see where I can substitute pk in: E(K) = Sum(E(k)pk) ??