Finding maximum value using expected profit with Binomially distributed demand

33 Views Asked by At

Let $D$ be Binomially distributed with mean $25$ and variance $20$. This means that $D\sim\text{Bin}(125,\frac{1}{5})$. I need to determine the optimal order quantity $Q$ which maximizes profit. For the profit I have two equations, $$profit=\begin{cases}pD-cQ-(Q-D)r, \;\text{ if }D\leq Q \\ pQ-cQ, \; \text{ if }D>Q\end{cases}$$ Combining these and taking the expectation gives me, $$\mathbb{E}[profit]=p\mathbb{E}[\min(D,Q)]-cQ-r\mathbb{E}[\max(Q-D,0)].$$ So I now compute the two epectations, $$\mathbb{E}[\min(D,Q)]=\mathbb{E}[D|D\leq Q]\cdot P(D\leq Q)+\mathbb{E}[Q|D>Q]\cdot P(D>Q),$$ $$\mathbb{E}[\min(D,Q)]=\sum_{i=0}^{Q}i\binom{125}{i}\left(\frac{1}{5}\right)^{i}\cdot\left(\frac{4}{5}\right)^{125-i}+Q\left(1-\sum_{i=0}^{Q}\binom{125}{i}\left(\frac{1}{5}\right)^{i}\cdot\left(\frac{4}{5}\right)^{125-i}\right).$$ Similairly, $$\mathbb{E}[\max(Q-D,0)]=\mathbb{E}[Q-D|D\leq Q]\cdot P(D\leq Q)=Q\cdot P(D\leq Q)-\mathbb{E}[D|D\leq Q]\cdot P(D\leq Q),$$ $$\mathbb{E}[\max(Q-D,0)]=Q\sum_{i=0}^{Q}\binom{125}{i}\left(\frac{1}{5}\right)^{i}\cdot\left(\frac{4}{5}\right)^{125-i}-\sum_{i=0}^{Q}i\binom{125}{i}\left(\frac{1}{5}\right)^{i}\cdot\left(\frac{4}{5}\right)^{125-i}.$$ So now I have determined both $\mathbb{E}[\min(D,Q)]$ and $\mathbb{E}[\max(Q-D,0)]$, I have my equation for $\mathbb{E}[profit]$. I now need to find the value for $Q$ which maximizes profit. I can find my desired $Q$ by taking the derivative of $\mathbb{E}[profit]$ with respect to $Q$ and setting the equation equal to 0. This is where I get stuck. I am unsure how to take the derivative with the binomial coefficients in the formula. Is my reasoning so far correct, and if so what would be the best way to proceed?