Sample Space, Event and Probability

(Ω,Σ,P)(\Omega,\Sigma,P) is a probability space, where Ω\Omega is the sample space, Σ\Sigma is the event space, and PP is the probability measure.

Σ\Sigma should satisfy:

Σ2ΩΣ is a σ-algebra\begin{aligned} & ① \Sigma \subset 2^{\Omega}\\ & ② \Sigma \text{ is a $\sigma$-algebra}\\ \end{aligned}

XX is a random variable, which is a function from Ω\Omega to R\mathbb{R}, i.e. X:ΩRX:\Omega \rightarrow \mathbb{R}.And should satisfy:

X1((,x])={ωΩ:X(ω)x}ΣxRX^{-1}((-\infty,x]) = \{ \omega \in \Omega: X(\omega) \leq x \} \in \Sigma \quad \forall x \in \mathbb{R}

Distribution Function

Here is the definition of distribution function:

FX(x)=P(Xx)=P(x(,x])F_X(x) = P(X \leq x) = P(x \in (-\infty, x])\\

Distribution function Fz(x)F_z(x) satisfies the following properties:

FX()=0,Fx(+)=1FX(x)FX(y) if xyFX(x) is right continuous\begin{aligned} & ① F_X(-\infty) = 0, F_x(+\infty) = 1\\ & ② F_X(x) \leq F_X(y) \text{ if } x \leq y\\ & ③ F_X(x) \text{ is right continuous}\\ \end{aligned}

The Derivative of FX(x)F_X(x) is the probability density function fX(x)f_X(x):

fX(x)=dFX(x)dxf_X(x) = \frac{dF_X(x)}{dx}

Now if

XFX(x)X \sim F_X(x)\\

We want to know the Distribution function of Y=aX+bY = aX + b:

FY(y)=P(Yy)=P(aX+by)={P(Xyba)=FX(yba)a>0P(Xyba)=1FX(yba)+P(X=yba)a<0F_Y(y) = P(Y \leq y) = P(aX + b \leq y) = {} \begin{cases} P(X \leq \frac{y-b}{a}) = F_X(\frac{y-b}{a}) & a > 0\\ P(X \geq \frac{y-b}{a}) = 1 - F_X(\frac{y-b}{a}) + P(X = \frac{y-b}{a}) & a < 0 \end{cases}

And the density function of YY is:

fY(y)={1afX(yba)a>01afX(yba)+P(X=yba)δ()a<0f_Y(y) = \begin{cases} \frac{1}{a}f_X(\frac{y-b}{a}) & a > 0\\ -\frac{1}{a}f_X(\frac{y-b}{a}) + P(X=\frac{y-b}{a})\delta() & a < 0 \end{cases}

(Temporarily ignore the part of δ\delta function)

Example

Monte Carlo Simulation

The key of the problem is the generation of Pseudo-random numbers, while these numbers should satisfy the required distribution.

Theoritically, we have a Uniform distribution U(0,1)U(0,1), and we can generate a random number XX with distribution FX(x)F_X(x) by:

X=FX1(U)X = F_X^{-1}(U)

Where FX1(x)F_X^{-1}(x) is the inverse function of FX(x)F_X(x).

Proof

FY(y)=P(Yy)=P(FX1(U)y)=P(UFX(y))=FU(FX(y))=FX(y)F_Y(y) = P(Y \leq y) = P(F_X^{-1}(U) \leq y) = P(U \leq F_X(y)) = F_U(F_X(y)) = F_X(y)