\documentclass[12pt,a4paper]{article}

\usepackage{amstext}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{stmaryrd}
\usepackage{enumerate}
\usepackage{alltt}
\usepackage[latin1]{inputenc}
\usepackage{cancel}
\usepackage{fancyhdr}
\usepackage{listings}
\usepackage{pstricks}
\usepackage{pst-plot}
%\usepackage{gastex}
%\usepackage{ngerman}
\usepackage{wasysym}
\usepackage{rotating}

\title{\textsc{Image Processing and Computer Vision \\ \large Assignment T2}}
\author{\shortstack[c]{Jan Hendrik Dithmar\\ \scriptsize 2031259} \\[0.5cm] Group T1: Tue, 14-16 (Sebastian Zimmer)}% \and \shortstack[c]{name\\ \scriptsize matr}}
\date{}

\pagestyle{fancy}

\lhead{Assignment T2}
\chead{}
\rhead{Dithmar (2031259)}
\lfoot{IPCV}
\cfoot{Page \thepage}
\rfoot{WS 2007/2008}

\begin{document}

\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}

\newcommand{\exercise}[1]{\subsection{#1}}
\renewcommand{\theenumi}{\textbf{\alph{enumi}}}

\newcommand{\AND}{\ensuremath{\wedge}}
\newcommand{\OR}{\ensuremath{\vee}}
\newcommand{\SetR}{\ensuremath{\mathbb{R}}}
\newcommand{\SetN}{\ensuremath{\mathbb{N}}}
\newcommand{\SetC}{\ensuremath{\mathbb{C}}}
\newcommand{\SetZ}{\ensuremath{\mathbb{Z}}}
\newcommand{\SetQ}{\ensuremath{\mathbb{Q}}}
\newcommand{\SetB}{\ensuremath{\mathbb{B}}}
\newcommand{\QED}{\ensuremath{\hspace*{\fill}\square}}
\newcommand{\FLASH}{\ensuremath{\hspace*{\fill}\lightning}}
\newcommand{\OnotO}{\ensuremath{\mathcal{O}}}
\newcommand{\bild}[2]{
	\begin{figure}[htpb]
		\centering
			\includegraphics[#1]{#2}\\[0.2cm]
	\end{figure}
	}

\newcommand{\m}[1]{\begin{pmatrix}#1\end{pmatrix}}
\newcommand{\+}{\phantom{-}}
\newcommand{\f}{\frac}

\maketitle

\thispagestyle{empty}

\newpage
\setcounter{page}{1}
\setcounter{section}{2}

This is a sample text to see, whether deactivating oplocks helps... blubb... blubb again... blubb again

\exercise{Image Pyramids}
We have the following signal
$$f = (-20, -2, 11, -4, -12, -20, 6, 24, 12)^\top$$
Let's do the Gaussian pyramid first:
\begin{eqnarray*}
	v^3 & = & f \\[0.3cm]
	v^2 & = & R_3^2 v^3 \\
	& = & \left(\begin{array}{ccccccccc}\frac{2}{3} & \frac{1}{3} & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & \frac{1}{4} & \frac{1}{2} & \frac{1}{4} & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & \frac{1}{4} & \frac{1}{2} & \frac{1}{4} & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & \frac{1}{4} & \frac{1}{2} & \frac{1}{4} & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & \frac{1}{3} & \frac{2}{3}\end{array}\right) \left(\begin{array}{r}-20 \\ -2 \\ 11 \\ -4 \\ -12 \\ -20 \\ 6 \\ 24 \\ 12\end{array}\right) \\
	& = & (-14, 4 , -12, 4 , 16)^\top \\[0.3cm]
	v^1 & = & R_2^1 v^2 \\
	& = & \left(\begin{array}{ccccc}\frac{2}{3} & \frac{1}{3} & 0 & 0 & 0 \\ 0 \frac{1}{4} & \frac{1}{2} & \frac{1}{4} & 0 \\ 0 & 0 & 0 & \frac{1}{3} & \frac{2}{3}\end{array}\right) \left(\begin{array}{r}-14 \\ 4 \\ -12 \\ 4 \\ 16\end{array}\right) \\
	& = & (-8, -4, 12)^\top \\[0.3cm]
	v^0 & = & R_1^0 v^1 \\
	& = & \left(\begin{array}{ccc}\frac{1}{3} & \frac{1}{3} & \frac{1}{3}\end{array}\right) \left(\begin{array}{r}-8 \\ -4 \\ 12\end{array}\right) \\
	& = & 0
\end{eqnarray*}
The Gaussian pyramid of the signal $f$ is $\{v^3, v^2, v^1, v^0\}$. \\[0.3cm]
Now I compute the Laplacian pyramid:
\begin{eqnarray*}
	w^0 & = & v^0 = 0 \\[0.3cm]
	w^1 & = & v^1 - P_0^1 v^0 \\
	& = & \left(\begin{array}{r}-8 \\ -4 \\ 12\end{array}\right) - \left(\begin{array}{c}1 \\ 1 \\ 1\end{array}\right) \cdot 0 \\
	& = & \left(\begin{array}{r}-8 \\ -4 \\ 12\end{array}\right) \\[0.3cm]
	w^2 & = & v^2 - P_1^2 v^1 \\
	& = & \left(\begin{array}{r}-14 \\ 4 \\ -12 \\ 4 \\ 16\end{array}\right) - \left(\begin{array}{ccc}1 & 0 & 0 \\ \frac{1}{2} & \frac{1}{2} & 0 \\ 0 & 1 & 0 \\ 0 & \frac{1}{2} & \frac{1}{2} \\ 0 & 0 & 1\end{array}\right) \cdot \left(\begin{array}{r}-8 \\ -4 \\ 12\end{array}\right) \\
	& = & \left(\begin{array}{r}-14 \\ 4 \\ -12 \\ 4 \\ 16\end{array}\right) - \left(\begin{array}{r}-8 \\ -6 \\ -4 \\ 4 \\ 12\end{array}\right) \\
	& = & \left(\begin{array}{r}-6 \\ 10 \\ -8 \\ 0 \\ 4\end{array}\right)
\end{eqnarray*}
\begin{eqnarray*}
	w^3 & = & v^3 - P_2^3 v^2 \\
	& = & \left(\begin{array}{r}-20 \\ -2 \\ 1 \\ -4 \\ -12 \\ -20 \\ 6 \\ 24 \\ 12\end{array}\right) - \left(\begin{array}{ccccc}1 & 0 & 0 & 0 & 0 \\ \frac{1}{2} & \frac{1}{2} & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 & 0 \\ 0 & \frac{1}{2} & \frac{1}{2} & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & \frac{1}{2} & \frac{1}{2} & 0 \\ 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & \frac{1}{2} & \frac{1}{2} \\ 0 & 0 & 0 & 0 & 1\end{array}\right) \cdot \left(\begin{array}{r}-14 \\ 4 \\ -12 \\ 4 \\ 16\end{array}\right) \\
	& = & \left(\begin{array}{r}-20 \\ -2 \\ 1 \\ -4 \\ -12 \\ -20 \\ 6 \\ 24 \\ 12\end{array}\right) - \left(\begin{array}{r}-14 \\ -5 \\ 4 \\ -4 \\ -12 \\ -4 \\ 4 \\ 10 \\ 16\end{array}\right) \\
	& = & (-6, 3, 7, 0, 0, -16, 2, 14, -4)^\top
\end{eqnarray*}
The Laplacian pyramid of the signal $f$ is $\{w^3, w^2, w^1, w^0\}$. \\[0.3cm]
Now I reconstruct the initial signal from the Laplacian pyramid:
\begin{eqnarray*}
	v^0 & = & w^0 = 0 \\[0.3cm]
	v^1 & = & w^1 + P_0^1 v^0 \\
	& = & \left(\begin{array}{r}-8 \\ -4 \\ 12\end{array}\right)
\end{eqnarray*}
\begin{eqnarray*}
	v^2 & = & w^2 + P_1^2 v^1 \\
	& = & \left(\begin{array}{r}-6 \\ 10 \\ -8 \\ 0 \\ 4\end{array}\right) + \left(\begin{array}{ccc}1 & 0 & 0 \\ \frac{1}{2} & \frac{1}{2} & 0  \\ 0 & 1 & 0 \\ 0 & \frac{1}{2} & \frac{1}{2} \\ 0 & 0 & 1\end{array}\right) \cdot \left(\begin{array}{r}-8 \\ -4 \\ 12\end{array}\right) \\
	& = & \left(\begin{array}{r}-6 \\ 10 \\ -8 \\ 0 \\ 4\end{array}\right) + \left(\begin{array}{r}-8 \\ -6 \\ -4 \\ 4 \\ 12\end{array}\right) \\
	& = & (-14, 4, -12, 4, 16)^\top \\[0.3cm]
	v^3 & = & w^3 + P_2^3 v^2 \\
	& = & \left(\begin{array}{r}-6 \\ 3 \\ 7 \\ 0 \\ 0 \\ -16 \\ 2 \\ 14 \\ -4\end{array}\right) + \left(\begin{array}{ccccc}1 & 0 & 0 & 0 & 0 \\ \frac{1}{2} & \frac{1}{2} & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 & 0 \\ 0 & \frac{1}{2} & \frac{1}{2} & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & \frac{1}{2} & \frac{1}{2} & 0 \\ 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & \frac{1}{2} & \frac{1}{2} \\ 0 & 0 & 0 & 0 & 1\end{array}\right) \cdot \left(\begin{array}{r}-14 \\ 4 \\ -12 \\ 4 \\ 16\end{array}\right) \\
	& = & \left(\begin{array}{r}-6 \\ 3 \\ 7 \\ 0 \\ 0 \\ -16 \\ 2 \\ 14 \\ -4\end{array}\right) + \left(\begin{array}{r}-14 \\ -5 \\ 4 \\ -4 \\ -12 \\ -4 \\ 4 \\ 10 \\ 16\end{array}\right) \\
	& = & (-20, -2, 11, -4, -12, -20, 6, 24, 12)^\top = f
\end{eqnarray*}

\newpage
\exercise{Discrete Fourier Transform}
First of all, I want to rename the signal $f_1$ to $f$ and $f_2$ to $g$ for the sake of readability when it comes to (double-)indicies later on. So we have:
$$f = (6, 8, 2, 4)^\top \quad \mbox{and} \quad g = (4, 6, 8, 2)^\top$$
\begin{enumerate}
	\item
		\begin{eqnarray*}
			\hat{f_0} & = & \frac{1}{2} \cdot \sum_{m=0}^3 f_m \cdot \exp \left(-\frac{i 2 \pi 0 m}{4}\right) \\
			& = & \frac{1}{2} \cdot (f_0 + f_1 + f_2 + f_3) \\
			& = & \frac{1}{2} \cdot (6 + 8 + 2 + 4) \\
			& = & 10 \\[0.3cm]
			\hat{f_1} & = & \frac{1}{2} \cdot \sum_{m=0}^3 f_m \cdot \exp \left(-\frac{i 2 \pi 1 m}{4}\right) \\
			& = & \frac{1}{2} \cdot (f_0 \cdot e^0 + f_1 \cdot e^{-i \pi / 2} + f_2 \cdot e^{-i \pi} + f_3 \cdot e^{-i 3 \pi / 2}) \\
			& = & \frac{1}{2} \cdot (6 \cdot 1 + 8 \cdot (-i) + 2 \cdot (-1) + 4 \cdot i) = \frac{4 - 4i}{2} \\
			& = & 2 - 2i \\[0.3cm]
			\hat{f_2} & = & \frac{1}{2} \cdot \sum_{m=0}^3 f_m \cdot \exp \left(-\frac{i 2 \pi 2 m}{4}\right) \\
			& = & \frac{1}{2} \cdot (f_0 \cdot e^0 + f_1 \cdot e^{-i \pi} + f_2 \cdot e^{-i 2 \pi} + f_3 \cdot e^{-i 3 \pi}) \\
			& = & \frac{1}{2} \cdot (6 \cdot 1 + 8 \cdot (-1) + 2 \cdot 1 + 4 \cdot (-1)) \\
			& = & -2 \\[0.3cm]
			\hat{f_3} & = & \frac{1}{2} \cdot \sum_{m=0}^3 f_m \cdot \exp \left(-\frac{i 2 \pi 3 m}{4}\right) \\
			& = & \frac{1}{2} \cdot (f_0 \cdot e^0 + f_1 \cdot e^{-i 3 \pi / 2} + f_2 \cdot e^{-i 3 \pi} + f_3 \cdot e^{-i 9 \pi / 2}) \\
			& = & \frac{1}{2} \cdot (6 \cdot 1 + 8 \cdot i + 2 \cdot (-1) + 4 \cdot (-i)) = \frac{4 + 4i}{2} \\
			& = & 2 + 2i
		\end{eqnarray*}
		\begin{eqnarray*}
			\hat{g_0} & = & \frac{1}{2} \cdot \sum_{m=0}^3 g_m \cdot \exp \left(-\frac{i 2 \pi 0 m}{4}\right) \\
			& = & \frac{1}{2} \cdot (g_0 + g_1 + g_2 + g_3) = \frac{1}{2} \cdot (4 + 6 + 8 + 2) \\
			& = & 10 \\[0.3cm]
			\hat{g_1} & = & \frac{1}{2} \cdot \sum_{m=0}^3 g_m \cdot \exp \left(-\frac{i 2 \pi 1 m}{4}\right) \\
			& = & \frac{1}{2} \cdot (g_0 \cdot e^0 + g_1 \cdot e^{-i \pi / 2} + g_2 \cdot e^{-i \pi} + g_3 \cdot e^{-i 3 \pi / 2}) \\
			& = & \frac{1}{2} \cdot (4 \cdot 1 + 6 \cdot (-i) + 8 \cdot (-1) + 2 \cdot i) = \frac{-4 - 4i}{2} \\
			& = & -2 - 2i \\[0.3cm]
			\hat{g_2} & = & \frac{1}{2} \cdot \sum_{m=0}^3 g_m \cdot \exp \left(-\frac{i 2 \pi 2 m}{4}\right) \\
			& = & \frac{1}{2} \cdot (g_0 \cdot e^0 + g_1 \cdot e^{-i \pi} + g_2 \cdot e^{-i 2 \pi} + g_3 \cdot e^{-i 3 \pi}) \\
			& = & \frac{1}{2} \cdot (4 \cdot 1 + 6 \cdot (-1) + 8 \cdot 1 + 2 \cdot (-1)) \\
			& = & 2 \\[0.3cm]
			\hat{g_3} & = & \frac{1}{2} \cdot \sum_{m=0}^3 g_m \cdot \exp \left(-\frac{i 2 \pi 3 m}{4}\right) \\
			& = & \frac{1}{2} \cdot (g_0 \cdot e^0 + g_1 \cdot e^{-i 3 \pi / 2} + g_2 \cdot e^{-i 3 \pi} + g_3 \cdot e^{-i 9 \pi / 2}) \\
			& = & \frac{1}{2} \cdot (4 \cdot 1 + 6 \cdot i + 8 \cdot (-1) + 2 \cdot (-i)) = \frac{-4 + 4i}{2} \\
			& = & -2 + 2i
		\end{eqnarray*}
		Now I compute the spectra of the signals:
		\begin{eqnarray*}
			\left|\hat{f_0}\right| & = & \sqrt{10^2} = 10 \\
			\left|\hat{f_1}\right| & = & \sqrt{2^2 + (-2 \cdot i)^2} = \sqrt{4 + 4i^2} = \sqrt{4 - 4} = 0 \\
			\left|\hat{f_2}\right| & = & \sqrt{(-2)^2} = 2 \\
			\left|\hat{f_3}\right| & = & \sqrt{2^2 + (2 \cdot i)^2} = \sqrt{4 + 4i^2} = \sqrt{4 - 4} = 0 \\[0.3cm]
			\left|\hat{g_0}\right| & = & \sqrt{10^2} = 10 \\
			\left|\hat{g_1}\right| & = & \sqrt{(-2)^2 + (-2 \cdot i)^2} = \sqrt{4 + 4i^2} = \sqrt{4 - 4} = 0 \\
			\left|\hat{g_2}\right| & = & \sqrt{2^2} = 2 \\
			\left|\hat{g_3}\right| & = & \sqrt{(-2)^2 + (2 \cdot i)^2} = \sqrt{4 + 4i^2} = \sqrt{4 - 4} = 0
		\end{eqnarray*}
		The Fourier spectra of $f$ and $g$ are identical while the coefficients of $f$ and $g$ are different.
	\item The highest frequency is 10 which I set to 0, so I obtain:
		\begin{eqnarray*}
			\hat{f_0} & = & 0 \\
			\hat{f_1} & = & 2 - 2i \\
			\hat{f_2} & = & -2 \\
			\hat{f_3} & = & 2 + 2i
		\end{eqnarray*}
		The backtransform looks like this:
		\begin{eqnarray*}
			f_0 & = & \frac{1}{2} \cdot \sum_{p=0}^3 \hat{f_p} \cdot \exp \left(\frac{i 2 \pi p 0}{4}\right) \\
			& = & \frac{1}{2} \cdot (0 + (2 - 2i) - 2 + (2 + 2i)) \\
			& = & \frac{1}{2} \cdot 2 \\
			& = & 1
		\end{eqnarray*}
		\begin{eqnarray*}
			f_1 & = & \frac{1}{2} \cdot \sum_{p=0}^3 \hat{f_p} \cdot \exp \left(\frac{i 2 \pi p 1}{4}\right) \\
			& = & \frac{1}{2} \cdot (0 + (2 - 2i) \cdot e^{i \pi / 2} - 2 \cdot e^{i \pi} + (2 + 2i) \cdot e^{i 3 \pi / 2}) \\
			& = & \frac{1}{2} \cdot ((2 - 2i) \cdot (-i) - 2 \cdot (-1) + (2 + 2i) \cdot i) \\
			& = & \frac{1}{2} \cdot (-2i + 2i^2 + 2 + 2i + 2i^2) \\
			& = & \frac{1}{2} \cdot (-2) \\
			& = & -1 \\[0.3cm]
			f_2 & = & \frac{1}{2} \cdot \sum_{p=0}^3 \hat{f_p} \cdot \exp \left(\frac{i 2 \pi p 2}{4}\right) \\
			& = & \frac{1}{2} \cdot (0 + (2 - 2i) \cdot e^{i \pi} - 2 \cdot e^{i 2 \pi} + (2 + 2i) \cdot e^{i 3 \pi}) \\
			& = & \frac{1}{2} \cdot ((2 - 2i) \cdot (-1) - 2 + (2 + 2i) \cdot (-1)) \\
			& = & \frac{1}{2} \cdot (-2 + 2i - 2 - 2 - 2i) \\
			& = & \frac{1}{2} \cdot (-6) \\
			& = & -3 \\[0.3cm]
			f_3 & = & \frac{1}{2} \cdot \sum_{p=0}^3 \hat{f_p} \cdot \exp \left(\frac{i 2 \pi p 3}{4}\right) \\
			& = & \frac{1}{2} \cdot (0 + (2 - 2i) \cdot e^{i 3 \pi / 2} - 2 \cdot e^{i 3 \pi} + (2 + 2i) \cdot e^{i 9 \pi / 2}) \\
			& = & \frac{1}{2} \cdot ((2 - 2i) \cdot i + 2 + (2 + 2i) \cdot (-i)) \\
			& = & \frac{1}{2} \cdot (2i - 2i^2 + 2 - 2i - 2i^2) \\
			& = & \frac{1}{2} \cdot 6 \\
			& = & 3
		\end{eqnarray*}
		The resulting signal is $f = (1, -1, -3, 3)^\top$. This signal is symmetric which results in a better signal with respect to smoothness.
\end{enumerate}

\newpage
\exercise{Discrete Fourier Transform}
To show that
$$v_p = \frac{1}{\sqrt{M}} \left(\exp \left(\frac{2 \pi i p 0}{M}\right), \exp \left(\frac{2 \pi i p 1}{M}\right), \dots, \exp \left(\frac{2 \pi i p (M - 1)}{M}\right)\right)^\top$$
form an orthonormal basis one has to show the following:
\begin{enumerate}[1.]
	\item We have $M$ different vectors (\textit{already known})
	\item $v_i \in \mathbb{C}^M \; \forall i \in \{0, ..., M - 1\}$ (\textit{already known})
	\item Vectors are orthogonal and have norm 1 which meands that they are orthonormal.
\end{enumerate}
The last point has to be shown. For this proof I want to state the following:
$$\langle v_p, v_q\rangle = \left\{\begin{array}{cc}1 & (p = q) \\ 0 & (\mbox{else})\end{array}\right. \quad \forall p,q \in \{0, ..., M - 1\}$$
To use this fact, a case distinction is necessary:
\begin{itemize}
	\item Let $p \in \{0, ..., M - 1\}, p = q$. \\
		Let's plug in the definition:
		\begin{eqnarray*}
			\langle v_p, v_q\rangle & = & \sum_{m=0}^{M-1} \frac{1}{\sqrt{M}} \cdot \exp \left(\frac{i 2 \pi p m}{M}\right) \cdot \overline{\frac{1}{\sqrt{M}} \cdot \exp \left(\frac{i 2 \pi q m}{M}\right)} \\
			& = & \sum_{m=0}^{M-1} \frac{1}{\sqrt{M}} \cdot \exp \left(\frac{i 2 \pi p m}{M}\right) \cdot \frac{1}{\sqrt{M}} \cdot \exp \left(-\frac{i 2 \pi q m}{M}\right) \\
			& = & \frac{1}{M} \cdot \sum_{m=0}^{M-1} \cdot \exp \left(\frac{i 2 \pi m}{M} \cdot (p-q)\right) \\
			& \stackrel{(p=q)}{=} & \frac{1}{M} \cdot \sum_{m=0}^{M-1} \underbrace{\exp (0)}_{=1} \\
			& = & \frac{M}{M} \\
			& = & 1
		\end{eqnarray*}
	\item Let $p \in \{0, ..., M - 1\}, p \neq q$. \\
		Let's plug in the definition again:
		\begin{eqnarray*}
			\langle v_p, v_q\rangle & = & \sum_{m=0}^{M-1} \frac{1}{\sqrt{M}} \cdot \exp \left(\frac{i 2 \pi p m}{M}\right) \cdot \overline{\frac{1}{\sqrt{M}} \cdot \exp \left(\frac{i 2 \pi q m}{M}\right)} \\
			& = & \sum_{m=0}^{M-1} \frac{1}{\sqrt{M}} \cdot \exp \left(\frac{i 2 \pi p m}{M}\right) \cdot \frac{1}{\sqrt{M}} \cdot \exp \left(-\frac{i 2 \pi q m}{M}\right) \\
			& = & \frac{1}{M} \cdot \sum_{m=0}^{M-1} \cdot \exp \left(\frac{i 2 \pi m}{M} \cdot (p-q)\right) \\
			& = & \frac{1}{M} \cdot \sum_{m=0}^{M-1} \exp \left(\frac{i 2 \pi}{M} \cdot (p-q)\right)^m \\
			& \stackrel{(*)}{=} & \frac{1}{M} \cdot \frac{1 - \exp \left(\frac{i 2 \pi}{M} \cdot (p-q)\right)^M}{1 - \exp \left(\frac{i 2 \pi}{M} \cdot (p-q)\right)} \\
			& = & \frac{1}{M} \cdot \frac{1 - \exp \left(\frac{i 2 \pi M}{M} \cdot (p-q)\right)}{1 - \exp \left(\frac{i 2 \pi}{M} \cdot (p-q)\right)} \\
			& = & \frac{1}{M} \cdot \frac{1 - \exp (i 2 \pi (p-q))}{1 - \exp \left(\frac{i 2 \pi}{M} \cdot (p-q)\right)} \\
			& = & \frac{1}{M} \cdot \frac{1- \exp (i 2 \pi)^{(p-q)}}{1 - \exp \left(\frac{i 2 \pi}{M} \cdot (p-q)\right)} \\
			& \stackrel{(**)}{=} & \frac{1}{M} \cdot \frac{1 - 1^{(p-q)}}{1 - \exp \left(\frac{i 2 \pi}{M} \cdot (p-q)\right)} \\
			& = & 0
		\end{eqnarray*}
		where $(*)$ is the formula for the geometric series
		$$\sum_{k=0}^n r^k = \frac{1 - r^{n+1}}{1-r} \quad (r \neq 1)$$
		and $(**)$ is the fact that $1 = e^{i 2 \pi}$ $\forall n \in \SetZ$. I want to prove the latter in just a few lines:
		\begin{eqnarray*}
			1 & = & 1^n \\
			& = & \left(e^{i 2 \pi}\right)^n \\
			& = & e^{i 2 \pi n}
		\end{eqnarray*}
		Since $(p-q) \in \SetZ$, the upper equations hold for our case.
\end{itemize}

\end{document}
