We will find a probability for a product to last between 13 and 16 days. This corresponds to the respective percentage. Let "X" be variable that corresponds to the shelf life of the product. It is normally distributed with "\\mu=12,\\,\\, \\sigma=9" . Its probability density function is "p(x)=\\frac{1}{\\sigma\\sqrt{2\\pi}}e^{-\\frac12(\\frac{x-\\mu}{\\sigma})^2}" . Then
"P(13\\leq X\\leq16)=\\int_{13}^{16}\\frac{1}{9\\sqrt{2\\pi}}e^{-\\frac12(\\frac{x-12}{9})^2}dx\\approx0.1274"
The latter is rounded to 4 decimal places. This corresponds to 12,74% of product.
The latter integral was computed with the help of Anaconda (free distribution of
the Python). The following code was used in Jupyter Notebook (a part of the distribution
for writing and running code) for calculation of the integral:
from scipy import integrate
import numpy as np
import math
func = lambda x:(1/(9*math.sqrt(2)*math.sqrt(math.pi)))*math.exp(-1/2*((x-12)/9)*((x-12)/9))
Pr = integrate.quad(func, 13, 16)
print(Pr)
Answer:12,74%
Comments
Leave a comment