\documentclass[a4paper]{article}

\usepackage[english]{babel}
\usepackage[utf8x]{inputenc}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage[colorinlistoftodos]{todonotes}

\title{MATH 542 Homework 1}
\author{Saket Choudhary\\skchoudh@usc.edu}

\begin{document}
\maketitle
\section*{Problem 1}
\begin{align*}
\mathbf{1}_n = \begin{pmatrix} 1\\
1\\
\vdots\\
1\\
\end{pmatrix}
\end{align*}
\subsection*{Problem 1.a}
Consider $\mathbf{a}' = \begin{pmatrix}a_1 & a_2 & \dots a_n \end{pmatrix}$

Thus, $$\mathbf{a}'\mathbf{1}_n = \begin{pmatrix}a_1 & a_2 & \dots a_n \end{pmatrix} \times \begin{pmatrix} 1\\
1\\
\vdots\\
1\end{pmatrix} = a_1 + a_2 + a_3 + \dots a_n
$$
$$
1_n'a = \begin{pmatrix} 1 & 1 & \dots & 1 \end{pmatrix} \times \begin{pmatrix} a_1\\
a_2 \\
\vdots \\
a_n
\end{pmatrix} = a_1+a_2+a_3+\dots+a_n =  \mathbf{a'} \mathbf{1_n}
$$
\subsection*{Problem 1.b}
\begin{align*}
A_n I &=  \begin{pmatrix} a_{11} & a_{12} & \dots & a_{1n} \\
a_{21} & a_{22}  & \dots & a_{2n}\\
\vdots\\
a_{n1} & a_{n2} & \dots  & a_{nn}
\end{pmatrix}  \times \begin{pmatrix} 1 \\
1\\
\vdots\\
1
\end{pmatrix} = \begin{pmatrix} \sum_{j=1}^n a_{ij}\\
\sum_{j=1}^n a_{2j}\\
\vdots\\
\sum_{j=1}^n a_{nj}
\end{pmatrix}\\
&= \text{Column vector with row sums of }A
\end{align*}

\subsection*{Problem 1.c}
Row sum of $j^{th}$ column of $A = \sum_{i=1}^na_{ij}$

Column sum of $i^{th}$ row of $A= \sum_{j=1}^n a_{ij}$

\begin{align*}
1_n'A &= \begin{pmatrix} 1 & 1 & \dots 1 \end{pmatrix} \times \begin{pmatrix} a_{11} & a_{12} & \dots & a_{1n} \\
a_{21} & a_{22}  & \dots & a_{2n}\\
\vdots\\
a_{n1} & a_{n2} & \dots  & a_{nn}
\end{pmatrix}\\
&= \begin{pmatrix} \sum_{i=1}^n a_{i1} & \sum_{i=1}^n a_{i2} & \sum_{i=1}^n a_{i3}  & \dots \sum_{i=1}^n a_{in} \end{pmatrix}\\
&= \text{Row vector with elements as column sums of A}
\end{align*}

\section*{Problem 2}

\begin{align*}
a_1 &= \begin{pmatrix}
2\\
3\\
1
\end{pmatrix}\\
A_2 &= \begin{pmatrix}
1 & 2\\
2 & 0\\
0 & 1\\
\end{pmatrix}\\
b_1' &= \begin{pmatrix}
1 & 1 & 1 & 0
\end{pmatrix}\\
B_2 &= \begin{pmatrix}
2 & 1 & 1 & 2\\
2 & 3 & 1 & 2
\end{pmatrix}
\end{align*}

\begin{align*}
AB &= a_1b_1' + A_2B_2
\end{align*}

\begin{align*}
a_1b_1' &= \begin{pmatrix}
2 &   2 & 2 &   0\\
3 &   3  &  3 &   0\\
1  &  1 &   1 &   0
\end{pmatrix}
\end{align*}

Similarly,
\begin{align*}
A_2B_2 &= \begin{pmatrix}
6 &   7 &   3 &   6\\
4 &   2  &  2  &  4\\
2  &  3   & 1 &   2
\end{pmatrix}
\end{align*}

And hence $AB = a_1b_1' + A_2B_2 = \begin{pmatrix}
6 &   7 &   3 &   6\\
4  &  2  &  2  &  4\\
2  &  3 &   1 &   2\\
\end{pmatrix}$
\section*{Problem 3}
$A$ is $n \times p$
\subsection*{Problem 3.a}
$AA'$ is symmetric if $AA' = A'A$

Proof:
$(AA')' = (A')'A' = AA'$ and hence $AA'_{n \times n}$ is symmetric

Similarly, for $A'A$ consider the following:

$(A'A)' = A'A''  = A'A$ and hence $A'A_{p \times p}$ is symmetric too.

\subsection*{Problem 3.b}

$(A'A)_{ij} = \sum_{k=1}^n a_{ki}a_{kj}$ and hence any diagonal element of $A'A$ is a sum of perfect squares(the case when $i=j$ $\implies$ $(A'A)_{ii} = \sum_{k=1}^n a_{ki}^2$)

If $\sum_{k=1}^n a_{ki}^2 =0$ $\implies$ $a_{ki} =0\  \forall 1 \leq k \leq n\  \forall i$ Hence $A$ is a zero matrix.

\section*{Problem 4}
\subsection*{Problem 4.a}

$$A_2 = \begin{pmatrix} 1 & 1 \\
1 & 1\\
1 & 0\\
0 & 0
\end{pmatrix}$$

$$A_3 = \begin{pmatrix} 1 & 1 & 1\\
1 & 1 & 0\\
1 & 0 & 0\\
0 & 0 & 1
\end{pmatrix}$$

$$A_4 = \begin{pmatrix} 1 & 1 & 1\\
1 & 1 & 0\\
1 & 0 & 0\\
0 & 0 & 1
\end{pmatrix}$$
\subsection*{Problem 4.b}
Rank of $V_2$:
\begin{align*}
V_2 &= \begin{pmatrix} 1 & 1 \\
1 & 1\\
1 & 0\\
0 & 0
\end{pmatrix}\\
&\stackrel{\text{C2-C1}}{\longrightarrow}\begin{pmatrix} 1 & 0 \\
1 & 0\\
1 & -1\\
0 & 0
\end{pmatrix}\\
\end{align*}
which cannot be reduced further, hence rank = $min(3,2) = 2$

Rank of  $V_3$:

\begin{align*} A_3 &= \begin{pmatrix} 1 & 1 & 1\\
1 & 1 & 0\\
1 & 0 & 0\\
0 & 0 & 1
\end{pmatrix}\\
&\stackrel{\text{R1-R2}}{\longrightarrow} \begin{pmatrix} 0 & 0 & 1\\
1 & 1 & 0\\
1 & 0 & 0\\
0 & 0 & 1
\end{pmatrix}\\
\end{align*}

Thus rank of $V_3=3$

\subsection*{Problem 4.c}

Basis for $V_2$(maximising zeroes by doing a $C1-C2$ operation):  $\big(\begin{pmatrix} 0 & 1 & 0 \end{pmatrix}'$, $\begin{pmatrix} 1 & 0 & 0\end{pmatrix}'\big)$

Basis for $V_3$ (maximised zeroes): $\big(\begin{pmatrix}1 & 0 & 0 \end{pmatrix}',\begin{pmatrix}1 & 1 & 0 \end{pmatrix}',\begin{pmatrix}0 & 0 & 1 \end{pmatrix}'\big)$

\end{document}


\documentclass{memoir}
\usepackage{linalg}

\begin{document}
\section{Algebraic Operations on $\mathcal{L}(V,W)$}

\begin{defn}[Addition and scalar multiplication on linear maps]
Suppose $S,T \in \mathcal{L}(V,W)$ and $\lambda \in F$. The  \textbf{sum} $S+T$ and \textbf{product} $\lambda T$ are the linear maps from $V \to W$ defined by
\begin{align*}
	(S+T)(v) = Sv + Tv \\
	(\lambda T)(v) = \lambda(Tv)
\end{align*}
for all $v \in V$.
\end{defn}
Composition of maps is also a map; $S(T(V))$ is similar to "multiplying" maps.\\

Moreso, these compositions are associative: ($T_3 \circ (T_2\circ T_1) = (T_3\circ T_2) \circ T_1$). It also has the identity: $Id_W \circ T = T \circ Id_V$.\\

Finally, it is also distributive; $T \circ (S_1+S_2) = T\circ S_1 + T \circ S_2$\\

Say $T \in L(V,W)$, $T:V\to W$. Suppose that $V$ is a finite-dimensional vector space. Then $T$ is \textit{determined} by what it does to a basis of $V$ :\\

Say $v_1,\ldots,v_n$ is a basis for $V$. Suppose we know the output of $T(v_1),\ldots,T(v_n)$. Then let $v \in V$. Know $v = a_1v_1+\ldots+a_nv_n$. Then $T(v) = T(a_1v_1+\ldots+a_nv_n) = T(a_1v_1)+\ldots+T(a_nv_n) = a_1T(v_1) + \ldots + a_n T(v_n)$\\

Therefore, we can construct $T(v)$ for any $v$ from knowledge of how $T$ applies to the basis.
\color{black}
\begin{thm}[Linear maps and basis of domain]
	Suppose that $w_1,\ldots,w_n \in W$ are arbitrary vectors and $v_1,\ldots,v_n$ is a basis of $V$. Then there is \textbf{exactly} one linear map $T:V\to W$ that sends $v_i$ to $w_i$.
\end{thm}
Note that \(\left\{ w_i \right\} \) are not necessarily linearly independent or spanning!

\section{Kernels}
\begin{defn}[Kernel]
	Let $T \in L(V,W)$, $T:V\to W$. The \textbf{kernel} of $T$ is

\begin{align*}
	\textrm{ker}T := \left\{ v \in V \mid T(v) = \vec{0})W \right\}
\end{align*}
\end{defn}
Note: $T(\vec{0}_V) = \vec{0}_W$ and so  $\vec{0}_V \in \text{ker}(T) $ automatically. We also refer to the kernel by Null$(T)$ sometimes.
\begin{exmp}[Examples of kernels]
	\begin{itemize}
		\item The zero map obviously has a kernel of the whole set
		\item The kernel of $\textrm{Id}_V$ is the set $\left\{ \vec{0}_V \right\} $
		\item Differentiation has a kernel consisting of constants
	\end{itemize}
\end{exmp}
\begin{defn}[Injective]
	A map is \textbf{injective} if $T(u) = T(v) \implies u = v$

In other words, different inputs give different outputs.
\end{defn}
\begin{prop}
	Let $T \in L(V,W)$. Then $T$ is injective if and only if $\text{ker}(T) = \left\{ \vec{0}_V \right\} $
\end{prop}
\section{Range and Surjectivity}
\begin{defn}[Range/Image]
	For $T$ a function from $V\to W$, the \textbf{range} or \textbf{image} of $T$ is the subset of $W$ defined by:
	\begin{align*}
		\text{range} T = \textrm{Im}T = \{Tv \mid v \in V \} .
	\end{align*}
\end{defn}
\end{document}


\section{Cohomology, Ext, cup product}
Let $R$ be a ring, probably a PID. It's often a field, but it could be $\Z$. Let $N$ be an $R$-module. Define $S^n(X;N)=\Map(\Sin_n(X),N)$. There's a boundary map $d:S^n(X;N)\to S^{n+1}(X;N)$ that takes a cochain $f$ to the map $df$ defined by $df(\sigma)=(-1)^{n+1}f(d\sigma)$ where $\sigma\in \Sin_{n+1}(X)$. Now, $d^2=0$, so $ H^n(X;N):= H^n(S^\ast(X;N))$. This is a contravariant functor from $\mathbf{Top}$ to $\mathbf{Ab}$ and it's covariant in the coefficients.

When $n=0$, you have $0\to S^0(X;N)\xrightarrow{d} S^1(X;N)$. Thus $ H^0(X;N)=\ker d$. Well, $S^0(X;N)=\Map(X,N)$, and $d$ sends a $0$-cochain $f$ to $\sigma\mapsto\pm f(d\sigma)=\pm(f(\sigma(0))-f(\sigma(1)))$. So a function is in the kernel of $d$ if its values on the ends of any path is the same. Thus $ H^0(X;N)=\Map(\pi_0(X),N)$.

We also talked about the Kronecker pairing. This gave an evaluation $ H^n(X;N)\otimes_R H_n(X;R)\to N$. Taking the adjoint gives a map $ H^n(X;N)\xrightarrow{\beta}\Hom_R( H_n(X;R),N)$. We can try to understand cohomology in terms of homology. $\beta$'ll often be an isomorphism, but not always.
\begin{theorem}[UCT for cohomology]
There is a natural sexseq:
\begin{equation*}
0\to\Ext^1_R( H_{n-1}(X;R),N)\to H^n(X;N)\xrightarrow{\beta}\Hom_R( H_n(X;R),N)\to 0
\end{equation*}
that splits, but not naturally. This also holds for relative cohomology.
\end{theorem}
I will tell you what $\Ext$ means now. I will prove this on Friday.

The problem that arises is that $\Hom_R(-,N):\mathbf{Mod}_R\to\mathbf{Mod}_R$ is not exact. More precisely, it preserves right exact sequences, but not left exact sequences. Consider $M^\prime\xrightarrow{i} M\xrightarrow{p} M^{\prime\prime}\to 0$ an exact sequence of $R$-modules. This gives a sequence $0\to \Hom_R(M^{\prime\prime},N)\to\Hom_R(M,N)\to \Hom_R(M^{\prime},N)$. If I have $f:M^{\prime\prime}\to N$, and I compose with $p$ to get a zero map, then is $f$ zero? Well, yes, because $p$ is surjective. Now suppose I have $g:M\to N$, such that $i\circ g=0$. So it facts through the cokernel, and you get a unique factorization $M^{\prime\prime}\to N$ (unique because $M\to M^{\prime\prime}$ is surjective).

Suppose I have an injection $0\to M^\prime\to M$. Is $\Hom(M,N)\to\Hom(M^\prime,N)$ surjective? If I have some map $M^\prime\to N$ and $M^\prime\hookrightarrow N$, then does this extend to a map $M\to N$? No! For example, if you have $1:\Z/2\Z\to\Z/2\Z$ and $\Z/2\Z\hookrightarrow\Z/4\Z$, then you can't lift to a map $\Z/4\Z\to\Z/2\Z$. This works, though, if the sexseq splits.

Homological algebra now comes to the rescue! Pick a free resolution of $M$ given by $\cdots\to F_2\to F_1\to M\to F_0\to 0$. If I apply $\Hom$, I get a chain complex $0\to \Hom(F_0,N)\to \Hom(F_1,N)\to \Hom(F_2,N)\to\cdots$.
\begin{definition}
Define $\Ext_R^n(M,N)= H^n(\Hom_R(F_\bullet,N))$ as the $n$-dimensional homology of this chain complex.
\end{definition}
\begin{remark}
If $R$ is a PID, then $\Ext^n=0$ if $n>1$. If $R$ is a field, then $\Ext^n=0$ for $n>0$. Also, $\Ext$ is well-defined and functorial (by the fundamental theorem of homological algebra). Another important point is that $\Hom_R(-,N)$ takes chain homotopies to chain homotopies. This is a pretty important thing, and is something to think about for a minute. This is because if I have $M^\prime\to M$, I get an induced map $\Hom_R(M^\prime,N)\leftarrow\Hom_R(M,N)$, and this is actually an $R$-module map, and in particular, additive. And this means that the $dh-hd=f_1-f_0$ is preserved. Lastly, if $M$ is free or projective, then $\Ext^n(M,-)=0$ for $n>0$. In addition, $\Ext^0(M,N)=\Hom_R(M,N)$.
\end{remark}
Recall the trick that if I have a sexseq $0\to A\to B\to C\to 0$, and I have free resolutions $F^\prime_\bullet\to A$ and $F^{\prime\prime}_\bullet\to 0$, I can get a free resolution $F_\bullet\to B$ to get a sexseq $0\to F^\prime_\bullet\to F_\bullet\to F^{\prime\prime}_\bullet\to 0$. I can now apply $\Hom_R(-,N)$ to get a sexseq of cochain complexes, because this sequence splits in any given degree. Thus, I get a lexseq:
\begin{equation*}
\xymatrix{ & & 0\ar[dll]\\
\Hom_R(M^{\prime\prime},N)\ar[r] & \Hom_R(M,N)\ar[r] & \Hom_R(M^{\prime},N)\ar[dll]\\
\Ext^1_R(M^{\prime\prime},N)\ar[r] & \Ext^1_R(M,N)\ar[r] & \Ext^1_R(M^{\prime},N)\ar[dll]\\
\cdots & &}
\end{equation*}
In this sense, $\Ext$ is like a cohomology theory for $R$-modules.

Let us use this to make a calculation.
\begin{example}
Let $R=\Z$, and look at the sexseq $0\to \Z\xrightarrow{k}\Z\to\Z/k\Z\to 0$. Here $N$ is some abelian group. So, our lexseq will look like:
\begin{equation*}
\xymatrix{ & & 0\ar[dll]\\
\Hom_R(\Z/k\Z,N)\ar[r] & \Hom_R(\Z,N)=N\ar[r] & \Hom_R(\Z,N)=N\ar[dll]\\
\Ext^1_R(\Z/k\Z,N)\ar[r] & 0\ar[r] & 0\ar[dll]\\
\cdots & &}
\end{equation*}
The map $N\to N$ in this lexseq is multiplication by $k$. Thus $\Hom(\Z/k\Z,N)=\ker(N\xrightarrow{k}N)$. And, well, $\Ext^1_\Z(\Z/k\Z,N)=N/kN$.
\end{example}
Let's get some consequences of cohomology from the UCT. Even independent of that, we get some properties.
\subsection{Properties of cohomology}
\begin{enumerate}
\item It's homotopy invariant. This means that if $f_0\sim f_1:(X,A)\to (Y,B)$, then $ H^\ast(X,A;N)\xleftarrow{f_0^\ast,f_1^\ast} H^\ast(Y,B;N)$ are equal. I can't use the UCT to address this because the UCT only tells you that things are isomorphic (use the 5-lemma). But we did establish a chain homotopy $f_{0,\ast}\sim f_{1,\ast}:S_\ast(X,A)\to S_\ast(Y,B)$, and applying $\Hom$ still retains this chain homotopy, and hence you get the same map on cohomology.
\item Excision. If $U\subseteq A\subseteq X$ such that $\overline{U}\subseteq\mathrm{Int}(A)$, then $ H^\ast(X,A;N)\leftarrow H^\ast(X-U,A-U;N)$ is an isomorphism. This follows from the UCT (in the relative form, which is also true).
\item Mayer-Vietoris sequence. If I have $A,B\subseteq X$ such that their interiors cover $X$, then I have an lexseq:
\begin{equation*}
\xymatrix{ & & \cdots\ar[dll]\\
 H^n(X;N)\ar[r] & H^n(A;N)\oplus H^n(B;N)\ar[r] & H^n(A\cap B;N)\ar[dll]\\
 H^{n+1}(X;N)\ar[r] & \cdots & }
\end{equation*}
\end{enumerate}


\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath,amssymb,amsthm}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{corollary}{Corollary}[theorem]
\newtheorem{lemma}[theorem]{Lemma}
\title{Mathematics Handout - Logaritmics}
\author{Daniel Frederico Lins Leite}
\date{July 2016}
\begin{document}
\section{Introduction}
\maketitle

\[{x_n}\] is a sequence of real numbers
Th sequence converge if:
$$\exists a \in Re$$
$$\exists \epsilon \in R such that \epsilon > 0$$
$$\exists N_a \in I such that N_a > 0$$
$$\forall n > N_a, |a - x_n| < \epsilon$$

if for example exists another
$$\exists b \in Re$$ such that
$$\exists N_b \in I such that N_b > 0$$
$$\forall n > N_b, |b - x_n| < \epsilon$$

then

$$|a-b| = |a - x_n + x_n - b|$$

Given that the $$R^n$$, the space of the elements of the sequence is a normed vector space, we can apply the Triangle Inequality. So

$$|a - x_n + x_n - b| <= |a - x_n| + |x_n - b|$$

given that $$|x_n - b|$$ is a even function
$$f(x) = f(-x)$$ we have that
$$|x_n - b| = -1 * |x_n - b| = |-x_n + b| = |b - x_x|$$

so we have

$$|a - x_n| + |x_n - b| < |a - x_n| + |b - x_n| <= \epsilon + \epsilon <= 2\epsilon$$

So

$$ 0 <= |a - b| <= 2\epsilon$$

So $|a-b|$ is squeezed between this two function. Given that this is true for every $\epsilon$, if $\epsilon -> 0$
we will have that:
$$|a-b| = 0$$ and $$a=b$$

The value a is called the limit of the sequence.

The

$$S = \sum_{i=0}^{\inf} {x_i}$$ is called the series associated with se sequence.

The partial sum is

$$S_n = \sum_{i=0}^{n} {x_i}$$

So

${S_n}$ is also a sequence. In the same way it can converge and have a limit.
If the sequence converge, we say that the series converge and that the limit is

$$limit of {S_n} =  \sum_{i=0}^{\inf} {x_i}$$

If we have two convergent series:

$$S_1 = \sum_{i=0}^{\inf} {a_i}$$
$$S_2 = \sum_{i=0}^{\inf} {b_i}$$

then

$$\sum_{i=0}^{\inf} {(a_i + b_i)} = \sum_{i=0}^{\inf} {a_i} + \sum_{i=0}^{\inf} {b_i}$$

\end{document}


\section{Fundamental Concepts}

\bx{
  We will check $\cup, \cap$ in DeMorgan's laws.

  Let's use
  \begin{itemize}
    \item $A = \pbrac{1, 2, 3, 4}$
    \item $B = \pbrac{-1, 2, 3, 5}$
    \item $C = \pbrac{3, 9, 11}$
  \end{itemize}

  Check
  \begin{align*}
    A - (B \cup C) &= \pbrac{1, 2, 3, 4}  - \pbrac{-1, 2, 3, 5, 9, 11}\\
    &= \pbrac{1, 4} \\
    &= (A - B) \cap (A - C) \\
    &= \pbrac{1, 4} \cap \pbrac{1, 2, 4} = \pbrac{1, 4}
  \end{align*}

  \begin{align*}
    A - (B \cap C) &= \pbrac{1, 2, 3, 4}  - \pbrac{3}\\
    &= \pbrac{1, 2, 4} \\
    &= (A - B) \cup (A - C) \\
    &= \pbrac{1, 4} \cup \pbrac{1, 2, 4} = \pbrac{1, 2, 4}
  \end{align*}
}

\bx{
  \ea{
    \item $\implies$ is true. $\impliedby$ is not true, consider $A = \pbrac{1, 2, 3}, B = \pbrac{1, 3}, C = \pbrac{2}$.
    \item $\implies$ is true. $\impliedby$ is not true, consider $A = \pbrac{1, 2, 3}, B = \pbrac{1, 3}, C = \pbrac{2}$.
    \item True.
    \item $\implies$ is not true. Consider $A = \pbrac{1} \subset B = \pbrac{1, 2}, C = \emptyset$. $\impliedby$ is true.
    \item Not true. Consider $A = \pbrac{1}, B = \pbrac{2}$. I think $\subset$ works.
    \item Not true. Consider $A = \pbrac{1, 2}, B = \pbrac{2, 3}$. LHS is equivalent to $A$, so this should be $\supset$.
    \item True.
    \item $\supset$
    \item True.
    \item True.
    \item Not true, if $A = \emptyset$ for example, we have $(A \times B)
    \subset (C \times D) = \emptyset \subset (C \times D)$, but we can set $B$
    to whatever and this statement is still true, so we can make $B$ have an
    element that is not in $D$, and therefore $B \not\subset D$.
    \item True.
    \item $\subset$
    \item $\subset$
    \item True.
    \item I think this is true at first glance...at least $\subset$ looks good.
    \item $\supset$
  }
}

\bx{
  \ea{
    \item
    \begin{itemize}
      \item \textbf{Original}: If $x < 0$ then $x^2 - x > 0$. True.
      \item \textbf{Contrapositive}: If $x^2 - x \leq 0$ then $x \geq 0$. True.
      \item \textbf{Converse}: If $x^2 - x > 0$ then $x < 0$. False.
    \end{itemize}

    \begin{figure}[H]
      \centering
      \def\domainSize{3}
      \begin{tikzpicture}
        \begin{axis}[
          axis y line = middle,
          axis x line = middle,
        ]

        \addplot[
          domain=-\domainSize:\domainSize,
          samples=100
        ]{
          x^2 - x
        };

        \end{axis}
      \end{tikzpicture}
      \caption{Showing how to visualize where $x^2 - x > 0 $}
      \label{chap1:fig:parabola}
    \end{figure}

    \item
    \begin{itemize}
      \item \textbf{Original}: If $x > 0$ then $x^2 - x > 0$. False.
      \item \textbf{Contrapositive}: If $x^2 - x \leq 0$ then $x \leq 0$. False.
      \item \textbf{Converse}: If $x^2 - x > 0$ then $x > 0$. False.
    \end{itemize}
  }
}

\bx{
  \ea{
    \item $\exists a \in A$ such that $a^2 \not\in B$
    \item $\forall a \in A, a^2 \not\in B$
    \item $\exists a \in A$ such that $a^2 \in B$.
    \item $\exists a \not\in A$ such that $a^2 \not\in B$.
  }
}

\bx{
  \ea{
    \item True. True.
    \item False. True.
    \item True. False.
    \item True. True.
  }
}

\bx{
  \TODO too lazy
}

\bx{
  \begin{align*}
    D &= A \cap (B \cup C) \\
    E &= (A \cap B) \cup C \\
    F &= A
  \end{align*}

  For $F$, I was thinking $x \in B \implies x \in C$ means that either $x \in B$
  and $x \in C$, or $x \not\in B$ and $x$ can be anything. This sounds like $x$
  can be anything in the second case, so we have $A \cap \mathcal{U} = A$.
}

\bx{
  $A = \pbrac{0, 1}$. $\mathcal{P}(A) = \pbrac{\emptyset, \pbrac{0}, \pbrac{1}, \pbrac{0, 1}}$.

  If $A$ has one element, $\abs{\mathcal{P}(A)} = 2$. It is called the power set
  because it contains all the subsets of $A$, and that $\abs{\mathcal{P}(A)} =
  2^\abs{A}$.
}

\bx{
  \TODO: You can honestly find this everywhere online. Standard proof.
}

\bx{
  \ea{
    \item $\mathbb{Z} \times \mathbb{R}$
    \item $\mathbb{R} \times \left(0, 1\right]$
    \item No. You can do a contradiction proof with cases that the first and second set are disjoint, and then that they are not disjoint.
    \item Yes, $\pa{\mathbb{R} - \mathbb{Z}} \times \mathbb{Z}$
    \item No. The cartesian product will produce a box, while this set is a circle.
  }
}


\input{../header_function}

%---------- start document ---------- %
 \section{factor.find -- find a factor}\linkedzero{factor.find}
%
\quad All methods in this module return one of a factor of given integer.
If it failes to find a non-trivial factor, it returns \(1\).
Note that \(1\) is a factor anyway.

\param{verbose} boolean flag can be specified for verbose reports.
To receive these messages, you have to prepare a logger (see \linklibrary{logging}).

  \subsection{trialDivision -- trial division}\linkedone{factor.find}{trialDivision}
   \func{trialDivision}
   {%
     \hiki{n}{integer},\ %
     **\param{options}
   }{%
     \out{integer}
   }\\
   \spacing
   % document of basic document
   \quad Return a factor of \param{n} by trial divisions.\\
   \spacing
   % input, output document
   \quad \param{options} can be either one of the following:
   \begin{enumerate}
   \item \param{start} and \param{stop} as range parameters.
         In addition to these, \param{step} is also available.
   \item \param{iterator} as an iterator of primes.
   \end{enumerate}
   If \param{options} is not given, the function divides \param{n} by primes from \(2\) to the floor of the square root of \param{n} until a non-trivial factor is found.\\
   \quad \param{verbose} boolean flag can be specified for verbose reports.\\
%
  \subsection{pmom -- $p-1$ method}\linkedone{factor.find}{pmom}
   \func{pmom}{%
     \hiki{n}{integer},\ %
     **\param{options}
   }{%
     \out{integer}
   }\\
   \spacing
   % document of basic document
   \quad Return a factor of \param{n} by the \(p-1\) method.\\
   \spacing
   % added document
   \quad The function tries to find a non-trivial factor of \param{n}
   using Algorithm 8.8.2 (\(p-1\) first stage) of \cite{Cohen1}.
   In the case of \(n = 2^{i}\), the function will not terminate.
   Due to the nature of the method, the method may return the
   trivial factor only.\\
   \spacing
   % input, output document
   \quad \param{verbose} Boolean flag can be specified for verbose reports,
   though it is not so verbose indeed.\\
%
   \subsection{rhomethod -- $\rho$ method}\linkedone{factor.find}{rhomethod}
   \func{rhomethod}{%
     \hiki{n}{integer},\ %
     **\param{options}
   }{%
     \out{integer}
   }\\
   \spacing
   % document of basic document
   \quad Return a factor of \param{n} by Pollard's \(\rho\) method.\\
   \spacing
   % added document
   The implementation refers the explanation in \cite{Pomerance}.
   Due to the nature of the method, a factorization may return the
   trivial factor only.\\
   \spacing
   % input, output document
   \quad \param{verbose} Boolean flag can be specified for verbose reports.\\
\begin{ex}
>>> factor.find.trialDivision(1001)
7
>>> factor.find.trialDivision(1001, start=10, stop=32)
11
>>> factor.find.pmom(1001)
91
>>> import logging
>>> logging.basicConfig()
>>> factor.find.rhomethod(1001, verbose=True)
INFO:nzmath.factor.find:887 748
13
\end{ex}%Don't indent!(indent causes an error.)
\C

%---------- end document ---------- %

\input{../footer}


\chapter{Clustering}
\newpage

\section{K-Means}
\begin{itemize}
    \item Dataset: $H=\{x^{(1)},x^{(2)},\dots,x^{(n)}\}$
    \item $d$ dimensions
    \item Want to divide $H$ into disjoint subsets $\{H_1,H_2,\dots,H_c\}$
\end{itemize}

\subsection{Objective Function}
Find an assignment such that the samples in the same class are as close to each other as possible.
\[ J_c \triangleq \sum_{i=1}^c\sum_{x\in H_i} \|x-m_i\|^2 \]
where $m_i$ is the centroid of each class.

\subsection{Before K-Means}
Let
\[ J_i = \sum_{x\in H_i}\|x-m_i\|^2 \]

\subsubsection{Framework}
\begin{enumerate}
    \item Initialize
    \item Re-assign data samples to make the loss smaller.
\end{enumerate}

\subsubsection{Update Rule}
Suppose a sample $\hat{x}$ is moved from $H_i$ to $H_j$. Let $n_j$ be the number of samples in $H_j$.
\[ m^*_j = \frac{n_jm_j + \hat{x}}{n_j+1} = m_j - m_j + \frac{n_jm_j + \hat{x}}{n_j+1} = m_j + \frac{\hat{x}-m_j}{n_j+1} \]
\[ m^*_i = \frac{n_im_i - \hat{x}}{n_i-1} = m_i + \frac{m_i - \hat{x}}{n_i-1} \]

\begin{align*}
    J_j^* & = \sum_{x\in H_j}\| x-m_j^* \|^2 + \| \hat{x} - m_j^* \|^2                                                \\
          & = \sum_{x\in H_j}\|x-m_j-\frac{\hat{x}-m_j}{n_j+1}\|^2 + \| \frac{n_j}{n_j+1}(\hat{x}-m_j) \|^2           \\
          & = \sum_{x\in H_j} \| x - m_j \|^2 - \frac{2}{n_j+1}\sum_{x\in H_j}(\hat{x}-m_j)^T(x-m_j)                  \\
          & \quad + \frac{1}{(n_j+1)^2}\sum_{x\in H_j}\| \hat{x} -m_j \|^2 + \frac{n_j^2}{(n_j+1)^2}\|\hat{x}-m_j\|^2 \\
          & = J_j + \frac{n_j}{(n_j+1)^2}\|\hat{x}-m_j\|^2 + \frac{n_j^2}{(n_j+1)^2}\|\hat{x}-m_j\|^2
\end{align*}
Notice that the second term is $0$ and the $\|\hat{x}-m_j\|^2$ in the first term is constant w.r.t. $x$ in the summation.

Therefore
\[ J^*_j = J_j + \frac{n_j}{n_j+1}\|\hat{x}-m_j\|^2 \]
\[ J^*_i = J_i - \frac{n_i}{n_i-1}\|\hat{x}-m_i\|^2 \]

\subsubsection{Convergence}
Always converges, because the loss function is always decreasing and has a lower bound $0$.

But it is SLOW.

\subsection{K-Means}
\subsubsection{Procedure}
\begin{enumerate}
    \item Update centroids
    \item Re-assign points
\end{enumerate}

\subsubsection{Mathematical Framework}
Let $r_{ik} \in \{0,1\}$ denote that the $i$-th sample is classified into the $k$-th class. $\sum_kr_{ik} = 1$. Then the loss function is
\[ J = \sum_i \sum_k \| x_i - m_k \|r_{ik} \]

\subsubsection{Convergence Analysis}
In E-Step, the loss always goes down because each sample finds the nearest centroid.
\[ J_c^{(old)} = \sum_i\sum_kr_{ik}^{(old)}\|x_i-m_k\| \ge \sum_i\sum_k\|x_i-m_k\|r_{ik}^{(new)} = J_c^{(new)} \]

In M-Step,
\begin{align*}
    J_c^k(old) & = \sum_{i\in H_k}\|x_i - m_k^{(old)}\|^2                               \\
               & = \sum_{i\in H_k}\| x_i - m_k^{(new)} + m_k^{(new)} - m_k^{(old)} \|^2 \\
               & = \sum_{i\in H_k} \|x_i - m_k^{(new)}\|^2                              \\
               & \quad + \sum_{i\in H_k}\|m_k^{(old)} - m_k^{(new)}\|^2                 \\
               & \quad + \sum_{i\in H_k}(x_i-m_k^{(new)})^T(m_k^{(old)}-m_k^{(new)})
\end{align*}
The first term is $J_c^k(new)$, the second term is non-negative and the third term is zero.

\subsubsection{Remarks}
\begin{itemize}
    \item Generally K-Means has good performance.
    \item Initialization matters.
    \item The choice of $k$ matters.
\end{itemize}

\subsection{Agglomerative Clustering}
\begin{enumerate}
    \item Initialize: everypoint is its own cluster.
    \item Find the most similar pair of clusters.
    \item Merge.
\end{enumerate}

\section{Gaussian Mixture Model}
    K-Means can be easily affected by outliers.

    \subsection{Multivariate Gaussian Distribution}
        \[ p(x) = \frac{1}{(2\pi|\Sigma|)^{d/2}}\exp\left\{ -\frac{1}{2}(x-\mu)^T\Sigma^{-1}(x-\mu) \right\} \]

    \subsection{Gaussian Mixture Model}
        Suppose the data has a distribution that can be modeled by the weighted sum of $K$ Gaussian distributions. Let $\pi_k = p(x=k)$ be the likelihood of the $k$-th Gaussian.
        \[ p(x) = \sum_{k=1}^Np(x=k)p(x|k) = \sum_{k=1}^K\pi_k \mathcal{N}(x|\mu_k,\Sigma_k) \]

        So the parameters of a GMM are
        \begin{itemize}
            \item $\pi_k$
            \item $\mu_k$
            \item $\Sigma_k$
        \end{itemize}

        Given the parameters of a GMM, the probabilities can be calculated.
        \begin{itemize}
            \item Prior: $p(x=k)=\pi_k$
            \item Likelihood: $p(x|x=k)=\mathcal{N}(x|\mu_k,\Sigma_k)$
            \item Joint Distribution: $p(x,x=k)=p(x=k)p(x|x=k)=\pi_k\mathcal{N}(x|\mu_k,\Sigma_k)$
            \item Evidence: $p(x) = \sum_{k=1}^Kp(x,x=k)=\sum_{k=1}^K\pi_k\mathcal{N}(x|\mu_k,\Sigma_k)$
            \item Posterior: $p(x=k|x)=\frac{p(x,x=k)}{p(x)}=\frac{\pi_k\mathcal{N}(x|\mu_k,\Sigma_k)}{\sum_{i=1}^K\pi_i\mathcal{N}(x|\mu_i,\Sigma_i)}$
        \end{itemize}

    \subsection{Estimating Parameters}
        Clustering using a GMM is simply estimating the parameters of the model.

        Suppose we have a dataset $D = \{x^{(1)},x^{(2)},\dots,x^{(N)}\}$. We maximize the log likelihood
        \[ \mathcal{L}(\theta) = \ln p(D|\theta) = \sum_{n=1}^N\ln\left\{\sum_{k=1}^K\pi_k\mathcal{N}(x^{(n)}|\mu_k,\Sigma_k)\right\} \]

        However, traditional MLE methods do not work due to the complexity of $\mathcal{L}$. To illustrate this, we take derivative w.r.t. $\mu_k$
        \[ \frac{\partial \mathcal{L}}{\partial \mu_k} = -\sum_{n=1}^N\frac{\pi_k\mathcal{N}(x^{(n)}|\mu_k,\Sigma_k)}{\sum_j\pi_j\mathcal{N}(x^{(n)}|\mu_j,\Sigma_j)}\Sigma_k^{-1}(x_n-\mu_k) \]
        but we cannot derive a closed-form solution of $\mu_k$.

        Instead, this is an exponential function that can be solved by iterative numerical methods, let
        \[ \gamma(z_{nk}) = \frac{\pi_k\mathcal{N}(x^{(n)}|\mu_k,\Sigma_k)}{\sum_j\pi_j\mathcal{N}(x^{(n)}|\mu_j,\Sigma_j)} \]
        \[ N_k = \sum_{n=1}^N \gamma(z_{nk}) \]

        To solve for $\mu_k$, we run multiple iterations, in each iteration, we first fix $\theta = (\pi_k,\mu_k,\Sigma_k)$ and update $\gamma(z_{nk})$, and then fix $\gamma(z_{nk})$ and update $\theta$.

        \subsubsection{Estimating Mean and Covariance Matrix}
        Using previous conclusions,
        \[ \mu_k = \frac{1}{N_k}\sum_{n=1}^N\gamma(z_{nk})x^{(n)} \]
        Similarly if we solve for $\Sigma_k$,
        \[ \Sigma_k = \frac{1}{N_k}\sum_{n=1}^N\gamma(z_{nk})(x^{(n)}-\mu_k)(x^{(n)}-\mu_k)^T \]

        \subsubsection{Estimating Mixture Coefficients}
        Notice that $\sum_k\pi_k = 1$, so maximizing w.r.t. $\pi_k$ is an ECP.

        The solution is given by
        \[ \pi_k = \frac{N_k}{N} \]

\section{Spectral Clustering}
    K-Means and GMM may have poor performance when the data is non-convex.

    \subsection{Graph-based Clustering}
        We use a graph $G=(V,E)$ to represent the dataset. Each sample is a node in $V$ and each edge has a weight $w_{ij}=f(d(i,j))$.

        \begin{enumerate}
            \item Construct the graph
            \item Perform edge cuts.
        \end{enumerate}

    \subsection{Graph Cut}
        \subsubsection{Definitions and Notations}
            \begin{itemize}
                \item Degree of a node $d_i = \sum_{j\in \mathcal{N}(i)}w_{ij}$.
                \item Degree of a subgraph $A_i = \sum_{i \in A}d_i$. There are two cases.
                    \begin{itemize}
                        \item $i \in A$, $j \in A$. In this case $w_{ij}$ is counted twice.
                        \item $i \in A$, $j \notin A$. In this case $w_{ij}$ is counted once.
                    \end{itemize}
                \item Cut of a graph $Cut(A, B) = \sum_{i \in A}\sum_{j \in B}w_{ij}$.
            \end{itemize}

        We minimize
        \[ \min Cut(A_1,A_2,\dots,A_k) \]

        However, the algorithm may favor isolated clusters and outliers.

        Can be mitigated by normalizing edge cuts.
        \[ NCut(A,B) = \frac{Cut(A,B)}{d_A} + \frac{Cut(A,B)}{d_B}\]
        Works. But it's NP-hard.

    \subsection{Optimizing Graph Cuts}
        \subsubsection{More Notations}
            \begin{itemize}
                \item Degree matrix $D_{ij} = \text{$d_i$ if $i=j$ else $0$}$
                \item $L=D-W$
                \item Define an indicator vector $x$. $x_i = 1$ if $i \in A$ and $x_i=0$ if $i \notin A$, i.e. $i \in B = V-A$. $x$ is unknown and we want to find $x$.
            \end{itemize}

        We can represent $d_A$ and $d_B$ in matrix form
        \[ d_A = \sum_{i\in A}d_i = \sum_i d_ix_i = x^TDx \]
        \[ d_B = \bar{x}^TD\bar{x} \]
        where $\bar{x}$ is the bitwise NOT of $x$.

        \[ Cut(A, V-A) = \sum_{i\in A}\sum_{j\in B}w_{ij} = \sum_{i \in A}d_i - \sum_{i \in A}\sum_{j \in A}w_{ij} = x^TDx - x^TWx = x^TLx \]

        Therefore
        \begin{align*}
            \min_x &\quad x^TLx\\
            \text{s.t.} &\quad x^TDx \ge \delta
        \end{align*}

        Can be solved by Lagrangian multipliers
        \[ \mathcal{L}(x, \lambda_A, \lambda_B) = x^TLx - \lambda_A(x^TDx-\delta) \]
        \[ D^{-1}Lx = \lambda_A x \]
        So we find the eigenvector of $D^{-1}L$ and take approximations to make elements of $x$ either $0$ or $1$.

        \subsubsection{Procedure}
            \begin{enumerate}
                \item Normalize $L = D^{-1/2}LD^{-1/2}$
                \item Compute the smallest $k_1$ eigenvalues and corresponding eigenvectors.
                \item Use eigenvectors to construct $N$ by $k_1$ matrix $P$.
                \item Use $P$ as the new input of some other clustering algorithm, where each sample has $k_1$ dimension.
            \end{enumerate}

        \subsubsection{Strengths and Weaknesses}
        \begin{itemize}
            \item Can handle non-convex datasets.
            \item Runs into trouble when new data samples comes. Cannot be easily extended.
        \end{itemize}


%%=========================
%% Section 1.02: Origins of the Green's Functions and Roots of P
%%=========================

\documentclass[../dissertation.tex]{subfiles}

\begin{document}
\section{Motivation of the Green's Functions}\label{sec1:RootsOfP}

To motivate our choice of Green's function for this linear spectral
problem, suppose there exists a function $G$ satisfying
$L_\delta(G^+)(x) = \delta_0(x)$,
where $\delta_0(x)$\label{sym:dirac} denotes the Dirac delta function (not to be confused with
the parameter $\delta$). Formally, by taking the Fourier
transform\label{sym:fourier} of both
sides of $L_\delta(G^+)(x) = \delta_0(x)$, we have
\[
	1
		= \xi \, \wh G^+ - \zeta \( \wh G^+ - \wh G^- \)
		= \big[ \xi - \zeta \(1 - e^{-2\delta\xi}\) \big] \wh G^+
		= p(\xi; \zeta, \delta) \, \wh G^+,
\]
where
\begin{align*}
	p(\xi; \lambda, \delta)
		&= \xi - \zeta\(1 - e^{-2\delta \xi}\) \\
		&= \( \frac{\xi}{1 - e^{-2\delta \xi}} - \zeta \)\(1 - e^{-2\delta \xi}\) \\
		&= \big(\zeta(\xi) - \zeta(\lambda)\big)\(1 - e^{-2\delta \xi}\).
\end{align*}
However, this approach is somewhat problematic, given that the function $p$ has
roots $\xi = 0$ and $\xi = \lambda$ along the real line. So, instead defining
a single Green's function for the spectral problem \eqref{eq:JostDE} based on
taking the inverse Fourier transform of $1/p$, we instead define two different
Green's functions $G_L^+$ and $G_R^+$ based on taking two different ``Fourier
inverse like'' transforms of $1/p$ for which the respective contours of
integration avoids the roots of $p$. Specifically,
	\begin{align*}
		G_L^+(x; \lambda, \delta)
			&:=
				\frac{1}{2\pi}
				\int_{\Gamma_L}
					e^{i\xi x} \frac{1}{p(\xi; \lambda, \delta)} \,
				d\xi \\
		G_R^+(x; \lambda, \delta)
			&:=
				\frac{1}{2\pi}
				\int_{\Gamma_R}
					e^{i\xi x} \frac{1}{p(\xi; \lambda, \delta)}
				\, \mathrm{d}\xi
	\end{align*}
where the contour ${\Gamma_L}$ bypasses the roots $\xi = 0$ and $\xi = \lambda$
from below, and the contour ${\Gamma_R}$ bypasses the roots $\xi = 0$ and
$\xi = \lambda$ from above, as mentioned in the previous section.

Since $p(\xi; \lambda)$ can be rewritten as
\[
	p(\xi; \lambda)
		= \(\frac{\xi}{1-e^{-2 \xi \delta}}-\zeta(\lambda)\)\(1-e^{-2 \xi \delta}\)
		= \big( \zeta(\xi) - \zeta(\lambda) \big)\(1 - e^{-2\xi \delta}\),
\]
it is easy to check that both $\xi = 0$ and $\xi = \lambda$ are roots of $p$.
In the remainder of this section, we argue that these are the only roots of
$p$ in the strip
\[
	\mathcal R_\delta:= \left\{z\in\CC ~:~ -\frac{\pi}{\delta}\leq\im z\leq\frac{\pi}{\delta} \right\}
\]
as is defined in the Introduction of this chapter.
That is, we show that the equation
\begin{align} \label{eq1:baseEqn}
	\xi - \zeta(\lambda) + \zeta(\lambda) e^{-2 \xi \delta} = 0
\end{align}
has exactly two solutions (in $\xi$) for $\xi \in \mc R_\delta$. With a little algebraic
manipulation, equation \eqref{eq1:baseEqn} can be rewritten as
\begin{align} \label{eq1:EqnToSolve}
	\big(2 \delta \xi - 2 \delta \, \zeta(\lambda)\big) \, e^{2 \delta \xi - 2 \delta \, \zeta(\lambda)}
		= -2 \delta \, \zeta(\lambda) \, e^{-2 \delta \, \zeta(\lambda)}.
\end{align}
In order to ``solve'' \eqref{eq1:EqnToSolve}, recall that the Lambert $W$ function
(which we henceforth refer to only as $W$) is defined to be the multivalued
``inverse'' of the function $z e^z$. So, to determine the number
of solutions \eqref{eq1:EqnToSolve} has for $\xi \in \mc R_\delta$, we need to specify
which branches of $W$ are appropriate to apply to both sides of \eqref{eq1:EqnToSolve}
given our restriction on $\xi$.

The following discussion of the branches of the complex $W$\label{sym1:Wk} function is heavily
inspired by Section 4 from the 1996 R.M. Corless, G.H. Gonnet, D.E.G. Hare, D.J.
Jeffery and D.E. Knuth paper \cite{Corless1996}. As is the case with the standard
complex exponential
and logarithmic functions, to define the branches of $W$, the canonical approach
is to make a branch cut along the negative real axis of the range of $z e^z$, and
determine which curves in the range of $W$ are mapped to the branch cut ({\em i.e.}
the negative real axis).

To do so, set
\[
	\begin{aligned}
		z &:= w e^w  & \qquad w&:= W(z) \\
		  &:= x + i y & \qquad &:= t + i s.
	\end{aligned}
\]
Then, using Euler's formula to simply the equation
\[
	( x + i y) = (t + i s) e^{t + i s}
\]
and taking real and imaginary parts, we obtain the system
\[
	\left\{
		\begin{aligned}
			x&= e^t \(t \cos s - s \sin s\) \\
			y&= e^t \( t \sin s + s \cos s \).
		\end{aligned}
	\right.
\]
So, if $y=0$, then either $s = 0$ or $t = - s \cot s$. Further, $x < 0$ if and
only if $t \cos s - s \sin s < 0$. Now, since $t = - s \cot s$ has asymptotes at
$s = k \pi$ ($k \in \ZZ \sm \{0\}$), and the function $t \cos s - s \sin s$ has
no roots, the inequality $t \cos s - s \sin s < 0$ holds precisely on the intervals
\[
	\(\bigcup_{-k \in \NN} \big( (2k + 1) \pi, \, 2 k \pi\big)\)
		\cup (-\pi, \,  \pi) \cup
		\( \bigcup_{k \in \NN} \big(2 k \pi, \,  (2k + 1) \)
\]
As such, the only curves the function $z e^z$ maps to the negative real axis are
\[
	\gamma_k(s) := - s \cot s + i s, \qquad k \in \ZZ,
\]
whose respective domains are given by
\begin{align*}
	\text{domain} \, \gamma_k(s) :=
		\begin{cases}
			\big( (2k + 1) \pi, \, 2 k \pi\big), & -k \in \NN \\
			(-\pi, \,  \pi), & k = 0 \\
			\big(2 k \pi, \,  (2k + 1) \pi\big), & k \in \NN
		\end{cases}
\end{align*}
and the curve whose graph is
\[
	(-\infty, -1) \cup \{ \gamma_0(s) + i s ~:~ -\pi < s \leq 0 \}.
\]
As such, these curves form the boundary values between the ranges of
the different branches of $W$. In particular, the ranges for the
the principle branch $W_0$ and the $W_{-1}$ and $W_1$ branches are
shown below in Figure \ref{fig:BoundaryCurves}.

\begin{figure}[H]
	\centering
	\begin{tikzpicture}[scale = 0.25]
	\def\ticklength{0.35}
	\def\Pi{3.141592653589793}
	\def\ee{2.718281828459045}

	%% Draw w-axes
	\draw[->, thick] (-15, 0) -- (16, 0) node[right] {$\re w = t$};
	\draw[->, thick] (0, -10) -- (0, 11) node[above] {$\im w$ = s};

	%% Draw Branch Curves
	\draw[red,smooth, samples=100, domain=-2.94756:2.94756, variable=\s, thick]
		plot ({-\s / tan(deg(\s))}, {\s} );
	\draw[red,smooth, samples=200, domain=6.70346:8.88978, variable=\s, thick]
		plot ({-\s / tan(deg(\s))}, {\s} );
	\draw[red,smooth, samples=200, domain=-8.88978:-6.70346, variable=\s, thick]
		plot ({-\s / tan(deg(\s))}, {\s} );
	\draw[red, domain=-15:-1, variable=\s, thick]
		plot ({\s}, 0);

	%% Place Region Labels
	\node (W0) at (4, 1) {$W_0$};
	\node (W-1) at (4, -5) {$W_{-1}$};
	\node (W1) at (4, 5) {$W_{1}$};
	\node (W2) at (-7, {3*\Pi}) {$W_2$};
	\node (W-2) at (-7, {-3*\Pi}) {$W_{-2}$};

	%% Draw im axis tiks
	\foreach \i in {-3, -2, -1, 1, 2, 3} {
		\draw[thick] ({\ticklength}, {\i * \Pi}) -- ({-\ticklength}, {\i * \Pi})
			node[left] {$\i \pi$};
	}

	%% Draw re axis tiks
	\draw[thick] (-1, \ticklength) -- (-1, -\ticklength);
	\node at (-1.6, -\ticklength-0.9) {$-1$};

	\end{tikzpicture}
	\caption{Ranges for the $W_{\pm2}$, $W_{\pm1}$, and $W_0$ branches of the
		$W$ function.}
	\label{fig:BoundaryCurves}
\end{figure}

Since the map $w \mapsto w e^w$ takes $w = -1$ to $z = -e^{-1}$,
on pages 17 and 18 in \cite{Corless1996},
Corless {\em et al.} proposetaking the branch cut which defines the
principle branch of $W$ along $\{ z \in \CC ~:~ -\infty < z \leq -e^{-1} \}$,
and taking all other branch cuts along the entire negative $\re z$-axis.
They further take all branch cuts in such a way that
the branch cuts are closed ``on the top,'' as shown in Figures
\ref{fig:ClosedOnTop} and \ref{fig:OtherBranches}.

\begin{figure}[h!]
	\begin{tikzpicture}[scale=0.5]
		\def\yaxisshift{-4.6}
		\def\ybranchshift{0.05}
		\def\ticklength{0.2}
		\def\Pi{3.141592653589793}
		\def\ee{2.718281828459045}

		%% Draw z-axes
		\draw[->, thick] (-22, 0) -- (-12, 0) node[right] {$\re z = x$};
		\draw[->, thick] (-17, -5) -- (-17, 5) node[above] {$\im z = y$};
		%% Draw w-axes
		\draw[->, thick] (-5, 0) -- (5, 0)
			node[right] {$\re w = t$};
		\draw[->, thick] (0, -5) -- (0, 5) node[above] {$\im w$ = s};
		%% Draw Map Arrows
		\path[->, thick] (-11, 2.5) edge[bend left] node[auto] {$w = W(z)$} (-6, 2.5);
		\path[->, thick] (-6, -2.5) edge[bend left] node[auto] {$z = w e^w$} (-11, -2.5);

		%% Draw Branch Cut on z-axes
		\draw[very thick, red]
			(-22, {\ybranchshift}) -- ({-17-1/\ee}, {\ybranchshift});
		\draw[dashed, very thick, red]
			(-22, {-\ybranchshift}) -- ({-17-1/\ee}, {-\ybranchshift});

		%% Draw Branch Cut along negative Re w axis
		\draw[dashed, very thick, red] (-5, {\ybranchshift}) -- (-1, {\ybranchshift});
		\draw[very thick, red] (-5, {-\ybranchshift}) -- (-1, {-\ybranchshift});

		%% Draw w Branch Curves
		\draw[red,smooth, samples=100, domain=-2.65:-0.001, variable=\s, very thick]
			plot ({-\s / tan(deg(\s)) -0.05}, {\s} );

		\draw[dashed, red,smooth, samples=100, domain=0.001:2.65, variable=\s, very thick]
			plot ({-\s / tan(deg(\s)) -0.05}, {\s} );

		%% Label Regions
		\node at (2, 1) {$W_0$};
		\node at (-3, 2) {$W_1$};
		\node at (-3, -2) {$W_{-1}$};

		%% Draw im w tick marks
		\foreach \i in {-1, 1} {
			\draw[thick] ({\ticklength}, {\i * \Pi}) -- ({-\ticklength}, {\i * \Pi})
				node[left] {$\i \pi$};
		}

		%% Draw re w tick mark
		\draw[thick] (-1, \ticklength) -- (-1, -\ticklength) node[below left] {$-1$};
		% \node at (-1.6, -\ticklength-0.9) {$-1$};

		%% Draw re z tick mark
		\draw[thick] ({-17-1/\ee}, \ticklength) -- ({-17-1/\ee}, -\ticklength)
			node[below left] {$-\frac{1}{e}$};

	\end{tikzpicture}
	\caption{$W_0$ Branch Cut}
	\label{fig:ClosedOnTop}
\end{figure}

\begin{figure}[h!]
	\begin{tikzpicture}[scale=0.17]
		\def\xm{15}
		\def\ashift{1}
		\def\xmin{-\xm}
		\def\xmax{\xm+\ashift}
		\def\ym{11}
		\def\ymin{-\ym}
		\def\ymax{\ym+\ashift}
		\def\yaxisshift{-4.6}
		\def\xshift{51}
		\def\mapshift{3}
		\def\ybranchshift{0.1}
		\def\ticklength{0.5}
		\def\Pi{3.141592653589793}
		\def\ee{2.718281828459045}

		%% Draw z-axes
		\draw[->, thick] (\xmin-\xshift, 0) -- (\xmax-\xshift, 0)
			node[right] {$\re z = x$};
		\draw[->, thick] (-\xshift, \ymin) -- (-\xshift, \ymax)
			node[above] {$\im z = y$};

		%% Draw w-axes
		\draw[->, thick] (\xmin, 0) -- (\xmax, 0) node[right] {$\re w = t$};
		\draw[->, thick] (0, \ymin) -- (0, \ymax) node[above] {$\im w$ = s};

		%% Draw Map Arrows
		\path[->, thick] (\xmax-\xshift+\mapshift, \ym/2) edge[bend left]
			node[auto] {$w = W(z)$} (\xmin - \mapshift, \ym/2);
		\path[->, thick] (\xmin - \mapshift, -\ym/2) edge[bend left]
			node[auto] {$z = w e^w$} (\xmax-\xshift+\mapshift, -\ym/2);

		%% Draw Branch Cut on z-axes
		\draw[very thick, red]
			({\xmin-\xshift}, {\ybranchshift}) -- ({0-\xshift}, {\ybranchshift});
		\draw[dashed, very thick, red]
			({\xmin-\xshift}, {-\ybranchshift}) -- ({0-\xshift}, {-\ybranchshift});

		%% Draw the Branch Curves
		\draw[red,smooth, samples=200, domain=6.70346:8.88978, variable=\s, very thick]
			plot ({-\s / tan(deg(\s))}, {\s+\ybranchshift} );
		\draw[dashed, red,smooth, samples=200, domain=6.70346:8.88978, variable=\s, very thick]
			plot ({-\s / tan(deg(\s))}, {\s-\ybranchshift} );
		\draw[red,smooth, samples=200, domain=-8.88978:-6.70346, variable=\s, very thick]
			plot ({-\s / tan(deg(\s))}, {\s+\ybranchshift} );
		\draw[dashed, red,smooth, samples=200, domain=-8.88978:-6.70346, variable=\s, very thick]
			plot ({-\s / tan(deg(\s))}, {\s-\ybranchshift} );

		%% Draw im axis tiks
		\foreach \i in {-3, -2, -1, 1, 2, 3} {
			\draw[thick] ({\ticklength}, {\i * \Pi}) -- ({-\ticklength}, {\i * \Pi})
				node[left] {$\i \pi$};
		}

		%% Place Region Labels
		\node (W2) at ({-2*\xm/3}, {3*\Pi}) {$W_2$};
		\node (W-2) at ({-2*\xm/3}, {-3*\Pi}) {$W_{-2}$};

	\end{tikzpicture}
	\caption{$W_k$ ($k \ne 0$) Branch Cuts}
	\label{fig:OtherBranches}
\end{figure}

Corless {\em et al.} further argue in \cite{Corless1996} that each branch
$W_k : \CC \to \ran W_k$ is bijective, which allows us to solve equation
\eqref{eq1:EqnToSolve} and find
\[
	\xi = \frac{1}{2\delta} W_k\big( -2 \delta \zeta(\lambda) \big) + \zeta(\lambda), \qquad k \in \zeta.
\]
Consequently, the only roots of $p(\xi, \lambda)$ which could have a chance of living
in $\mc R_\delta$ are those corresponding to the $W_{-1}$, $W_0$, and $W_1$ branches.
Now, if $\xi = 0$, then
\[
	W_k\big( -2 \delta \zeta(\lambda) \big) = -2 \delta \zeta(\lambda).
\]
Since $\zeta$ is a positive, strictly increasing function with $\zeta(0) = 1/(2\delta)$,
if $\lambda < 0$, then $-1 < -2\delta \zeta(\lambda) < 0$, and if $\lambda \geq 0$, then
$-2 \delta \zeta(\lambda) \leq -1$. In other words, if $\lambda < 0$ the $\xi = 0$ root of $p$
corresponds to the $W_0$ branch, but if $\lambda \geq 0$, then it corresponds to the
$W_{-1}$ branch.

On the other hand, if $\xi = \lambda$, then
\[
	W_k\big( -2 \delta \zeta(\lambda) \big) = 2\delta \lambda -2 \delta \zeta(\lambda).
\]
Let $g(\lambda):= 2\delta \lambda -2 \delta \zeta(\lambda)$.
Note that
\begin{align*}
	\begin{cases}
		0 < \zeta'(\lambda) < \frac{1}{2}, & \text{for } \lambda < 0 \\
		\zeta'(0) = \frac{1}{2}, &  \\
		\frac{1}{2} < \zeta'(\lambda) < 1, & \text{for } \lambda > 0
	\end{cases}
\end{align*}
which implies $g$ is a strictly increasing function. Moreover, since
$\lim_{\lambda\to \infty} g(\lambda) = 0$ and $g(0) = -1$, we see that
\[
	\begin{cases}
		2\delta \lambda -2 \delta \zeta(\lambda)  < -1, & \lambda < 0 \\
		2\delta \lambda -2 \delta \zeta(\lambda) = -1, & \lambda = 0 \\
		-1 < 2\delta \lambda -2 \delta \zeta(\lambda) < 0, & \lambda > 0
	\end{cases}
\]
Therefore, if $\lambda < 0$ then the $\xi = \lambda$ zero of $p$ corresponds to the
$W_{-1}$ branch, but if $\lambda \geq 0$, it corresponds to the $W_{0}$. Moreover,
given that $-2\delta \zeta(\lambda)$ lies on the negative real axis and hence on the branch
cut used for $W_k$, $k \ne 0$, each value of
$2\delta\xi-2\delta\zeta(\lambda) = W_k\big(-2\delta\zeta(\lambda)\big)$ ($k \ne 0$) lies on the boundary
between the respective ranges of the $W$ branches. In particular, given that
the strip $\big\{ z ~:~ -2\pi \leq \im z \leq 2 \pi \big\}$ does not contain
any part of the boundary between $\ran W_{-2}$ and $\ran W_{-1}$ or any part
of the boundary between $\ran W_1$ and $\ran W_2$, this strip contains exactly
two values of $W\big(-2 \delta \zeta(\lambda) \big)$. Since
\[
	\mc R_\delta = \frac{1}{2\delta}\big\{ z ~:~ -2\pi \leq \im z \leq 2 \pi \big\}+\zeta(\lambda),
\]
the strip $\mc R\delta$ contains exactly two roots of $p$\textemdash{}precisely as claimed.

\end{document}


\chapter{The Definition of Groups}
\label{ch:the-definition-of-groups}
%% FIXME: \cite{Pinter2016}*{Chapter 3}

\begin{enumerate}[label={\Alph*.},font={\bfseries}]
\item {\bf Examples of Abelian Groups}
  \begin{enumerate}[label={\arabic*},font={\bfseries}]
  \item $\Group{\mathbb{R}, x*y=x+y+k}$
    \begin{enumerate}[label={(\roman*)}]
    \item $*$ is commutative:
      $x*y=x+y+k = y+x+k=y*x$
    \item $*$ is associative.
      \begin{alignat*}{3}
        & x(yz) &&= x(y+z+k) &&= x+y+z+2k \\
        & (xy)z &&= (x+y+k)z &&= (xy)z \\
        & x(yz) &&= (xy)z
      \end{alignat*}
    \item $\mathbb{R}$ has an identity element with respect to $*$.
      \begin{align*}
        xe &= x \\
        x+e+k &= x \\
        e &= -k \\
        (-k)x &= x \\
        -k+x+k &= x
      \end{align*}
    \item $\forall x\in\mathbb{R}(\exists x^\prime\in\mathbb{R}(x*x^\prime=-k))$
      \begin{alignat*}{3}
        xx^\prime &= -k \\
        x+x^\prime+k &= -k \\
        x^\prime &= -x-2k \\
        x^{\prime}x &= xx^\prime & \text{due to commutativity}
      \end{alignat*}
    \end{enumerate}
  \item $\Group{\mathbb{R}^*, x*y=\frac{xy}{2}}$
    \begin{enumerate}[label={(\roman*)}]
    \item $*$ is commutative:
      $x*y=\frac{xy}{2} = \frac{yx}{2}=y*x$
    \item $*$ is associative.
      \begin{alignat*}{3}
        x*(y*z) &= x*(\frac{yz}{2}) &= \frac{xyz}{4} \\
        (x*y)*z &= (\frac{xy}{2})*z &= \frac{xyz}{4}
      \end{alignat*}
    \item $\mathbb{R}^*$ has an identity element with respect to $*$.
      \begin{align*}
        x*e &= \frac{xe}{2} = \frac{ex}{2}=e*x = x \\
        e &= 2
      \end{align*}
    \item $\forall x\in\mathbb{R}(\exists x^\prime\in\mathbb{R}(x*x^\prime=2))$
      \begin{align*}
        x*x^\prime &= \frac{xx^\prime}{2} = \frac{x^{\prime}x}{2} = x^{\prime}*x = e = 2 \\
        x^\prime = \frac{4}{x}
      \end{align*}
    \end{enumerate}
  \item $\Group{\Set{x\in\mathbb{R} : x \neq -1}, x*y=x+y+xy}$
    \begin{enumerate}[label={(\roman*)}]
    \item $*$ is commutative: $x*y=x+y+xy = y+x+yx=y*x$
    \item $*$ is associative.
      \begin{alignat*}{3}
        x*(y*z) &= x*(y+z+yz) = x+(y+z+yz)+x(y+z+yz) &= x+y+z+xy+xz+yz+xyz \\
        (x*y)*z &= (x+y+xy)*z = (x+y+xy)+z+(x+y+xy)z &= x+y+z+xy+xz+yz+xyz
      \end{alignat*}
    \item $\Set{x\in\mathbb{R} : x \neq -1}$ has an identity element with respect to $*$.
      \begin{align*}
        x*e &= x+e+xe = e+x+ex = e*x = x \\
        e(x+1) &= 0 \\
        e &= 0
      \end{align*}
    \item Every element of $\Set{x\in\mathbb{R} : x \neq -1}$ has an inverse with respect to $*$.
      \begin{align*}
        x*x^\prime &= x+x^\prime+xx^\prime=x^\prime+x+x^{\prime}x = e = 0 \\
        x^{\prime}(x+1) &= -x \\
        x^\prime &= -\frac{x}{x+1}
      \end{align*}
    \end{enumerate}
  \item $\Group{\Set{x\in\mathbb{R} :-1 < x < 1}, x*y=\frac{x+y}{xy+1}}$
    \begin{enumerate}[label={(\roman*)}]
    \item $*$ is commutative: $x*y=\frac{x+y}{xy+1}=\frac{y+x}{yx+1}=y*x$
    \item $*$ is associative.
      \begin{alignat*}{4}
        x*(y*z) &= x*(\frac{y+z}{yz+1})
        &= \frac{x+(\frac{y+z}{yz+1})}{x(\frac{y+z}{yz+1})+1}
        &= \frac{xyz+x+y+z}{xy+xz+yz+1} \\
        (x*y)*z &= \frac{x+y}{xy+1}*z
        &= \frac{(\frac{x+y}{xy+1})+z}{(\frac{x+y}{xy+1})z+1}
        &= \frac{x+y+z+xyz}{xy+yz+xz+1}
      \end{alignat*}
    \item $\Set{x\in\mathbb{R} : -1 < x < 1}$ has an identity element w.r.t. $*$.
      \begin{align*}
        x*e &= \frac{x+e}{xe+1} = x \\
        x+e &= x(xe+1) \\
        e &= ex^2 \\
        e(1-x^2) &= 0 \\
        e &= 0 \\
        x*0 &= \frac{x+0}{(x\times0)+1} = x = \frac{0+x}{0x+1} = 0*x
      \end{align*}
    \item Every element of $\Set{x\in\mathbb{R} : -1 < x < 1}$ has an inverse with respect to $*$.
      \begin{align*}
        x * x^\prime &= \frac{x+x^\prime}{xx^\prime+1} = 0; \quad
        x+x^\prime = 0; \quad
        x^\prime = -x \\
        x*(-x) &= \frac{x-x}{x(-x)+1} = 0 = \frac{-x+x}{-x^2+1} = (-x)*x
      \end{align*}
    \end{enumerate}
  \end{enumerate}
\item {\bf Groups on the Set $\mathbb{R} \times \mathbb{R}$}
  \begin{enumerate}[label={\arabic*},font={\bfseries}]
  \item $(a,b) * (c,d) = (ad + bc, bd)$, on the set $\Set{(x,y)\in\mathbb{R}\times\mathbb{R} : y \ne 0}$
    \begin{enumerate}[label={(\roman*)}]
    \item $*$ is commutative.
      \begin{align*}
        (c,d) * (a,b) &= (cb+da,db) \\
        &= (ad+bc,bd) \\
        &= (a,b) * (c,d)
      \end{align*}
    \item $*$ is associative.
      \begin{align*}
        (a,b) * \left[(c,d) * (e,f)\right] &= (a,b) * (cf+de,df) \\
        &= (adf+bcf+bde,bdf) \\
        &= (ad+bc, bd) * (e,f) \\
        &= \left[(a,b) * (c,d)\right] * (e,f)
      \end{align*}
    \item $(e_1,e_2) = (0,1)$
      \begin{align*}
        (a,b) * (e_1,e_2) &= (ae_2 + be_1, be_2) \\
        &= (a,b) \\
        \\
        be_2 &= b \\
        e_2 &= 1 \\
        \\
        ae_2 + be_1 &= a \\
        a + be_1 &= a \\
        e_1 &= 0
      \end{align*}
    \item $(a^\prime,b^\prime) = \left(\frac{-a}{b^2}, \frac{1}{b}\right)$
      \begin{align*}
        (a,b) * (a^\prime,b^\prime) &= (ab^\prime + ba^\prime, bb^\prime) \\
        &= (0,1)
      \end{align*}
      \begin{align*}
        bb^\prime &= 1 \\
        b^\prime &= \frac{1}{b} \\
        \\
        ab^\prime + ba^\prime &= 0 \\
        \frac{a}{b} + ba^\prime &= 0 \\
        ba^\prime &= \frac{-a}{b} \\
        a^\prime &= \frac{-a}{b^2} \\
        \\
        (a,b) * \left(\frac{-a}{b^2}, \frac{1}{b}\right) &= \left(\frac{a}{b} + \frac{-a}{b}, b\left(\frac{1}{b}\right)\right) \\
        &= (0,1)
      \end{align*}
    \end{enumerate}
  \item $(a, b) * (c, d) = (ac, bc + d)$, on the set $\Set{(x,y)\in\mathbb{R}\times\mathbb{R} : x \ne 0}$
    \begin{enumerate}[label={(\roman*)}]
    \item $*$ is not commutative: $(c,d) * (a,b) = (ca, da + b) \ne (a,b) * (c,d)$
    \item $*$ is associative.
      \begin{align*}
        \left[(a,b) * (c,d)\right] * (e,f) &= (ac, bc+d) * (e,f) \\
        &= (ace, bce+de+f) \\
        &= (a,b) * (ce, de+f) \\
        &= (a,b) * \left[(c,d) * (e,f)\right]
      \end{align*}
    \item $(e_1,e_2) = (1,0)$
      \begin{align*}
        (a,b) * (e_1,e_2) &= (ae_1, be_1+e_2) \\
        &= (a, b) \\
        \\
        ae_1 &= a \\
        e_1 &= 1 \\
        \\
        be_1+e_2 &= b \\
        b+e_2 &= b \\
        e_2 &= 0
      \end{align*}
    \item $(a^\prime,b^\prime) = (\frac{1}{a},\frac{-b}{a})$
      \begin{align*}
        (a,b) * (a^\prime,b^\prime) &= (aa^\prime, ba^\prime + b^\prime) \\
        &= (1,0) \\
        \\
        aa^\prime &= 1 \\
        a^\prime &= \frac{1}{a} \\
        \\
        ba^\prime + b^\prime &= 0 \\
        \frac{b}{a} + b^\prime &= 0 \\
        b^\prime &= \frac{-b}{a}
        \\
        (a,b) * (\frac{1}{a}, \frac{-b}{a}) &= (\frac{a}{a}, \frac{b}{a} - \frac{b}{a}) \\
        &= (1,0)
      \end{align*}
    \end{enumerate}
  \item $(a, b) * (c, d) = (ac, bc + d)$, on the set $\Set{(x,y)\in\mathbb{R}\times\mathbb{R}}$
    \begin{enumerate}[label={(\roman*)}]
    \item $*$ is not commutative, as per 2(i).
    \item $*$ is associative, as per 2(ii).
    \item $(e_1,e_2) = (1,0)$, as per 2(iii).
    \item $a^\prime$ is not defined $\forall a\in\mathbb{R}$, notably when $a=0$.
    \end{enumerate}
  \item $(a, b) * (c, d) = (ac-bd,ad+bc)$, on the set $\Set{(x,y)\in(\mathbb{R}\times\mathbb{R})\setminus\Set{(0,0)}}$
    \begin{enumerate}[label={(\roman*)}]
    \item $*$ is commutative.
      \begin{align*}
        (c,d) * (a,b) &= (ca-db,cb+da) \\
        &= (ac-db,ad+bc) \\
        &= (a,b) * (c,d)
      \end{align*}
    \item $*$ is associative.
      \begin{align*}
        (a,b) * \left[(c,d) * (e,f)\right] &= (ac-bd,ad+bc) * (ce-df,cf+de) \\
        &= \left(a(ce-df) - b(cf+de), a(cf+de)+b(ce-df)\right) \\
        &= (ace-adf-bcf-bde, acf+ade+bce-bdf) \\
        &= \left(e(ac-bd)-f(ad+bc), f(ac-bd)+e(ad+bc)\right) \\
        &= (ac-bd,ad+bc) * (e,f) \\
        &= \left[(a,b) * (c,d)\right] * (e,f)
      \end{align*}
    \item $(e_1,e_2) = (?,?)$
      \begin{align*}
        (a,b) * (e_1,e_2) &= (ae_1-be_2,ae_2+be_1) \\
        &= (a,b) \\
        \\
        ae_2+be_1 &= b \\
        be_1 &= b - ae_2 \\
        e_1 &= 1 - \frac{ae_2}{b} \\
        \\
        ae_1-be_2 &= a \\
        -be_2 &= a-ae_1 \\
        be_2 &= ae_1-a \\
        e_2 &= \frac{ae_1-a}{b}
      \end{align*}
    \end{enumerate}
  \end{enumerate}
  \newpage
\item {\bf Groups of Subsets of a Subset}
  \begin{enumerate}[label={\arabic*},font={\bfseries}]
  \item The identity element with respect to the operation $+$ is $\emptyset$.
    \begin{align*}
      A+I &= (A-I) \cup (I-A) = A \\
      &= (A-\emptyset) \cup (I-\emptyset) \\
      \\
      I &= \emptyset
    \end{align*}
  \item $\Group{\powerset{D}, +}$ is a group, since
    $\forall A \in \powerset{D}, A\inverse = A$.
    \begin{align*}
      A+A\inverse &= \emptyset \\
      (A-A\inverse) \cup (A\inverse-A) &= \emptyset \\
      A-A\inverse &= A\inverse-A = \emptyset \\
      A\inverse &= A
    \end{align*}
  \item Let $D = \Set{a,b,c}$.
    \[
    \powerset{D} = \Set{
      \emptyset,
      \Set{a}, \Set{b}, \Set{c},
      \Set{a,b}, \Set{a,c}, \Set{b,c},
      \Set{a,b,c}
    }
    \]
    \begin{center}
      \captionof{table}{$\Group{\powerset{D}, +}$}
      \begin{tabular}{ c | c c c c c c c c}
        $+$ & $\emptyset$ & $\Set{a}$ & $\Set{b}$ & $\Set{c}$ & $\Set{a,b}$ & $\Set{a,c}$ & $\Set{b,c}$ & $\Set{a,b,c}$ \\
        \hline
        $\emptyset$ & $\emptyset$ & $\Set{a}$ & $\Set{b}$ & $\Set{c}$ & $\Set{a,b}$ & $\Set{a,c}$ & $\Set{b,c}$ & $\Set{a,b,c}$ \\
        $\Set{a}$ & $\Set{a}$ & $\emptyset$ & $\Set{a,b}$ & $\Set{a,c}$ & $\Set{b}$ & $\Set{c}$ & $\Set{a,b,c}$ & $\Set{b,c}$ \\
        $\Set{b}$ & $\Set{b}$ & $\Set{a,b}$ & $\emptyset$ & $\Set{b,c}$ & $\Set{a}$ & $\Set{a,b,c}$ & $\Set{c}$ & $\Set{a,c}$ \\
        $\Set{c}$ & $\Set{c}$ & $\Set{a,c}$ & $\Set{b,c}$ & $\emptyset$ & $\Set{a,b,c}$ & $\Set{a}$ & $\Set{b}$ & $\Set{a,b}$ \\
        $\Set{a,b}$ & $\Set{a,b}$ & $\Set{b}$ & $\Set{a}$ & $\Set{a,b,c}$ & $\emptyset$ & $\Set{b,c}$ & $\Set{a,c}$ & $\Set{c}$ \\
        $\Set{a,c}$ & $\Set{a,c}$ & $\Set{c}$ & $\Set{a,b,c}$ & $\Set{a}$ & $\Set{b,c}$ & $\emptyset$ & $\Set{a,b}$ & $\Set{b}$ \\
        $\Set{b,c}$ & $\Set{b,c}$ & $\Set{a,b,c}$ & $\Set{c}$ & $\Set{b}$ & $\Set{a,c}$ & $\Set{a,b}$ & $\emptyset$ & $\Set{a}$ \\
        $\Set{a,b,c}$ & $\Set{a,b,c}$ & $\Set{b,c}$ & $\Set{a,c}$ & $\Set{a,b}$ & $\Set{c}$ & $\Set{b}$ & $\Set{a}$ & $\emptyset$
      \end{tabular}
    \end{center}
  \end{enumerate}
\item {\bf A Checkerboard Game}
  \begin{center}
    \captionof{table}{$\Group{G, *}$}
    \begin{tabular}{ c | c c c c }
      $*$ & $I$ & $V$ & $H$ & $D$ \\
      \hline
      $I$ & $I$ & $V$ & $H$ & $D$ \\
      $V$ & $V$ & $I$ & $D$ & $H$ \\
      $H$ & $H$ & $D$ & $I$ & $V$ \\
      $D$ & $D$ & $H$ & $V$ & $I$
    \end{tabular}
  \end{center}
  As shown in the \gls{Cayley table} above, the identity element is $I$ and
  every element is its own inverse. Having shown that and granting
  associativity, $\Group{G, *}$ is a group.
\item {\bf A Coin Game}
  \begin{center}
    \captionof{table}{$\Group{G, *}$}
    \begin{tabular}{ c | c c c c c c c c }
      $*$ & $I$ & $M_1$ & $M_2$ & $M_3$ & $M_4$ & $M_5$ & $M_6$ & $M_7$ \\
      \hline
      $I$ & $I$ & $M_1$ & $M_2$ & $M_3$ & $M_4$ & $M_5$ & $M_6$ & $M_7$ \\
      $M_1$ & $M_1$ & $I$ & $M_3$ & $M_2$ & $M_5$ & $M_4$ & $M_7$ & $M_6$ \\
      $M_2$ & $M_2$ & $M_3$ & $I$ & $M_1$ & $M_6$ & $M_7$ & $M_4$ & $M_5$ \\
      $M_3$ & $M_3$ & $M_2$ & $M_1$ & $I$ & $M_7$ & $M_6$ & $M_5$ & $M_4$ \\
      $M_4$ & $M_4$ & $M_6$ & $M_5$ & $M_7$ & $I$ & $M_2$ & $M_1$ & $M_3$ \\
      $M_5$ & $M_5$ & $M_7$ & $M_4$ & $M_6$ & $M_1$ & $M_3$ & $I$ & $M_2$ \\
      $M_6$ & $M_6$ & $M_4$ & $M_7$ & $M_5$ & $M_2$ & $I$ & $M_3$ & $M_1$ \\
      $M_7$ & $M_7$ & $M_5$ & $M_6$ & $M_4$ & $M_3$ & $M_1$ & $M_2$ & $I$
    \end{tabular}
  \end{center}

  As shown in the \gls{Cayley table} above, the identity element is $I$ and
  every element is invertible. Having shown that and granting associativity,
  $\Group{G, *}$ is a group. It is not commutative, because, for example
  $M_6 * M_4 = M_2$, while $M_4 * M_6 = M_1$, so $M_6 * M_4 \ne M_4 * M_6$.
  \newpage
  \captionof{figure}{$\Group{r,s,t\ |\ r^2,s^2,t^2,(rs)^4,(st)^3,(rt)^2}$}
  \begin{figure}[h]
    \begin{tikzpicture}[line width=1pt]
      \node (I) at (0,4) { $I$ };
      \node (M3) at (4,0) { $M_3$ };
      \node (M5) at (3,3) { $M_5$ };
      \node (M6) at (1,1) { $M_6$ };
      \node (M7) at (3,1) { $M_7$ };

      \node[green] (M1) at (4,4) { $\mathbf{M_1}$ };
      \node[blue] (M2) at (0,0) { $\mathbf{M_2}$ };
      \node[red] (M4) at (1,3) { $\mathbf{M_4}$ };

      \draw[green] (I)  -- (M1)
                   (M1) -- (I)
                   (M2) -- (M3)
                   (M3) -- (M2)
                   (M4) -- (M6)
                   (M5) -- (M7)
                   (M6) -- (M4)
                   (M7) -- (M5);

      \draw[blue] (I)  -- (M2)
                  (M1) -- (M3)
                  (M2) -- (I)
                  (M3) -- (M1)
                  (M4) -- (M5)
                  (M5) -- (M4)
                  (M6) -- (M7)
                  (M7) -- (M6);

      \draw[red] (I)  -- (M4)
                 (M1) -- (M5)
                 (M2) -- (M6)
                 (M3) -- (M7)
                 (M4) -- (I)
                 (M5) -- (M1)
                 (M6) -- (M2)
                 (M7) -- (M3);
    \end{tikzpicture}
  \end{figure}
\item {\bf Groups in Binary Codes}
  \begin{enumerate}[label={\arabic*},font={\bfseries}]
  \item $\Seq{a_1,a_2,...,a_n} + \Seq{b_1,b_2,...,b_n} = \Seq{b_1,b_2,...,b_n} + \Seq{a_1,a_2,...,a_n}$,
    since the left-hand side is equivalent to $\Seq{a_1+b_1,a_2+b_2,...,a_n+b_n}$,
    which by commutativity is equivalent to $\Seq{b_1+a_1,b_2+a_2,...,b_n+a_n}$,
    which is equivalent to $\Seq{b_1,b_2,...,b_n} + \Seq{a_1,a_2,...,a_n}$.
  \item
    \begin{alignat*}{5}
      &1 + (1 + 1) &&= 1 + 0 &&= 1 &&= 0 + 1 &&= (1 + 1) + 1 \\
      &1 + (1 + 0) &&= 1 + 1 &&= 0 &&= 0 + 0 &&= (1 + 1) + 0 \\
      &1 + (0 + 1) &&= 1 + 1 &&= 0 &&= 1 + 1 &&= (1 + 0) + 1 \\
      &0 + (1 + 1) &&= 0 + 0 &&= 0 &&= 1 + 1 &&= (0 + 1) + 1 \\
      &1 + (0 + 0) &&= 1 + 0 &&= 1 &&= 1 + 0 &&= (1 + 0) + 0 \\
      &0 + (0 + 1) &&= 0 + 1 &&= 1 &&= 0 + 1 &&= (0 + 0) + 1 \\
      &0 + (1 + 0) &&= 0 + 1 &&= 1 &&= 1 + 0 &&= (0 + 1) + 0 \\
      &0 + (0 + 0) &&= 0 + 0 &&= 0 &&= 0 + 0 &&= (0 + 0) + 0
    \end{alignat*}
  \item
    \begin{align*}
      \Seq{a_1,a_2,...,a_n} + \left[\Seq{b_1,b_2,...,b_n} + \Seq{c_1,c_2,...,c_n}\right]
      &= \Seq{a_1,a_2,...,a_n} + \Seq{b_1+c_1,b_2+c_2,...,b_n+c_n} \\
      &= \Seq{a_1+b_1+c_1,a_2+b_2+c_2,...,a_n+b_n+c_n} \\
      &= \Seq{a_1+b_1,a_2+b_2,...,a_n+b_n} + \Seq{c_1,c_2,...,c_n} \\
      &= \left[\Seq{a_1,a_2,...,a_n} + \Seq{b_1,b_2,...,b_n}\right] + \Seq{c_1,c_2,...,c_n}
    \end{align*}
    \item The identity element of $\mathbb{B}^n$, that is, the identity element
      for adding words on length $n$, is $0^n$.
    \item The inverse, with respect to word addition, of any word
      $(a_1,...,a_n)$ is $(a_1,...,a_n)$.
    \item $\mathbf{a} + \mathbf{b} = \mathbf{a} + (-\mathbf{b})$,
      since $\mathbf{b} = -\mathbf{b}$.
      Thus $\mathbf{a} + \mathbf{b} = \mathbf{a} - \mathbf{b}$.
    \item
      \begin{align*}
        \mathbf{a} + \mathbf{b} &= \mathbf{c} \\
        \mathbf{a} + (-\mathbf{b}) &= \mathbf{c} \\
        \mathbf{a} - \mathbf{b} &= \mathbf{c} \\
        \mathbf{a} &= \mathbf{b} + \mathbf{c}
      \end{align*}
  \end{enumerate}
  \newpage
\item {\bf Theory of Coding: Maximum-Likelihood Decoding}
  \begin{enumerate}[label={\arabic*},font={\bfseries}]
  \item
    \begin{center}
      \captionof{table}{Parity check equations in $C_1$}
      \begin{tabular}{ c | c c c c c c c }
        $C_1$ & $a_4$ & $a_1+a_3$ & $a_4=a_1+a_3$ & $a_5$ & $a_1+a_2+a_3$ & $a_5=a_1+a_2+a_3$ \\
        \hline
        $00000$ & $0$ & $0+0$ & \checkmark & $0$ & $0+0+0$ & \checkmark \\
        $00111$ & $1$ & $0+1$ & \checkmark & $1$ & $0+0+1$ & \checkmark \\
        $01001$ & $0$ & $0+0$ & \checkmark & $1$ & $0+1+0$ & \checkmark \\
        $01110$ & $1$ & $0+1$ & \checkmark & $0$ & $0+1+1$ & \checkmark \\
        $10011$ & $1$ & $1+0$ & \checkmark & $1$ & $1+0+0$ & \checkmark \\
        $10100$ & $0$ & $1+1$ & \checkmark & $0$ & $1+0+1$ & \checkmark \\
        $11010$ & $1$ & $1+0$ & \checkmark & $0$ & $1+1+0$ & \checkmark \\
        $11101$ & $0$ & $1+1$ & \checkmark & $1$ & $1+1+1$ & \checkmark
      \end{tabular}
    \end{center}
  \item
    \begin{enumerate}[label={(\alph*)}]
    \item
      \[
      C_2 = \Set{
        000000,
        001001,
        010111,
        011110,
        100011,
        101010,
        110000,
        111101
      }
      \]
    \item
      \begin{center}
        \captionof{table}{Distance in $C_2$}
        \begin{tabular}{ c | c c c c c c c c }
          $d(\mathbf{a}, \mathbf{b})$ & 000000 & 001001 & 010111 & 011110 & 100011 & 101010 & 110000 & 111101 \\
          \hline
          000000 &   & 2 & 4 & 4 & 3 & 3 & 2 & 5 \\
          001001 & 2 &  & 4 & 4 & 3 & 3 & 4 & 3 \\
          010111 & 4 & 4 &   & 2 & 3 & 5 & 4 & 3 \\
          011110 & 4 & 4 & 2 &   & 5 & 3 & 4 & 3 \\
          100011 & 3 & 3 & 3 & 5 &   & 2 & 3 & 4 \\
          101010 & 3 & 3 & 5 & 3 & 2 &   & 3 & 4 \\
          110000 & 2 & 4 & 4 & 4 & 3 & 3 &   & 3 \\
          111101 & 5 & 3 & 3 & 3 & 4 & 4 & 3 &
        \end{tabular}
      \end{center}
      The minimum distance of the code $C_2$ is $2$.
      \item Since the minimum distance is $C_2$, one error is sure to be
        detected in any codeword of $C_2$.
    \end{enumerate}
  \item $C_3 = \Set{0000,0101,1011,1110}$ where $a_3 = a_1$ and $a_4 = a_1+a_2$.
    \begin{center}
      \captionof{table}{Distance in $C_3$}
      \begin{tabular}{ c | c c c c }
        $d(\mathbf{a}, \mathbf{b})$ & 0000 & 0101 & 1011 & 1110 \\
        \hline
        0000 & 0 & 2 & 3 & 3 \\
        0101 & 2 & 0 & 3 & 3 \\
        1011 & 3 & 3 & 0 & 2 \\
        1110 & 3 & 3 & 2 & 0
      \end{tabular}
      \end{center}
    $$\min_{\mathbf{a} \in C_3, \mathbf{a}\ne\mathbf{b}} d(\mathbf{a}, \mathbf{b}) = 2$$
  \item
    \begin{itemize}
    \item $11111 \to 11101$
    \item $00101 \to 00111$
    \item $11000 \to 11010$
    \item $10011 \to 10011$
    \item $10001 \to 10011$
    \item $10111 \to 10011\ or\ 00111$
    \end{itemize}
  \end{enumerate}
\end{enumerate}


\documentclass{article}
\usepackage{amsmath}
\usepackage[margin=1.0in]{geometry}
\usepackage{xcolor}

\begin{document}

\noindent
Does $\displaystyle \sum_{n=1}^\infty \frac{n^2+1}{n^4+7}$
diverge, converge absolutely, or converge conditionally?

\subsection*{Solution 1}

$\displaystyle \sum_{n=1}^\infty \frac1{n^2}$ is a $p$-series with $p=2$. Since $p > 1$, the series $\displaystyle \sum_{n=1}^\infty \frac1{n^2}$ converges by the $p$-series test. If we use $a_n = \frac{n^2+1}{n^4+7}$ and $b_n = \frac1{n^2}$, then
\begin{align*}
\lim_{n \to \infty} \frac{a_n}{b_n}
&= \lim_{n \to \infty} \frac{n^2+1}{n^4+7} \cdot \frac{n^2}{1}\\
&= \lim_{n \to \infty} \frac{n^4+n^2}{n^4+7} \\
&= \lim_{n \to \infty} \frac{4n^3+2n}{4n^3} \text{ using L'hopital}\\
&= \lim_{n \to \infty} \frac{12n^2+2}{12n^2} \text{ using L'hopital}\\
&= \lim_{n \to \infty} \frac{24n}{24n} \text{ using L'hopital}\\
&= \lim_{n \to \infty} 1\\
&= 1
\end{align*}
So by the Limit Comparison Test, the series $\displaystyle \sum_{n=1}^\infty \frac{n^2+1}{n^4+7}$ converges.
Since $\sum |a_n| = \sum a_n$, the series $\displaystyle \sum_{n=1}^\infty \frac{n^2+1}{n^4+7}$ converges absolutely.

\subsection*{Solution 2}

We are looking for a fixed $K > 0$ such that
\[ \frac{n^2+1}{n^4+7} \leq \frac{K}{n^2}\]
By multiplying both sides by $n^2(n^4+7)$, we have
\[ n^4+n^2 \leq K(n^4+7)\]
\[ n^4+n^2 \leq Kn^4+7K\]
and it appears we can use $K=2$, because then we'd have
\[ n^4+n^2 \leq 2n^4+14\]
\[ n^4+n^2 \leq n^4+n^4+14\]
and $n^2 \leq n^4$ (when comparing second terms).
So we are ready to present starting from true inequalities.

With the scratch work above done, since $n^2 \leq n^4$, we have
\[ n^4+n^2 \leq n^4+n^4+14\]
\[ n^4+n^2 \leq 2n^4+14\]
\[ n^4+n^2 \leq 2(n^4+7)\]
by dividing both sides by $n^2(n^4+7)$, we get
\[ \frac{n^2+1}{n^4+7} \leq \frac{2}{n^2}\]

Since $\displaystyle \sum_{n=1}^\infty \frac2{n^2} = 2\sum_{n=1}^\infty \frac1{n^2}$ converges by the $p$-test, the series
$\displaystyle \sum_{n=1}^\infty \frac{n^2+1}{n^4+7}$ converges by the Direct Comparison Test.
Since $\sum |a_n| = \sum a_n$, the series $\displaystyle \sum_{n=1}^\infty \frac{n^2+1}{n^4+7}$ converges absolutely.

\end{document}%%%%%%%%%%%%%%%%%

\begin{align*}
L&=\lim_{n \to \infty} \sqrt[n]{|a_n|}\\
&= \lim_{n \to \infty} \sqrt[n]{\left| \right|}\\
\end{align*}

\begin{align*}
L&=\lim_{n \to \infty} \left|\frac{a_{n+1}}{a_n}\right|\\
&= \lim_{n \to \infty} \left| \right|\\
\end{align*}

\begin{align*}
\lim_{n \to \infty} a_n
&= \lim_{n \to \infty} \\
\end{align*}

Since $\sum |a_n| = \sum a_n$, the series $\displaystyle \sum_{n=1}^\infty AAAAAAAAAAAAAA$ converges absolutely.

Since $|r| < 1$, the series ...  converges by the Geometric Series Test.

Since $|r| \geq 1$, the series ...  diverges by the Geometric Series Test.

The function $f(x)=\frac{}{}$ is continuous, positive, and decreasing on $[1,\infty)$.

\subsection*{Solution}


\documentclass{article}

\usepackage{fullpage}
\usepackage{amsmath,amssymb}

\setlength{\parindent}{0pt}

\begin{document}

\section*{The Birthday Problem}

\textsc{Q: What is the probability that, in a group of $n$ people, at least 2 have the same birthday?}\\[1em]
Let us represent the days of the year by the integers 1, 2, \ldots, 365. Then we choose our sample space $\textsl{S}$ to be \{all possible combinations of $n$ birthdays\}. That is, we include all possible combinations of $n$ days, with repetition (up to $n$ repetitions of the same day, where all $n$ birthdays fall on the same day).\\[1ex]
For example, if $n=3$, we include:
\begin{itemize}
\item all the single days of the year (eg. (1, 1, 1), (2, 2, 2), (3, 3, 3), \ldots), in the case that all 3 birthdays fall on the same day,
\item all combinations of 2 different days of the year (eg. (1, 1, 2), (1, 1, 3), (1, 1, 4), \ldots), in the case that 2 of the birthdays fall on the same day, and
\item all combinations of 3 different days of the year (eg. (1, 2, 3), (1, 2, 4), (1, 2, 5), \ldots), in the case that all 3 birthdays fall on different days
\end{itemize}
Suppose that all birthdays are equally likely. Then, by the classical definition of probability,
\begin{equation*}
\boxed{
P(\{\text{at least 2 people share a birthday}\})=\dfrac{|\{\text{at least 2\ldots}\}|}{|\textsl{S}|}
}
\end{equation*}
We know from counting principles that
\begin{align*}
|\textsl{S}|& =\text{\# of ways to select the first birthday $\times$ \# of ways to select the second birthday}\\
& \quad\times\ldots\times\text{\# of ways to select the $n$th birthday}\\
& =365\times 365\times\ldots\times 365\\
& =365^n
\end{align*}
and that
\begin{align*}
|\{\text{at least 2\ldots}\}|& =\text{\# of arrangements of $n$ birthdays where 2 people share a birthday}\\
& \quad+\text{\# of arrangements of $n$ birthdays where 3 people share a birthday}\\
& \quad+\ldots+\text{\# of arrangements of $n$ birthdays where $n$ people share a birthday}
\end{align*}
So
\begin{equation*}
\boxed{
P(\{\text{at least 2 people share a birthday}\})=\dfrac{|\{\text{2 people share a birthday}\}|+\ldots+|\{\text{$n$ people share a birthday}\}|}{365^n}
}
\end{equation*}
Then we consider that
\begin{align*}
\text{\# of arrangements of $n$ birthdays}& \\
\text{where $r$ people share a birthday}& =\text{\# of ways to select the first unshared birthday}\\
& \quad\times\text{\# of ways to select the second unshared birthday}\\
& \quad\times\ldots\times\text{\# of ways to select the $(n-r)$th unshared birthday}\\
& \quad\times \text{\# of ways to select the shared birthday}\\
& \quad\times \text{\# of ways to arrange $n-r$ different birthdays and $r$ same birthdays}\\
& =365\times 364\times\ldots\times(365-(n-r-1))\times(365-(n-r))\times \dfrac{n!}{r!1!\ldots 1!}
\end{align*}
For example, if $n=3$,
\begin{align*}
\text{\# of arr. where 2 people share a birthday}& =\text{\# of ways to select the unshared birthday}\\
& \quad\times \text{\# of ways to select the shared birthday}\\
& \quad\times\text{\# of ways to arrange 1 unique birthday and 2 same birthdays}\\
& =365\times 364\times \frac{3!}{2!1!}\\
& =398\,580
\end{align*}
and then
\begin{align*}
P(\{\text{at least 2 people share a birthday}\})&=\dfrac{|\{\text{2 people share a birthday}\}|+|\{\text{3 people share a birthday}\}|}{365^3}\\
& =\dfrac{398\,580+365}{365^3}\\
& =\dfrac{398\,945}{365^3}
\end{align*}
%\textsc{In general,}
%\begin{align*}
%|\{\text{at least 2\ldots}\}|& =(365\times 364\times\ldots\times(365-(n-2-1))\times(365-(n-2)))\times \dfrac{n!}{2!1!\ldots 1!}\\
%& \quad+(365\times 364\times\ldots\times(365-(n-3-1))\times(365-(n-3)))\times\dfrac{n!}{3!1!\ldots 1!}\\
%& \quad+\ldots+365\\
%& =\sum\limits_{i=2}^n \left(\dfrac{n!}{i!}\prod\limits_{j=i}^{n}(365-(n-j))\right)
%\end{align*}
%and so
%\begin{equation*}
%\boxed{
%P(\{\text{at least 2 people share a birthday}\})=\dfrac{\sum\limits_{i=2}^n \left(\dfrac{n!}{i!}\prod\limits_{j=i}^{n}(365-(n-j))\right)}{365^n}
%}
%\end{equation*}
\textsc{However}, this seems very laborious to compute, particularly if $n$ is large.\\
We can instead use the complement rule to determine that
\begin{equation*}
\boxed{\begin{split}
P(\{\text{at least 2 people share a birthday}\})& =1-P(\{\overline{\text{at least 2 people share a birthday}}\})\\
& =1-P(\{\text{no shared birthdays}\})\\
& =1-\dfrac{\text{\# of ways to select $n$ unshared birthdays}}{365^n}\\
& =1-\dfrac{365\times 364\times\ldots\times(365-n+1)}{365^n}
\end{split}}
\end{equation*}
For example, if $n=3$,
\begin{align*}
P(\{\text{at least 2 people share a birthday}\})
& =1-\dfrac{\text{\# of ways to select 3 unshared birthdays}}{365^n}\\
& =1-\dfrac{365\times 364\times 363}{365^3}\\
& =1-\dfrac{48\,228\,180}{365^3}\\
& =\dfrac{398\,945}{365^3}
\end{align*}
\textsc{Notice} that, if $n>365$, the above calculation produces
\begin{align*}
P(\{\text{at least 2\ldots}\})& =1-\dfrac{365\times(365-1)\times\ldots\times(365-364)\times(365-365)\times\ldots\times(365-n+1)}{365^n}\\
& =1-\dfrac{365\times\ldots\times 0\times\ldots\times(365-n+1)}{365^n}\\
& =1-\dfrac{0}{365^n}\\
& =1-0=1
\end{align*}
Why does this make sense?\\[1ex]
By the pigeonhole principle, if we have $n$ objects to place in fewer than $n$ pigeonholes, at least 1 pigeonhole will contain multiple objects. In this case, if there are more than 365 birthdays to distribute over 365 days, at least 2 birthdays will fall on the same day. Thus, the probability of at least 2 people sharing a birthday is 1, or absolutely certain.\\[1ex]
\textsc{Note} that this counting method counts \textit{ordered} $n$-tuples: for example, where $n=3$, we consider (1, 1, 2) and (1, 2, 1) to be different combinations of birthdays.\\
If we were to instead consider unordered $n$-tuples, we could not use the classical definition of probability, since not all outcomes would be equally likely. For example, where $n=3$, the unordered combination (1, 1, 2) is more likely than the unordered combination (1, 2, 3), since there are more ways in which the former can occur.

\end{document}


\section{Adjoints of bounded operators}
\label{sec:adjoints-bounded-operators}

\para
Throughout this section, $\hilbertH$ stands for a Hilbert space over the
field $\fldK$ of real or complex numbers.
Let $A \in \blinOps (\hilbertH)$ that is let
$A:\hilbertH \rightarrow \hilbertH$ be linear and bounded. Then the map
\[
 b_A : \hilbertH \times \hilbertH \to \fldK, \: (v,w) \mapsto \inprod{v, Aw}
\]
is sesquilinear and bounded with norm
\[
\norm{b_A} = \sup \big\{ \left| b_A(v,w)\right| \bigmid
   v,w\in \hilbertH \:\&\: \norm{w}=\norm{v}=1 \big\} =
                \norm{A} \ .
\]
By \Cref{thm:correspondence-bounded-sesquilinear-forms-bounded-operators}
to the Riesz representation theorem there exists a unique element
$A^* \in \blinOps(\hilbertH)$ such that
\[
 b_A (v,w) = \inprod{A^* v, w} \quad
 \text{for all } v,w \in \hilbertH \ .
\]
This operator satisfies $\norm{A^*}= \norm{b_A} = \norm{A}$.
\begin{definition}
The unique operator $A^*\in \blinOps (\hilbertH)$ associated to some
$A\in \blinOps(\hilbertH)$ such that
\[
 \inprod{v,Aw} = \inprod{A^* v, w} \quad
 \text{for all } v,w \in \hilbertH
\]
is called the \emph{adjoint} of $A$.
\end{definition}

\begin{proposition}
If $A \in \blinOps (\hilbertH)$, then so is its adjoint $A^* \in \blinOps (\hilbertH)$.
\end{proposition}

\begin{proof}
First we show that $A^*$ is linear. Given $v, w, w' \in H$, we compute
\begin{align*}
\inprod{v, A^*(w + w')} &= \mu_{A, w+w'}(v) = \inprod{Av, w + w'} = \inprod{Av, w} + \inprod{Av, w'}\\
&= \mu_{A, w}(v) + \mu_{A, w'}(v) = \inprod{v, A^*w} + \inprod{v, A^*w'} = \inprod{v, A^*w + A^*w'}
\end{align*}
Since this is true for all $v \in H$, this implies that $A^*(w+w') = A^*w'$.  Furthermore, given $\lambda \in \fldK$, we have
\begin{align*}
\inprod{v, A^*(\lambda w)} &= \mu_{A, \lambda w}(v) = \inprod{Av, \lambda w} = \widebar \lambda \inprod{Av, w}\\
&= \widebar \lambda \mu_{A, w}(v) = \widebar \lambda \inprod{v, A^* w} = \inprod{v, \lambda A^*w}.
\end{align*}
Again, since this is true for all $v \in H$, we know $A^*(\lambda w) = \lambda A^*w$. This proves that $A^*$ is linear.

It remains to show that $A^*$ is bounded. We know
\[
\norm{A^*} = \sup_{\norm{v} = \norm{w} = 1} \abs{\inprod{v, A^* w}} = \sup_{\norm{v} = \norm{w} = 1} \abs{\inprod{w, Av}} = \norm{A} < \infty,
\]
which is what we wanted to show. Note that $\norm{A^*} = \norm{A}$.
\end{proof}

We leave it as an exercise to show that
\[
\norm{A} = \sup_{\norm{v} = \norm{w} = 1} \abs{\inprod{v, Aw}}
\]
for all $A \in \linOps (\hilbertH)$, as was used in the above proof.

\begin{definition}
An operator $A \in \linOps (\hilbertH)$ is called \emph{self-adjoint} if $A = A^*$, \emph{unitary} if $A^* = A^{-1}$, and \emph{normal} if $[A, A^*] = AA^* - A^*A = 0$.
\end{definition}

We note that self-adjoint and unitary operators are always normal, but normal operators do not have to be self-adjoint or unitary. In the remainder of these notes, we gather several results on self-adjoint and normal operators.

\begin{lemma}
An operator $A \in \linOps (\hilbertH)$ is self-adjoint if and only if $\inprod{Av, v} \in \R$ for all $v \in H$.
\end{lemma}

\begin{proof}
$\Rightarrow$) If $A$ is self-adjoint, then
\[
\inprod{Av, v} = \mu_{A,v}(v) = \inprod{v, A^*v} = \inprod{v, Av} = \overline{\inprod{Av,v}},
\]
which implies that $\inprod{Av,v} \in \R$.

$\Leftarrow$) Suppose that $\inprod{Av, v} \in \R$ for all $v \in H$. We know
\begin{align*}
\inprod{A(v+w), v+w} = \inprod{Av, v} + \inprod{Av, w} + \inprod{Aw, v} + \inprod{Aw, w}. \tag{$*$}
\end{align*}
By assumption, $\inprod{A(v+w), v+w}$, $\inprod{Av, v}$, and $\inprod{Aw, w}$ are all real. This implies that $\inprod{Av, w} + \inprod{Aw, v}$ is real as well, so
\[
\Im \inprod{Av, w} = -\Im \inprod{Aw, v}= \Im \inprod{v, Aw}.
\]
Since this holds for all $w \in H$, it holds for $iw$ as well. Thus,
\[
\Re \inprod{Av, w} = \Im \inprod{Av, -iw} = \Im \inprod{v, A(-iw)} = \Im i\inprod{v, Aw} = \Re \inprod{v, Aw}.
\]
Combining the above two lines yields $\inprod{Av, w} = \inprod{v, Aw}$ for all $v, w \in H$. Since the adjoint satisfies $\inprod{Av, w} = \inprod{v, A^*w}$, this implies that $A = A^*$.
\end{proof}

\begin{proposition}
If $A \in \linOps (\hilbertH)$ and $\inprod{Av, v} = 0$ for all $v \in H$, then $A = 0$.
\end{proposition}

\begin{proof}
Since $\inprod{Av, v} = 0$ for all $v \in H$, equation ($*$) from Lemma 4 reduces to
\[
\inprod{Av, w} = -\inprod{Aw, v} = -\inprod{w, Av} = -\overline{\inprod{Av, w}} \quad \text{for all } v, w \in H \ ,
\]
i.e.\ $\inprod{Av,w}$ has no real part for all $v, w \in H$. But then fixing $v$ and setting $w = Av$ implies $\norm{Av}^2 = 0$ for all $v \in H$, so $A = 0$.
\end{proof}

\begin{proposition}
If $A \in \linOps (\hilbertH)$ is self-adjoint, then
\[
\norm{A} = \sup_{\norm{v} = 1} \abs{\inprod{Av, v}}.
\]
\end{proposition}

\begin{proof}
We know
\[
\norm{A} = \sup_{\norm{v} = \norm{w} = 1} \abs{\inprod{Av, w}},
\]
so we clearly have
\[
\sup_{\norm{v} = 1} \abs{\inprod{Av, v}} \leq \norm{A}.
\]
%I'M NOT SURE HOW TO PROVE THE OTHER DIRECTION.
\end{proof}

\begin{proposition}
If $A \in \linOps (\hilbertH)$, then $A^*A$ is self-adjoint and $\norm{A^*A} = \norm{A}^2$.
\end{proposition}

\begin{proof}
For arbitrary $v \in H$, we have
\[
\inprod{A^*Av, v} = \inprod{Av, Av} = \norm{Av}^2 \in \R,
\]
so $A^*A$ is self-adjoint by Lemma 4. By Proposition 6,
\[
\norm{A^*A} = \sup_{\norm{v} = 1} \abs{\inprod{A^*Av, v}}  = \sup_{\norm{v} = 1} \norm{Av}^2 = \norm{A}^2.
\]
\end{proof}

\begin{proposition}
If $A \in \linOps (\hilbertH)$, then there exist $B,C \in \linOps (\hilbertH)$ self-adjoint such that $A = B+iC$. Furthermore, $A$ is normal if and only if $[B,C] = 0$.
\end{proposition}

\begin{proof}
We define
\[
B = \frac{1}{2}(A + A^*) \quad \text{ and } \quad C = \frac{i}{2}(A^* - A).
\]
Clearly $A = B + iC$. Note also that $A^* = B - iC$. Furthermore, for all $v \in H$
\begin{align*}
\inprod{Bv, v} = \frac{1}{2} \inprod{Av, v} + \frac{1}{2}\inprod{A^*v, v} = \frac{1}{2}\inprod{Av, v} + \frac{1}{2}\overline{\inprod{Av, v}} \in \R
\end{align*}
and
\begin{align*}
\inprod{Cv, v} = \frac{i}{2}\inprod{A^*v, v} - \frac{i}{2}\inprod{Av, v} = \frac{i}{2}\overline{\inprod{Av, v}} - \frac{i}{2}\inprod{Av, v} \in \R
\end{align*}
This implies that $B$ and $C$ are self-adjoint by Lemma 4.

Finally, we compute
\begin{align*}
[A, A^*] = [B + iC, B-iC] = -i[B, C] + i[C,B] = -2i[B,C],
\end{align*}
Clearly $A$ is normal if and only if $[B,C] = 0$.
\end{proof}

\begin{proposition}
If $A$ is normal, then $\norm{Av} = \norm{A^*v}$ for all $v \in H$.
\end{proposition}

\begin{proof}
Using the fact that $A^*A = AA^*$, we compute
\begin{align*}
\norm{Av}^2 = \inprod{Av, Av} = \inprod{v, A^*Av} = \inprod{v, AA^*v} = \inprod{A^*v, A^*v} = \norm{A^*v}^2.
\end{align*}
Taking a square root yields the desired result.
\end{proof}