Maximize the profit of a product given a Gamma distribution I'm having trouble translating this problem into a workable form:

A bakery sells rolls in units of a dozen. The demand X (in 1000 units) for rolls has a gamma distribution with parameters $\alpha=3,\theta=.5$, where $\theta$ is in units of days per 1000 units of rolls.

At this point I am stuck as I am not sure what is what in the distribution. The remainder of the problem is as follows:

It costs \$2 to make a unit of rolls that sells for \$5 on the first day when the rolls are fresh. Any leftover units are sold for \$1 on the second day. How many units should be made to maximize the expected value of the profit?

 A: I will present a solution under the simplyfying assumptions that I proposed in a comment: No inventories are carried over to the next day. "Demand" is "demand for fresh rolls", while "left overs" induce extra demand at the end of the day, due to their very low price, exactly equal to their quantity. So all rolls are sold the day they are produced (non-destroyed, or carried over). Denote $X$ the demand for fresh rolls, $q$ quantity of units produced in a day, $p_f$ the selling unit price of fresh rolls, $p_l$ the selling unit price of left-overs, and $c$ the common unit costs. We leave the matter of units for the end, to be made consistent with the distributional assumption (which approximates a discrete situation with a continuous random variable). Denote $F(x)$ and $f(x)$ the CDF and PDF of $X$ respectively.
Treating the unit of rolls as a continuous variable, the profit function of the bakery (not the expected profit function) is
$$\pi = \big[p_fX + p_l(q-X)- cq\big]\cdot I_{\{X\leq q\}} + (p_f-c)q\cdot I_{\{X> q\}}$$
$$=\big[(p_f-p_l)X + p_lq\big]\cdot I_{\{X\leq q\}} + p_fq\cdot I_{\{X> q\}} - cq \tag{1}$$
where we have used indicator functions to separate the two possible states of the world (demand lower or higher than production).
The expected profit is therefore
$$E(\pi) = (p_f-p_l)E[X\cdot I_{\{X\leq q\}}] + p_lq\cdot E[I_{\{X\leq q\}}] + p_fq\cdot E[I_{\{X> q\}}]- cq$$
$$=(p_f-p_l)\int_0^qxf(x)dx\;+\;p_lqF(q)\; + \;p_fq\cdot[1-F(q)]\; -\;cq$$
Differentiating with respect to $q$ which is our decision variable we have
$$\frac {\partial E(\pi)}{\partial q} = (p_f-p_l)qf(q)+ p_lF(q) + p_lqf(q) + p_f\cdot[1-F(q)] - p_fqf(q) -c$$
The first term cancels off with the third and fifth so we are left with
$$\frac {\partial E(\pi)}{\partial q} =  p_lF(q) + p_f\cdot[1-F(q)]  -c$$
The first-order condition for maximization is 
$$\frac {\partial E(\pi)}{\partial q} = 0 \Rightarrow \frac {p_f-c}{p_f-p_l} = F(q^*) \Rightarrow q^* = F^{-1}\left(\frac {p_f-c}{p_f-p_l}\right) \tag{2}$$
while the second-order condition is satisfied for any $q$.  
We turn to making sense of the distributional assumption. @Glen_b proposed in a comment that given how the parameter $\theta$ of the distribution is defined, the "shape-rate" parametrization of the Gamma distribution is implied. And, as usual, he is right because this is consistent with the concept of "units of rolls demanded per day", since in the shape-rate parametrization we have (writing as a physicist would)
$$E(X) = \frac {\alpha}{\theta \frac {\text{day}}{\text{rolls-units}}} = \frac {\alpha}{\theta}(\text{rolls-units}/\text{day}) = 6\, (\text{thousand of dozens}/\text{day})$$
The fact that $X$ is measured in units of $1,000$ dozens and not $1$ dozen, does not affect the ratio $\frac {p_f-c}{p_f-p_l}$ (the $1,000$ factor cancels out), but it will determine the units in which the optimal production will be measured, for which we have
$$q^* : q^* = F^{-1}(3/4)$$
and $F^{-1}$ being the inverse CDF of a Gamma distribution with shape $\alpha = 3$ and rate $\theta =0.5$.  
Note already that the above implies that, given the structure of revenues and costs, production is optimally to be set so as there is only $25$% probability that the bakery will lose sales, and $75$% probability that the bakery will have to sell some of its production at a loss. This should be intuitive since profit per fresh dozen sold is $3$ while loss per left-over dozen sold is $-1$: asymmetry.
If I am not making any mistake, we should obtain $q^* = 7.84$ (thousands of dozens), a value $\approx 31$% higher than the expected value of $X$.  
This is a good example to remind us that, even if we deal in expected-value terms (we wanted to maximize the expected value of profits), the expected value $E(X)$ is not, in general, the maximizer in such kinds of very real problems. It is one situation to strive for scientific accuracy (where usually, underpredicting is considered equally "bad" with overpredicting, and "deviation-cost" functions are symmetric), and it is an altogether different situation where the deviation costs are asymmetric, as is the case with almost all economic problems like the one above.
SIMULATION
I generated $1,095$ observations from a Gamma as specified in the question. Then I calculated profits for $q^*_1=7.84$ and $q^*_1= E(X) = 6$. I obtained for daily profits using $(1)$
$$q^*_1=7.84, \;\; \bar \pi = 13.42, \;\; s_{\pi} = 8.75$$ 
For $\sim 8$% of days the operation made a loss.
In comparison
$$q^*_1=6, \;\; \bar \pi = 12.7, \;\; s_{\pi} = 6.21$$ 
The operation made a loss for $\sim 4$% of days.
Conclusion: more conservative operation, less variability, less nerve-wrecking experiences (losses), less profits. Should I consider this as a... mathematical proof of the value of venturous entrepreneurship (whatever that may mean)?
