We denote by "X" a random variable, which is a height of a randomly selected traveler. It has a normal distribution with "\\mu=160" cm, "\\sigma=8" cm. We remind that its probability density function has the form "p(x)=\\frac{1}{\\sigma\\sqrt{2\\pi}}e^{-\\frac12(\\frac{x-\\mu}{\\sigma})^2}" . We obtain the following probabilities (rounded to 4 decimal places):
i) "P(148\\leq X\\leq175)=\\frac{1}{8\\sqrt{2\\pi}}\\int_{148}^{175}e^{-\\frac12(\\frac{x-160}{8})^2}dx\\approx0.9028" ;
ii) "P(X\\geq164)=\\frac{1}{8\\sqrt{2\\pi}}\\int_{164}^{+\\infty}e^{-\\frac12(\\frac{x-160}{8})^2}dx\\approx0.3085;"
iii) "P(X\\leq179)=\\frac{1}{8\\sqrt{2\\pi}}\\int_{-\\infty}^{179}e^{-\\frac12(\\frac{x-160}{8})^2}dx\\approx0.9912;"
Anaconda (https://www.anaconda.com/) was used for computations. The following code produces numeric values:
from scipy import integrate
import numpy as np
import math
func = lambda x:(1/(8*math.sqrt(2)*math.sqrt(math.pi)))*math.exp(-1/2*((x-160)/8)*((x-160)/8))
Pr1 = integrate.quad(func, 148, 175)
Pr2 = integrate.quad(func, 164, np.Infinity)
Pr3 = integrate.quad(func, -np.Infinity, 179)
print(Pr1)
print(Pr2)
print(Pr3)
Answer: 0.9028; 0.3085; 0.9912 (rounded to 4 decimal places)
Comments
Leave a comment