Sunday, 21 September 2014

Probability Theory Problems

Let's have fun on probability theory, here is my first problem set in the said subject.


  1. It was noted that statisticians who follow the deFinetti school do not accept the Axiom of Countable Additivity, instead adhering to the Axiom of Finite Additivity.
    1. Show that the Axiom of Countable Additivity implies Finite Additivity.
    2. Although, by itself, the Axiom of Finite Additivity does not imply Countable Additivity, suppose we supplement it with the following. Let $A_1\supset A_2\supset\cdots\supset A_n\supset \cdots$ be an infinite sequence of nested sets whose limit is the empty set, which we denote by $A_n\downarrow\emptyset$. Consider the following:

      Axiom of Continuity: If $A_n\downarrow\emptyset$, then $P(A_n)\rightarrow 0$

      Prove that the Axiom of Continuity and the Axiom of Finite Additivity imply Countable Additivity.
  2. Prove each of the following statements. (Assume that any conditioning event has positive probability.)
    1. If $P(B)=1$, then $P(A|B)=P(A)$ for any $A$.
    2. If $A\subset B$, then $P(B|A)=1$ and $P(A|B)=P(A)/P(B)$.
    3. If $A$ and $B$ are mutually exclusive, then \begin{equation}\nonumber P(A|A\cup B) = \displaystyle\frac{P(A)}{P(A)+P(B)}. \end{equation}
    4. $P(A\cap B\cap C)=P(A|B\cap C)P(B|C)P(C)$.

Friday, 12 September 2014

R: k-Means Clustering on an Image

Enough with the theory we recently published, let's take a break and have fun on the application of Statistics used in Data Mining and Machine Learning, the k-Means Clustering.
k-means clustering is a method of vector quantization, originally from signal processing, that is popular for cluster analysis in data mining. k-means clustering aims to partition n observations into k clusters in which each observation belongs to the cluster with the nearest mean, serving as a prototype of the cluster. (Wikipedia, Ref 1.)
We will apply this method to an image, wherein we group the pixels into k different clusters. Below is the image that we are going to use,
Colorful Bird From Wall321
We will utilize the following packages for input and output:
  1. jpeg - Read and write JPEG images; and,
  2. ggplot2 - An implementation of the Grammar of Graphics.

Sunday, 7 September 2014

Translation Invariant of Lebesgue Outer Measure

Another proving problem, this time on Real Analysis.


  1. Prove that the Lebesgue outer measure is translation invariant. (Use the property that, the length of an interval $l$ is translation invariant.)


  1. Proof. The outer measure is translation invariant if for $y\in \mathbb{R}$, \begin{equation}\nonumber \mu^{*}(A)=\mu^{*}(A+y) \end{equation} Hence, we need to show that Case 1: $\mu^{*}(A)\leq \mu^{*}(A+y)$; and Case 2: $\mu^{*}(A+y)\leq \mu^{*}(A)$.

    Case 1: Consider a countable collection $\{I_n\}_{n=1}^{\infty}$, and let \begin{equation}\nonumber W = \left\{\displaystyle\sum_{n=1}^{\infty}l(I_n)\mid A\subseteq\displaystyle\bigcup_{n=1}^{\infty}I_n\right\} \end{equation} Then the outer measure of $A$ is, \begin{equation}\nonumber \mu^{*}(A)=\inf\,\{W\}. \end{equation}
Fork me on GitHub