2017年4月28日星期五

Probability Problem 3.3 Critical Steps for solving it.

Prove that

$\mathbb{E}[X] = \int_{0}^{\infty}\mathbf{P}(X>x)dx - \int_{0}^{\infty}\mathbf{P}(X < -x) dx$.

Solution:

$\int_{0}^{\infty}P(X>x)dx

= \int_{0}^{\infty}\big(\int_{x}^{\infty}f_X(y)dy\big)dx

= \int_{0}^{\infty}\big(\int_{0}^{y}f_X(y)dx\big)dy

= \int_{0}^{\infty}f_X(y)\int_{0}^{y}dxdy

=\int_{0}^{\infty}yf_X{y}dy

$

The second step could be understood by drawing a graph on the x-y plane.

Probability, Problem 3.2 The Laplace random variable

Let $X$ be a random variable with the PDF

$f_X(x)=\frac{\lambda}{2}e^{-\lambda |x|}, \lambda > 0$

Verify that $f_X$ satisfies the normalization property and evaluate the mean and the variance of $X$.

Solution:

(a). Notice that $f_X(x)$ is an even function. Therefore

$\int_{-\infty}^{+\infty} \frac{\lambda}{2}e^{\lambda|x|}dx

= 2 \times \frac{\lambda}{2}\int_{-\infty}^{0}e^{-\lambda \cdot -x}dx

= \lambda \int_{-\infty}^{0}e^{\lambda x}dx

= e^{\lambda x} \bigg\rvert_{-\infty}^{0}

= 1
$

$\because \int_{-\infty}^{+\infty}f_X(x)dx = 1 \therefore f_X(x)$ satisfies the normalization property.

(b) $\mathbb{E}[X] = \int_{-\infty}^{+\infty}xf_X(x)dx
= \int_{-\infty}^{+\infty}x \frac{\lambda}{2} e^{-\lambda |x|} dx$

$\because f_X(x)$ is an even function and $x$ is an odd function.
$\therefore xf_X(x)$ is an odd function. Thus, $\int_{-\infty}^{+\infty}xf_X(x)dx = 0$.

$\mathbb{E}[X^] = \int_{-\infty}^{+\infty} x^2 f_X(x)dx
=2 \int_{0}^{+\infty}x^2 \frac{\lambda}{2} e^{-\lambda x}dx
= \int_{0}^{+\infty}x^2 \lambda e^{-\lambda x}dx
$
The second step is because $x^2f(x)$ is an even function. By using integral by part, we got

$\int_{-\infty}^{+\infty}x^2 f_X(x) dx
= \big(-x^2 \cdot e^{-\lambda x} - \frac{2}{\lambda}(x e^{-\lambda x} + \frac{1}{\lambda} e^{-\lambda x}) \big) \bigg\rvert_{0}^{+\infty}
$

And note that, by using L'Hospital's rule, we can show that

$\lim_{x \to \infty} -x^2e^{-\lambda x} = \lim_{x \to \infty} \frac{-x^2}{e^{\lambda x}} = 0$.

Hence, $\mathbb{E}[X^2] = \frac{2}{\lambda^2}$ and $VAR(X) = \mathbb{E}[X^2] - \mathbb{E}[X] = \frac{2}{\lambda^2} - 0 = \frac{2}{\lambda^2}$

2017年4月10日星期一

Tips & summary of Probability, Chapter 2.

An infrequent equation

$\mathbb{P}(X|B) = \sum_{i=1}^n \mathbb{P}(A_i|B)\mathbb{P}(X|A_i \cap B) = \sum_{i=1}^{n} \frac{\mathbb{P}(A_i, B)}{\mathbb{P}(B)} \cdot \frac{\mathbb{P}(X,A_i,B)}{\mathbb{P}(A_i,B)}$
Similarly,

$\mathbb{E}[X|B] = \sum_{i=1}^n \mathbb{P}(A_i|B)\mathbb{E}[X|A_i \cap B]$

An useful trick of solving problems:

Let $\mathbb{X_i}$ be a random variable s.t. $\mathbb{X_i} = 1$ when event $\mathbf{A_i}$ happens, $\mathbb{X_i} = 0$ otherwise. Then $\mathbb{P}(\mathbf{A_i} \cap \mathbf{A_j} \cap \mathbf{A_k})$ = $\mathbb{P}(\mathbb{X_i = 1}, \mathbb{X_j = 1}, \mathbb{X_k = 1})$. If events $\mathbf{A_k}$ are independent, this trick would greatly simplify the calculation.