Abstract:Certain commodities have to be sold in time, otherwise they would have to be sold at a lower price or become useless. Usually, Monte Carlo simulation is used to determine the optimal size of production. By a mathematical analysis, this paper has derived a mathematical formula to calculate the best amount of production when the demand is estimated to be a discrete random variable, a continuous one or one satisfying triangular distribution.