Typically, a random variable has a discrete or continuous distribution. We shall consider these cases:
"P(X\\leq17)=\\sum_{k\\in K}p_k," where "\\{k\\in {\\mathbb{N}}|x_k\\leq17\\}" .
2. Assume that "X" has a continuous distribution. Then, "X" has a respective probability
density function "p(x)" satisfying "\\int_{-\\infty}^{+\\infty}p(x)dx=1" . We have the following formulae for
the mean and the standard deviation:"\\int_{-\\infty}^{+\\infty}xp(x)dx=20" and
"\\int_{-\\infty}^{+\\infty}p(x)(x-20)^2dx=25."
"P(X\\leq17)=\\int_{-\\infty}^{17}p(x)dx." In particular, in case "X" has a normal distribution with
"\\mu=20,\\,\\sigma=5" we have "P(X\\leq17)=\\frac{1}{5\\sqrt{2\\pi}}\\int_{-\\infty}^{17}e^{-\\frac12(\\frac{x-20}{5})^2}dx\\approx0.274".
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/(5*math.sqrt(2)*math.sqrt(math.pi)))*math.exp(-1/2*((x-20)/5)*
((x-20)/5))
Pr = integrate.quad(func, 0, 17)
print(Pr)
Comments
Leave a comment