显示标签为“Probability”的博文。显示所有博文
显示标签为“Probability”的博文。显示所有博文

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.

2017年3月27日星期一

Probability - Exercise 21 in Chapter 1

Two players take turns removing a ball from a jar that initially contains $m$ white and $n$ black balls. The first player to remove white ball wins. Develop a recursive formula that allows the convenient computation of the probability that the starting player wins.

Solution

Let $p(m,k)$ indicates the winning probability when there is $m$ white balls and $k$ black balls.

Let event $A = $ the starting player wins at the first move and $B=$ the starting player lost the first move but its opponent is doomed to lose. Let $C$ = the starting player will win when there is $m$ white balls and $k$ black balls.

Then, $P(C) = P(A) + P(B)$. Let $p(m,k)$ indicate the winning probability when there are $m$ white balls and $k$ black balls. We have

$P(A) = \frac{m}{m+k}$, $P(B) = \frac{k}{m+k} \times (1-p(m,k-1))$, $p(m,k) = \frac{m}{m+k} + \frac{k}{m+k} \times (1 - p(m,k-1))$.

The initial statement is $p(m,0) = 1$.

Tips about Probability Problems 2(a), 9, 10

2.a Show that $A^C = (A^C \cap B) \cup (A^C \cap B^C)$.

Observe that

$(A^C \cap B) \cup (A^C \cap B^C) = ( (A^C \cap B) \cup (A^C) ) \cap ((A^C \cap B) \cup B^C)$

and

$( (A^C \cap B) \cup A^C ) = A^C$, $(A^C \cap B) \cup B^C = A^C \cup B^C$.

Therefore, $(A^C \cap B) \cup (A^C \cap B^C) = A^C \cap (A^C \cup B^C) = A^C$.

9. (a) The key point is noticing the sets $A \cup S_i$ are disjoint, therefore, the additive axiom is applicable.

(b) $P(A) = P(A \cap B \cap C) + P(A \cap B \cap C^C) + P(A \cap B^C \cap C) + P(A \cap B^C \cap C^C)$ and using $P(A \cap B) = P(A \cap B \cap C^C) + P(A \cap B \cap C)$, $P(A \cap C) = P(A \cap B \cap C) + P(A \cap B^C \cap C)$.

10.

$P((A \cap B^C) \cup (A^C \cap B) ) = P(A) + P(B) - 2P(A \cap B)$ is a equation that compute either event $A$ or event $B$ happen, but not both. Comparing to $P(A \cup B) = P(A) + P(B) - P(A \cap B)$, the latter formula gives a way for computing "at least one event in $A$ and $B$ happens".