I am doing a study problem and I would like to know if my answers look fine.
$X$ is a random variable that represents the demand for a product with the following density function: $$f(x) = \frac1{e^x} ,\ x > 0$$
$c > 0$ is the number of units in stock
$ax$ are the earnings for $x$ units sold
$b(c-x)$ is the loss caused by the unsold units
1) Find the earnings as a function of $X$ and $c$
My answer: $$W = aX - b(c - X)$$
2) What are the expected earnings?
To get this answer I assumed that $X$ is a continuous random variable. My answer: $$E[X] = 1$$ $$E[W] = a - b(-1 + c)$$
3) What is the value of $c$ that maximizes the expected earnings?
My answer: $$c = E[X]$$