\documentclass[12pt,fleqn]{article}
\usepackage{mathtools}
\usepackage{amsmath}

\begin{document}
% \setlength{\mathindent}{0pt}
\section{Distributions}
\subsection{how to tell between the distributions?}

generallly counting processes are discrete (how many coin flips)

amount of time, speed, height, continuous/interval processes are continuous. measured using an interval (you dont go from 500kph to 501 kph without passing through 500.5 kph)

\subsection{Geometric}
Discrete

"how many flips until first success"

$E[k, p] = \dfrac{1-p}{p}$ or $\dfrac{1}{p}$

$\sigma = \dfrac{1-p}{p^2}$

\subsubsection{PMF}
$Geo(k, p) = (1-p)^{k-1}p$

\subsection{Bernoulli}
\subsection{Binomial}
Discrete

\begin{align*}
	E[x] = np\\
	Var(x) = np(1-p)
\end{align*}

\subsubsection{PMF}
$bin(x=k,n,p) = {N\choose k} p^k(1-p)^n-k$

assumes resilts are independent and identically distributed

\subsection{Negative Binomial}
\subsection{Poisson}
Discrete

mean arrival rate ($\mu$) is usually given

$\sigma = \sqrt{\mu}$

\subsubsection{PDF}
$p_x(k;\mu) = p(X=k; \mu) = \dfrac{e^{-\mu}\mu^k}{k!}$, for $k = 0,1,2...$
\subsection{Uniform}

\begin{align*}
	f(x) &= \dfrac{1}{(b-a)}, \text{for $a \le x \le b$}\\
	f(x) &= 0, \text{for any single $x$}\\
	E[x] &= \dfrac{(b-a)}{2}\\
	Var(x) &=\dfrac{(b-a)^2}{12}
\end{align*}

\subsection{Normal}

median is $\mu$

\begin{align*}
	\mu_{discrete} &= \sum_{x \in D} x p(x)\\
	E[x]_{discrete} &= \sum_{x \in D} h(x) p(x)\\
	\mu_{continuous} &= \int_{-\infty}^{\infty} x f(x) dx\\
	E[x]_{continuous} &= \int_{-\infty}^{\infty} h(x) f(x) dx
\end{align*}

\subsubsection{PDF}
$f(x) = \dfrac{1}{\sigma\sqrt{2\pi}}e^{(\dfrac{-(x-\mu)^2}{2\sigma^2})}$
\subsubsection{CDF}
$F(x) = $

\subsubsection{Standardizing}
a random variable following the standard normal distribution $\Phi$ has $\mu = 0$ and $\sigma = 1$ and is often represented by the letter $Z$.

This can be converted to/from a non-standard normal using these formulas:

$Z = \dfrac{X-\mu}{\sigma}$

$X = (Z \sigma) + \mu$

\subsection{Exponential}

$
f(x)=\begin{cases}
\lambda e^{-\lambda x}, & \text{for $x\ge0$}.\\
0, & \text{for $x<0$}.
\end{cases}
$

$ F(x)=1-e^{-\lambda x} $

\subsection{Weibull}

$\alpha$ - shape
$\beta$ - scale

$E[X] = \beta\Gamma(1+\dfrac{1}{\alpha})$
$Var(X) = \beta^2[\Gamma(1+\dfrac{2}{\alpha})-[\Gamma(1+\dfrac{1}{\alpha})]^2]$

\subsubsection{PDF}

$
f(x)=\begin{cases}
\dfrac{\alpha}{\beta^\alpha}x^{\alpha-1}e^{-(x/\beta)^\alpha}, & \text{for $x\ge0$}.\\
0, & \text{for $x<0$}.
\end{cases}
$

\subsubsection{CDF}

$
f(x)=\begin{cases}
1-e^{-(x-\beta)^\alpha}, & \text{for $x\ge0$}.\\
0, & \text{for $x<0$}.
\end{cases}
$

\subsection{Gamma}

$\Gamma(n)$ known as "standard gamma"

for any $\alpha > 1$:
\begin{itemize}
	\item ? (missed this in notes)
	\item for any positive integer n $\Gamma(n) = (n-1)!$
	\item $\Gamma(1/2) = \sqrt{\pi}$
\end{itemize}

\subsubsection{PDF}

nonstandard gamma
$f(x;\alpha, \beta) = \dfrac{x^{\alpha-1}e^{\dfrac{-x}{\beta}}}{\beta^\alpha \int_0^\infty x^{\alpha-1}e^{-x}dx}$

standard gamma ($\beta=1$)
$\Gamma(x; \alpha) = \int_0^\infty x^{\alpha-1}e^{-x}dx$

\subsection{Sample Means}

$\sigma$ - Population standard deviation

$\mu$ - Population mean

$\overline{X}$ - Sample mean

$T_0$ - Sample total

\begin{align*}
T_0 &= n\mu\\
Var(T_0) &= \sqrt{n\sigma}
\end{align*}

\end{document}


\subsection{The bit}

A single bit can store a binary piece of information. We can use it to distinguish between two states.

These two states could be represented by True \(T\) and False \(F\), but by convention we use \(1\) and \(0\).

We can combine bits to store more complex pieces of information. If we have \(n\) bits, we can distinguish between \(2^n\) states.

Eight bits together constitute a byte. This can represent one of \(2^8=256\) states.


\Lecture{Jayalal Sarma}{Nov 23, 2020}{34}{Extremal Set Theory}{Mohit Singla}{$\alpha$}{JS}
\section{Recall Sperner Theorem}
\begin{theorem}
Let $F$ be the family of subsets of $[n]$ $|$ $\forall$ $A,B \in F$, $A \nsubseteq B$.
$$|F| \le {n\choose{n/2}}$$
The size is the width of subset boolean poset.
\begin{proof}
\textbf{Tightness:-} The bound is tight as we have example $F=\{A\subseteq [n] \mid \left |A\right |=n/2\}$\\\\
 A permutation $\pi \in S_n$ is said to meet $A \subseteq \{1,2,\ldots,n\}$ if $A$ forms prefix of $\pi$. Let's say $|A| = k$ then $\pi$ said to meet $A$ if $A = \{\pi(1),\pi(2),\ldots,\pi(k)\}$.\\\\
Consider each subset in $F$ and consider permutations meeting them, As we are taking subsets from $F$, they are incomparable. Hence a single permutation can not meet both $A$ and $B$. So,
$$\sum_{A\in F} \bigg|\{\pi | \pi ~meets~ A\}\bigg| \leq n!$$\\
Now number of permutations that can meet set $A$ of size $k$ is $k! \times (n-k)!$.So,
$$\sum_{A\in F} |A|! \times (n-|A|)! ~~~\leq~~~ n!$$
$$\boxed{\sum_{A\in F} \frac{1}{{n \choose {|A|}}} ~~~ \leq ~~~ 1}$$\\
The above inequality is known as \textbf{LYM Inequality -  Lubell–Yamamoto–Meshalkin Inequality,}\\\\
We can substitute $n \choose \frac{n}{2}$ in place of $|A|$ and the inequality still holds.
$$\sum_{A\in F} \frac{1}{{n \choose \frac{n}{2}}} ~~~ \leq ~~~ 1$$
$$\sum_{A\in F} 1  ~~~ \leq ~~~ {n \choose \frac{n}{2}}$$
$$|F| ~~~\leq~~~ {n \choose \frac{n}{2}}$$\\
\end{proof}
\end{theorem}
\section{Disussing family of subsets with certain intersection properties}
The \textbf{Sperner theorem} we did is sample of family of subsets with intersection properties : for any pair $A,B \subseteq F ~|~ A\cap B \neq A$\\\\
\textbf{Question:-} Consider  family of subsets of $[n]$ such that for any pair $A,B \subseteq [n]$, $A \cap B \neq \phi$. How large can $F$ be?\\\\
\textbf{Building up:-} The size can be as large a $2^n$ but will not be equal to $2^n$ as if we take all singleton sets, their pairwise intersection is empty.\\ The size can be $2^{n-1}$, $F = \{ B \cup \{n\}~ | ~B\subseteq[n-1] \}$. Example for $n=3$ : $F=\{\{3\},\{1,3\},\{2,3\},\{1,2,3\}\}$. Can it be larger than $2^{n-1}$ ?
\begin{theorem} The size of intersection family is atmost $2^{n-1}$. And this bound is tight as we already have an example for any $n$.
\begin{proof}
By the property of family of subsets, its clear that if any subset $A \in F \implies {A}^\complement \notin F$. If both $A$ and $A^\complement$ are present then their intersection is empty. So for every subset in $F$ there is subset not present in $F$. Hence $|F| \le 2^{n-1}$.
\end{proof}
\end{theorem}
\textbf{Special cases of above family:-}
\begin{enumerate}
\item The intersection size is always $\lambda$ i.e. $A,B \subseteq F ~ \mid ~ |A \cap B|=\lambda$. Claim : $|F|\le n$.
\item The family is $k$-uniform.
\end{enumerate}
We will answer above two cases using \textbf{Linear Algebra} techniques. Before proving above claims lets take a look at some other problem that uses similar proof techniques.

\subsection{Odd Town Problem}
\begin{itemize}
    \item $n$ people in an odd town form $m$ clubs $C_1, C_2, \hdots, C_m$.
    \item Each club has an odd number of members.
    \item Each pair of clubs have an even number of common members.
    \item No two clubs have same set of members.
\end{itemize}
\begin{theorem}In Odd Town problem $m \le n$.
\begin{proof}
Associate a $n$-sized 0-1 vector $v_i$ to each club $C_i$, such that $v_i[j]=1$ if $j$ is member of club $C_i$ else 0. It is now sufficient to prove that we cannot have more than $n$ different vectors. Theses vectors are defined over field $\mathbb{F}_2^n$. The field $\mathbb{F}_2^n$ can be considered as structure where both addition and multiplication is modulo 2 and every element is either 0 or 1.\\\\
If we can show that the set of vectors $v_1, v_2, \hdots, v_m$ are linearly independent over $\mathbb{F}_2^n$, then it's implied that $m \le n$ as number of independent vectors are always less than or equal to dimension.\\\\
Consider the inner product $\langle v_i,v_j\rangle$. In $\mathbb{F}_2^n$, $\langle a,b\rangle = (\sum_{1}^{n} a_ib_i)\%2$.\\

~\textbf{Case 1:} $i\neq j$, $\langle v_i,v_j\rangle = \sum_{k=1}^{n} v_i[k]v_j[k] = | C_i \cap C_j |\%2 = 0$. As the size of intersection is always $even$.\\

~\textbf{Case 2:} $i= j$, $\langle v_i,v_j\rangle = \sum_{k=1}^{n} v_i[k]v_i[k] = (\sum_{k=1}^{n} v_i[k])\%2= 1$. As the size of each club is $odd$.\\\\
Suppose the set of vectors $v_1, v_2, \hdots, v_m$ are not linearly independent. Then these exist non-trivial solution to the equation: $\sum \lambda_i v_i=0$. If we can show that only solution to above equation is when all $\lambda_i$ is \textbf{0}, then we are done with proof.\\\\
Take inner product of $\sum \lambda_i v_i$ with $v_j$ for every $j$. As $\sum \lambda_i v_i$ is \textbf{0} vector.
$$ \left \langle \sum \lambda_i v_i,v_j\right\rangle = 0$$
$$  \sum \left \langle \lambda_i v_i,v_j\right\rangle = 0$$
$$  \sum \lambda_i \left \langle  v_i,v_j\right\rangle = 0$$\\
As we saw earlier, when $i\neq j$ $\langle v_i,v_j\rangle=0$. And when $i= j$, $\langle v_i,v_j\rangle=1$. So the above equation can be written as:
$$  \lambda_j \left \langle  v_j,v_j\right\rangle = 0$$
For above equation to satisfy $\lambda_j=0$, this can be shown for all $\lambda$s. Hence proved $m\le n$.
\end{proof}
\end{theorem}
In next lecture we will analyse the special cases of intersection family.

\Lecture{Jayalal Sarma}{Nov 25, 2020}{35}{More on Linear Algebra Techniques}{Mohit Singla}{$\alpha$}{JS}
\section{Recall some intersection families}
The family $F$ such that for any two subsets $A,B\subseteq F ~|~ A\cap B \neq \phi$, then $|F| \le 2^{n-1}$. Then we questioned two special cases of this intersection family.
\begin{enumerate}
    \item The intersection size is always $\lambda$ i.e. $A,B \subseteq F ~ \mid ~ |A \cap B|=\lambda$. Claim : $\boxed{|F|\le n}$. This inequality is knows as \textbf{Fisher's Inequality}.
    \item The family is $k$-uniform $\lambda$ i.e. $A \subseteq F ~ \mid ~ |A|=k$. Claim : $\boxed{|F|\le {{n-1}\choose{k-1}}}$. This is knows as \textbf{Edr{\"o}s Ko-Rado Theorem}.
\end{enumerate}
We saw \textbf{Odd-Town Theorem} which states that if:
\begin{itemize}
    \item $n$ people in an odd town form $m$ clubs $C_1, C_2, \hdots, C_m$.
    \item Each club has an odd number of members.
    \item Each pair of clubs have an even number of common members.
    \item No two clubs have same set of members.
\end{itemize}
Then $m\le n$. We proved this inequality using \textbf{Linear Algebra}. We associated one vector with each club and showed that all the vectors are linearly independent. As the dimension is $n$, there can not be more that $n$ linearly independent vectors.

\section{Fisher's Inequality (1940s)}
We will look at proof by \textbf{Babai Frankl} in 1992.
\begin{theorem}
The family $F$ such that intersection size is always $\lambda$ i.e. $A,B \subseteq F ~ \mid ~ |A \cap B|=k $. then $|F|\le n$.
\begin{proof}Associate a $n$-sized 0-1 vector $v_i$ to each club $C_i$, such that $v_i[j]=1$ if $j$ is member of club $C_i$ else 0. Each $v_i\in \mathbb{R}^n$.\\\\
Consider the inner product $\langle v_i,v_j\rangle$. In $\mathbb{R}^n$, $\langle a,b\rangle = (\sum_{1}^{n} a_ib_i)$.\\

~\textbf{Case 1:} $i\neq j$, $\langle v_i,v_j\rangle = \sum_{k=1}^{n} v_i[k]v_j[k] = | C_i \cap C_j | = k$. As the size of intersection is always k.\\

~\textbf{Case 2:} $i= j$, $\langle v_i,v_j\rangle = \sum_{k=1}^{n} v_i[k]v_i[k] = \sum_{k=1}^{n} v_i[k]= |C_i|$.\\\\
We will show the vectors are linearly independent. Suppose the set of vectors $v_1, v_2, \hdots, v_m$ are not linearly independent. Then these exist non-trivial solution to the equation: $\sum \lambda_i v_i=\textbf{0}$. We can write\\
$$ \left \langle \sum_1^m \lambda_i v_i,\sum_1^m \lambda_i v_i \right\rangle = 0$$
$$\implies ~~ \sum_1^m \lambda_i^2 \left \langle   v_i, v_i \right\rangle + \sum_{1\le i \neq j\le m} \lambda_i \lambda_j \left \langle   v_i, v_j \right\rangle = 0$$
$$\implies ~~ \sum_1^m \lambda_i^2 |C_i| + \sum_{1\le i \neq j\le m} \lambda_i \lambda_j k = 0$$
$$\implies ~~ \sum_1^m \lambda_i^2 (|C_i|-k) +\sum_1^m \lambda_i^2k + \sum_{1\le i \neq j\le m} \lambda_i \lambda_j k = 0$$
$$\implies ~~ \sum_1^m \lambda_i^2 (|C_i|-k) +(\sum_1^m \lambda_i)^2k = 0$$\\\\

Suppose there exist a $C_i$ such that $|C_i|=k$, then no other club size can be $k$. If there are two clubs with size $k$ and their intersection is also of size $k$, then both the clubs have to be equal. so at-most one club can have size $k$. Now as the intersection size is always $k$, for all $j$, $C_i \subseteq C_j$ must hold as the size of $C_i$ is $k$ and $|C_i \cap C_j |=k$. Note for all $C_i$, $|C_i|\ge k$ as the intersection size with any other club is of size $k$.\\\\
So in the expression $\sum_1^m \lambda_i^2 (|C_i|-k) +(\sum_1^m \lambda_i)^2k$, both the parts in summation are non-negative. For right part to be zero, $\sum_1^m \lambda_i =0$. Not all $\lambda$s are zero but their summation is, so there are atleast 2 $\lambda$s which are non-zero.\\\\
Now lets focus on left part. Each term $\lambda_i^2 (|C_i|-k)$ is non-negative.  There are atleast 2 $\lambda$s which are non-zero but atmost one $(|C_i|-k)$ can be zero. So the summation is always positive. So if there are non-zero $\lambda$s then summation cannot be equated to zero. This leads to contradiction in assumption that there exists non-zero $\lambda$s which satisfy above equation.\\\\
Hence proved that vectors $v_1, v_2, \hdots, v_m$ are linearly independent. So $m\le n$.
\end{proof}
\end{theorem}

\section{Application of Fisher Inequality and Odd Town Theorem}
\subsection{Ramsey Number}
\textbf{Definition:}$R(s,t)$ is minimum number ($n$) of vertices required in complete graph such that 2-edge coloring (red and blue colors) of this $K_n$ produces either red $K_s$ or blue $K_t$.\\\\
Earlier we have proved $R(t,t)>2^t$ i.e. there exist a 2-edge coloring of $K_{2^t}$ such that there is no red $K_t$ or blue $K_t$. We proved this using probabilistic method. We chose color of each edge uniformly at random and observed that the probability of graph having either red $K_t$ or blue $K_t$ is strictly less than 1. So there exist a graph with neither has red $K_t$ nor blue $K_t$, we did not explicitly drew thew the graph. This proof was \textbf{non-constructive}.\\\\
If we want a constructive example for lower-bound, we have much weaker lower bound.
\subsection{Constructive lower bound for diagonal Ramsey number}
\begin{claim}
$R(t+1,t+1)> {t\choose 3}$\\\\
We will be able to show a construction to prove this claim.
\begin{proof}
We need to show there exist a 2-edge coloring of $K_{t\choose 3}$ such that there is no red $K_{t+1}$ or blue $K_{t+1}$.\\\\
$n={t\choose 3}$. Interpret each vertex as 3-sized subset of set $\{1, 2, \hdots, t\}$. Let $A,B \in V$, then $A,B \subseteq [t]$ and $|A|=|B|=3$. Color edge $AB$ red if $|A\cap B| =0$ or $2$. As size of each subset is 3 and all are pairwise distinct, the intersection size can only be 0, 1 or 2. Color edge $AB$ blue if $|A\cap B| =1$.\\\\
Lets look for blue $K_{t+1}$. Consider $F$ as family consisting 3-sized subsets of $[t]$ such that intersection size is 1. These subsets in $F$ will represent the vertices corresponding to blue edges as described earlier. By Fishers theorem we know $|F|\le t$. There are atmost $t$ vertices available so there cannot be $K_{t+1}$.\\\\
Lets look for red $K_{t+1}$. Consider $F$ as family consisting 3-sized subsets of $[t]$ such that intersection size is even. These subsets in $F$ will represent the vertices corresponding to red edges as described earlier. Now we have all subsets of odd size and intersection size even. All conditions required in Odd Town theorem are satisfied, so by the theorem $|F|\le t$. There are atmost $t$ vertices available so there cannot be $K_{t+1}$.\\\\
Hence proved.
\end{proof}
\end{claim}

\section{Edr{\"o}s Ko-Rado Theorem (Discovered-1938, Presented-1962)}
\begin{lemma} Let $C$ be a cycle of length $n$ ($n$ edges and $n$ vertices). Let $H$ be family of paths in $C$ of fixed length $k$ where $k\le \frac{n}{2}$. Assume any paths in $H$ have an common edge. Then $|H|\le k$.
\begin{proof}Pick a path $p = (v_1, v_2, \hdots v_{k+1})$. All other paths have to intersect with this path. A path here is contiguous set of edges in cycle. Lets analyse how other paths look like. No other path can start from $v_1$, as it will end up being the same path $p$. No path can start at $v_{k+1}$, as $k\le \frac{n}{2}$ and path starting at $v_{k+1}$ will not have any edge common with $p$. Similarly no path can end at $v_1$ and $v_{k+1}$. So paths can start or end at $v_2, v_3 \hdots v_{k}$. Note if there is a path that starts at $v_j$, we cannot include path ending at $v_j$ as these two paths will not have any common edge. So there can at-most be $k-1$ other paths. Hence $|H|\le k$.
\end{proof}
\end{lemma}

\begin{theorem}[{\bf Erd{\"o}s-Ko-Rado Theorem}]
$F$ is $k$-uniform where $k\le \frac{n}{2}$, family of subsets of $[n]$ such that for every $A,B \subseteq F$, $A\cap B \neq \phi$. Note if $k> \frac{n}{2}$, then every pair of subsets trivially has non-empty intersection. Then $|F|\le {{n-1}\choose{k-1}}$

\begin{proof}
Before we prove the theorem, to get a feel, we construct an example first. And this example also will prove that the above theorem is tight.

\paragraph{Tightness:}
Consider the family.
$$F_k=\{\{n\}\cup B ~|~ B\subseteq [n-1] ,|B|=k-1\}$$

Since $n$ is there in every set in the family, the family is an intersecting family. All sets have size $k$ and hence it is $k$-uniform. By definition, $|F_k|={{n-1}\choose{k-1}}$. Thus the claim is tight as we have an example for any $k$. It turns out that these are the only tight examples when $k < \frac{n}{2}$.

When $n$ is even and $k=n/2$, there is one more tight example. We can take $F_k$ such that for every $\frac{n}{2}$-sized subset of $[n]$, we take either that subset or its complement in $F$.
$$|F_k|={{{n}\choose{n/2}}* \frac{1}{2}}=\frac{n}{n/2}* {{n-1}\choose n/2-1}* \frac{1}{2} = {{n-1}\choose{n/2-1}}$$

\paragraph{Proof of the {\bf Erd{\"o}s-Ko-Rado Theorem}:} We will discuss the proof by \textbf{Katona (1972)} using cycle permutation argument.

Assume someone invited all of the $n$ people from the town to a party. These $n$ people are members of clubs $C_1, C_2, \hdots, C_m$ where each club is of size $k$ and every pair of intersection is non-empty. The party has round table with $n$ labelled chairs. Host wants to seat the club members contiguously. But of course he may not be able to since there may be contradictory requirements across clubs since members can be common.

However, in an attempt to maximise the seating satisfaction of the club members, he decided to try all $n!$ permutations. Lets define a Matrix $H$ with $n!$ rows indexing the permutation number which represents seating arrangement. The columns are indexed by club $C_1, C_2, \hdots, C_m$, so total $m$ columns. The entries of the matrix defined as follows. For $\sigma \in S_n, j \in [m]$:

$$H(\sigma,j) =
\begin{cases}
1 & \textrm{~if $\sigma$ seats members of club $C_j$ contiguously} \\
0 & \textrm{otherwise} \\
\end{cases}
$$

Let $c$ be the number of ones in matrix $H$. we will count $c$ in two different ways.

\begin{description}
\item{\textbf{Count 1 - Row-wise first:}} For a given permutation, each club seated contiguously is a path in the cycle. The guests correspond to edges. As the family of clubs is an intersecting family, by above lemma we know that in each row there can be atmost $k$ ones. so $c \le k*n!$
\item{\textbf{Count 2 : Column-wise first:}} As we are considering all the permutations possible, the number of times each club appears contiguously will be the same. In fact a club will appear contiguously in $nk!(n-k)!$ permutations. First choose the starting index from n positions, then permute the members inside group, and then permute the members outside group. There are $m$ columns, so $c=mnk!(n-k)!$.
\end{description}
Using the above two counts,
\begin{eqnarray*}
m~n~k!~(n-k)! & \le & k~n! \\
m & \le & \frac{kn!}{nk!(n-k)!} \le \frac{(n-1)!}{(k-1)!(n-k)!} \le {n-1 \choose k-1}
\end{eqnarray*}

\end{proof}
\end{theorem}

\Lecture{Jayalal Sarma}{Nov 27, 2020}{37}{Generalization of linear algebraic method }{Banavath Tarun}{$\alpha$}{JS}

\section {Running problems}

\begin{enumerate}
    \item \underline{\textbf{Intersecting family}} : Let $\mathcal{F}$ be family of subsets of $\{1,2,3,...,n\}$ and is called Intersecting family, if every two subsets in these family intersect (i.e. $\forall A, B \in \mathcal{F}$, ~~$A \cap B \ne \phi$), and we have seen that $|\mathcal{F}|\le 2^{n-1}$.

    \item \underline{\textbf{Intersecting family with fixed size $\lambda$ (Fisher's Inequality)}} : Similarly, when $\mathcal{F}$ is a family of subsets of $\{1,2,3,....,n\}$ such that $\forall A, B \in \mathcal{F}$, $~~~|A\cap B| = \lambda$, then size of family is not too large and is given as $|\mathcal{F}|\le n$
    \subitem \textbf{techniques used in Fisher's inequality :} Odd town problem, linear algebra method.
\end{enumerate}

In this lecture, we discuss the theorems involving polynomial methods (or) function space methods.
\\

\underline{proof techniques for polynomial method (or) function space methods includes 3 steps:}

\begin{enumerate}
     \item Associate a polynomial in $n$-variables with each element
     \item prove that polynomials are linearly independent
     \item Bound the dimensions of space of polynomials
\end{enumerate}

\section{Independence criterion Tool and Two-distance set}

\begin{lemma}
(\textbf{Independence criterion Tool}) $\forall ~1 \le i \le m$, let $f_i : \Omega \longrightarrow \mathbb{F}$ be a function, $v_i \in \Omega$ such that it satisfies the following two conditions :
\begin{enumerate}
    \item $f_i(v_i) \ne 0, ~\forall ~i$
    \item $f_i(v_j) = 0, ~\forall ~1 \le i<j \le m $
\end{enumerate}
then $\{f_1, f_2, f_3,....,f_m\}$ are linearly independent in $\mathbb{F}^{\Omega}$. (Here each function $f_i$ is a element in $\mathbb{F}^{\Omega}$ i.e. a vector)
\begin{proof}
Suppose $\exists \lambda_1, \lambda_2, \lambda_3,...,\lambda_m \in \mathbb{F}$ such that $F = \sum_{i =1}^{m} \lambda_i f_i = 0$ and suppose there are dependent, where not all $\lambda_i = 0$, then there is a contradiction.
Let $j$ be the largest index (rightmost) such that $\lambda_j \ne 0.$ Substitute $v_j$ to the above function $F$.
We then have $F(v_j) = \sum_{i=1}^{m} \lambda_i f_i(v_j) = \lambda_j f_j(v_j)$ (because $\forall i > j $ $\lambda_i = 0$ by choice of $j$ and $\forall i< j$ the term $f_i(v_j) = 0$ by second condition) then $\lambda_j f_j(v_j) = 0$. Since $f_j(v_j) \ne 0$, $\lambda_j$ should be zero, but $\lambda_j \ne 0$ from above assumption. Thus it contradicts the fact that $\exists~ \lambda_1, \lambda_2, \lambda_3,...,\lambda_m \in \mathbb{F}$ that are dependent.
\end{proof}
\end{lemma}

\begin{claim}
Let $a_1,a_2,....,a_m$ be $m$ points in $\mathbb{R}^{n}$, such that all pair-wise distances are unique, them relation between $m$ and $n$ is given as : $m \le n+1$
\end{claim}
What if we relax the condition in above claim and require that there are two possible distances c, d, so that any pairwise distance is either c or d? Such a set is called a two-distance set.
\\
Below theorem is an example of demonstration of a polynomial method (or) function space method.
\\
\begin{theorem}(\textbf{Two-distance set}) Consider a two-distance set, a set $S = \{a_1,a_2,a_3,...,a_m\}$ is said to two-distance set, if $\exists$ $d_1, d_2$ (two fixed distances) such that $\forall a_i, a_j \in S$, satisfy the relation $dist(a_i, a_j) = d_1$ or $dist(a_i, a_j) = d_2$ (where $dist(a_i, a_j)$ is the distance between the two points $a_i,a_j$ in $\mathbb{R}^{n}$).
Then the relation between $m$ (size of two-distance set) and $n$ (dimension of elements in two-distance set) is given as : $m \le {n \choose 2} + 3n +2$.
\end{theorem}
\begin{proof}
We Solve it using polynomial method (or) function space methods that follows the three steps as already mentioned.
\\

\underline{\textbf{step1 (Associate a polynomial)}} :
Associate a polynomial $P_i(x_1,x_2,x_3,....,x_n)$ for each element $a_i$ in $S=\{a_1,a_2,a_3,....,a_m\}$ with some properties, so that we can prove independence in these polynomials. As seen in above lemma the functions $f_i$'s are polynomial $P_i$'s here and $\Omega = \mathbb{R}^{n}$ in this case (since $\forall i,~a_i \in \mathbb{R}^{n}$). Let $x=(x_1,x_2,x_3,...,x_n)$ be a $n$-vector then polynomial :
$\forall ~1 \le i \le m ~P_i(x) = \big({||x-a_i||}^2-{d_1}^2\big)\big({||x-a_i||}^2-{d_2}^2\big)$.
\\

\underline{\textbf{step2 (prove that polynomials are linearly independent)}} :
The above polynomials defined satisfies the two conditions of independent criterion tool. i.e.
\begin{enumerate}
    \item $P_i(a_i) \ne 0,~ \forall i$. $P_i$ satisfy the first condition because $P_i(a_i)= \big({||a_i-a_i||}^2-{d_1}^2\big)\big({||a_i-a_i||}^2-{d_2}^2\big) = {{d_1}^2}{{d_2}^2} \ne 0$ (since $d_1,d_2 \ne 0$), So  $P_i(a_i) \ne 0,~ \forall i$
    \item $P_i(a_j) = 0, \forall 1 \le i <j \le m$. $P_i$ also satisfy the second condition because $P_i(a_j) = \big({||a_j-a_i||}^2-{d_1}^2\big)\big({||a_j-a_i||}^2-{d_2}^2\big)$ and also ${||a_j - a_i||}^2 = {{d_1}^2}$ (or) ${||a_j - a_i||}^2 = {{d_2}^2}$ from definition of two-distance set. So $P_i(a_j) = \big({||a_j-a_i||}^2-{d_1}^2\big)\big({||a_j-a_i||}^2-{d_2}^2\big) = 0, \forall 1 \le i <j \le m$
\end{enumerate}

\underline{\textbf{step3 (Bound the dimension of space of polynomials)}} :
The polynomial that we have constructed has a property that we wanted and all these polynomials are now independent by independent criteria. Also after expanding the polynomial $P_i(x=(x_1,x_2,...x_n)) = \big({||x-a_i||}^2-{d_1}^2\big)\big({||x-a_i||}^2-{d_2}^2\big)$, we can see that the polynomial have only following type of terms:
$$(\sum_{i=1}^{n}{x_i}^{2})^2, {\sum_{i}{x_i}^{2}} x_j, {\sum_{1 \le i\le j \le n}x_ix_j}, \sum_{i=1}^{n}x_i ,1$$.
i.e.
\begin{itemize}
    \item Number of terms of form $(\sum_{i=1}^{n}{x_i}^{2})^2$ are $1$.
    \item Number of terms of form ${\sum_{i}{x_i}^{2}} x_j$ are $n$.
    \item Number of terms of form ${\sum_{1 \le i\le j \le n}x_ix_j}$ are ${n \choose 2} + n$.
    \item Number of terms of form $\sum_{i=1}^{n}x_i$ are $n$.
    \item Number of constant terms are $1$.
\end{itemize}
So in total we have $1+n+{n \choose 2} + n + n +1  = {n \choose 2} + 3n + 2$ number of terms i.e. any polynomial in our family can be expressed as a linear combination in ${n \choose 2} + 3n + 2$ number of terms, which means that dimensions of set of polynomials that we are looking cannot be greater than ${n \choose 2} + 3n + 2$ because these are the simplified polynomials using which we can express all the polynomials in our family. So, the dimension of underline space is bounded by ${n \choose 2} + 3n + 2$ and hence
$$m \le {n \choose 2} + 3n + 2$$ because there cannot be more than ${n \choose 2} + 3n + 2$ number of independent polynomials (or) vectors.
\end{proof}

\section{Frankl-Wilson Theorem}
\begin{theorem}
Let $\mathcal{F}$ be family of subsets of $[n]$ and let $L$ be subset of $[n]$ ($L \subseteq \{1,2,3,...,n\}$) such that $\forall A,B \in \mathcal{F}$,  $~~|A\cap B| \in L$, then $|\mathcal{F}| \le \sum_{i=1}^{|L|} {n \choose i}$. This theorem is also known as \textbf{Frankl-Wilson Theorem}, which is a Generalization of \textbf{Fisher's theorem}.
\end{theorem}

\begin{proof}
Let $\mathcal{F} = \{A_1,A_2,....,A_m\}$ be family of subsets of $[n]$, $L={l_1,l_2,....,l_s}$ be a subset of $[n]$ such that $\forall i,j ~(1 \le i,j \le n)$ $\exists~ k~(1 \le k \le s)$ such that $|A_i\cap A_j| = l_k$. Let $v_i$ be the characteristic vector of $A_i$, $v_i \in \Omega = \mathbb{R}^n$ \big(where $<v_i,v_i> = |A_i|$ and $<v_i,v_j> = |A_i\cap A_j|\big)$ and we can assume that $A_1$ to $A_m$ is ordered such that sizes are non-decreasing order (or) rename them accordingly. We then have
$$|A_1| \le |A_2|  \le |A_3|..... \le |A_m|.$$
Now We Solve the proof using polynomial method (or) function space methods that follows the three steps as already mentioned.
\\

\underline{\textbf{step1 (Associate a polynomial)}} :
Associate a polynomial $P_i(x_1,x_2,....,x_n)$ for each element $A_i$. So the polynomial that we are going to define is as follows:
$$P_i\big(x = (x_1,x_2,....,x_n)\big) = \prod_{k ~: ~l_k < |A_i|}\big(<v_i,x>-l_k\big)$$
where $x=(x_1,x_2,....,x_n)$ is a $n$-vector.
\\

\underline{\textbf{step2 (prove that polynomials are linearly independent}} : The above polynomials defined satisfies the two conditions of independent criterion tool.
\begin{enumerate}
    \item
    when $x=v_i$, we have:
$$P_i(v_i) = \prod_{k ~: ~l_k < |A_i|}\big(<v_i,v_i>-l_k\big) = \prod_{k:l_k < |A_i|}\bigg(|A_i|-l_k\bigg) \ne 0$$
so, $P_i(v_i) \ne 0,~ \forall i$
    \item
    when $x=v_j$ and $i < j$, we have:
$$P_i(v_j) = \prod_{k ~: ~l_k < |A_i|}\big(<v_i,v_j>-l_k\big) = \prod_{k:l_k < |A_i|}\big(|A_i\cap A_j|-l_k\big)=0$$
Since $|A_i \cap A_j| $ must be one of the $l_p \in L$ and this $p$ must satisfy $l_p < |A_i|$, because the intersection size $|A_i \cap A_j|$ cannot be more than $A_i$.
So, $P_i(v_j) = 0, \forall 1 \le i <j \le m$
Now we have this polynomial $P_i\big(x = (x_1,x_2,....,x_n)\big) = \prod_{k ~: ~l_k < |A_i|}\big(<v_i,x>-l_k\big)$ that satisfies the two conditions of Independent criteria and hence $P_1,P_2,....,P_n$ are linearly independent as polynomials (or) as coefficients of vectors.
\end{enumerate}

\underline{\textbf{step3 (Bound the dimension of space of polynomials)}} :
Estimating the underlying dimensions (here, space of polynomials):
We need to compute the dimension of space containing all these polynomials. Since we are using only 0/1 vectors here we can reduce the dimension by replacing the higher powers ${x_i}^k$ with $x_i$, this process does not change the linear dependence property and we still get same conditions. Now each term monomial looks like $x_1x_2x_3....$. Polynomials with these properties (i.e. each monomial with every individual variable degree to be at most one) are called as multilinear polynomials. So the polynomials under consideration lives in the space of multilinear polynomials of degree at most $s$.
\\
Let us look at the example on multilinear polynomials when $n=3$ and degree=2, the only terms correspond to these multilinear polynomials looks like:
$$x_1 x_2, ~x_2 x_3, ~x_1 x_3, ~x_1, ~x_2, ~x_3, ~1$$ there are 7 terms and an example of these multilinear polynomial with real coefficients looks like:
$5x_1 x_2 + 6x_1 x_3 + 5x_2 x_3 + 3x_1 + 2x_2 + x_3 + 6$
and dimension of this multilinear polynomial example is $7$. The number of monomials we can have with that much degree is the bound for dimension. So in general when degree=$k$ and number of variables is $n$, then number of monomials in this multilinear polynomial is $n \choose k$ (i.e. select $k$ elements from $\{1,2,3,....,n\}$ and associate a monomial with corresponding variables). But now we have that degree is at most $s$, so we need to sum the result $n \choose k$ overall values of $k$ (i.e. $1 \le k \le s$). So,
$$Dimension ~of ~space = \# ~of~ subsets~ of ~\{1,2,3,...,n\} ~of~ size ~\le s = \sum_{k=1}^{s}{n\choose k}$$
and hence
$$m \le Dimension \le \sum_{k=1}^{|L|}{n \choose k}$$
\end{proof}

\begin{theorem}
Let $\mathcal{F}$ be family of subsets of $[n]$, $p$ be a prime and $L$ be subset of $\{0,1,2,3,...,p-1\}$, ($L \in \{0,1,2,3,...,p-1\}$) such that $\forall A, B \in F$, $~~|A \cap B| \in L (mod~p)$ and $|A| \notin L (mod~p)$, then $|\mathcal{F}| \le \sum_{i=1}^{|L|} {n \choose i}$. This theorem is proved by \textbf{Ray-choudhuri Wilson}, which is a Generalization of \textbf{odd-town problem}.
\end{theorem}

\begin{theorem}
Let $\mathcal{F}$ be a k-Uniform family of subsets of $[n]$ and let $L$ be subset of $[n]$,  ($L \subseteq \{1,2,3,...,n\}$) such that $\mathcal{F}$ is $L-$intersecting (i.e. $\forall A, B \in F$, $~~|A \cap B| \in L$), then the size of $\mathcal{F}$ is given as : $|\mathcal{F}|\le {n \choose |L|}$. This theorem is proved by \textbf{Ray-choudhuri Wilson}
\end{theorem}

The above two theorems are also applications of polynomial method and process involved in proving them is similar to that we have done before.


%%%
\chapter{Mathematics}

One of the greatest motivating forces for Donald Knuth when he began developing the original TeX system was to create something that allowed simple construction of mathematical formulae\index{formulae}, while looking professional when printed. The fact that he succeeded was most probably why TeX (and later on, LaTeX) became so popular within the scientific community. Typesetting mathematics is one of LaTeX's greatest strengths. It is also a large topic due to the existence of so much mathematical notation.

If your document requires only a few simple mathematical formulas, plain LaTeX has most of the tools that you will need. If you are writing a scientific document that contains numerous complicated formulas, the amsmath package\index{package} introduces several new commands that are more powerful and flexible than the ones provided by basic LaTeX. The mathtools package fixes some amsmath quirks and adds some useful settings, symbols, and environments to amsmath.

$$M = \begin{bmatrix}
\frac{5}{6} & \frac{1}{6} & 0           \\[0.3em]
\frac{5}{6} & 0           & \frac{1}{6} \\[0.3em]
0           & \frac{5}{6} & \frac{1}{6}
\end{bmatrix}$$

\begin{equation}
x = a_0 + \cfrac{1}{a_1
	+ \cfrac{1}{a_2
		+ \cfrac{1}{a_3 + \cfrac{1}{a_4} } } }
\end{equation}


\appendix
\chapter{Appendix}

\section{Sum of reciprocal vertices depending only on $v_1$}
\label{appx:sum_reciprocal_vertices}
One condition deduced from theorem~\ref{theo:1} is the product condition~\ref{eq:condition_max}, which specifies the validity of the cycle-alpha's upper limit. This condition requires the sum $\frac{1}{kv_1}+\frac{1}{kv_2}+\frac{1}{kv_3}+\ldots$ to be limited. In order to formulate this sum independently from the successive vertices $v_2,v_3,\ldots$, we substitute these as follows:
\begin{flalign}
v_1&=v_1\notag\\
v_2&=\frac{kv_1+1}{2^{\alpha_1}}\notag\\
v_3&=\frac{k^2v_1+k+2^{\alpha_1}}{2^{\alpha_1+\alpha_2}}\notag\\
v_4&=\frac{k^3v_1+k^2+k\cdot2^{\alpha_1}+2^{\alpha_1+\alpha_2}}{2^{\alpha_1+\alpha_2+\alpha_3}}\label{eq:sum_v_4}\\
\vdots\notag\\
v_{n+1}&=\frac{k^nv_1+\sum_{j=1}^{n}k^{j-1}2^{\alpha_1+\ldots+\alpha_n-\sum_{l>n-j}\alpha_l}}{2^{\alpha_1+\ldots+\alpha_n}}\label{eq:sum_v_n_plus_1}
\end{flalign}

\par\medskip
The sum of the reciprocal vertices can be expressed as a term that depends from $v_1$ and from the number of contracted edges, id est the number of dvisions by two, between two successive vertices $\alpha_1,\alpha_2,\alpha_3,\ldots$:
\begin{equation*}
\sum_{i=1}^{n+1}\frac{1}{kv_i}=\frac{1}{k}\left(\frac{1}{v_1}+\sum_{i=1}^{n}\frac{1}{v_{i+1}}\right)=\frac{1}{k}\left(\frac{1}{v_1}+\sum_{i=1}^{n}\frac{2^{\alpha_1+\ldots+\alpha_i}}{k^iv_1+\sum_{j=1}^{i}k^{j-1}2^{\alpha_1+\ldots+\alpha_n-\sum_{l>i-j}\alpha_l}}\right)
\end{equation*}

\section{The product formula depending only on $v_1$}
\label{appx:product_formula_depending_v1}
In a similar way to deduce the sum of reciprocal vertices depending only on $v_1$ as performed in \ref{appx:sum_reciprocal_vertices}, we evolve the product formula depending only on $v_1$:
\begin{flalign}
\prod_{i=1}^{n+1}\left(1+\frac{1}{kv_i}\right)&=1+\frac{2^{\alpha_1+\ldots+\alpha_n}+k\cdot2^{\alpha_1+\ldots+\alpha_{n-1}}+\ldots+k^{n-1}\cdot2^{\alpha_1}+k^n}{k^{n+1}v_1}\label{eq:prod_sum_v_n_plus_1}\\
&=1+\frac{2^{\alpha_1+\ldots+\alpha_n}+k\cdot\sum_{j=1}^{i}k^{j-1}2^{\alpha_1+\ldots+\alpha_n-\sum_{l>i-j}\alpha_l}}{k^{n+1}v_1}\label{eq:prod_sum_v_n_plus_1_inserted}\\
&=1+\frac{2^{\alpha_1+\ldots+\alpha_n}+k\cdot\left(v_{n+1}\cdot2^{\alpha_1+\ldots+\alpha_n}-k^nv_1\right)}{k^{n+1}v_1}\notag\\
&=\frac{2^{\alpha_1+\ldots+\alpha_n}\left(1+kv_{n+1}\right)}{k^{n+1}v_1}\label{eq:prod_sum_v_n_plus_1_simplified}
\end{flalign}
We inserted the sum used in equation~\ref{eq:sum_v_n_plus_1} into the above-given equation~\ref{eq:prod_sum_v_n_plus_1} and then obtained equation~\ref{eq:prod_sum_v_n_plus_1_inserted}. Let us divide this product by the last factor and consider the product in the condition for cycle-alpha's upper limit, which iterates to $n$ instead of $n+1$:

\begin{equation}
\label{eq:prod_sum_v_n_simplified}
\prod_{i=1}^{n}\left(1+\frac{1}{kv_i}\right)=\frac{\prod_{i=1}^{n+1}\left(1+\frac{1}{kv_i}\right)}{\frac{kv_{n+1}+1}{kv_{n+1}}}=\frac{2^{\alpha_1+\ldots+\alpha_n}\cancel{\left(1+kv_{n+1}\right)}kv_{n+1}}{k^{n+1}v_1\cancel{\left(kv_{n+1}+1\right)}}=\frac{2^{\alpha_1+\ldots+\alpha_n}v_{n+1}}{k^nv_1}
\end{equation}

The above-shown equation~\ref{eq:prod_sum_v_n_simplified} for the product in the condition for cycle-alpha's upper limit becomes simplified, when we replaced the numerator by equation~\ref{eq:prod_sum_v_n_plus_1_simplified}.

\section{Simplying the product for $k=3$}
\label{appx:product_simplification_k3}
Below we will show the simplification of the product in the condition for alpha's upper limit, which has been performed by equation~\ref{eq:product_simplification_k3}:
\[
\prod_{i=1}^{n}\frac{3^i(v_1+1)-2^i}{3^i(v_1+1)-3*2^{i-1}}
=\frac{1}{v_1}-\frac{1}{v_1}\left(\frac{2}{3}\right)^n+1
\]

In fact, this product is a telescoping product. We factor out $\frac{1}{3^n}$, then shift the index in the product of the denominator by one to start with $i=0$, and use the product's telescopic property to cancel equal factors in numerator and denominator:
\begin{flalign*}
	&\prod_{i=1}^{n}\frac{3^i(v_1+1)-2^i}{3^i(v_1+1)-3*2^{i-1}}
	=\frac{1}{3^n}\prod_{i=1}^{n}\frac{3^i(v_1+1)-2^i}{3^{i-1}(v_1+1)-2^{i-1}}
	=\frac{1}{3^n}\frac{\prod_{i=1}^{n}\left(3^i(v_1+1)-2^i\right)}{\prod_{i=1}^{n}\left(3^{i-1}(v_1+1)-2^{i-1}\right)}\\
	=&\frac{1}{3^n}\frac{\prod_{i=1}^{n}\left(3^i(v_1+1)-2^i\right)}{\prod_{i=0}^{n-1}\left(3^i(v_1+1)-2^i\right)}
	=\frac{1}{3^n}\frac{3^n(v_1+1)-2^n}{(v_1+1)-1}
	=\frac{3^nv_1+3^n-2^n}{3^nv_1}
	=\frac{1}{v_1}-\frac{1}{v_1}\left(\frac{2}{3}\right)^n+1
\end{flalign*}

\section{Proving the product simplification for $k=3$ inductively}
\label{appx:proof_product_simplification_k3}
Using induction, we prove the simplification below that has been made by equation~\ref{eq:product_simplification_k3}:
\[
\prod_{i=1}^{n}\frac{3^i(v_1+1)-2^i}{3^i(v_1+1)-3*2^{i-1}}
=\frac{1}{v_1}-\frac{1}{v_1}\left(\frac{2}{3}\right)^n+1
\]

The base case $n=1$ is readily comprehensible and obviously correct:
\[
\prod_{i=1}^{1}\frac{3^i(v_1+1)-2^i}{3^i(v_1+1)-3*2^{i-1}}
=\frac{3(v_1+1)-2}{3(v_1+1)-3}
=\frac{1}{3v_1}+1
=\frac{1}{v_1}-\frac{1}{v_1}\left(\frac{2}{3}\right)+1
\]

The induction step is explained below, and here we arrive at a true statement too:
\begin{flalign*}
	\prod_{i=1}^{n+1}\frac{3^i(v_1+1)-2^i}{3^i(v_1+1)-3*2^{i-1}}&=\frac{3^{n+1}(v_1+1)-2^{n+1}}{3^{n+1}(v_1+1)-3*2^n}\prod_{i=1}^{n}\frac{3^i(v_1+1)-2^i}{3^i(v_1+1)-3*2^{i-1}}\\
	&=\frac{3^{n+1}(v_1+1)-2^{n+1}}{3^{n+1}(v_1+1)-3*2^n}\left(\frac{1}{v_1}-\frac{1}{v_1}\left(\frac{2}{3}\right)^n+1\right)\\
	&=\frac{3^{n+1}(v_1+1)-2^{n+1}}{3^{n+1}(v_1+1)-3*2^n}\cdot\frac{3^n-2^n+3^nv_1}{3^nv_1}\\
	&=\frac{3^{n+1}(v_1+1)-2^{n+1}}{\cancel{3^{n+1}(v_1+1)-3*2^n}}\cdot\frac{\cancel{3*(3^n-2^n+3^nv_1)}}{3*3^nv_1}\\
	&=\frac{1}{v_1}-\frac{1}{v_1}\left(\frac{2}{3}\right)^{n+1}+1
\end{flalign*}

\section{The condition for an Engel expansion's limited growth}
\label{appx:condition_limited_growth}
The steps for transforming the inequality~\ref{eq:condition_limited_growth} as the condition for limiting an Engel expansion's growth (see section~~\ref{sec:condition_limited_growth}) are given below:

\begin{flalign*}
0&<1+v_1-\frac{3^nv_1}{2^{m+n}}-\frac{3^{n-1}}{2^{m+n}}-\frac{3^{n-1}2^{m+1}}{2^{m+n}}\\
0&<1+v_1-\frac{3^{n-1}}{2^{m+n}}\left(3v_1+1\right)-\frac{3^{n-1}}{2^{n-1}}\\
0&<2^{n-1}+2^{n-1}v_1-\frac{3^{n-1}}{2^{m+1}}\left(3v_1+1\right)-3^{n-1}\\
0&<3\cdot2^{n-1}+3\cdot2^{n-1}v_1-3\cdot\frac{3^{n-1}}{2^{m+1}}\left(3v_1+1\right)-3^n-2\cdot2^{n-1}+2\cdot2^{n-1}\\
0&<2^{n-1}\left(3v_1+1\right)-3\cdot\frac{3^{n-1}}{2^{m+1}}\left(3v_1+1\right)-3^n+2^n\\
0&<\left(3v_1+1\right)\left(2^{n-1}-3\cdot\frac{3^{n-1}}{2^{m+1}}\right)-3^n+2^n\\
3^n-2^n&<\left(3v_1+1\right)\left(2^{n-1}-3\cdot\frac{3^{n-1}}{2^{m+1}}\right)
\end{flalign*}

Now we reshape the inequality further so that we isolate $v_1$ to the right side of this inequality:
{\setlength{\jot}{1.2em}
\begin{flalign*}
\frac{3^n-2^n}{2^{n-1}-3\cdot\frac{3^{n-1}}{2^{m+1}}}-1&<3v_1\\
\frac{3^n2^{m+1}-2^n2^{m+1}}{2^{m+1}2^{n-1}-3^n}-1&<3v_1\\
\frac{3^n2^{m+1}-2\cdot3^n-2^n2^{m+1}+2\cdot3^n}{2^{m+n}-3^n}-1&<3v_1\\
\frac{3\cdot3^{n-1}2^{m+1}-2\cdot3\cdot3^{n-1}-2\cdot2^{n-1}2^{m+1}+2\cdot3^n}{3\cdot\left(2^{m+n}-3^n\right)}-\frac{1}{3}&<v_1\\
\frac{\cancel3\cdot3^{n-1}2^{m+1}-2\cdot\cancel3\cdot3^{n-1}}{\cancel3\cdot\left(2^{m+n}-3^n\right)}-\frac{2\cdot\cancel{\left(2^{m+n}-3^n\right)}}{3\cdot\cancel{\left(2^{m+n}-3^n\right)}}-\frac{1}{3}&<v_1\\
\frac{3^{n-1}2^{m+1}-2\cdot3^{n-1}}{2^{m+n}-3^n}-1&<v_1
\end{flalign*}}

%\section{An alternative proof for alpha's upper limit for $H_{C,1}$}
%\label{appx:proof_k1}
%We demonstrate that condition~\ref{eq:condition_max} is true for $k=1$. What makes this case so special and therefore so manageable is that the equation in theorem~\ref{theo:2} constantly yields $2^1$, whatever value we use for $n$. By setting $k=1$, the condition becomes reduced to:
%\begin{equation}
%\label{eq:condition_k1}
%\prod_{i=1}^{n}\frac{v_i+1}{v_i}<2^2
%\end{equation}
%One can see instantly that the condition~\ref{eq:condition_k1} above is met for $n=v_1=1$. This trivial cycle only includes the sole vertex $v_1=1$. The fact which causes a worst case sequence $v_n,v_{n-1},\ldots,v_2,v_1$ describing a path from $v_n$ to $v_1$ is precisely that between two successive nodes a division by two was only made once:
%\begin{equation}
%\label{eq:worst_case_1}
%\arraycolsep=1.4pt
%\begin{array}{llll}
%v_n&=2^{n-1}&\cdot\ (v_1-1)+1&\\
%v_{n-1}&=2^{n-2}&\cdot\ (v_1-1)+1&\\
%\vdots\\
%v_2&=2^1&\cdot\ (v_1-1)+1&=2v_1-1\\
%v_1&=2^0&\cdot\ (v_1-1)+1&=v_1
%\end{array}
%\end{equation}
%One example for such a sequence is $v_4=17,v_3=9,v_2=5,v_1=3$. It shall be mentioned that the sequence $v_1,2\cdot v_1-1,4\cdot v_1-3,\ldots$ is an increasing one for any $v_1>1$, which means $v_1<v_2<\ldots<v_{n-1}<v_n$. Why might such a sequence be referred to as worst case? Ultimately, it is because one needs to show that the product stays below the upper limit $2^2=4$. The smaller the values (labels) of the vertices, the larger the product. If we allowed additional divisions by $2$, the sequence would increase more steeply, the vertices' values would be larger and the product would consequently be smaller.

%Setting the worst case sequence $v_n=2^{n-1}(v_1-1)+1$ into the product \ref{eq:condition_k1} leads to the following product:
%\begin{equation}
%\label{eq:condition_k1_v1}
%\prod_{i=1}^{n}\frac{2^{i-1}(v_1-1)+2}{2^{i-1}(v_1-1)+1}
%\end{equation}
%As previously mentioned, we have to consider the worst case scenario, which results in the maximum product. We provoke the worst case if a vertex's value is as small as possible, which we achieve with the sequence $1,3,5,9,17,\ldots$ that is composed from two partial sequences, namely the one-element sequence $v_1=1$ and the sequence defined by \ref{eq:worst_case_1} starting with $v_1=3$. As product we then receive the composed product given below which must remain below the limit 4:
%\[
%\prod_{i=1}^{1}\frac{v_i+1}{v_i}\prod_{i=1}^{n}\frac{2^{i-1}(v_1-1)+2}{2^%{i-1}(v_1-1)+1}=2\prod_{i=1}^{n}\frac{2^i+2}{2^i+1}<4
%\]
%The first sub-product refers to \ref{eq:condition_k1} and comprises only a single iteration. We insert the value $v_1=1$ yielding a final result of $2$. The second sub-product is sourced from \ref{eq:condition_k1_v1} and has been simplified by setting $v_1=3$. We further facilitate this second sub-product as shown below:
%\begin{equation*}
%	\prod_{i=1}^{n}\frac{2^i+2}{2^i+1}=2^n\prod_{i=1}^{n}\frac{2^{i-1}+1}{2^i+1}=2^n\frac{(2^0+1)\cancel{(2^1+1)}\cancel{(2^2+1)}\cdots\cancel{(2^{n-1}+1)}}{\cancel{(2^1+1)}\cancel{(2^2+1)}\cdots\cancel{(2^{n-1}+1)}(2^n+1)}=\frac{2^{n+1}}{2^n+1}
%\end{equation*}

%The upper limit of this second sub-product is $2$ and consequently the entire product composed by both sub-products therefore converges from below towards $4$, which leads to our condition~\ref{eq:condition_k1} being fulfilled even in the worst case:
%\[
%\prod_{i=1}^{\infty}\frac{2^i+2}{2^i+1}=\lim_{n\to\infty}\frac{2^{n+1}}{2^n+1}=2
%\]

\section{Further worst-case studies}
\label{sec:worstcase_k3}
Regarding worst case scenarios, a distinction must be made between two basic cases:
\begin{itemize}
	\item The vertex $v_{n+1}$ becomes a maximum. This kind of worst case we have dealt with in chapter~\ref{ch:maximizing_target_node} and we used for proving cycle-alpha's upper limit in $H_{C,1}$ with section~\ref{sec:alphas_upper_limit_k_1}.
	\item The product in condition~\ref{eq:condition_max} and consequently the sum of reciprocal vertices, formulated in \ref{appx:sum_reciprocal_vertices}, becomes a maximum.
\end{itemize}
Trying to find a worst case that maximizes the product in condition~\ref{eq:condition_max} means to search for a sequence of odd numbers that rises as high as possible. One could try the ascending sequence of odd integers $v_i=2i-1$ (beginning at $v_1=1$), but will find that for this case the product will not converge against a limit value. This sequence (beginning at $v_1=1$) allow us to transform the product contained in condition~\ref{eq:condition_max} into a limit analyzable function using the Pochhammer’s symbol (sometimes referred to as the \textit{rising factorial} or \textit{shifted factorial}), which is denoted by $(x)_n$ and defined as follows \cite{Ref_Zwillinger_Kokoska}, \cite[p.~679]{Ref_Brychkov} and \cite[p.~1005]{Ref_Trott}:
\[
(x)_n=x(x+1)(x+2)\cdots(x+n-1)=\prod_{i=0}^{n-1}(x+i)=\prod_{i=1}^{n}(x+i-1)=\frac{\Gamma(x+n)}{\Gamma(x)}
\]

Setting $v_i=2i-1$ into the product expressed by condition~\ref{eq:condition_max} and setting $x=\frac{k+1}{2k}$ into Pochhammer’s symbol $(x)_n$ interestingly makes it possible for us to perform the following transformation:
\begin{equation}
\label{eq:pochhammer}
\prod_{i=1}^{n}\left(1+\frac{1}{kv_i}\right)
=\frac{\prod_{i=1}^{n}(kv_i+1)}{\prod_{i=1}^{n}kv_i}
=\frac{\prod_{i=1}^{n}\left(k(2i-1)+1\right)}{k^n\prod_{i=1}^{n}(2i-1)}
=\frac{2^{2n}n!}{(2n)!}\cdot\frac{\Gamma\left(\frac{k+1+2kn}{2k}\right)}{\Gamma\left(\frac{k+1}{2k}\right)}
\end{equation}

\begin{example}
	One simple example that is easy to recalculate may be provided by choosing $k=3$ and $n=4$:
	\[
	\left(1+\frac{1}{3*1}\right)\left(1+\frac{1}{3*3}\right)\left(1+\frac{1}{3*5}\right)\left(1+\frac{1}{3*7}\right)=1,6555=\frac{2^8*4!}{8!}\cdot\frac{\Gamma(\frac{14}{3})}{\Gamma(\frac{4}{6})}
	\]
\end{example}

The product in the numerator in equation~\ref{eq:pochhammer} will be transformed into a form that allows us to use the Pochhammer’s symbol:
\[\prod_{i=1}^{n}\left((2i-1)k+1\right)=2^nk^n\prod_{i=1}^{n}\frac{(2i-1)k+1}{2k}=2^nk^n\prod_{i=1}^{n}\frac{k+1+2ki-2k}{2k}=2^nk^n\prod_{i=1}^{n}\left(\frac{k+1}{2k}+i-1\right)\]

This product can be written now as $2^nk^n(x)_n$, whwereby $x=\frac{k+1}{2k}$:
\[\prod_{i=1}^{n}\left((2i-1)k+1\right)=2^nk^n\frac{\Gamma\left(\frac{k+1+2kn}{2k}\right)}{\Gamma\left(\frac{k+1}{2k}\right)}\]

We recall the basic fact that the product of even integers is given by $\prod_{i=1}^{n}2i=2^n\cdot n!$ and the product of odd integers is $\prod_{i=1}^{n}\left(2i-1\right)=1\cdot3\cdot5\cdot7\ldots=\frac{(2n)!}{2^n\cdot n!}$. Thus we can transform the product in the denominator in equation~\ref{eq:pochhammer} as follows:
\[\prod_{i=1}^{n}kv_i=k^n\prod_{i=1}^{n}v_i=k^n\prod_{i=1}^{n}(2i-1)=k^n\frac{(2n)!}{2^nn!}\]

\par\medskip
This product is divergent, it does not converge to a limiting value. Thankfully, the ascending sequence of natural odd numbers overshoots the worst-case scenario. According to this scenario we would not have contracted a single edge between two successive nodes.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copyright (c) 2003-2018 by The University of Queensland
% http://www.uq.edu.au
%
% Primary Business: Queensland, Australia
% Licensed under the Apache License, version 2.0
% http://www.apache.org/licenses/LICENSE-2.0
%
% Development until 2012 by Earth Systems Science Computational Center (ESSCC)
% Development 2012-2013 by School of Earth Sciences
% Development from 2014 by Centre for Geoscience Computing (GeoComp)
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\chapter{Einstein Notation}
\label{EINSTEIN NOTATION}

Compact notation is used in equations such continuum mechanics and linear
algebra; it is known as Einstein notation or the Einstein summation convention.
It makes the conventional notation of equations involving tensors more compact
by shortening and simplifying them.

There are two rules which make up the convention.
Firstly, the rank of a tensor is represented by an index.
For example, $a$ is a scalar, $b_{i}$ represents a vector, and $c_{ij}$
represents a matrix.
Secondly, if an expression contains repeated subscripted variables, they are
assumed to be summed over all possible values, from $0$ to $n$.
For example, the expression
\begin{equation}
y = a_{0}b_{0} + a_{1}b_{1} + \ldots + a_{n}b_{n}
\label{NOTATION1}
\end{equation}
can be represented as
\begin{equation}
y = \sum_{i=0}^n  a_{i}b_{i}
\label{NOTATION2}
\end{equation}
then in Einstein notation:
\begin{equation}
y = a_{i}b_{i}
\label{NOTATION3}
\end{equation}
%
Another example:
\begin{equation}
\nabla p = \frac{\partial p}{\partial x_{0}}\textbf{i} + \frac{\partial p}{\partial x_{1}}\textbf{j} + \frac{\partial p}{\partial x_{2}}\textbf{k}
\label{NOTATION4}
\end{equation}
can be expressed in Einstein notation as
\begin{equation}
\nabla p = p,_{i}
\label{NOTATION5}
\end{equation}
where the comma ',' in the subscript indicates the partial derivative.

\noindent For a tensor:
\begin{equation}
\sigma _{ij}=
\left[ \begin{array}{ccc}
\sigma_{00} & \sigma_{01} & \sigma_{02} \\
\sigma_{10} & \sigma_{11} & \sigma_{12} \\
\sigma_{20} & \sigma_{21} & \sigma_{22} \\
\end{array} \right]
\label{NOTATION6}
\end{equation}

The $\delta_{ij}$ is the Kronecker $\delta$-symbol, which is a matrix with ones
in its diagonal entries ($i = j$) and zeros in the remaining entries
($i \neq j$).

\begin{equation}
\delta _{ij} =
\left \{ \begin{array}{cc}
1, & \mbox{if $i = j$} \\
0, & \mbox{if $i \neq j$} \\
\end{array}
\right.
\label{KRONECKER}
\end{equation}


\chapter{Representations of algebras}
In the 19th century, the word ``group'' hadn't been invented yet;
all work was done with subsets of $\GL(n)$ or $S_n$.
Only much later was the abstract definition of a group was given,
an abstract set $G$ which was an object in its own right.

While this abstraction is good for some reasons,
it is often also useful to work with concrete representations.
This is the subject of representation theory.
Linear algebra is easier than abstract algebra,
so if we can take a group $G$ and represent it concretely
as a set of matrices in $\opname{GL}(n)$,
this makes them easier to study.
This is the \emph{representation theory of groups}:
how can we take a group and represent its elements as matrices?

\section{Algebras}
\prototype{$k[x_1, \dots, x_n]$ and $k[G]$.}
Rather than working directly with groups from the beginning,
it will be more convenient to deal with so-called $k$-algebras.
This setting is more natural and general than that of groups,
so once we develop the theory of algebras well enough,
it will be fairly painless to specialize to the case of groups.

Colloquially,
\begin{moral}
	An associative $k$-algebra is
	a possibly noncommutative ring with a copy of $k$ inside it.
	It is thus a $k$-vector space.
\end{moral}
% In particular this makes such an algebra into a $k$-vector space.
I'll present examples before the definition:
\begin{example}
	[Examples of $k$-Algebras]
	Let $k$ be any field. The following are examples of $k$-algebras:
	\begin{enumerate}[(a)]
		\ii The field $k$ itself.
		\ii The polynomial ring $k[x_1, \dots, x_n]$.
		\ii The set of $n \times n$ matrices with entries in $k$,
		which we denote by $\Mat_n(k)$.
		Note the multiplication here is not commutative.
		\ii The set $\Mat(V)$ of linear operators $T : V \to V$,
		with multiplication given by the composition of operators.
		(Here $V$ is some vector space over $k$.)
		This is really the same as the previous example.
	\end{enumerate}
\end{example}
\begin{definition}
	Let $k$ be a field.
	A \vocab{$k$-algebra} $A$ is a \emph{possibly noncommutative} ring,
	equipped with an injective ring homomorphism $k \injto A$
	(whose image is the ``copy of $k$'').
	In particular, $1_k \mapsto 1_A$.

	Thus we can consider $k$ as a subset of $A$, and
	we then additionally require $\lambda \cdot a = a \cdot \lambda$
	for each $\lambda \in k$ and $a \in A$.

	If the multiplication operation is also commutative,
	then we say $A$ is a \vocab{commutative algebra}.
\end{definition}
\begin{definition}
	Equivalently, a \vocab{$k$-algebra} $A$ is a
	$k$-\emph{vector space} which also has an associative,
	bilinear multiplication operation (with an identity $1_A$).
	The ``copy of $k$'' is obtained by considering elements
	$\lambda 1_A$ for each $\lambda \in k$
	(i.e.\ scaling the identity by the elements of $k$,
	taking advantage of the vector space structure).
\end{definition}

\begin{abuse}
	Some other authors don't require $A$ to be associative or to have
	an identity, so to them what we have just defined is an
	``associative algebra with $1$''.
	However, this is needlessly wordy for our purposes.
\end{abuse}

\begin{example}
	[Group algebra]
	The \vocab{group algebra} $k[G]$ is the $k$-vector space
	whose \emph{basis elements} are the elements of a group $G$,
	and where the product of two basis elements is the group multiplication.
	For example, suppose $G = \Zc 2 = \{1_G, x\}$.
	Then
	\[ k[G] = \left\{ a1_G + bx \mid a,b \in k \right\} \]
	with multiplication given by
	\[ (a1_G + bx)(c1_G+dx) = (ac+bd)1_G + (bc+ad)x. \]
\end{example}
\begin{ques}
	When is $k[G]$ commutative?
\end{ques}
The example $k[G]$ is very important,
because (as we will soon see) a representation of the algebra $k[G]$
amounts to a representation of the group $G$ itself.

It is worth mentioning at this point that:
\begin{definition}
	A \vocab{homomorphism} of $k$-algebras $A$, $B$ is a
	linear map $T : A \to B$ which respects multiplication
	(i.e.\ $T(xy) = T(x)T(y)$) and which sends $1_A$ to $1_B$.
	In other words, $T$ is both a homomorphism as a ring and as a vector space.
\end{definition}
\begin{definition}
	Given $k$-algebras $A$ and $B$, the \vocab{direct sum} $A \oplus B$
	is defined as pairs $a + b$, where addition is done in the obvious way,
	but we declare $ab = 0$ for any $a \in A$ and $b \in B$.
\end{definition}
\begin{ques}
	Show that $1_A + 1_B$ is the multiplicative identity of $A \oplus B$.
\end{ques}

\section{Representations}
\prototype{$k[S_3]$ acting on $k^{\oplus 3}$ is my favorite.}

\begin{definition}
	A \vocab{representation} of a $k$-algebra $A$
	(also a \vocab{left $A$-module}) is:
	\begin{enumerate}[(i)]
		\ii A $k$-vector space $V$, and
		\ii An \emph{action} $\cdot$ of $A$ on $V$: thus, for every $a \in A$
		we can take $v \in V$ and act on it to get $a \cdot v$.
		This satisfies the usual axioms:
		\begin{itemize}
			\ii $(a+b) \cdot v = a \cdot v + b \cdot v$,
			$a \cdot (v+w) = a \cdot v + a \cdot w$,
			and $(ab) \cdot v = a \cdot (b \cdot v)$.
			\ii $\lambda \cdot v = \lambda v$ for $\lambda \in k$.
			In particular, $1_A \cdot v = v$.
		\end{itemize}
	\end{enumerate}
\end{definition}

\begin{definition}
	The action of $A$ can be more succinctly described as saying
	that there is a \emph{$k$-algebra homomorphism} $\rho : A \to \Mat(V)$.
	(So $a \cdot v = \rho(a)(v)$.)
	Thus we can also define a \vocab{representation} of $A$ as a pair
	\[ \left( V, \rho : A \to \Mat(V) \right). \]
\end{definition}
This is completely analogous to how a group action $G$ on a set $X$
with $n$ elements just amounts to a group homomorphism $G \to S_n$.
From this perspective, what we are really trying to do is:
\begin{moral}
	If $A$ is an algebra,
	we are trying to \emph{represent}
	the elements of $A$ as matrices.
\end{moral}

\begin{abuse}
	While a representation is a pair $(V, \rho)$
	of \emph{both} the vector space $V$ and the action $\rho$,
	we frequently will just abbreviate it to ``$V$''.
	This is probably one of the worst abuses I will commit,
	but everyone else does it and I fear the mob.
\end{abuse}
\begin{abuse}
	Rather than $\rho(a)(v)$ we will just write $\rho(a)v$.
\end{abuse}

\begin{example}
	[Representations of $\Mat(V)$]
	\listhack
	\begin{enumerate}[(a)]
		\ii Let $A = \Mat_2(\RR)$.
		Then there is a representation $(\RR^{\oplus 2}, \rho)$
		where a matrix $a \in A$ just acts by $a \cdot v = \rho(a)(v) = a(v)$.

		\ii More generally, given a vector space $V$ over any field $k$,
		there is an obvious representation of $A = \Mat(V)$
		by $a \cdot v = \rho(a)(v) = a(v)$ (since $a \in \Mat(V)$).

		From the matrix perspective: if $A = \Mat(V)$,
		then we can just represent $A$ as matrices over $V$.

		\ii There are other representations of $A = \Mat_2(\RR)$.
		A silly example is the representation $(\RR^{\oplus 4}, \rho)$ given by
		\[
			\rho :
			\begin{bmatrix} a & b \\ c & d \end{bmatrix}
			\mapsto
			\begin{bmatrix} a & b & 0 & 0 \\ c & d & 0 & 0 \\
				0 & 0 & a & b \\ 0 & 0 & c & d \end{bmatrix} .
		\]
		More abstractly, viewing $\RR^{\oplus 4}$ as
		$(\RR^{\oplus 2}) \oplus (\RR^{\oplus 2})$,
		this is $a \cdot (v_1,v_2) = (a \cdot v_1, a \cdot v_2)$.
	\end{enumerate}
\end{example}

\begin{example}
	[Representations of polynomial algebras]
	\listhack
	\begin{enumerate}[(a)]
		\ii Let $A = k$.
		Then a representation of $k$ is just any $k$-vector space $V$.

		\ii If $A = k[x]$,
		then a representation $(V, \rho)$ of $A$
		amounts to a vector space $V$ plus the choice of
		a linear operator $T \in \Mat(V)$ (by $T = \rho(x)$).

		\ii If $A = k[x] / (x^2)$
		then a representation $(V, \rho)$ of $A$
		amounts to a vector space $V$ plus the choice of
		a linear operator $T \in \Mat(V)$ satisfying $T^2 = 0$.

		\ii We can create arbitrary ``functional equations'' with this pattern.
		For example, if $A = k[x,y] / (x^2 - x+y, y^4)$
		then representing $A$ by $V$ amounts to finding operators
		$S, T \in \Mat(V)$ satisfying $S^2 = S-T$ and $T^4 = 0$.
	\end{enumerate}
\end{example}

\begin{example}
	[Representations of groups]
	\listhack
	\begin{enumerate}[(a)]
		\ii Let $A = \RR[S_3]$.
		Then let
		\[ V = \RR^{\oplus 3} = \{ (x,y,z) \mid x,y,z \in \RR \}. \]
		We can let $A$ act on $V$ as follows:
		given a permutation $\pi \in S_3$, we permute the corresponding
		coordinates in $V$.
		So for example, if
		\[ \text{If } \pi = (1 \; 2)
		\text{ then } \pi \cdot (x,y,z) = (y,x,z). \]
		This extends linearly to let $A$ act on $V$,
		by permuting the coordinates.

		From the matrix perspective, what we are doing
		is representing the permutations in $S_3$
		as permutation matrices on $k^{\oplus 3}$, like
		\[ (1 \; 2)
		\mapsto \begin{bmatrix} 0&1&0 \\ 1&0&0 \\ 0&0&1 \end{bmatrix}. \]

		\ii More generally, let $A = k[G]$.
		Then a representation $(V, \rho)$ of $A$
		amounts to a group homomorphism $\psi : G \to \GL(V)$.
		(In particular, $\rho(1_G) = \id_V$.)
		We call this a \vocab{group representation} of $G$.
	\end{enumerate}
\end{example}
\begin{example}[Regular representation]
	Any $k$-algebra $A$ is a representation $(A, \rho)$ over itself,
	with $a \cdot b = \rho(a)(b) = ab$ (i.e.\ multiplication given by $A$).
	This is called the \vocab{regular representation}, denoted $\Reg(A)$.
\end{example}

\section{Direct sums}
\prototype{The example with $\RR[S_3]$ seems best.}
\begin{definition}
	Let $A$ be $k$-algebra and let $V = (V, \rho_V)$ and $W = (W, \rho_W)$
	be two representations of $A$.
	Then $V \oplus W$ is a representation, with action $\rho$ given by
	\[ a \cdot (v,w) = (a \cdot v, a \cdot w). \]
	This representation is called the \vocab{direct sum} of $V$ and $W$.
\end{definition}
\begin{example}
	Earlier we let $\Mat_2(\RR)$ act on $\RR^{\oplus 4}$ by
	\[
		\rho :
		\begin{bmatrix} a & b \\ c & d \end{bmatrix}
		\mapsto
		\begin{bmatrix} a & b & 0 & 0 \\ c & d & 0 & 0 \\
			0 & 0 & a & b \\ 0 & 0 & c & d \end{bmatrix} .
	\]
	So this is just a direct sum of two two-dimensional representations.
\end{example}
More generally, given representations $(V, \rho_V)$ and $(W, \rho_W)$
the representation $\rho$ of $V \oplus W$ looks like
\[ \rho(a) =
	\begin{bmatrix}
		\rho_V(a) & 0 \\ 0 & \rho_W(a)
	\end{bmatrix}.
\]
\begin{example}[Representation of $S_n$ decomposes]
	Let $A = \RR[S_3]$ again,
	acting via permutation of coordinates on
	\[ V = \RR^{\oplus 3} = \{ (x,y,z) \mid x,y,z \in \RR \}. \]
	Consider the two subspaces
	\begin{align*}
		W_1 &= \left\{ (t,t,t) \mid t \in \RR \right\} \\
		W_2 &= \left\{ (x,y,z) \mid x+y+z = 0 \right\}.
	\end{align*}
	Note $V = W_1 \oplus W_2$ as vector spaces.
	But each of $W_1$ and $W_2$ is a subrepresentation
	(since the action of $A$ keeps each $W_i$ in place),
	so $V = W_1 \oplus W_2$ as representations too.
\end{example}

Direct sums also come up when we play with algebras.
\begin{proposition}[Representations of $A \oplus B$ are $V_A \oplus V_B$]
	\label{prop:rep_direct_sum}
	Let $A$ and $B$ be $k$-algebras.
	Then every representation of $A \oplus B$ is of the form
	\[ V_A \oplus V_B \]
	where $V_A$ and $V_B$ are representations of $A$ and $B$, respectively.
\end{proposition}
\begin{proof}[Sketch of Proof]
	Let $(V, \rho)$ be a representation of $A \oplus B$.
	For any $v \in V$, $\rho(1_A+1_B)v = \rho(1_A)v + \rho(1_B)v$.
	One can then set $V_A = \{ \rho(1_A)v \mid v \in V \}$
	and $V_B = \{ \rho(1_B)v \mid v \in V \}$.
	These are disjoint, since if $\rho(1_A) v = \rho(1_B) v'$,
	we have $\rho(1_A)v = \rho(1_A1_A)v = \rho(1_A1_B) v' = 0_V$,
	and similarly for the other side.
\end{proof}

\section{Irreducible and indecomposable representations}
\prototype{$k[S_3]$ decomposes as the sum of two spaces.}

One of the goals of representation theory will be to classify
all possible representations of an algebra $A$.
If we want to have a hope of doing this,
then we want to discard ``silly'' representations such as
\[
	\rho :
	\begin{bmatrix} a & b \\ c & d \end{bmatrix}
	\mapsto
	\begin{bmatrix} a & b & 0 & 0 \\ c & d & 0 & 0 \\
		0 & 0 & a & b \\ 0 & 0 & c & d \end{bmatrix}
\]
and focus our attention instead on ``irreducible'' representations.
This motivates:
\begin{definition}
	Let $V$ be a representation of $A$.
	A \vocab{subrepresentation} $W \subseteq V$ is a subspace $W$
	with the property that for any $a \in A$ and $w \in W$,
	$a \cdot w \in W$.
	In other words, this subspace is invariant under actions by $A$.
\end{definition}
Thus for example if $V = W_1 \oplus W_2$ for representations $W_1$, $W_2$
then $W_1$ and $W_2$ are subrepresentations of $V$.

\begin{definition}
	If $V$ has no proper nonzero subrepresentations then it is \vocab{irreducible}.
	If there is no pair of proper subrepresentations $W_1$, $W_2$ such that $V = W_1 \oplus W_2$,
	then we say $V$ is \vocab{indecomposable}.
\end{definition}
\begin{definition}
	For brevity, an \vocab{irrep} of an algebra/group is a
	\emph{finite-dimensional} irreducible representation.
\end{definition}

\begin{example}[Representation of $S_n$ decomposes]
	Let $A = \RR[S_3]$ again, acting via permutation of coordinates on
	\[ V = \RR^{\oplus 3} = \{ (x,y,z) \mid x,y,z \in \RR \}. \]
	Consider again the two subspaces
	\begin{align*}
		W_1 &= \left\{ (t,t,t) \mid t \in \RR \right\} \\
		W_2 &= \left\{ (x,y,z) \mid x+y+z = 0 \right\}.
	\end{align*}
	As we've seen, $V = W_1 \oplus W_2$, and thus $V$ is not irreducible.
	But one can show that $W_1$ and $W_2$ are irreducible
	(and hence indecomposable) as follows.
	\begin{itemize}
		\ii For $W_1$ it's obvious, since $W_1$ is one-dimensional.
		\ii For $W_2$, consider any vector $w = (a,b,c)$
		with $a+b+c=0$ and not all zero.  Then WLOG we can assume $a \neq b$
		(since not all three coordinates are equal).
		In that case, $(1 \; 2)$ sends $w$ to $w' = (b,a,c)$.
		Then $w$ and $w'$ span $W_2$.
	\end{itemize}
	Thus $V$ breaks down completely into irreps.
\end{example}

Unfortunately, if $W$ is a subrepresentation of $V$,
then it is not necessarily the case that we can find a
supplementary vector space $W'$ such that $V = W \oplus W'$.
Put another way, if $V$ is reducible, we know that it has a subrepresentation,
but a decomposition requires \emph{two} subrepresentations.
Here is a standard counterexample:
\begin{exercise}
	\label{exer:irred_not_indecomp}
	Let $A = \RR[x]$, and $V = \RR^{\oplus 2}$ be the representation with action
	\[ \rho(x) = \begin{bmatrix} 1 & 1 \\ 0 & 1 \end{bmatrix}. \]
	Show that the only subrepresentation is $W = \{ (t,0) \mid t \in \RR \}$.
	So $V$ is not irreducible, but it is indecomposable.
\end{exercise}

Here is a slightly more optimistic example,
and the ``prototypical example'' that you should keep in mind.

\begin{exercise}
	Let $A = \Mat_d(k)$ and consider the obvious representation $k^{\oplus d}$
	of $A$ that we described earlier. Show that it is irreducible.
	(This is obvious if you understand the definitions well enough.)
\end{exercise}

\section{Morphisms of representations}
We now proceed to define the morphisms between representations.

\begin{definition}
	Let $(V, \rho_V)$ and $(W, \rho_W)$ be representations of $A$.
	An \vocab{intertwining operator}, or \vocab{morphism}, is a
	linear map $T : V \to W$ such that
	\[ T(a \cdot v) = a \cdot T(v) \]
	for any $a \in A$, $v \in V$.
	(Note that the first $\cdot$ is the action of $\rho_V$
	and the second $\cdot$ is the action of $\rho_W$.)
	This is exactly what you expect if you think that $V$ and $W$
	are ``left $A$-modules''.
	If $T$ is invertible, then it is an \vocab{isomorphism} of representations
	and we say $V \cong W$.
\end{definition}
\begin{remark}
	[For commutative diagram lovers]
	The condition $T(a \cdot v) = a \cdot T(v)$ can be read as saying that
	\begin{diagram}
		V & \rTo^{\rho_1(a)} & V \\
		\dTo^T & & \dTo_T \\
		W & \rTo_{\rho_2(a)} & W
	\end{diagram}
	commutes for any $a \in A$.
\end{remark}

\begin{remark}
	[For category lovers]
	A representation is just a ``bilinear'' functor from an
	abelian one-object category $\{\ast\}$ (so $\Hom(\ast, \ast) \cong A$)
	to the abelian category $\catname{Vect}_k$.
	Then an intertwining operator is just a \emph{natural transformation}.
\end{remark}

Here are some examples of intertwining operators.
\begin{example}[Intertwining operators]
	\listhack
	\begin{enumerate}[(a)]
		\ii For any $\lambda \in k$, the scalar map $T(v) = \lambda v$
		is intertwining.
		\ii If $W \subseteq V$ is a subrepresentation,
		then the inclusion $W \injto V$ is an intertwining operator.
		\ii The projection map $V_1 \oplus V_2 \surjto V_1$
		is an intertwining operator.
		\ii Let $V  = \RR^{\oplus 2}$
		and represent $A = k[x]$ by $(V, \rho)$ where
		\[ \rho(x) = \begin{bmatrix} 0 & 1 \\ -1 & 0 \end{bmatrix}. \]
		Thus $\rho(x)$ is rotation by $90\dg$ around the origin.
		Let $T$ be rotation by $30\dg$.
		Then $T : V \to V$ is intertwining (the rotations commute).
	\end{enumerate}
\end{example}

\begin{exercise}[Kernel and image are subrepresentations]
	Let $T : V \to W$ be an intertwining operator.
	\begin{enumerate}[(a)]
		\ii Show that $\ker T \subseteq V$ is a subrepresentation of $V$.
		\ii Show that $\img T \subseteq W$ is a subrepresentation of $W$.
	\end{enumerate}
\end{exercise}

The previous lemma gives us the famous Schur's lemma.
\begin{theorem}
	[Schur's lemma]
	Let $V$ and $W$ be representations of a $k$-algebra $A$.
	Let $T : V \to W$ be a \emph{nonzero} intertwining operator.
	Then
	\begin{enumerate}[(a)]
		\ii If $V$ is irreducible, then $T$ is injective.
		\ii If $W$ is irreducible, then $T$ is surjective.
	\end{enumerate}
	In particular if both $V$ and $W$ are irreducible then $T$
	is an isomorphism.
\end{theorem}
An important special case is if $k$ is algebraically closed:
then the only intertwining operators $T \colon V \to V$
are multiplication by a constant.
\begin{theorem}
	[Schur's lemma for algebraically closed fields]
	Let $k$ be an algebraically closed field.
	Let $V$ be an irrep of a $k$-algebra $A$.
	Then any intertwining operator $T \colon V \to V$ is multiplication by a scalar.
	\label{thm:schur_algclosed}
\end{theorem}
\begin{exercise}
	Use the fact that $T$ has an eigenvalue $\lambda$ to
	deduce this from Schur's lemma.
	(Consider $T - \lambda \cdot \id_V$, and use Schur to deduce it's zero.)
\end{exercise}
We have already seen the counterexample of rotation by $90\dg$ for $k = \RR$;
this was the same counterexample we gave to the assertion that all linear maps
have eigenvalues.

\section{The representations of $\Mat_d(k)$}
To give an example of the kind of progress already possible, we prove:
\begin{theorem}
	[Representations of $\Mat_d(k)$]
	\label{thm:rep_1mat}
	Let $k$ be any field, $d$ be a positive integer and
	let $W = k^{\oplus d}$ be the obvious representation of $A = \Mat_d(k)$.
	Then the only finite-dimensional representations
	of $\Mat_d(k)$ are $W^{\oplus n}$
	for some positive integer $n$ (up to isomorphism).
	In particular, it is irreducible if and only if $n=1$.
\end{theorem}
For concreteness, I'll just sketch the case $d=2$,
since the same proof applies verbatim to other situations.
This shows that the examples of representations of $\Mat_2(\RR)$
we gave earlier are the only ones.

As we've said this is essentially a functional equation.
The algebra $A = \Mat_2(k)$ has basis given by four matrices
\[
	E_1 = \begin{bmatrix} 1 & 0 \\ 0 & 0 \end{bmatrix},
	\qquad
	E_2 = \begin{bmatrix} 0 & 0 \\ 0 & 1 \end{bmatrix},
	\qquad
	E_3 = \begin{bmatrix} 0 & 1 \\ 0 & 0 \end{bmatrix},
	\qquad
	E_4 = \begin{bmatrix} 0 & 0 \\ 1 & 0 \end{bmatrix}
\]
satisfying relations like $E_1 + E_2 = \id_A$, $E_i^2 = E_i$, $E_1E_2 = 0$, etc.
So let $V$ be a representation of $A$, and let $M_i = \rho(E_i)$ for each $i$;
we want to classify the possible matrices $M_i$ on $V$
satisfying the same functional equations.
This is because, for example,
\[ \id_V = \rho(\id_A) = \rho(E_1+E_2) = M_1 + M_2. \]
By the same token $M_1M_3 = M_3$.
Proceeding in a similar way, we can obtain the following multiplication table:
\[
	\begin{array}{r|llll}
		\times & M_1 & M_2 & M_3 & M_4 \\ \hline
		M_1 & M_1 & 0 & M_3 & 0 \\
		M_2 & 0 & M_2 & 0 & M_4 \\
		M_3 & 0 & M_3 & 0 & M_1 \\
		M_4 & M_4 & 0 & M_2 & 0
	\end{array}
	\qquad \text{and} \qquad
	M_1 + M_2 = \id_V
\]
Note that each $M_i$ is a linear operator $V \to V$;
for all we know, it could have hundreds of entries.
Nonetheless, given the multiplication table of the basis $E_i$
we get the corresponding table for the $M_i$.

So, in short, the problem is as follows:
\begin{moral}
	Find all vector spaces $V$ and quadruples of matrices $M_i$
	satisfying the multiplication table above.
\end{moral}

Let $W_1 = M_1\im(V)$ and $W_2 = M_2\im(V)$ be the images of $M_1$ and $M_2$.
\begin{claim}
	$V = W_1 \oplus W_2$.
\end{claim}
\begin{proof}
	First, note that for any $v \in V$ we have
	\[ v = \rho(\id)(v) = (M_1+M_2)v = M_1v + M_2v. \]
	Moreover, we have that $W_1 \cap W_2 = \{0\}$, because if
	$M_1v_1 = M_2v_2$ then $M_1v_1 = M_1(M_1v_1) = M_1(M_2v_2) = 0$.
\end{proof}
\begin{claim}
	$W_1 \cong W_2$.
\end{claim}
\begin{proof}
	Check that the maps
	\[ W_1 \taking{\times M_4} W_2
		\quad\text{and}\quad
		W_2 \taking{\times M_3} W_1 \]
	are well-defined and mutually inverse.
\end{proof}
Now, let $e_1, \dots, e_n$ be basis elements of $W_1$;
thus $M_4e_1$, \dots, $M_4e_n$ are basis elements of $W_2$.
However, each $\{e_j, M_4e_j\}$ forms a basis of a subrepresentation
isomorphic to $W = k^{\oplus 2}$ (what's the isomorphism?).

This finally implies that all representations of $A$
are of the form $W^{\oplus n}$.
In particular, $W$ is irreducible because there are no representations
of smaller dimension at all!

\section\problemhead
\begin{dproblem}
	\label{prob:one_dim}
	Suppose we have \emph{one-dimensional} representations
	$V_1 = (V_1, \rho_1)$ and $V_2 = (V_2, \rho_2)$ of $A$.
	Show that $V_1 \cong V_2$ if and only if
	$\rho_1(a)$ and $\rho_2(a)$ are multiplication
	by the same constant for every $a \in A$.
\end{dproblem}

\begin{dproblem}
	[Schur's lemma for commutative algebras]
	Let $A$ be a \emph{commutative} algebra
	over an algebraically closed field $k$.
	Prove that any irrep of $A$ is one-dimensional.
	\begin{hint}
		For any $a \in A$, the map $v \mapsto a \cdot v$ is intertwining.
	\end{hint}
\end{dproblem}

\begin{sproblem}
	\label{prob:reg_mat}
	Let $(V, \rho)$ be a representation of $A$.
	Then $\Mat(V)$ is a representation of $A$
	with action given by
	\[ a \cdot T = \rho(a) \circ T \]
	for $T \in \Mat(V)$.
	\begin{enumerate}[(a)]
		\ii Show that $\rho : \Reg(A) \to \Mat(V)$ is an intertwining operator.
		\ii If $V$ is $d$-dimensional, show that $\Mat(V) \cong V^{\oplus d}$
		as representations of $A$.
	\end{enumerate}
	\begin{hint}
		For part (b), pick a basis and do $T \mapsto (T(e_1), \dots, T(e_n))$.
	\end{hint}
\end{sproblem}

\begin{sproblem}
	\label{prob:regA_intertwine}
	Fix an algebra $A$.
	Find all intertwining operators
	\[ T : \Reg(A) \to \Reg(A). \]
	\begin{hint}
		Right multiplication.
	\end{hint}
	\begin{sol}
		The operators are those of the form $T(a) = ab$
		for some fixed $b \in A$.
		One can check these work, since for $c \in A$
		we have $T(c \cdot a) = cab = c \cdot T(a)$.
		To see they are the only ones, note that
		$T(a) = T(a \cdot 1_A) = a \cdot T(1_A)$ for any $a \in A$.
	\end{sol}
\end{sproblem}

\begin{problem}
	\gim
	Let $(V, \rho)$ be an \emph{indecomposable}
	(not irreducible) representation of an algebra $A$.
	Prove that any intertwining operator $T : V \to V$
	is either nilpotent or an isomorphism.

	(Note that \Cref{thm:schur_algclosed} doesn't apply,
	since the field $k$ may not be algebraically closed.)
	\begin{hint}
		Apply \Cref{prob:endomorphism_eventual_lemma}.
	\end{hint}
\end{problem}


\documentclass{tufte-handout}

\usepackage{xcolor}
\usepackage{graphicx}

% set hyperlink attributes
\hypersetup{colorlinks}

\usepackage{amsmath}

% set image attributes:
\usepackage{graphicx}
\graphicspath{ {images/} }

% create environment for bottom paragraph:
\newenvironment{bottompar}{\par\vspace*{\fill}}{\clearpage}

% ============================================================

% define the title
\title{SOC 4930/5050: Week 05 Equations Quick \\Reference}
\author{Christopher Prener, Ph.D.}
\date{September 25\textsuperscript{th}, 2017}
% ============================================================
\begin{document}
% ============================================================
\maketitle % generates the title
% ============================================================

\vspace{5mm}
\section{Binomial Distribution}
For the binomial distribution, let: \\
\noindent $n =$ number of independent trials \\
\noindent $p =$ probability of success in each trial

\paragraph{Mean}\mbox{}\\
\begin{equation}
\scalebox{2} {$ \mu = np $}
\end{equation}

\paragraph{Standard Deviation}\mbox{}\\
\begin{equation}
\scalebox{2} {$ \sigma =\sqrt { np\left( 1-p \right)  } $}
\end{equation}

\vspace{5mm}
\section{Poisson Distribution}
For the Poisson distribution, let: \\
\noindent $n =$ count of independent events \\
\noindent $p =$ probability of success in each event \\
\begin{equation}
\scalebox{2} {$ \lambda = np $}
\end{equation}

\vspace{5mm}
\section{Standard Normal Distribution}
\paragraph{Standardized Scores: Population}\mbox{}\\
\begin{equation}
\scalebox{2} {$ z = \frac{x-\mu}{\sigma} $}
\end{equation}

\paragraph{Standardized Scores: Sample}\mbox{}\\
\begin{equation}
\scalebox{2} {$ z = \frac{x-\bar{x}}{s} $}
\end{equation}

\vspace{5mm}
\section{Skew}\marginnote{Note that $sk$ is an abbreviation that I use in my classes to differentiate skew from standard deviation. There is no single accepted abbreviation for skew. Similarly, there are a number of equations in use to calculate skew; this is one that I teach because it simplifies some of the required calculations.}
\begin{equation}
\scalebox{2} {$ sk = \sqrt{n}\frac { \sum _{ i=1 }^{ n }{ \left( {x}_{i}-\bar{x} \right)^3 }  }{ \left( \sum _{ i=1 }^{ n }{ \left( { x }_{ i }-\bar{x} \right)^2 }  \right)^\frac{3}{2}  } $}
\end{equation}

\vspace{5mm}
\section{Kurtosis}\marginnote{Note that there are a number of accepted abbreviations for kurtosis including $k$. There are also a number of equations in use to calculate kurtosis. As with skew, this is one that I teach because it simplifies some of the required calculations.}
\begin{equation}
\scalebox{2} {$ k = n\frac { \sum _{ i=1 }^{ n }{ \left( {x}_{i}-\bar{x} \right)^4 }  }{ \left( \sum _{ i=1 }^{ n }{ \left( { x }_{ i }-\bar{x} \right)^2 }  \right)^2  } $}
\end{equation}
% ============================================================
\end{document}


\documentclass[11pt]{article}

\usepackage[headings]{fullpage}
\usepackage[utopia]{mathdesign}

\pagestyle{myheadings}
\markboth{}{Conditioning}

\input{../../fncextra}

\begin{document}

\begin{center}
  \bf Rooting for accuracy
\end{center}

Suppose we have a quadratic polynomial $p(x;s) = a(s)x^2+b(s)x+c(s)$ whose coefficients depend on a parameter $s$. In this lab, we define
\begin{equation}
  \label{eq:poly}
  p(x;s) = 9x^2 - (6+s)x + 1.
\end{equation}
For each value of $s$ there are two roots $t_1(s)$ and $t_2(s)$. Since $a$, $b$, and $c$ vary continuously as a function of $s$, $t_1(s)$ and $t_2(s)$ are also continuous.

The effect of roundoff in floating point calculations is to perturb the coefficients of $p$ by a relative amount $\macheps$. As a result, the roots may change by a relative amount $\kappa \macheps$, where $\kappa$ is the condition number of the roots. In the text it's shown in a special case that for the root $t_k$, the condition number is given by
\begin{equation}
  \label{eq:kappa}
  \kappa = |t_k|/|t_1-t_2|.
\end{equation}
If $t_1\approx t_2$, the errors in the computed roots are potentially large (compared to machine precision). In our case $p(x;0)=(3x-1)^2$, which makes $\kappa$ formally infinite, so $s=0$ is critical to the conditioning of the roots.

%Even when a computed $\tilde{t}_k$ is not close to $t_k$, however, it may still be the case that the \textbf{residual} $p(\tilde{t}_k;s)$ is close to zero. In practical computations we usually don't know the error, but we can always compute the residual.

\subsection*{Goals}

You will examine the sensitivity of the roots of a quadratic polynomial whose roots come together, coalesce, and separate again.

\subsection*{Preparation}

Read section~1.2 and the online help for the \texttt{roots} and \texttt{polyval} commands.

In MATLAB, perform the following.
\begin{verbatim}
t1 = @(s) (6+s+sqrt((6+s).^2-36))/18;
t2 = @(s) (6+s-sqrt((6+s).^2-36))/18;
s = linspace(-1,1,800)';
plot(t1(s),'r.')
hold on
plot(t2(s),'b.')
xlabel('real part'),  ylabel('imaginary part')
title('Roots for -1 < s < 1')
\end{verbatim}
Use the resulting picture to describe in words what happens to the roots as the parameter $s$ passes from negative to positive values.

\subsection*{Procedure}

Download the template script and complete it in sections as guided below.

\begin{enumerate}
\item Define the functions \texttt{t1} and \texttt{t2} as in the Preparation section above.

\item Let $s=-0.1$. Use \texttt{roots} to compute the two roots of $p(x;s)$ as a vector \texttt{r}. One complication is that we don't know whether \texttt{r(1)} is meant to be $t_1$ or $t_2$. So we compute its error by means of
\begin{verbatim}
err1 = min( abs(r(1)-t1(s)), abs(r(1)-t2(s)) )
\end{verbatim}
  Find this value. Then find $\kappa$ from~\eqref{eq:kappa} with $k=1$.

\item Define the vector
\begin{verbatim}
s = linspace(-1,1,800)';
\end{verbatim}
  In a loop over the entries of the vector \texttt{s}, find the error and $\kappa$, storing the results in vectors. The template has code for plotting the results.

\item Nothing in the previous step indicates much reason for concern. However, the results are strikingly different if we approach very close to $s=0$. Define
\begin{verbatim}
s = logspace(-15,-1,100)';
\end{verbatim}
Then repeat the loop from step~3.
\end{enumerate}

\subsection*{Going further}

We always compute with a fixed value of $\varepsilon_{\text{mach}}$, but we can simulate the effect of varying it by manually perturbing data. For example, a relative perturbation of size $\delta$ to each entry of vector $y$ is made by
\begin{verbatim}
r = 2*rand(size(y))-1;    % random in [-1,1]
yy = y .* (1+delta*r);
\end{verbatim}
For each $\delta=10^{-6},10^{-8},10^{-10},10^{-12},10^{-14}$, make 500 random perturbations to the coefficient vector of $p(x;0)$, each time using \texttt{roots} to find the resulting roots and plotting them in the complex plane. (You should end up five plots, each with 1000 points.)

\end{document}

%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:


\section{Application: Balancing chemical reactions}

The tools of linear algebra can also be used in the subject area of
Chemistry, specifically for balancing chemical reactions.  Consider
the chemical reaction%
\index{chemical reactions!balancing}
\begin{equation*}
  SnO_2+H_2\rightarrow Sn+H_2O.
\end{equation*}
Here the elements involved are tin ($Sn$), oxygen ($O$), and hydrogen
($H$). A chemical reaction occurs that transforms a combination of tin
dioxide ($SnO_2$) and hydrogen ($H_2$) into a combination of tin
($Sn$) and water ($H_2O$). When considering chemical reactions, we
want to investigate how much of each substance we began with and how
much of each substance is involved in the result.

An important theory we will use here is the mass balance theory. It
tells us that we cannot create or delete elements within a chemical
reaction. For example, in the above expression, we must have the same
number of atoms of oxygen, tin, and hydrogen on both sides of the
reaction. Notice that this is not currently the case.  For example,
there are two oxygen atoms on the left and only one on the right. In
order to fix this, we want to find numbers $x,y,z,w$ such that
\begin{equation*}
  x\;SnO_2+y\;H_2\rightarrow z\;Sn+w\;H_2O,
\end{equation*}
where both sides of the reaction have the same number of atoms of the
various elements.

This is a familiar problem. We can solve it by setting up a system of
equations in the variables $x,y,z,w$. Thus we need
\begin{equation*}
  \begin{array}{cl}
    Sn: & x=z \\
    O: & 2x=w \\
    H: & 2y=2w.
  \end{array}
\end{equation*}
We can rewrite these equations as
\begin{equation*}
  \begin{array}{cl}
    Sn: & x - z = 0 \\
    O: & 2x - w = 0 \\
    H: & 2y - 2w = 0.
  \end{array}
\end{equation*}
The augmented matrix for this system of equations is given by
\begin{equation*}
  \begin{mymatrix}{rrrr|r}
    1 & 0 & -1 & 0 & 0 \\
    2 & 0 & 0 & -1 & 0 \\
    0 & 2 & 0 & -2 & 0
  \end{mymatrix}.
\end{equation*}
The {\rref} of this matrix is
\begin{equation*}
  \def\arraystretch{1.2}
  \begin{mymatrix}{rrrr|r}
    1 & 0 & 0 & -\frac{1}{2} & 0 \\
    0 & 1 & 0 & -1 & 0 \\
    0 & 0 & 1 & -\frac{1}{2} & 0
  \end{mymatrix},
\end{equation*}
and the solution is given in parametric form as
\begin{equation*}
  \begin{array}{r@{~}c@{~}ll}
    x &=& \frac{1}{2} t \\
    y &=& t \\
    z &=& \frac{1}{2}t \\
    w &=& t.
  \end{array}
\end{equation*}
For example, let $t=2$ and this would yield $x=1$, $y=2$, $z=1$, and
$w=2$. We can put these values back into the expression for the
reaction which yields
\begin{equation*}
  SnO_2+2H_2\rightarrow Sn+2H_2O.
\end{equation*}
Observe that each side of the expression contains the same number of
atoms of each element. This means that the chemical reaction is
balanced. Of course, because it is a homogeneous system of equations,
any multiple of a solution is also a solution. For example,
\begin{equation*}
  2SnO_2+4H_2\rightarrow 2Sn+4H_2O
\end{equation*}
is also correct. It just means that we have just doubled the amount of
every substance involved. In chemistry, the numbers you are finding
would typically be the number of mols of the molecules on each
side. Thus one mol of $SnO_2$ added two mols of $H_2$ yields one mol
of $Sn$ and two mols of $H_2O$.

Here is another example.

\begin{example}{Balancing a chemical reaction}{balancing-chem}
  Potassium is denoted by $K$, oxygen by $O$, phosphorus by $P$ and
  hydrogen by $H$.  Consider the reaction given by
  \begin{equation*}
    KOH+H_3PO_4\rightarrow K_3PO_4+H_2O.
  \end{equation*}
  Balance this chemical reaction.
\end{example}

\begin{solution}
  We will use the same procedure as above to solve this problem. We
  need to find values for $x,y,z,w$ such that
  \begin{equation*}
    x\;KOH+y\;H_3PO_4\rightarrow z\;K_3PO_4+w\;H_2O.
  \end{equation*}
  preserves the total number of atoms of each element.  Finding these
  values can be done by finding the solution to the following system
  of equations.
  \begin{equation*}
    \begin{array}{cl}
      K: & x=3z \\
      O: & x+4y=4z+w \\
      H: & x+3y=2w \\
      P: & y=z.
    \end{array}
  \end{equation*}
  The augmented matrix for this system is
  \begin{equation*}
    \begin{mymatrix}{rrrr|r}
      1 & 0 & -3 & 0 & 0 \\
      1 & 4 & -4 & -1 & 0 \\
      1 & 3 & 0 & -2 & 0 \\
      0 & 1 & -1 & 0 & 0
    \end{mymatrix},
  \end{equation*}
  and the {\rref} is
  \begin{equation*}
    \def\arraystretch{1.2}
    \begin{mymatrix}{rrrr|r}
      1 & 0 & 0 & -1 & 0 \\
      0 & 1 & 0 & -\frac{1}{3} & 0 \\
      0 & 0 & 1 & -\frac{1}{3} & 0 \\
      0 & 0 & 0 & 0 & 0
    \end{mymatrix}.
  \end{equation*}

  The general solution is given in terms of the parameter $t$ as
  \begin{equation*}
    \begin{array}{c}
      x = t \\
      y = \frac{1}{3}t \\
      z = \frac{1}{3}t \\
      w = t
    \end{array}
  \end{equation*}
  Choose a value for $t$, say $3$. This yields $x=3$, $y=1$, $z=1$,
  and $w=3$. It follows that the balanced reaction is given by
  \begin{equation*}
    3KOH+H_3PO_4\rightarrow K_3PO_4+3H_2O
  \end{equation*}
  Note that this results in the same number of atoms of each element
  on both sides.
\end{solution}


Deep Neural Networks (DNNs) consists of connected layers of different types. These types of layers will be discussed in this section

\subsection{Fully Connected layer}

A Fully Connected (FC) layer is a layer where every neuron from the previous layer is connected to every neuron in the next layer (See Figure 1). It is the basic layer in most of Deep Learning Systems, however due to the number of operations it has a big complexity (matrix multiplication is around $O(n^3)$  in big O notation). The face images used in this study were images of size $224 \times 224$ with 3 RGB channels. If in the first hidden layer we would have 1000 nodes it would be $224 \times 224 \times 1000 = 50176000$ parameters to optimize (it is only the first layer). For this reason, we must somehow reduce the number of parameters, for example by using convolution layers.

\subsection{Convolution layer}

Convolution Layer is an idea based on edge detection. Edge detection was one of early techniques used to solve computer vision problems, as the name suggest it allows us to detect edges in a given image (See Figure 3). The Edge detection  algorithm  is  performed using a matrix called a mask and an operation called convolution. It takes matrix of size m (size of a mask) from input image, multiply it element-wise by values in mask, sums all values and as a result returns edges detected in input image (See Figure 2). The general expression of a convolution is:
\begin{equation}
g(x, y)=(\omega * f)(x, y)=\sum_{s=-a}^{a} \sum_{t=-b}^{b} \omega(s, t) f(x-s, y-t)
\end{equation}

Where $g(x,y)$ is the filtered image, $f(x,y)$ is the original image, $\omega$ is the filter kernel. Every element of the filter kernel is considered by $-a \leqslant s \leqslant a$ and $-b \leqslant t \leqslant b$ \footnote{Equation from Wikipedia \url{https://en.wikipedia.org/wiki/Kernel_(image_processing)}}
\newline

Using hand-engineered filters values we can detect horizontal or vertical edges (See Figure 4) but what if we want to detect some more sophisticated features like cat edges (See Figure 5)? This is where deep learning comes in: Instead of using hand-engineered filter values we can use a Gradient Descent Algorithm to find the right values for mask matrix.

What is interesting at this point is the fact that regardless of the image size, we have same number of parameters to train. No matter if our image is $20 \times 20$ pixels or $1000 \times 1000$ we need to train the same number of parameters - the number of values in filter mask. It is one of main reasons why CNNs are so popular in real life computer vision problems.

The role of convolution layer is to extract crucial information (edges) from image by using custom filter masks. The side benefit of detecting edges can be reduction of image size (it is not always the case, it depends on used padding see Sec. 3.5 Padding). Outcome of Convolution Layer (the one consisting crucial information about edges) can be then propagated to Fully Connected Layers to perform classification.

   \begin{figure}[!ht]
  \centering
  \framebox{\parbox{5.5in}{$
    \begin{bmatrix}
        0 & 0 & 0 & 10 & 10 & 10\\
        0 & 0 & 0 & 10 & 10 & 10\\
        0 & 0 & 0 & 10 & 10 & 10\\
        0 & 0 & 0 & 10 & 10 & 10\\
        0 & 0 & 0 & 10 & 10 & 10\\
        0 & 0 & 0 & 10 & 10 & 10\\
    \end{bmatrix}_{img} * \begin{bmatrix}
        -1 & 0 & 1\\
        -1 & 0 & 1\\
        -1 & 0 & 1\\
    \end{bmatrix}_{mask} =
    \begin{bmatrix}
        0 & 30 & 30 & 0\\
        0 & 30 & 30 & 0\\
        0 & 30 & 30 & 0\\
    \end{bmatrix}_{detected \: edge}
    $
    }}
  %\includegraphics[scale=1.0]{figurefile}
  \caption{Example convolution operation}
  \label{figurelabel}
\end{figure}

\begin{figure}[!ht]
  \centering
  \includegraphics[scale=0.35]{Images/bikes-gray-sobel.jpg}
  \caption{Detected edges after applying Sobel filter\protect\footnotemark}
  \label{figurelabel}
\end{figure}

\footnotetext{Cat edges from \url{http://mcogswell.io/blog/why_cat_2/}}

\begin{figure}[!ht]
  \centering{
  \framebox{\parbox{4in}{
  $\begin{bmatrix}
-1 & 0 & 1\\
-2 & 0 & 2\\
-1 & 0 & 1\\
\end{bmatrix}_{0} $       $\begin{bmatrix}
0 & 1 & 2\\
-1 & 0 & 1\\
-2 & -1 & 0\\
\end{bmatrix}_{45} $  $\begin{bmatrix}
1 & 2 & 1\\
0 & 0 & 0\\
-1 & -2 & 1\\
\end{bmatrix}_{90} $
}}}

  \caption{Example edge detection Sobel filter for angles: \ang{0}, \ang{45} and \ang{90}}
  \label{figurelabel}
\end{figure}

\begin{figure}
\centering
\includegraphics[width=0.5\textwidth]{Images/cat-features.png}
\caption{Cat edges recognized by individual CNN layers\protect\footnotemark}
\end{figure}

\footnotetext{Example detected egdes image from \url{https://en.wikipedia.org/wiki/Sobel_operator}}

\subsection{Convolution operation on volume}

Black and white images contain only single color channel, but in color images there are more. E.g. color RGB Image contains 3 channels (Red, Green, Blue). In that case each filter need to have 3 "sub filters", one for each channel. We apply convolution operation to each channel and then sum up the result (See Figure 6).
\newline

\begin{figure}[ht]
\centering
\includegraphics[width=0.5\textwidth]{Images/convolution-operation-on-volume.png}
\caption{Convolution on volume example [11]}
\end{figure}

\subsection{Multiple filters}

To detect multiple types of features in previous layer we should use multiple filters. E.g. one filter will detect vertical edges and one will detect horizontal (See Figure 7).

\begin{figure}[ht]
\centering
\includegraphics[width=0.5\textwidth]{Images/convolution-with-multiple-filters.png}
\caption{Convolution with multiple filters example[11]}
\end{figure}

\subsection{Padding}

To avoid underrepresentation of edge pixels it is worth to add one layer of extra pixels around original image (See Figure 8).

\begin{figure}
\centering
\includegraphics[width=0.5\textwidth]{Images/padding.png}
\caption{Example of 1 pixel padding [11]}
\end{figure}

\subsection{Stride}

Stride determines the number of cells that the filter moves in the input to calculate cell in output (See Figure 9).

\begin{figure}
\centering
\includegraphics[width=0.5\textwidth]{Images/stride.png}
\caption{Example output for stride equal 2[11]}
\end{figure}

\subsection{Pooling layer}

Another type of layer used in CNNs is Pooling Layer. There are two types of Pooling Layers: Avg. Pooling and Max Pooling.  Pooling layers significantly reduce size of an image. The intuition behind pooling is \textit{take most important information} for Max Pooling and \textit{take average of all information} for Avg Pooling. (See Figure 10).

\begin{figure}
\centering
\includegraphics[width=0.5\textwidth]{Images/pooling-layer.png}
\caption{Outputs after pooling operations [11]}
\end{figure}


\section{Reasoning}

\subsection{Beweismethoden}
\begin{tabular}{ll}
    Direkter Beweis & $ p \rightarrow q $ \\
    Beweis durch Kontraposition & $ \neg q \rightarrow \neg p $ \\
    Beweis durch Widerspruch & $ \neg p \rightarrow q $ \\
\end{tabular}

\subsection{Induktionsbeweis}
\begin{tabular}{ll}
    Induktionshypothese & $P(k)$ \\
    Induktionsverankerung & $P(1)$ \\
    Induktionsschritt & $P(k) \to P(k+1)$ \\
\end{tabular} \\

$[P(1) \land \forall k (P(k) \to P(k+1))] \to \forall n P(n)$

\subsection{Schlussregeln / Inferenzregeln}
\begin{tabular}{ll}
    Modus ponens & $((p \to q) \land p) \to q$ \\
    Modus tollens & $((\neg q \land (p \to q))) \to \neg p$ \\
    Hypothetischer & \multirow{2}{*}{$((p \to q) \land (q \to r)) \to (p \to r)$} \\
    Syllogismus & \\
    Disjunktiver & \multirow{2}{*}{$((p \lor q) \land \neg p) \to q$} \\
    Syllogismus & \\
    Addition & $p \to (p \lor q)$ \\
    Simplifikation & $(p \land q) \to p$ \\
    Konjunktion & $((p) \land (q)) \to p \land q$ \\
    Resolution & $((p \land q) \land (\neg p \lor r)) \to (q \lor r)$ \\
\end{tabular} \\