In inventory control the engineer is faced with the followingdilemma. If she keeps too much inventory, it results in high costs.On the other hand, if she keeps too few items, she runs thepossibility of stocking out. The scenario in this problem is asfollows:
– Demand for a spare part ~ Poisson(2) –
On-hand inventory ~ Binomial(4, 0.5)
• 4 is our choice for the stock to keep on hand each day
• 0.5 models our (in)ability to keep n units available
Use R to
(1)Show a simulation with 100 rows of data and create twocolumns one for the excess inventory, if any, and one for lostpotential items sold.
(2)Show the pmf of Demand, On-hand Inventory, Excess, andloss.
(3)Also show descriptive stats for each of the followingstatistics (Mean, standard deviation, and maximum)