# Normal distribution

Given normal density and distribution functions for N(0,1)

\begin{equation}
  f_X(x)=\frac{1}{\sqrt{2\pi}}e^{-x^2/2}
\end{equation}

\begin{equation}
  F_X(x)=\int_\infty^x \frac{1}{\sqrt{2\pi}}e^{-u^2/2}du
\end{equation}

What is the probability that $4.0 < x < 4.5$?


```python
print("Probability from table: %.6f" % (0.999997 - 0.999968))
```

    Probability from table: 0.000029



```python
from numpy import pi, sqrt, exp
from scipy.integrate import quad

fx = lambda x: 1/sqrt(2*pi)*exp(-x**2/2)
prob = quad(fx, 4, 4.5)
print("Probability from integration: %.6f (%.2e)" % prob)
```

    Probability from integration: 0.000028 (3.14e-19)


de4122a375672e0d2b3a95682d56a1d6bb854ca3
ipynb
Jupyter Notebook
Example 1.7.ipynb
mfkiwl/GMPE340
3602b8ba859a2c7db2cab96862472597dc1ac793
MIT
2021-09-07T09:36:36.000Z
2021-09-07T09:36:36.000Z
Example 1.7.ipynb
mfkiwl/GMPE340
3602b8ba859a2c7db2cab96862472597dc1ac793
MIT
Example 1.7.ipynb
mfkiwl/GMPE340
3602b8ba859a2c7db2cab96862472597dc1ac793
MIT
2021-09-20T18:48:20.000Z
2021-09-20T18:48:20.000Z
Qwen/Qwen-72B
1. YES
2. YES