# Probability
# Basic
## Variance
$Var(X)=E[X^2]-E[X]^2$
# Advance
## PMF v.s PDF v.s CDF
### PMF (Probability Mass function)
A PMF is a mathematical function that gives the probability that a discrete random variable is exactly equal to a specific value. It is used in statistics to describe the distribution of discrete random variables.
> $p(x) = P(X=x)$, $p(x)$ is PMF
### PDF (probability density function)
PDF is a statistical term that describes the probability distribution of the continues random variable.
> $F(x)=P(a\le x\le b)=\int^{b}_{a}f(x)dx$
> $F(x)=P(a\le x\le b)$ is the PDF
We can know that $\rightarrow$
* $\int^{\infty}_{-\infty}f(x)dx=1$
* $E[g(X)]=\int^{\infty}_{-\infty}g(x)f_Xdx$
### CDF (Cumulative distribution function)
The cumulative distribution function is applicable for describing the distribution of random variables ***either it is continuous or discrete***
* $F_X(x)=P(X\le x)$
* for discreate random variable:
* $F_X(x)=P(X\le x)=\sum^{x}_{-\infty}p(x)dx$
* the sum of PMF to $x$
* for continuous random variable:
* $F_X(x)=P(X\le x)=\int^{x}_{-\infty}f(x)dx$
* the integral of PDF to $x$
## Classic PDF
### Gaussian(Normal) Distribution
| | |
| -------- | -------- |
| Definition | $\mathcal{N}(\mu, \sigma^2)=\frac{1}{\sqrt{2\pi \sigma^2}}e^{-\frac{(x-\mu)^2}{2\sigma^2}}$|
|$E[X]$|$\mu$|
|$Var(X)$|$\sigma^2$|
> A is a point that $(1,\sigma^2)$ that you can observe how it change
<iframe src="https://www.geogebra.org/calculator/wedycqxx?embed" width="800" height="600" allowfullscreen style="border: 1px solid #e4e4e4;border-radius: 4px;" frameborder="0"></iframe>
## Joint PDF
$P(X,Y)\in S=\int\int_Sf_{X,Y}(x,y)dxdy$