\documentclass{article}
    % General document formatting
    \usepackage[margin=0.7in]{geometry}
    \usepackage[parfill]{parskip}
    \usepackage[utf8]{inputenc}

    \usepackage{graphicx}
    % Related to math
    \usepackage{amsmath,amssymb,amsfonts,amsthm}

    \newtheorem{theorem}{Theorem}
    \newtheorem{lemma}{Lemma}
    \newtheorem*{definition}{Definition}

\begin{document}

\setcounter{section}{-1}

\title{Electronic information processing and cybernetics - An algebrasation of the synthesis problem for circuits}
\author{G\"{u}nter Hotz}
\date{March 1965}

\maketitle
\begin{abstract}
  The composition of switching circuits $A$, $B$, to new circuits can be reduced to two basic operations:
  \begin{enumerate}
    \item The sequential composition $A \circ B$ of $A$ and $B$, if the number of outputs of $B$ is equal to the number of inputs of $A$.
    \item The composition of $A$ and $B$ to $A\times B$ analogue to the cartesian product. The number of inputs of $A\times B$ is equal the sum of the numbers of the inputs of $A$ and $B$. The same holds for the outputs.
  \end{enumerate}
  Between different compositions a equivalence is introduced which is compatible with "$\circ$" and "$\times$". When the compositions are carried over to the set of the equivalence classes, one gets a algebraical structure, that forms category respective to "$\circ$" and semi-group (monoid) respectice "$\times$". The compositions satisfy the relation
  \[ (A\times B) \circ (C \times D) = (A \circ C) \times (B \circ D) \]
  if $A\circ C$ and $B\circ D$ are defined. A category with this property is called a X-category.
  The X-categories $\mathcal{F}$ studied here can be characterized in the following way:
  \begin{enumerate}
  \item The set of units of $\mathcal{F}$ form a semi-group generated by one generator relative to "$\times$",
  \item $\mathcal{F}$ has a countable generator set or it holds
  \item $\mathcal{F}$ is a subcategory of a category satisfying 1 and 2.
  \end{enumerate}

    In the free X-category of "plane nets" a concept of the combinatorial topology related to the braids of ARTIN plays an important role. Each of the studied free X-categories $\mathcal{F}$ may be mapped on to a X-category of plane nets by a functor. Each theorem about $\mathcal{F}$ by the functor is carried over to a theorem about a category of nets. The theorem proved for the nets can easy be proved in most cases for $\mathcal{F}$; i.e. the theorems about $\mathcal{F}$ have an essential
    combinatorial character. This is the reason that the first chapter only deals about nets.

    The connection of the switching circuits represented by the elements of $\mathcal{F}$ their function gives a functor from $\mathcal{F}$ into the X-category $\mathcal{C}_S$ of maps of the type $f: S^n \rightarrow S^m$, where $S$ is a countable set containing at least two elements. The "$\times$"-product is in $\mathcal{C}_S$ the catesian product.
\end{abstract}

\section{Introduction}
The occasion for this work is a problem from automata theory: From a given set of building blocks an automaton, whose functionality is predetermined, shall be assembled. From the different, eventually existing  solutions the cheapest shall be selected.

A building block $A \in \mathcal{U}$ is a physical, mostly electrical device with $Q(A)$ inputs and $Z(A)$ outputs. For each input a Set $S$ of input signals is permitted, on which the building block reacts with output signals. We assume the following simplifications with regard to the issue, the following holds:

\begin{enumerate}
\item For each input of the elements of $\mathcal{U}$ a set of signals $S$ is prescribed, and each element of $S^n$ is allowed as input signal for $A$ with $n = Q(A)$.
\item The set of output signals of $A \in \mathcal{U}$ lies in $S^m$ with $m = Z(A)$.
\item If at time $t$ the input signal $s \in S^n$ is applied to $A$, then the output signal at time $t$ is uniquely determined by $s$. (We therefore neglect the finite propagation speed of signals).
\end{enumerate}

Thus, the finite automaton is completely described by its function $\phi(A):S^n \rightarrow S^m$. It is presumed that inputs and outputs of $A$ are labeled with a fixed numbering from $1$ to $Q(A)$, and respectively from $1$ to $Z(A)$. The $i$-th input (output) is assigned to the $i$-th component of $S^n$ ($S^m$).

An element of $\mathcal{U}$ is a circuit. If $A$ and $B$ are circuits with $Q(A)$, or $Q(B)$ inputs and $Z(A)$, or respectively $Z(B)$ outputs, then we build new circuits from $A$ and $B$ by integrating them to a new element $A\times B$ with $Q(A)+Q(B)$ inputs and $Z(A)+Z(B)$ outputs. We declare the $i$-th input of $A$ as the $i$-th input of $A\times B$ and the $i$-th input of $B$ as the $(Q(A) + i)$-th input of $A\times B$ (figure \ref{fig:figure1}).

\begin{figure}
\includegraphics[]{figure1.png}
  \centering
\caption{}
\label{fig:figure1}
\end{figure}

If $Z(A) = Q(B)$ we get from $A$ and $B$ a circuit $B\circ A$ by switching the $i$-th output of $A$ to the $i$-th input of $B$.

A circuit of elements of $\mathcal{U}$ is a device, which is described inductively by the preceding explanations.

If $\phi(A)$ ($\phi(B)$) is the function of circuit $A$ ($B$), then $\phi(A)\times \phi(B)$ is the function of $A\times B$, and $\phi(B)\circ \phi(A)$ for $Q(B) = Z(A)$  is the function of $B\circ A$.

The costs for the building blocks in $\mathcal{U}$ shall be defined by the function $L : \mathcal{U} \rightarrow N \cup \{0\}$. We define:

\[
\begin{array}{lcr}
L(A\times B) & = & L(A) + L(B), \\
L(B\circ A) & = & L(A) + L(B).
\end{array}
\]

Hereby a price is assigned to each circuit.

Now, the task is the following: Given $f : S^n \rightarrow S^m$, find a circuit $A$ with $\phi(A) = f$ and
\[
L(A) = \min_{B \in \phi^{-1}(f)} \{ L(B) \}.
\]

If $f$ does not fully map to $S^n$, but only to $R \subset S^n$, then the optimum shall be searched on $\cup_{g|R=f} \phi^{-1}(g)$.

The task is generalized in an obvious way, if $Q(f) = Z(F) = S^n$ and $f$, as it is often the case with finite automata, is determined just by a transformation of $S^n$,

In order to solve this problem it appears advantageous to know relations, which allow to generate from an element $A \in \phi^{-1}(f)$ all the elements from the class $\phi^{-1}(f)$.

In the first two sections of this work a theory of interconnection of automata will be developed, as already sketched out in the description of the task:

First, the topological notion of a \emph{planar} network is introduced. The binary operators "$\circ$" and "$\times$" will be explained for these networks. One obtains an algebraic structure $\mathcal{R}$, which is a category with respect to "$\circ$" and a semi-group with respect to "$\times$". $\mathcal{R}$ turns out to be a generalisation of the D-category (category with direct products), which we want to call \emph{$X$-Kategorie}.

$\mathcal{R}$ reflects the interconnection of automata, but does not reflect the possibility of different building blocks with the same number of inputs and outputs. This will be accommodated by assigning symbols of the alphabet $\mathcal{U}$ to inner points of the network, respecting the functions $Q : \mathcal{U} \rightarrow N \cup {0}$ and $Z : \mathcal{U} \rightarrow N \cup {0}$. One arrives at an $X$-Kategorie $\mathcal{F}(\mathcal{U})$, which possesses $\mathcal{U}$ as a free family of
generators. The elements of $\mathcal{F}(\mathcal{U})$ correspond to the set of circuits which may be yielded from $\mathcal{U}$. The mapping $\phi$, which assigns to each automaton its functions, becomes a functor $\phi:\mathcal{F}(\mathcal{U}) \rightarrow \mathcal{C}$, where $\mathcal{C}$ is the category of mappings of type $S^n \rightarrow S^m$.

The introduction of the quotient category  $\mathcal{F}(\mathcal{U})/\mathcal{R}$ from $\mathcal{F}(\mathcal{U})$ to a relational system $\mathcal{R}$ forms the basis for the study of classes $\phi^{-1}(f)$. In section 3 $\phi^{-1}(f)$ will be studied for certain categories $\mathcal{F(U)}$ and distinguished functors $\phi$: We consider only families of generators $\mathcal{U}$ with $\{U, V, D\} \subset \subset \mathcal{U}$ and $Z(A) = 1$ for $A\in \mathcal{U} \setminus \{U, V, D\}$ and functors $\phi$, for which $\phi(U)$ is the mapping from $S$
to $S^{\circ}$, $\phi(V)$ the permutation of the components of $S^2$, and $\phi(D)$ the diagonalisation $S \rightarrow S^2$. Such functions are called \emph{normal}. A relational system $\mathcal{R}$ will be given with the following property: For each normal $\phi$ it holds that $\phi(F) = \phi(G)$ for $F, G \in \mathcal{F}(\mathcal{U})$, iff $F\equiv G(\mathcal{R})$. $\mathcal{F}(\mathcal{U})/\mathcal{R}$ is a $D$-category and $\mathcal{U} \setminus \{U, V, D\}$ a free family of generators of the
$D$-category.

Thus, the relational system allows to simplify the representations $F$ of a function $\phi(F)$, which are possible without the knowledge of the elements in $\mathcal{U} \setminus \{ U, V, D \}$. Figure \ref{fig:figure2} shows that there are proper simplifications in this system.

\begin{figure}
\includegraphics[]{figure2.png}
  \centering
\caption{}
\label{fig:figure2}
\end{figure}

In this work we allow an arbitrary countable set for $S$, such that these results can also be of interest for computer programming. If one wants to formally simplify programs which are constructed from sub-programs, then the number of possible sub-programs renders the specific consideration of the computed function infeasible, but the rules for the transformation of programs have to be applicable uniformly for all sub-programs. Thus, that means that the allowed relations have to be the system
$\mathcal{R}$ or an equivalent system.

For an orientation on the state of the art of the theory of circuit synthesis refer to \cite{circuit-synthesis}, in relation to Streckenkpomplexen to \cite{combinatory-topology} and category theory to \cite{categories-functors} and \cite{category-theory}.
For stimulating discussions and critical remarks I want to thank J. D\"{o}rr and D. Puppe. My thanks go to the Deutsche Forschungsgemeinschaft, who has supported this study with a grant of the FRITZ-THYSSEN-foundation.

\section{The category of planar networks }
\subsection{The category $\mathcal{R}$ of planar networks}
The following topological structure is understood as a network with $n$ inputs and $m$ outputs ($n, m = 0, 1, 2...$):
A rectangle with sides $g_1, g_2$ and $h_1, h_2$ is given in the euclidean plane, where both $g_i$ and $h_i$ lie face to face to each other. $A_1 \ldots A_n$ ($B_1 \ldots B_n$) are mutually distinct points on $g_1$ ($g_2$), where the numbering of points runs from $h_1$ to $h_2$; the $A_i$ ($B_i$) divide $g_1$ ($g_2$) into equidistant parts.
Let $A_i$ be the starting points and $B_i$ be the endpoints of precisely one line segment of an oriented, finite, planar Streckenkomplex, which lies in the euclidean plane without crossings in the rectangle \footnote{In the euclidean sense it is a matter of piecewise linear curves. }. We further demand from the Streckenkomplex that each of its line segments simply lie above $h_i$ and that the orientation of the line segments points from $g_1$ to $g_2$. Thus the case in figure \ref{fig:figure3} is
excluded.
\begin{figure}
\includegraphics[]{figure3.png}
  \centering
\caption{}
\label{fig:figure3}
\end{figure}

We call $g_1, g_2, h_1, h_2$ the network frame, $A_1, \ldots, A_n$ ($B_1, \ldots, B_m$) the \emph{starting points} or inputs (\emph{end points} or outputs) of the network. The points which are neither inputs nor outputs are called \emph{inner points} of the network.

Two networks are called equal, if they can be - after overlaying their frames without self-penetration in the plane - deformed into one another, in such a way that all intermediate positions are networks.

We understand a \emph{deformation} as an \emph{elementary deformation} or a deformation, which may be generated by a chain of elementary deformations; the elementary deformations are triangular deformations (figure \ref{fig:figure4}a) or generalised triangular deformations, as shown on figure \ref{fig:figure4}b and \ref{fig:figure4}c. Further the (trivial) deformations are allowed, which are stretches of the frame or euclidean motions of the network.
\begin{figure}
\includegraphics[]{figure4.png}
  \centering
\caption{}
\label{fig:figure4}
\end{figure}

One recognises that the given equivalence definition is reflexive, symmetric and transitive, i.e. a division of the network into equivalence classes.

From now on we call this class a network and call networks in the conventional sense, when a distinction is important, \emph{representative} of a network.

Different representatives of a network have the same number of inputs and outputs, which we denote by $Q(N)$ and $Z(N)$.

Let $N_1$ and $N_2$ be networks with $Q(N_2)=Z(N_1)$, then we declare between $N_1$ and $N_2$ a composition over representatives $N_1^{\prime}$ and $N_2^{\prime}$ from $N_1$ and $N_2$:

We deform the frame of $N_2^{\prime}$ (in a trivial manner), such that we can join $N_2^{\prime}$ onto $N_1{\prime}$; i.e. we bring $g_2$ and $g_1^{\prime}$ to the same size and set both frames along $g_2$ and $g_1^{\prime}$ against each other (figure \ref{fig:figure5}). We remove $g_2 = g_1^{\prime}$ and the points $A_i^{\prime} = B_i$ and get again a network representative, that we call $N_2 \circ N_1$. One sees that the definition is independent of the choice of representatives.

\begin{figure}
\includegraphics[]{figure5.png}
  \centering
\caption{}
\label{fig:figure5}
\end{figure}

Further the following holds:

\[
\begin{array}{lcr}
Q(N_2 \circ N_1) & = & Q(N_1), \\
Z(N_2 \circ N_1) & = & Z(N_2).
\end{array}
\]

As is shown easily, the product is associative; i.e. it holds for networks $N_1, N_2, N_3$ with $Q(N_2) = Z(N_1)$ and $Q(N_3) = Z(N_2)$ that
\[ (N_3 \circ N_2) \circ N_1 = N_3 \circ (N_2 \circ N_1). \]

For each network with $Q(N) = n$ and $Z(N) = m$ there is exactly one network $E_n$ and $E_m$ with the property

\[
N\circ E_n = E_m \circ N = N;
\]

$E_n$ is a network with $n$ inputs, $n$ outputs and $n$ line segments (figure \ref{fig:figure6}). The set of networks therefore forms a category with respect to "$\circ$".

\begin{figure}
\includegraphics[]{figure6.png}
  \centering
\caption{}
\label{fig:figure6}
\end{figure}

We declare a further combination of networks, namely the \emph{X-product}. Let $N_1^{\prime}$ and $N_2^{\prime}$ be representatives of the networks $N_1$ and respectively $N_2$, then we deform the frame to the same length and set them along $h_{12}$ and $h_{21}$ together (figure \ref{fig:figure7}). Subsequently we delete $h_{21}=h_{12}$ and numbering the inputs from left to right. If we take care that the input- and output-points of the structure are again equidistant, then we have again a representative
of a network $N_3$. We call $N_3$ the direct product of $N_1$ and $N_2$ and write $N_3 = N1 \times N_2$. One sees that the direct product is independent of the choice of the representative, associative, and that $E_k = E_1 \times \ldots \times E_1$ ($k$-times), and $E_0 \times N = N \times N_0 = N$ for every network $N$.

We call the set of networks with these two connections with $\mathcal{R}$. We summarize the results into

\begin{theorem}
$\mathcal{R}$ forms a category with respect to "$\circ$" and a semi-group with respect to "$\times$".
\end{theorem}

\begin{figure}
\includegraphics[]{figure7.png}
  \centering
\caption{}
\label{fig:figure7}
\end{figure}

\subsection{The free family of generators of $\mathcal{R}$}

We now want to specify a family of generators for $\mathcal{R}$, i.e. the set $\mathcal{C}$ of networks, from which all networks of $\mathcal{R}$ can be obtained by application of the operations of $\mathcal{R}$.

It is possible to bring each representative of a network into a position in which at most one inner point lies on a parallel to $g_1$. Thus, $N$ may be obtained as a product of networks, which each possess one inner point, expect the case that $N$ does not possess an inner point, thus it is a unit (figure \ref{fig:figure8}).

\begin{figure}
\includegraphics[]{figure8.png}
  \centering
\caption{}
\label{fig:figure8}
\end{figure}

Each network $N$ with exactly one inner point can be factored into a direct product
\[
N = E_k \times F \times E_m
\]

where $F$ contains the inner point and each line segment of $F$ possesses this point as start- and end-point (figure \ref{fig:figure9}). Potentially $k = 0$ or $m = 0$. $F$ is completely determined by the number of its inputs and outputs. If $F$ has $n$ inputs and $m$ outputs we write $\gamma_m^n$ for $F$.

\begin{figure}
\includegraphics[]{figure9.png}
  \centering
\caption{}
\label{fig:figure9}
\end{figure}

Thereby we have

\begin{theorem}
\label{eq:th2}
The set $\mathcal{C} = \{ \gamma_m^n | n, m = 0, 1, \ldots \}$ is a complete family of generators of $\mathcal{R}$
\end{theorem}

One recognizes further that the family of generators is minimal, since no generators can be expressed in termes of other generators. $\mathcal{C}$ is also the only minimal family of generators of $\mathcal{R}$, because no generator can be expressed through other elements of $\mathcal{R}$ other than through itself; the latter follows, because the number of inner points of a product are equal to the sum of inner points of the factors. Later (section \ref{basis-function-representation}) we will show that $\mathcal{C}$ is
a free family of generators.

We have shown above more than contained in theorem \ref{eq:th2}, namely:

\begin{theorem}
Each network $N \in \mathcal{R}$ with at least one inner point can be factored into one "$\circ$"-product of direct products of the form $E_k \times \gamma_m^n \times E_j$.
\end{theorem}

The presentation of a network $N$ in this form is called a \emph{sequential presentation} of $N$. The same sequential presentations naturally define the same network, but the same network allows different sequential presentations. The next section will provide information on the different presentations of a network.

\subsection{The relations of $\mathcal{R}$}
\label{the-relations-of-R}

It follows directly from the definition of the deformations that the following relations hold
\begin{equation}
\label{eq:R1}
\tag{R1}
(E_{n+k} \times \gamma_j^l) \circ (\gamma_n^m \times E_{k + l}) = (\gamma_n^m \times E_{k+j}) \circ (E_{m+k} \times \gamma_j^l)
\end{equation}
for $k, m, n = 0, 1, 2, \ldots$ (see figure \ref{fig:figure10}).

\begin{figure}
\includegraphics[]{figure10.png}
  \centering
\caption{
  $(E_{3} \times \gamma_2^1) \circ (\gamma_2^2 \times E_{3}) = (\gamma_2^2 \times E_{2}) \circ (E_{3} \times \gamma_2^1)$
}
\label{fig:figure10}
\end{figure}

Further the following relations hold for $F, G, H \in \mathcal{R}$ with $m = Q(F), n = Z(F)$ and $Q(H)=Z(G)$
\begin{equation}
\label{eq:R2}
\tag{R2}
\left.
\begin{array}{c}
(H \circ G) \times F = (H \times F) \circ (G \times E_m) = (H \times E_n) \circ (G \times F), \\
F \times (H \circ G) = (F \times H) \circ (E_m \times G) = (E_n \times H) \circ (F \times G)
\end{array}
\right\}
\end{equation}

(cf. figure \ref{fig:figure11}).

One sees that the relations (\ref{eq:R1}) are contained in (\ref{eq:R2}).

\begin{figure}
\includegraphics[]{figure11.png}
  \centering
\caption{}
\label{fig:figure11}
\end{figure}

\begin{theorem}
Two presentations $H_1$ and $H_2$ of the same network in the generator family $\mathcal{C}$ under the usage of connections of $\mathcal{R}$ can be transformed via (\ref{eq:R2}) into each other.
\end{theorem}
\begin{proof}
It is apparent that every presentation can be transformed into a sequential presentation with (\ref{eq:R2}). For each sequential presentation of a network a presentation of the network may be assigned, such that exactly these sequential presentations may be recovered by cutting through parallels to $g$.
\end{proof}

Following the previous results, we may suppose that $H_1$ and $H_2$ are sequential presentations of the same network. Let $N_1^{\prime}$ and $N_2^{\prime}$ be assigned to $H_1$ and $H_2$ in the previously described manner. After defining equality $N_1^{\prime}$ may be deformed into $N_2^{\prime}$. Each step of deformation may be divided into sub-deformations such that the order of at most two points of the network is changed, because no two points in $N_1$ by construction lie on a parallel to $g$. The sequential
presentation of the network stays the same, if the order of points is not changed. If it is changed we consider the two corresponding factors of the sequential product. These shall have the form
\[
(E_t \times \gamma_n^m \times E_s) \circ (E_r \times \gamma_j^l \times E_q).
\]
We can separate the common $E$-factors on both sides using (\ref{eq:R2}); Because of the exchangeability of order of the points the term can be transformed into the form
\[
  E_u \times ((\gamma_n^m \times E_{k+j}) \circ (E_{m+k} \times \gamma_j^l)) \times E_v,
\]

or into the form which correspond to the other two points in question. Now we apply (\ref{eq:R1}) and obtain a presentation, which corresponds to the permutation of points after the deformation. Using (\ref{eq:R2}) we bring the presentation back to the sequential form. By deforming $N_1^{\prime}$ step by step into $N_2^{\prime}$ and each time applying the transformations of the sequential presentations just described, $H_1$ is transformed via (\ref{eq:R1}) and (\ref{eq:R2}) into $H_2$, q.e.d.

We will often use subsequently the following relations derived from (\ref{eq:R2}):
\begin{equation}
\label{eq:r2prime}
\tag{$R2^{\prime}$}
\left.
  \begin{array}{c}
  F \times G = (F \circ E_m) \times G = (F\times E_j) \circ (E_m \times G), \\
    (F \times G) = (E_n \circ F) \times G = (E_n \times G) \circ (F \times E_k)
\end{array}
\right\}
\end{equation}

with $k = Q(G), j = Z(G), m = Q(F), n = Z(F)$.

Subsequently we call a category $\mathcal{F}$, which forms a semi-group with respect to a further composition "$\times$", and whose elements meet the relation (\ref{eq:R2}) an \emph{$X$-Kategorie}.

We want to revisit the transformation of a sequential presentation into another via (\ref{eq:R1}) and (\ref{eq:R2}).

We now assume that we have two presentations of a network, which are deformable into each other by definition. Initially we can deform both networks such that no two points of the network lie on a parallel of the base of frames $g$.
Now we transform each elementary deformation into sub-deformations, such that each step changes the order of at most two inner points.
If the order of points stayed the same, then the sequential presentation stayed the same.
Otherwise we can perform a transposition of the corresponding factors in the sequential presentation through the application of relations from (\ref{eq:R1}) and (\ref{eq:R2}).
In order to simplify a later proof we want to describe the modifications of sequential presentations a bit more formally.
These modifications of the sequential presentation are described uniquely by the declaration of the two factors, which concern the modifications of the order, if the point of the upper factor is a starting point or the point of the lower factor is an endpoint of at least one line segment.
If the $i$-th factor of the presentation $H$ is transposed with the $(i + 1)$-th factor as described before and if the result of the sequential presentation is $H^{\prime}$, then we write $H^{\prime} = v_{i} H$.

In order to ensure the uniqueness condition of $v_i H$ we introduce the \emph{premise} \emph{for this section} that for the network under consideration each point is either starting point or each point is end point of at least one line segment.
This is the precondition of the aspired theorem 5.

A sequence
\[
  H_1, H_2 = v_i H_1, \ldots , H_j = v_{i_{j-1}} H_{j-1}.
\]

of sequential presentations is called a chain of deformations. We also write $H_j = v H$ with $v = [v_{i_1}, \ldots v_{i_{j-1}}]$.

From the proof of theorem 4 follows:

\begin{lemma}
\label{eq:l1}
If $H$ and $H^{\prime}$ are sequential presentations of the same network, then there is a chain of deformations $v$ with $H^{\prime} = v H$; in doing so we permit the empty word $e$ and define $eH = H$.
\end{lemma}

One regognizes: If $H^{\prime} = v_i H$, then $v_i H^{\prime}$ is also explained, and $H = v_i H^{\prime} == [v_i, v_i] H$.

\begin{definition}
A chain of deformations is called \emph{reduced} if no pair $[v_i, v_i]$ does occur on $v$. We say that $v^{\prime}$ arises by reduction, if $v^{\prime}$ is obtainable through cancellation of pairs $[v_i, v_i]$ from $v$.
\end{definition}

It immediatly follows

\begin{lemma}
 $v$ describes a chain of deformation of $H$ and $v^{\prime}$ is derived from $v$ by reduction. If $H^{\prime} = vH$, then also $H^{\prime} = v^{\prime}H$.
\end{lemma}

We now observe the "path" the first factor of a sequential presentation (the rightmost factor, or the uppermost point of the corresponding presentation) travels during a deformation.

We let
\[
  \begin{array}{rcl}
    h(0) =  1 & = & \mbox{Place of the first factor before the first deformation; }\\
    h(l) (0 \leq l \le j) & = & \mbox{Place of the first factor after the $l$-th deformation.}
  \end{array}
\]

And find:
\[
  h(l+1)= \begin{cases}
           h(l),     & \mbox{ if $i_{l+1} \neq h(l), h(l) - 1$;} \\
           h(l) + 1, & \mbox{ if $i_{l+1} = h(l)$;} \\
           h(l) -1,  & \mbox{ if $i_{l+1} = h(l) - 1$;}
          \end{cases}
\]

where $v = [v_i, \ldots, v_j]$ describes the considered chain of deformation.

\begin{lemma}
  If $h(l) \neq h(l + 1)$ for $l = 0, \ldots, k - 1$ ($\geq 0$) and if $h(0) = h(k)$ is the chain of deformation $v$ of $H$, then $v$ is not reduced.
\end{lemma}

\begin{proof}
  Let $v = [v_{i_1}, \ldots , v_{i_k}]$. Since $k \geq 1$ and $h(l) \neq h(l + 1)$ there exists a $j$ with $h(j) \geq 1$ and $h(j)$ is maximal. Then $h(j) = j(j + 1) + 1$ and $v_{i_j} = v_{i_{j+1}}$ and so $v$ is not reduced.
\end{proof}

\begin{lemma}
  \label{eq:lemma4}
  \begin{enumerate}
    \item If $v = [v_i, v_k]$ with $i \neq k \pm 1$ is a chain of deformation of $H$, then $v^{\prime} = v_k, v_i]$ is a also a chain of deformation for $H$, and $vH =v^{\prime}H$.
    \item If $v = [v_i, v_{i+1}, v_i]$ and $v^{\prime}=[v_{i+1}, v_i, v_{i+1}]$, then $v$ is defined for $H$ iff $v^{\prime}$ is defined for $H$ and $vH = v^{\prime}H$ holds.
    \item Let $v^{\prime}$ be a subsequence of $v$ and let $v^{''}$ be defined for a sequential presentation $H_1$, iff this holds for $v^{\prime}$, and let $v^{\prime}H_1 = v^{''} H_1$.
          Let $v^{+}$ be obtained by replacing $v^{\prime}$ with $v^{\prime \prime}$, then $v$ and $v^{+}$ are declared for the exact same sequential presentation, and it holds,
          if $v$ is defined for $H$, $v H = v ^{+} H$.
  \end{enumerate}
\end{lemma}

\begin{proof}
  (1) and (2) are evident by geometry. (3) follows from figure \ref{fig:figure12}, where $[v_1, v^{\prime}, v_2] = v$ and $v_1, v^{\prime}, v_2$ are subsequences of $v$.
\end{proof}

\begin{figure}
\includegraphics[]{figure12.png}
  \centering
\caption{}
\label{fig:figure12}
\end{figure}

\subsection{The uniqueness of the solution of the equation $N\circ X= N^{\prime}$}

\begin{theorem}
  \label{eq:th5}
  Let $F, G, G^{\prime} \in \mathcal{R}$ and $G^{\prime} \circ F$ and each inner point of $G \circ F$ is an endpoint of at least one line segment. Then it is true that:
  \begin{equation} G \circ F = G^{\prime} \circ F \implies G = G^{\prime}. \label{eq:th51} \end{equation}
  The symmetric proposition is also true: If $F \circ G$ and $F \circ G^{\prime}$ are declared and for every inner point is the starting point of at least one line segment, then it follows:
  \begin{equation} F \circ G = F \circ G^{\prime} \implies G = G^{\prime}. \label{eq:th52} \end{equation}
  If the preconditions (\ref{eq:th51}) or the preconditions of (\ref{eq:th52}) are met, then it follows that:
  \begin{equation} F \times G = F \times G^{\prime} \implies G = G^{\prime}, \label{eq:th53} \end{equation}
  \begin{equation} G \times F = G^{\prime} \times F \implies G = G^{\prime}. \label{eq:th54} \end{equation}
\end{theorem}

As can be seen from the example on figure \ref{fig:figure13}, the claims (\ref{eq:th51}) and (\ref{eq:th52}) of the theorem are not correct without the constraint on the inner points. The example shows:
\begin{figure}
  \includegraphics[]{figure13.png}
  \centering
  \caption{}
  \label{fig:figure13}
\end{figure}

  \begin{equation*} (E \times \gamma_1^0) \circ \gamma_1^0 = (\gamma_1^0 \times E) \circ \gamma_1^0, \end{equation*}
  \begin{equation*} E \times \gamma_1^0 \neq \gamma_1^0 \times E.  \end{equation*}

For propositions (\ref{eq:th53}) and (\ref{eq:th54}) the preconditions are superfluous, but they facilitate the proof. Since we get along subsequently with (\ref{eq:th53}) and (\ref{eq:th54}) with precondition, we settle for theorem \ref{eq:th5}.

We first proof (\ref{eq:th53}) and (\ref{eq:th54}) under the precondition of (\ref{eq:th51}) and (\ref{eq:th52}).

Proof for (\ref{eq:th53}) and (\ref{eq:th54}). Given that precondition (\ref{eq:th51}) is met. We apply (\ref{eq:r2prime}) and obtain

\begin{equation*} G \times F = (G \times E_n) \circ (E_m \times F), \end{equation*}
\begin{equation*} G^{\prime} \times F = (G^{\prime} \times E_n) \circ (E_k \times F). \end{equation*}

Since $G \times F = G^{\prime} \times F$ we get $Q(G) = Q(G^{\prime})$ and also $k = m$. We apply the precondition to (\ref{eq:th54}) and proposition (\ref{eq:th51}) and get

\[ G \times E_n = G^{\prime} \times E_n. \]

Now we select the sequential presentations $H$ of $G$ and $H^{\prime}$ of $G^{\prime}$.
Herefrom we obtain a sequential presentation of $G \times E_n$ resp. $G^{\prime} \times E_n$,
by multiplying every factor from the right "directly" with $E_n$; let the thus obtained sequential presentations be $H_1$ resp.
$H^{\prime}_1$. From lemma \ref{eq:l1} it follows that there exists a chain of deformation $v$ with $H^{\prime}_1=vH_1$.
Now we see that $v$ also describes a chain of deformation of $H$ and that $H^{\prime}=vH$ holds, from which $G = G^{\prime}$ follows.

The proof runs analogously, when the precondition of (\ref{eq:th52}) is met;
we then bring $G \times F$ to the form, which is appropriate for the application of (\ref{eq:th52}).
Thereby (\ref{eq:th54}) is proven. (\ref{eq:th53}) is proven accordingly.
Now, it suffices to prove (\ref{eq:th51}), since the proof is symmetrical to (\ref{eq:th52}).
For the time being we prove some lemmas.

\begin{lemma}
Let $H_2 \circ H_1$ and $H^{\prime}_2 \circ H_1$ be sequential presentations of the same network. Let $H_1$ consists of a single factor.
If the precondition of (\ref{eq:th51}) is met, and if $v = [v_{i_1}, \ldots, v_{i_k}]$ a chain of deformations for $H_2 \times H_1$ with $H^{\prime}_2 \circ H_1 = v(H_2 \circ H_1)$,
then $h(0)=h(k)$, where $h$ is the function defined in \ref{the-relations-of-R}.
\end{lemma}

\begin{proof}
We will carry out the proof geometrically, by switching to representative of the networks, which corresponds to the two sequential presentations.
$h(k)$ specifies to which position in the order of inner points the in $H_2 \circ H_1$ most upper points by the corresponding deformation to $v$ is brought.
Due to the precondition (\ref{eq:th51}) we know that the in $H_2 \circ H_1$ and $H^{\prime}_2 \circ H_1$ respectively most upper point
is connected with at least one starting point of the network.
Since in both sequential presentations the two most upper factors are equal and from a starting point at most one line segment starts,
but the incidence relations of the line segments are not changed,
if follows that the point at the $(h(k))$-th position in $H^{\prime}_2 \circ H_1$ is identical to the point which stands on the first position, i.e. $h(k) = 1 = h(0)$.
\end{proof}

\begin{lemma}
Let $H_2 \circ H_1 \xrightarrow{v_{i_1}} H_2^{\prime} \circ H_1 \xrightarrow{v} H^{+}_2 \circ H_1$ a chain of deformations,
and $H_1$ consists of only one factor, then $H^{\prime}_2=v_{i_1 - 1} H_2$, i.e. $H^{+}_2 \circ H_1 = v ((v_{i_1-1} H_2) \circ H_1)$.
\end{lemma}

\begin{proof}
Since $i_1 > 1$, $v_{i_1}$ does not concern the first factor, but only factors in $H_2$.
But their place has measured in $H_2$ a position number which is smaller by $1$ than in $H_2 \circ H_1$, from which the claim follows.
\end{proof}

If $v=[v_{i_1}, \ldots, v_{i_k}]$ describes a chain of deformations for $H$, then we define
\[
\begin{array}{rc}
   A(v) = & \mbox{Number of positions $i$ with $h(i) = h(i + 1)$} \\
          & \mbox{for $i = 0 , \ldots, k - 1$}
\end{array}
\]

\begin{lemma}
Let $v = [v_{i_1} , \ldots, v_{i_k}]$ be a reduced chain of deformations for $H$,
and let $h(0) = h(k)$. If $A(v) > 0$, then there exists a chain of deformations $v^{\prime} = [ v_{l_1}, \ldots, v_{i_k}]$ with $l_1 > 1$ and $v^{\prime} H = v H$,
$A(v) = A(v^{\prime})$ and $h(0)=h^{\prime}(k)$.
\end{lemma}
\begin{proof}
Since $A(v) > 0$, there exists a $j$ with $h(j) = h(j - i)$;
let $j$ be the smallest number with this property. If $j = 1$, then $v_{i_1} \neq v_1$, and there is nothing to show.
\end{proof}

Thus, let $j > 1$. Since $v$ is reduced and $j$ is minimal with $h(j) = h(j - 1)$,
it follows that $i_1 = 1, i_2 = 2, \ldots, i_{j-1} = j - 1, h(j-1) = j$ and $i_j \neq j - 1, j$. If $i_j > j$,
then we can exchange $v_{ij}$ according to lemma \ref{eq:lemma4} with $[v_i, \ldots, v_{j-1}]$ and thereby obtain desired the chain of deformation $v^{\prime}$.
If $i_j < j - 1$, then we can exchange as long as we arrive at a $v_l$ with $l = i_j + 1$.
Then we apply the substitution considered in lemma \ref{eq:lemma4} of $[v_{l-1}, v_1, v_{l -1}]$ with $[v_l, v_{l-1}, v_l]$,
such that the resulting chain of deformation has the form $[v_1, \ldots v_{l-2}, v_l, v_{l-1}, v_l, \ldots]$.
Now, we can exchange $v_l$ with $[v_1, \ldots, v_{l-2}]$ and have thereby obtained a chain of deformation $v^{\prime}$ of the same length as $v$,
which begins with $v_l \neq v_1$ and for which $v^{\prime}H = vH$ holds (according to lemma \ref{eq:lemma4}). It is apparent that:
$A(v^{\prime})=A(v)$ and $h(k) = h^{\prime}(k)$, i.e. $h(k)=1$.

\begin{lemma}
  Let $H_1$ be a network with exactly one inner point, $H_2 \circ H_1$ and $H^{\prime}_2 \circ H_1$ are defined fulfil the requirements (1) (theorem \ref{eq:th5}).
  $v = [v_{i_1}, \ldots, v_{i_{k-1}}]$ defines a chain of deformation for $H_2 \circ H_1$ with $H^{\prime}_2 \circ H_1 = v (H_2 \circ H_1)$.
  Then it follows: $H_2$ and $H^{\prime}_2$ define the same network.
\end{lemma}

\begin{proof}
  (proof by induction over the length $k$ of the chain of deformation).
  \begin{enumerate}
    \item Base case. For $k = 0$, i.e. v = e it follows that $H_2 = H^{\prime}_2$.
    \item The proposition is true for $0 \leq n \leq k - 1$. If $v$ is not reduced, then the proposition follows from lemma 2. Thus, let $v$ be reduced.
      Then $A(v) > 0$ following lemma 3. Following lemma 5 $h(0) = h(k)$. Thereby the requirements for lemma 7 are met.
      There exists a \[v^{\prime} = [v_{l_1}, \ldots, v_{l_{k - 1}} \mbox{with} v_{l_1} \neq v_1 \mbox{and} v^{\prime}(H_2 \circ H_1) = H^{\prime}_2 \circ H_1. \]
      We apply lemma 6 and obtain a $H^{\prime \prime}$ with
      \[ H_2 \circ H_1 \xrightarrow{v_{l_1}} H^{\prime \prime}_2 \circ H_1 \xrightarrow{[v_{l_2}, \ldots, v_{l_k}]} H^{\prime}_2 \circ H_1 \]
      and
      \[ H^{\prime \prime} = v_{i_1 - 1} H_2 \mbox{.} \]
      Using the base case we can induce that $H^{\prime \prime}_2$ and $H^{\prime}_2$ define the same network,
      from which this also follows for $H_2$ and $H_2^{\prime}$, q.e.d.
    \end{enumerate}

\end{proof}

Now we can finally proof theorem 5.

Let $G \circ F = G^{\prime} \circ F$.
Then we choose a sequential presentation of $G, G^{\prime}$ and $F$, which we compose into sequential presentations $G \circ F$ and $G^{\prime} \circ F$.
If $F$ contains an inner point, then it follows directly from lemma 8 the proposition $G = G^{\prime}$.
We prove the theorem in its generality by induction over the number of inner points in $F$,
i.e. over the number of factors in the sequential presentation of $F$. Let $F_2 \circ F_1 = F$,
and $F_1$ contain exactly one inner point, then $(G \circ F_2) \circ F_1 = (G^{\prime} \circ F_2) \circ F_1$ holds,
from which according to the previous arguments follows that $G \circ F_2 = G^{\prime \prime} \circ F_2$.
After applying the base case to this we obtain $G = G^{\prime}$, which proves theorem 5.

The results of theorem 5 permit us the specify a simple procedure for the decision of equality of networks,
which fulfil the preconditions of the theorem.

A necessary condition for $N_1 = N_2$ is that $Q(N_1) = Z(N_2)$ and $Z(N_1) = Z(N_2)$ and that $N_1$ and $N_2$ have the same number of inner points.

If $m = 1$, then the decision is trivial.

Let $m > 1$. In this case there is a network $N^{\prime}_1$ with $m - 1$ inner points,
such that $N_1 = N^{\prime} \circ H_1$ holds. Now examine if it is possible to separate factor $H_1$ from $N_2$.
This can be done by checking if there is an inner point from $N_2$ with the same number of inputs and outputs as the inner point $H_1$,
and if this point is connected in the corresponding fashion with the starting points of $N_2$,
as it applies to the inner point of $H_1$.
If such a point exists, then it follows that $N_2 = N^{\prime}_2 \circ H_1$ and because of theorem 5 it follows that $N_2 = N_1$ iff we can write $N^{\prime}_2 = N^{\prime}_1$.
$N^{\prime}_2$ and $N^{\prime}_1$ have only $m - 1$ inner points.
Thus we have a procedure with delivers the sought-after decision not later than $m$ steps.

\section{Definition of categories by a direct product through generators and defining relations}
\subsection{Representation of functions with basis functions}
\label{basis-function-representation}
\subsection{The uniqueness of the solution $F \circ X = G$}
\subsection{Creation of the factor category of $\mathcal{F}(U)$ according to a relational system}
\subsection{Representation of functions with basis functions}

\begin{thebibliography}{9}
\bibitem{zoepfe}
Artin, E., Theorie der Zöpfe. Abh. des Math. Seminars der Hamburgerischen Universit\"{a}t Bd. IV (1926).

\bibitem{circuit-synthesis}
Curtis, H. A., A New Approach to the Design of Switching Circuits. D. van Norstrand Com., Princeton 1962

\bibitem{computability}
Hermes, H., Aufz\"{a}hlbarkeit, Entscheidbarkeit, Berechenbarkeit. Springer-Verlag, Berlin-G\"{o}ttingen-Heidelberg 1961

\bibitem{categories-functors}
Puppe, D., Kategorien und Funktoren. Ausarbeitung einer Vorlesung an der Universit\"{a}t Saarbr\"{u}cken im Sommersemester 1963

\bibitem{combinatory-topology}
Reidemeister, K., Einf\"{u}rung in die kombinatorische Topologie. Vieweg-Verlag, Braunschweig 1951

\bibitem{category-theory}
Kurosch, A. G. u. a., Zur Theorie der Kategorien. Mathematische Forschungsberichte XV. Deutscher Verlag der Wissenschaften, Berlin 1963
\end{thebibliography}

\end{document}


\subsection{Feature hashing}


\documentclass[fleqn]{minimal}

\usepackage[
  paperwidth=8.5cm,
  paperheight=11.4cm,
  margin=0cm,
]{geometry}
\usepackage[
  pdfauthor={QXF},
]{hyperref}
\usepackage{
  amsmath,
}
\hypersetup{bookmarks=true}

\setlength{\mathindent}{0pt}
\setlength{\parindent}{0pt}
\def\chapter#1{\clearpage\pdfbookmark{#1}{id:#1}\textbf{#1}\\}

\begin{document}
\chapter{Hello}
Voila, this is a simple text.
Use the hyperref package, included in pretty much every latex distribution these days.In combination with hyperref package it might cause some problems like described here. Just wanted to mention this, since I just experienced the same problem.\\
See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
This is pdfTeX, Version 3.14159265-2.6-1.40.20 (MiKTeX 2.9.7250 64-bit)
entering extended mode\\
\\%%%%%%%

\[ \int_{hello}^{world}\frac{dividen}{divider} \Omega~this~is~complex \]
\[ \int_{hello}^{world}\frac{dividen}{divider} \Omega~this~is~complex \]

\newlength\q
\setlength\q{\dimexpr .334\textwidth -2\tabcolsep}
\noindent\begin{tabular}{p{\q}p{\q}p{\q}}
\[\int abc\] & test text & voila\\
c & d & e
\end{tabular}

\end{document}


% -*- coding:utf-8 -*-
\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\newenvironment{note}{\paragraph{NOTE:}}{}
\newenvironment{field}{\paragraph{field:}}{}
\newcommand*{\tags}[1]{\paragraph{tags: }#1}

\begin{document}

\begin{note}
    \tags{even/odd}
    \begin{field}
    \[
        \tan(-\theta)
    \]
    \begin{center}
    (even/odd)
    \end{center}
    \end{field}
    \begin{field}
    \[
        -\tan \theta
    \]
    \begin{center}
    (even/odd)
    \end{center}
    \end{field}
\end{note}

\begin{note}
    \tags{even/odd}
    \begin{field}
    \[
        \cos(-\theta)
    \]
    \begin{center}
    (even/odd)
    \end{center}
    \end{field}
    \begin{field}
    \[
        \cos \theta
    \]
    \begin{center}
    (even/odd)
    \end{center}
    \end{field}
\end{note}

\begin{note}
    \tags{even/odd}
    \begin{field}
    \[
        \sin(-\theta)
    \]
    \begin{center}
    (even/odd)
    \end{center}
    \end{field}
    \begin{field}
    \[
        - \sin \theta
    \]
    \begin{center}
    (even/odd)
    \end{center}
    \end{field}
\end{note}

\end{document}


\documentclass[10pt]{amsart}
\usepackage{fullpage}
% https://tex.stackexchange.com/questions/174073
\usepackage{parskip}

% macros
\usepackage{ccg-macros}
\usepackage{amscd, amssymb}
\usepackage{physics}

% pandoc is utf8 native
\usepackage[utf8]{inputenc}

% pandoc transfers h2 to subsections, I prefer h2 for sections
\let\subsubsection\subsection
\let\subsection\section
\let\section\chapter
\let\chapter\part

% pandoc section numbering
\setcounter{secnumdepth}{5}

% pandoc urls as footnotes
\usepackage[unicode=true]{hyperref}
\renewcommand{\href}[2]{#2\footnote{\url{#1}}}

% pandoc for upquote if available
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}

% tables, pandoc manges export

\usepackage[all]{xy}

% pandoc prevent overfull lines
\setlength{\emergencystretch}{3em}
\providecommand{\tightlist}{%
  \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}

% pandoc default figure placement to htbp
\makeatletter
\def\fps@figure{htbp}
\makeatother

\title{First look at the Universal Coefficient Theorem}
\author{Colton Grainger (scribe) \and Marvin Qi (presenter)}
\date{2019-02-13}

\begin{document}

\maketitle

This problem is set from Bredon {[}1, No. IV.5.1{]}; it works out
techniques that might later play into a proof of the universal
coefficient theorem.

\emph{Given}. Let \(p \colon \ZZ \to \ZZ\) be multiplication by the
prime \(p\), and consider the short exact sequence \begin{equation}
0 \to \ZZ \xrightarrow{p} \ZZ \xrightarrow{\pi} \ZZ_p \to 0.
\label{eq:p}
\end{equation}

Say \(X\) is a topological space. We assume
\(\Delta_*(-) \colon \mathsf{Top} \to \mathsf{Comp}\) is the singular
chain functor from topological spaces to chain complexes of abelian
groups, with \(H_*(-) \colon \mathsf{Comp} \to \mathsf{GradedAb}\) the
homology functor on chain complexes. For an abelian group \(G\), denote
by \(H_*(C_*; G)\) the \emph{homology of \(C_*\) with coefficients in
\(G\)}, which is the homology of the chain complex \(G \otimes C_*\)
with boundary operator \(\id_G \otimes \partial\).

\emph{To prove.} There is an exact sequence \begin{equation}
0 \to \ZZ_p \otimes H_n(X) \to H_n(X;\ZZ_p) \to \Tor(H_{n-1}(X), \ZZ_p) \to 0,
\label{eq:wts}
\end{equation} with a homomorphism
\(H_n(X; \ZZ_p) \to \ZZ_p \otimes H_n(X)\) such that \eqref{eq:wts}
splits.

\emph{Proof.} We'll construct the exact sequence \eqref{eq:wts}, then
the splitting homomorphism.

Each group in \(\Delta_*(X)\) is free abelian, and, in particular, flat
as a \(\ZZ\)-module. Thus tensoring the short exact sequence
\eqref{eq:p} on the right by the \(n\)th singular chain \(\Delta_n(X)\)
group preserves exactness, and produces: \begin{equation}
\xymatrix{
0 \ar[r] & \ZZ\otimes \Delta_n(X) \ar[r]^{p\otimes \id_\Delta} & \ZZ\otimes \Delta_n(X) \ar[r]^{\pi\otimes \id_\Delta} & \ZZ_p \otimes\Delta_n(X) \ar[r]&  0
}
\label{eq:level}
\end{equation}

Lining up copies of \eqref{eq:level} levelwise with the appropriate
differentials, we exhibit the short exact sequence of chain complexes:
\begin{equation}
\xymatrix{
& \vdots \ar[d] & \vdots \ar[d] & \vdots \ar[d] &\\
0 \ar[r] & \ZZ\otimes \Delta_n(X) \ar[d]^{\id_\ZZ \otimes \partial_n} \ar[r]^{p\otimes \id_\Delta} & \ZZ\otimes \Delta_n(X) \ar[d]^{\id_\ZZ \otimes \partial_n} \ar[r]^{\pi\otimes \id_\Delta} & \ZZ_p \otimes\Delta_n(X) \ar[d]^{\id_{\ZZ_p} \otimes \partial_n}\ar[r]&  0\\
0 \ar[r] & \ZZ\otimes \Delta_{n-1}(X) \ar[d] \ar[r]^{p\otimes \id_\Delta}  & \ZZ\otimes \Delta_{n-1}(X) \ar[d] \ar[r]^{\pi\otimes \id_\Delta} & \ZZ_p \otimes\Delta_{n-1}(X) \ar[d] \ar[r]&  0\\
& \vdots & \vdots & \vdots  &\\
}
\label{eq:ch1}
\end{equation}

As abelian groups, we'll identify
\(\ZZ \otimes \Delta_n(X) = \Delta_n(X)\) and
\(\ZZ_p \otimes \Delta_n(X) = \Delta_n(X)/p\) (the cokernel of the
\(p\)th multiple map). Accordingly, we'll write the homomorphisms
\(p \otimes \id_\Delta = p\), \(\pi \otimes \id_\Delta = \pi\), with all
the differentials \(\id \otimes \partial_n\) as \(\partial\). Given
these abbreviations, the short exact sequence \eqref{eq:ch1} becomes:
\begin{equation}
\xymatrix{
0 \ar[r] & \Delta_*(X) \ar[r]^{p} &\Delta_*(X) \ar[r]^{\pi} & \Delta_*(X)/p \ar[r]&  0
}
\label{eq:ses}
\end{equation}

By inspection of the definition of homology with coefficients along with
the diagram \eqref{eq:ch1}, the long exact sequence of homology groups
induced by \eqref{eq:ses} is: \begin{equation}
\xymatrix{
\cdots \ar[r]^{\delta_*} & H_n(X) \ar[r]^{ p_* } & H_n(X) \ar[r]^{ \pi_* } & H_n(X; \ZZ_p) \ar[r]^{\delta_*} & H_{n-1}(X) \ar[r]^{p_*} & \cdots
}
\label{eq:les}
\end{equation}

We now make an aside to argue the algebraic structure of a long exact
sequence is encoded in a series of intertwined short exact sequences
{[}2, No. 2.5{]}. Start by considering an exact sequence of abelian
groups
\[\cdots \to A_{n+2} \to A_{n+1} \to A_{n} \to A_{n-1} \to A_{n-2} \to \cdots.\]
By definition of exactness at \(A_n\),
\begin{equation}\label{eq:defexact}\im (A_{n+1} \to A_n) = \ker(A_n \to A_{n-1}).\end{equation}
Quotienting by the kernel of the map out of \(A_n\), we have an
isomorphism onto the image in \(A_{n-1}\) \begin{equation}
A_n/\ker (A_n \to A_{n-1}) \cong \im(A_n \to A_{n-1})
\label{eq:isomthm}
\end{equation} Now, the cokernel of an additive homomorphism is the
target group quotiented by the incoming image. Substituting
\eqref{eq:defexact} into \eqref{eq:isomthm} gives an example of such
\[\coker ( A_{n+1} \to A_n) := A_n/\im (A_{n+1} \to A_n) \cong \im(A_n \to A_{n-1}).\]
Putting it all together, there's a group \(C_n\) that is

\begin{itemize}
\tightlist
\item
  the kernel of the map \(A_n \to A_{n-1}\),
\item
  isomorphic to the image of the map \(A_{n+1} \to A_n\), and
\item
  isomorphic to the cokernel of the map \(A_{n+2} \to A_{n+2}\).
\end{itemize}

Moreover, there are groups \(C_{n+k}\) for \(k \in \ZZ\) satisfying
analogously conditions. We may now decorate our long exact sequence with
inclusions and natural projections so that the diagram \begin{equation}
\xymatrix @=2pt@! { %We want equal spacing, and the entries close together
&&0\ar[dr]&&0&&0\ar[dr]&&0&&&&0\\
&&&C_{n+1}\ar[ur]\ar[dr]&&&&C_{n-1}\ar[ur]\ar[dr]&&&&C_{n-3}\ar[ur]\\
\cdots \ar[rr]&&A_{n+2}\ar[rr]\ar[ur]&&A_{n+1}\ar[rr]\ar[dr]&&A_{n}\ar[rr]\ar[ur]&&A_{n-1}\ar[rr]\ar[dr]&&A_{n-2}\ar[ur]\ar[rr]&&\cdots\\
&C_{n-2}\ar[ur]&&&&C_{n}\ar[ur]\ar[dr]&&&&C_{n-2}\ar[ur]\ar[dr]&&&&\\
0\ar[ur]&&&&0\ar[ur]&&0&&0\ar[ur]&&0&&&&
}
\label{eq:knit}
\end{equation} is exact. We emphasize that the crossing maps are either
\emph{inclusions} or \emph{natural projections}. The crossing sequences
are short exact because, e.g., for
\(0 \to C_n \to A_n \to C_{n-1} \to 0\),

\begin{itemize}
\tightlist
\item
  \(C_n\) is the kernel, so injects and passes through \(A_n\) to \(0\)
  in \(C_{n-1}\),
\item
  \(A_n\) surjects onto \(C_{n-1}\) and passes to \(0\),
\item
  any element in \(A_n\) that passes to \(0\) in \(C_{n-1}\) must be in
  the image of \(C_n\) in \(A_n\), because \(A_n \to C_{n-1}\) is the
  natural projection onto \(A_n / \ker(A_n \to A_{n-1}) = A_n /C_n\).
\end{itemize}

We now construct the desired short exact sequence \eqref{eq:wts}.
Placing the long exact sequence of homology groups \eqref{eq:les} into
the position of the long exact sequence in the cross stitched diagram
\eqref{eq:knit}, one visibly obtains the short exact sequence:
\begin{equation}
\xymatrix{
0 \ar[r] & \coker\big(H_n(X) \xrightarrow{p_*} H_n(X)\big) \ar[r]  & H_n(X; \ZZ_p) \ar[r] & \ker\big( H_{n-1}(X) \xrightarrow{p_*} H_{n-1}(X)\big) \ar[r] & 0
}
\label{eq:sestosplit}
\end{equation}

This sequence \eqref{eq:sestosplit} is isomorphic to the one we wanted
\eqref{eq:wts}, as
\[\coker\big(H_n(X) \xrightarrow{p_*} H_n(X)\big) \cong \ZZ_p \otimes H_n(X)\]
and
\[\ker\big( H_{n-1}(X) \xrightarrow{p_*} H_{n-1}(X)\big) =: \Tor(H_{n-1}(X), \ZZ_p).\]

What remains to be proven is that there is a homomorphism from
\(H_n(X, \ZZ_p)\) down to \(\ZZ_p \otimes H_n(X)\) that (left) inverts
the inclusion of \(\ZZ_p \otimes H_n(X)\) up into \(H_n(X, \ZZ_p)\). My
argument here closely follows {[}2, No. 3.21{]}.

We'll work levelwise for a while in the singular chain complex
\(\Delta_*(X)\). Let \(Z_n\) be the cycle subgroup of \(\Delta_n(X)\)
and \(B_{n-1}\) the boundary subgroup \(\delta \Delta_n(X)\) in
\(\Delta_{n-1}(X)\). Observe that \(Z_n\) includes into \(\Delta_n(X)\)
which projects onto \(B_{n-1}\). So we have the short exact sequence of
free abelian groups \begin{equation}
\xymatrix{
0 \ar[r] & Z_n \ar[r]^f & \Delta_n(X) \ar@/^1pc/ @{-->} [l]^g \ar[r] & B_{n-1} \ar[r] & 0,
}
\end{equation} that splits with \(g \circ f = \id_{Z_n}\). Extend \(g\)
to the quotient \(H_n(X)\) so that the following diagram commutes:
\begin{equation}
\label{eq:extend}
\xymatrix{
\Delta_n(X)\ar[d]^g \ar@{-->}[dr]^{g'} & \\
Z_n \ar[r] & H_n(X)
}\end{equation}

Consider the graded abelian group \(\{H_k(X)\}_{k \in \ZZ}\) in a chain
with trivial differentials
\[\ldots \xrightarrow{0} H_{n+1}(X) \xrightarrow{0} H_n(X) \xrightarrow{0} H_{n-1}(X) \xrightarrow{0} \ldots.\]
Call this chain complex \(H_*(X)\). We induce a chain map \(g_*\) from
\(\Delta_*(X)\) to \(H_*(X)\) with \(g'\):

\begin{minipage}{.5\textwidth}
\begin{equation}
\xymatrix{
\vdots \ar[d]^\partial & \vdots \ar[d]^0\\
\Delta_{n+1}(X) \ar[r]^{g'} \ar[d]^\partial & H_{n+1}(X) \ar[d]^0\\
\Delta_{n}(X) \ar[r]^{g'} \ar[d]^\partial& H_{n}(X) \ar[d]^0\\
\Delta_{n-1}(X) \ar[r]^{g'} \ar[d]^\partial& H_{n-1}(X) \ar[d]^0\\
\vdots & \vdots\\
}\label{eq:trivialchain}\end{equation}
\end{minipage}
\begin{minipage}{.5\textwidth}
\begin{equation}
\xymatrix{
\vdots \ar[d]^{\id\otimes\partial} & \vdots \ar[d]^0\\
\ZZ_p\otimes\Delta_{n+1}(X) \ar[r]^{\id \otimes g'} \ar[d]^{\id \otimes \partial} & \ZZ_p\otimes H_{n+1}(X) \ar[d]^0\\
\ZZ_p\otimes\Delta_{n}(X)   \ar[r]^{\id \otimes g'} \ar[d]^{\id \otimes \partial} & \ZZ_p\otimes H_{n}(X)   \ar[d]^0\\
\ZZ_p\otimes\Delta_{n-1}(X) \ar[r]^{\id \otimes g'} \ar[d]^{\id \otimes \partial} & \ZZ_p\otimes H_{n-1}(X) \ar[d]^0\\
\vdots & \vdots\\
}\end{equation}
\end{minipage}

Observe that
\(\partial(\Delta_{n+1}(X)) = B_n(X) = \ker\left(Z_n \to H_n(X)\right)\)
so that each square in \eqref{eq:trivialchain} commutes. We may then
tensor both chains by \(\ZZ_p\) on the right, obtaining
\[\ZZ_p \otimes \Delta_*(X) \xrightarrow{\id \otimes g_*} \ZZ_p \otimes H_n(X).\]
When we take homology on \(\ZZ_p \otimes \Delta_*(X)\) by definition we
have \(H_*(X, \ZZ_p)\). However, when computing homology in the chain
complex \(\ZZ_p \otimes H_n(X)\), the image of each map in the complex
is \emph{trivial}, so the homology of the complex is
\(\ZZ_p \otimes H_*(X)\).

The map \({\id \otimes g_*}\) of chain complexes induces a homomorphism
\(H_*(\id\otimes g')\) on homology from
\(H_*(X, \ZZ_p) \to \ZZ_p \otimes H_*(X)\). In particular, at the
\(n\)th level,
\begin{equation}\label{eq:finish}H_n(X, \ZZ_p) \xrightarrow{H_*(\id \otimes g')} \ZZ_p \otimes H_n(X).\end{equation}
By construction in \eqref{eq:extend} of \(g'\) as the extension of the
splitting map \(g\) (where \(g \circ f = \id_{Z_n}\)), the induced map
\(H_*(\id \otimes g')\) in \eqref{eq:finish} is a left inverse to the
inclusion of \(\ZZ_p \otimes H_n(X)\) into \(H_n(X, \ZZ_p)\). \qedsymbol

\subsection*{References}
\addcontentsline{toc}{subsection}{References}

\hypertarget{refs}{}
\leavevmode\hypertarget{ref-Bre93}{}%
{[}1{]} G. E. Bredon, \emph{Topology and Geometry}. New York:
Springer-Verlag, 1993.

\leavevmode\hypertarget{ref-Che09}{}%
{[}2{]} J. L. Chen, ``Universal Coefficient Theorem for Homology,''
2009.

\end{document}


\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{multicol}
\usepackage{listings}
\usepackage{verbatim}
\usepackage{color}
\usepackage{geometry}

\usepackage{float}
\usepackage{amsmath}
\usepackage{hyperref}
\setlength{\belowcaptionskip}{-10pt}
\setlength{\abovecaptionskip}{-30pt}
\floatstyle{boxed}
\restylefloat{figure}
\usepackage{graphicx}
\definecolor{codegreen}{rgb}{0,0.6,0}
\definecolor{codegray}{rgb}{0.5,0.5,0.5}
\definecolor{codepurple}{rgb}{0.58,0,0.82}
\definecolor{backcolour}{rgb}{0.95,0.95,0.92}

\lstdefinestyle{mystyle}{
	backgroundcolor=\color{backcolour},
	commentstyle=\color{codegreen},
	keywordstyle=\color{blue},
	numberstyle=\tiny\color{codegray},
	stringstyle=\color{codepurple},
	basicstyle=\footnotesize,
	breakatwhitespace=false,
	breaklines=true,
	captionpos=b,
	keepspaces=true,
	numbers=left,
	numbersep=5pt,
	showspaces=false,
	showstringspaces=false,
	showtabs=false,
	tabsize=2
}

\lstset{style=mystyle}
\title{Data Mining\\
		Home work 05\\Q-Q-plots and frequent itemsets}
\author{Aqeel Labash\\ \textbf{Lecturer:} Jaak Vilo}
\date{6 March 2016}

\geometry{
	a4paper,
	total={170mm,257mm},
	left=10mm,
	top=5mm,
}
\begin{document}
	\maketitle
	\section*{First Question}
\textbf{Use the data of child height/weight and study them using qq-plots in a specific age and gender at a time. }\\
Firstly I removed unneeded data and removed the negative values by this code :
\begin{lstlisting}[language=R]
rm(list=ls())
setwd('/home/aqeel/Study/DM/HW05')
ncmp = read.csv('ncmp_1415_final_non_disclosive.csv',header = TRUE)
ncmp$ncmppseudosystemid<-NULL
ncmp$heightzscore<-NULL
ncmp$suppress_imd<-NULL
ncmp$heightpscore<-NULL
ncmp$weightzscore<-NULL
ncmp$weightpscore<-NULL
ncmp$bmizscore<-NULL
ncmp$bmipscore<-NULL
ncmp$suppress_table<-NULL
ncmp$suppress_record_low<-NULL
ncmp$schooltier1localauthority<-NULL
ncmp$suppress_record_high<-NULL
ncmp$suppress_record_high<-NULL
ncmp$pupilschooldistancebanded<-NULL
ncmp$schooltier2localauthority<-NULL
ncmp$schoolgovernmentofficeregion<-NULL
ncmp <- ncmp[ncmp$height>0,]
datasample<-ncmp[sample(nrow(ncmp),5000),]
\end{lstlisting}
After that I tried to get the age with most kids in it by running this code :
\begin{lstlisting}[language=R]
test <-table(ncmp$ageinmonths)
test[test==max(test)]
\end{lstlisting}
Which lead to age 60.6 with 7346 kid.I used the following code to separate male,females and plot height vs weight under age 60.6
\begin{lstlisting}[language=R]
male<- ncmp[ncmp$ageinmonths==60.6&
ncmp$genderdescription=="Male",]
female<-ncmp[ncmp$ageinmonths==60.6&
ncmp$genderdescription=="Female",]

png ('male.png',width = 1200,height = 830)
qqplot(male$height,male$weight)
dev.off()
png ('female.png',width = 1200,height = 830)
qqplot(female$height,female$weight)
dev.off()
\end{lstlisting}
\begin{figure}[H]
\includegraphics[scale=0.4]{male.png}
\caption{Weight vs height for male kids at age 60.6}
\end{figure}
From figure 1 can notice that height and weight are highly correlated.
\begin{figure}[H]
	\includegraphics[scale=0.4]{female.png}
	\caption{Weight vs height for male kids at age 60.6}
\end{figure}
In figure 2 we can notice that they are also correlated but if we compare figure 1 with figure 2 we can notice that the weight growth with height slightly higher.\\
\textbf{Compare heights of underweight and very overweight children }\\
To do the comparison I used the following code :
\begin{lstlisting}[language=R]
underoverweights<- ncmp[ncmp$bmipopulationcategory =='very overweight' | ncmp$bmipopulationcategory=='underweight' ,]
png('undervsover.png',width=1200,height = 830)
ggplot(data = underoverweights, mapping = aes(x=bmipopulationcategory,y=height))+geom_point()
dev.off()
\end{lstlisting}
\begin{figure}[H]
\includegraphics[scale = 0.4]{undervsover.png}
\caption{Comparison under weight vs very over weight height }
\end{figure}
From figure 3 we can see that over weight kids and under weight kids have almost same distribution but I would say that there is high percentage of under weight kids with heights around 110.The following code is what I used to accomplish it:
\begin{lstlisting}[language=R]

underweight<- ncmp[ncmp$bmipopulationcategory =='very overweight' ,]
overweight<-ncmp[ncmp$bmipopulationcategory=='underweight',]
png('undervsover.png',width=1200,height = 830)
qqplot(underweight$height,overweight$height,xlab = 'Under Weight Height',ylab = 'Over weight height')
dev.off()
\end{lstlisting}
\textbf{Compare one of the attributes (height, weight, BMI) between boys and girls (select either younger or older age group) to each other. }\\
For this task I selected the younger age group. and used the following code :
\begin{lstlisting}[language=R]
agelimits<-c(49.1,70.0,120.8,141.4)
maleage1 <-ncmp[ncmp$ageinmonths>agelimits[1] & ncmp$ageinmonths<agelimits[2]&
ncmp$genderdescription=="Male",]

femaleage2 <-ncmp[ncmp$ageinmonths>agelimits[1] & ncmp$ageinmonths<agelimits[2]&
ncmp$genderdescription=="Female",]
png('malevsfemale.png',width=1200,height = 830)
qqplot(maleage1$height,femaleage2$height)
dev.off()
\end{lstlisting}
\begin{figure}[H]
\includegraphics[scale=0.4]{malevsfemale.png}
\caption{Q-Q plot for heights male vs female}
\end{figure}
From previous plot we can see that it's almost linear plot which mean at this age almost female and male have the same height.In other worlds sex doesn't affect the height at this age.
	\section*{Second Question}
For this question I used the groups I created for the first question with same age 60.6 and used the following code for the plots:
\begin{lstlisting}[language=R]
png('malebmi.png',width = 1200,height = 830)
qqplot(male$height,male$bmi)
dev.off()
png('femalebmi.png',width = 1200,height = 830)
qqplot(female$height,female$bmi)
dev.off()
\end{lstlisting}
\begin{figure}[H]
\includegraphics[scale=0.4]{malebmi.png}
\caption{Male age =60.6 , height vs BMI}
\end{figure}
Comparing figure 5 with figure 6 we can notice that females has more BMI than males in the same group of height.
\begin{figure}[H]
	\includegraphics[scale=0.4]{malebmi.png}
	\caption{Female age =60.6 , height vs BMI}
\end{figure}
	\section*{Third Question}
	For this task I took the male gender from 60.6 to 80 (about 15000 kid) for over weight children. I used the following code :
	\begin{lstlisting}[language=R]
########Third Question #############
overweight<-ncmp[ncmp$bmipopulationcategory=='overweight'&ncmp$genderdescription=='Male' &ncmp$ageinmonths>60.6 &
ncmp$ageinmonths<80,]
png('QQvsdest',width = 1200,height = 830)
qqnorm(overweight$height);qqline(overweight$height,col=2);
dev.off()
	\end{lstlisting}
\begin{figure}[H]
\includegraphics[scale=0.4]{QQvsdest.png}
\caption{Overweight children height vs Theoretical normal distribution}
\end{figure}
Although figure 7 shows that the height almost identical to normal distribution but when we take all the points of overweighted children we would notice a difference.
	\section*{Fourth Question}
\textbf{Note:}I believe the question changed (it was with support more than 3 then become more than 0.3) which is the same in this question (3/8 = 0.375 , 2/8 = 0.25).\\
For this question I used python \\ \textbf{Note: } you need to generalize the last step to get all the combination we want.Here is the code :
\begin{lstlisting}[language=Python]

# coding: utf-8

# In[95]:

import itertools

# In[96]:

main =[]
main.append(sorted(['B','C', 'A' ,'F', 'H']))
main.append(sorted(['F', 'E', 'C', 'H']))
main.append(sorted(['E' ,'D', 'B']))
main.append(sorted(['A', 'C' ,'H', 'F']))
main.append(sorted(['E', 'F' ,'A']))
main.append(sorted(['D', 'H' ,'B']))
main.append(sorted(['E', 'C' ,'F', 'B', 'D']))
main.append(sorted(['A', 'H' ,'C', 'E']))
main.append(sorted(['G', 'A', 'E']))
main.append(sorted(['B', 'H', 'E']))

# In[97]:

lst={}
def addelement(element):
if element not in lst.keys():
lst[element]=1
else:
lst[element]+=1

# In[98]:

for i in main:
for j in i:
addelement(j)

# In[99]:

print len(lst.keys())
for key in lst.keys():
print key,lst[key]
if lst[key]<3:
lst.pop(key,None)
print '------ after cleaning--------'
for key in lst.keys():
print key,lst[key]
print len(lst.keys())

# In[148]:

lst2items={}
def addelement2(el):
el = ''.join(map(str.strip,el))
if el not in lst2items.keys():
lst2items[el]=1
else:
lst2items[el]+=1

# In[149]:

def checkcontain(myelements,thelist):
for i in myelements:
if i.strip() not in thelist:
return False
return True

# In[150]:

newcomb = itertools.combinations(lst.keys(), 3)

for i in newcomb:
for j in main:
if checkcontain(i,j):
addelement2(i)

# In[151]:

for key in lst2items.keys():
print key,lst2items[key]
if lst2items[key]<3:
lst2items.pop(key,None)
print '------ after cleaning--------'
for key in lst2items.keys():
print key,lst2items[key]
\end{lstlisting}
You can find a copy on git hub here \href{https://github.com/aqeel13932/DM}{DM} in Home work 05 folder.\\
I started with one element :
A 5
C 5
B 5
E 7
D 3
F 5
H 6\\
Then for 2 elements :
BD 3
BE 3
AC 3
AE 3
EH 3
AF 3
AH 3
EF 3
BH 3
CF 4
CE 3
CH 4
FH 3\\
Then for 3 elements:
ACH 3
CFH 3\\
And there is no 4 elements with support 3 or more.
	\section*{Fifth Question}
For this question I put all the information in Calc sheet and fulled it with the results I got from 4th question. Here is the heat map:
\begin{figure}[H]
\includegraphics[scale=0.6]{5q.png}
\caption{Heatmap for support}
\end{figure}
To calculate the confidence I actually used a trick :) .In figure 9 you can see the table that I depended on to calculate both (support \& confidence).
\begin{figure}[H]
\includegraphics[scale=0.6]{5q3.png}
\caption{Table shows how many two items occurred}
\end{figure}
We can notice that if we divide each cell on 8 (number of transaction) we get the support and if we divide each row on the diagonal element we get the confidence.\\
Here is the confidence table :
\begin{figure}[H]
	\includegraphics[scale=0.6]{5q2.png}
\caption{Confidence table}
\end{figure}
\textbf{Note:}All code,pictures , python , R , ipython in this repository \href{https://github.com/aqeel13932/DM/tree/master/HW05}{aqeel13932}
\end{document}


\section{Sample of collision participants
in nuclear collisions.}

\subsection{MC procedure to define collision participants.}
\hspace{1.0em} The inelastic
hadron--nucleus or
nucleus--nucleus interactions at ultra--relativistic energies are considered
as
independent hadron--nucleon or
nucleon-nucleon inelastic collisions.  It was shown long
time ago \cite{CK78} for the hadron--nucleus collision that such a
picture can be obtained starting from the Regge--Gribov
approach \cite{BT76}, when one assumes that the hadron-nucleus elastic
scattering amplitude is a result of reggeon exchanges between the
initial hadron and  nucleons from target--nucleus. This result can be
extended for the nucleus--nucleus collision case and leads to
simple and efficient MC procedure \cite{Am86} to define
the interaction cross sections and the number of the nucleons
participating in the inelastic nucleus--nucleus collision:
\begin{itemize}
\item We should randomly distribute $A$ nucleons from the projectile-nucleus and $B$
nucleons from the target-nucleus on the impact parameter plane according
to the weight functions $T([\vec{b}^{A}_{i}])$ and
$T([\vec{b}^{B}_{j}])$, respectively. These functions represent
probability densities to find sets of the nucleon impact parameters
$[\vec{b}^{A}_{i}]$, where $i=1,2,...,A$ and $[\vec{b}^{B}_{j}]$, where
$j=1,2,...,B$.
\item For each pair of nucleons $i$ and $j$ with choosen impact parameters $\vec{b}^{A}_{i}$ and
$\vec{b}^{B}_{j}$ we should check whether they interact inelastically or
not using the probability $p_{ij}(\vec{b}^{A}_{i}-\vec{b}^{B}_{j},s)$,
where $s_{ij}=(p_{i}+p_{j})^2$ is the squared total c.m.  energy of the
given nucleons with the $4$--momenta $p_{i}$ and $p_{j}$, respectively.
\end{itemize}

The described MC procedure is based on the probability
$P(\vec{B},s)$ given impact parameter $\vec{B}$ and at given squared total
c.m. nucleon--nucleon energy $s$ ( to simplify notations, we assume, that
all interacting nucleon pairs have the same $s$)
of a such configuration, when several pairs of nucleons
from the projectile and target nuclei interact inelastically and the
rest of the nucleons do not participate in collisions:
\begin{equation}
\label{SP1}P(\vec B,s)=<\prod\limits_{i,j=1}p_{ij}(\vec b_i^A-\vec
b_j^B,s)\prod\limits_{k,l=1}(1-p_{kl}(\vec b_k^A-\vec b_k^B,s))>,
\end{equation}
which can be rewritten
 more explicitly as
\begin{equation}
\label{SP2}
\begin{array}{c}
P(\vec B,s)=
\int \prod\limits_{i,j=1}p_{ij}(\vec b_i^A-\vec
b_j^B,s)\prod\limits_{k,l=1}(1-p_{kl}(\vec b_k^A-\vec b_l^B,s))\\ T_A(\vec
b_1^A)T_A(\vec b_2^A)...T_A(\vec B-\vec b_B^B)d\vec b_1^Ad\vec b_2^A...d\vec
b_B^B.
\end{array}
\end{equation}

In the Regge--Gribov approach\cite{BT76} the probability for an inelastic
collision of nucleons $i$ and $j$ as a function at the squared impact
parameter difference $b_{ij}^2=(\vec{ b}_i^A-\vec{ b}_j^B)^2 $ and $s$
is given by
\begin{equation}
\label{SP3}
 p_{ij}(\vec{ b}_i^A-\vec{ b}_j^B,s)=
 c^{-1}[1-\exp{\{-2u(b_{ij}^2,s)\}}] =
\sum_{n=1}^{\infty}p^{(n)}_{ij}(\vec{ b}_i^A-\vec{ b}_j^B,s),
\end{equation}
where
\begin{equation}
\label{SP4}
 p^{(n)}_{ij}(\vec{ b}_i^A-\vec{ b}_j^B,s)
=c^{-1}\exp{\{-2u(b_{ij}^2,s)\}}
 \frac{[2u(b_{ij}^2,s)]^{n}}{n!}.
\end{equation}
is the probability to find the $n$ cut Pomerons (or the probability for
$2n$ string produced in an inelastic nucleon-nucleon collision).  These
probabilities are defined in terms of the (eikonal) amplitude of
nucleon--nucleon elastic scattering with Pomeron exchange:
\begin{equation}
\label{SP5}u(b_{ij}^2,s)=\frac{z(s)}{2}\exp (-b_{ij}^2/4\lambda (s)).
\end{equation}
The quantities $z(s)$ and $\lambda (s)$ are expressed through the
parameters of the Pomeron trajectory, $\alpha _P^{^{\prime }}=0.25$
$GeV^{-2}$ and $\alpha _P(0)=1.0808$, and the parameters of the
Pomeron-nucleon vertex $R_P^2=3.56$ $GeV^{-2}$ and $\gamma _P=3.96$
$GeV^{-2}$:
\begin{equation}
\label{SP6}z(s)=\frac{2c\gamma _P}{\lambda (s)}(s/s_0)^{\alpha _P(0)-1}
\end{equation}
\begin{equation}
\label{SP7}\lambda (s)=R_P^2+\alpha _P^{^{\prime }}\ln (s/s_0),
\end{equation}
respectively, where $s_{0} = 3.0$ $GeV^{2}$ is a dimensional parameter.

In Eqs. (\ref{SP3},\ref{SP4}) the so--called shower enhancement
coefficient $c=1.4$ can be introduced to determine the contribution of
diffractive dissociation\cite{BT76}.  Thus, the total interaction
probability and the probability for diffractive dissociation of a pair
of nucleons can be computed as
\begin{equation}
\label{SP8}p_{ij}^{tot}(\vec b_i^A-\vec b_j^B,s)=(2/c)[1-\exp
\{-u(b_{ij}^2,s)\}].
\end{equation}
\begin{equation}
\label{SP9}p_{ij}^d(\vec b_i^A-\vec b_j^B,s)=\frac{c-1}{c}[p_{ij}^{tot}(\vec
b_i^A-\vec b_j^B,s)-p_{ij}(\vec b_i^A-\vec b_j^B,s)].
\end{equation}
The Pomeron parameters are found from a global fit of the total,
elastic, differential elastic and diffractive cross sections of the
nucleon--nucleon interaction at different energies.

For the pion-nucleon and kaon-nucleon collisions the Pomeron vertex
parameters and shower enhancement coefficient should be changed, e. g.
$R^{\pi}_{P^2} = 2.36$ $GeV^{-2}$, $\gamma^{\pi}_P = 2.17$ $GeV^{-2}$,
$s^{\pi}_{0} = 1.5$ $GeV^{2}$, $c^{\pi}=1.6$ and $R^{K}_{P^2} = 1.96$
$GeV^{-2}$, $\gamma^{K} _P = 1.92$ $GeV^{-2}$, $s^{K}_{0} = 2.3$
$GeV^{2}$, $c^{\pi}=1.8$ can be used to describe properly the total,
elastic and diffractive cross sections.

\subsection{High energy hadron--nucleon interaction cross sections.}

\hspace{1.0em}The hadron--nucleon  cross sections can be calculated from
the corresponding interaction probabilities. Particularly, the
hadron--nucleon total and inelastic cross section can be written as
follows:
\begin{equation}
\label{SP10}\sigma_{tot} = 2\pi \int_0^{\infty}bdbp_{ij}^{tot}(b^2_{ij},s)
= \sigma_{P} f(\frac{z}{2})
\end{equation}
and
\begin{equation}
\label{SP11}\sigma_{in} = 2\pi \int_0^{\infty}bdbp_{ij}^{in}(b^2_{ij},s)
= \sigma_{P} f(z),
\end{equation}
where
\begin{equation}
\label{SP12}\sigma_{P}=4\pi z(s)\lambda(s)
\end{equation}
and
\begin{equation}
\label{SP13} f(z)= \sum_{\nu = 1}^{\infty}\frac{(-z)^{\nu -1}}{\nu \nu !}.
\end{equation}

\subsection{Separation of hadron diffraction excitation.}

\hspace{1.0em}For each pair of nucleons $i$ and $j$ with choosen impact
parameters $\vec{b}^{A}_{i}$ and $\vec{b}^{B}_{j}$ we should check
whether they interact inelastically or not using the probability
\begin{equation}
\label{SP14}
p^{in}_{ij}(\vec{b}^{A}_{i}-\vec{b}^{B}_{j},s)=
p_{ij}(\vec{b}^{A}_{i}-\vec{b}^{B}_{j},s)
+ p_{ij}^d(\vec b_i^A-\vec b_j^B,s).
\end{equation}
 If interaction will be realized, then
we have to consider it to be diffractive or nondiffractive with probabilities
\begin{equation}
\label{SP15}
\frac{p_{ij}^d(\vec b_i^A-\vec b_j^B,s)}{p^{in}_{ij}
(\vec{b}^{A}_{i}-\vec{b}^{B}_{j},s)}
\end{equation}
and
\begin{equation}
\label{SP16}
\frac{p_{ij}(\vec b_i^A-\vec b_j^B,s)}{p^{in}_{ij}
(\vec{b}^{A}_{i}-\vec{b}^{B}_{j},s)}.
\end{equation}


\clearpage
\subsection{Vector GREV}

These instructions are vectorised versions of the Bitmanip
\mnemonic{grevi} instruction\footnote{
See \url{https://github.com/AndyGlew/Ri5-stuff/wiki/VGREV---Vector-Generalized-Reverse}
for the initial design discussion around vector \mnemonic{grev}.
}.

\begin{cryptoisa}
vgrev.vv     vd, vs2, vs1 , vm  // Vector-Vector
vgrev.vs     vd, vs2, vs1 , vm  // Vector-Scalar
vgrev.vi     vd, vs2, uimm, vm  // Vector-Immediate
vgrev.vx     vd, vs2, rs1 , vm  // Vector-XReg
\end{cryptoisa}

\begin{figure}[h]
\lstinputlisting[language=sail,firstline=531,lastline=553]{../sail/riscv_insts_crypto_rvv_alu.sail}
\caption{
Sail specification for the vector-vector generalised reverse operation.
Other variants such as vector-scalar and vector-immediate can be seen in
the Sail model code.
}
\label{fig:sail:vgrev}
\end{figure}

For each \EEW-bit wide element in \vrs{2}, if the corresponding $\vm[i]$
bit is clear, then the destination element in \vrd is {\em zeroed}.
If the $\vm[i]$ bit is set, then we apply the
\texttt{generalised\_reverse} operation to the \EEW-bit element, using the
$6$-bit \texttt{uimm} immediate as the control variable.
For a complete specification of the \texttt{generalised\_reverse}
operation, see
\cite[Section 2.2.2, Generalized Reverse]{riscv:bitmanip:draft}.

For the Cryptography Extension,
Implementations must support an \EEW upto and including \XLEN.
Executing the instruction with an un-supported \EEW results in an
Invalid Opcode Exception.
Only the values of \texttt{uimm} listed in table \ref{tab:vgrev:uimm}
are required by the Cryptography Extension.
An un-supported value of \texttt{uimm} results in an
Invalid Opcode Exception.

\begin{table}
\centering
\begin{tabular}{ll}
\texttt{uimm} Value & Operation                         \\
\hline
\texttt{0b000111}   & Reverse bits within bytes         \\
\texttt{0b011000}   & Reverse bytes within 32-bit words \\
\texttt{0b111000}   & Reverse bytes within 64-bit words \\
\hline
\end{tabular}
\caption{Required values of \texttt{uimm} which Cryptography Extensions
of \texttt{vgrev.vi} must support.}
\label{tab:vgrev:uimm}
\end{table}


\documentclass[11pt,letter]{article}

\usepackage{latexsym, color, graphicx, comment}
\usepackage[top=1in,bottom=1in,left=1in,right=1in]{geometry}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{hyperref}
\hypersetup{colorlinks=true,linkcolor=blue}

%\graphicspath{{../MATLAB/}}

\newcommand{\vect}[1]{\mbox{\boldmath $#1$}}
\DeclareMathAlphabet{\mathbfsf}{\encodingdefault}{\sfdefault}{bx}{n}
\newcommand{\tens}[1]{\mathbfsf{#1}}

\newcommand{\red}[1]{\textcolor{red}{#1}}
\newcommand{\erf}{\mathrm{erf}}
\newcommand{\PS}{Pfirsch-Schl\"{u}ter~}
\newcommand{\ExB}{\vect{E}\times\vect{B}}
\newcommand{\Cnl}{C_{\mathrm{nl}a}}
\newcommand{\vma}{\vect{v}_{\mathrm{m}a}}
\newcommand{\vm}{\vect{v}_{\mathrm{m}}}
\newcommand{\vda}{\vect{v}_{\mathrm{d}a}}
\newcommand{\vE}{\vect{v}_{E}}
\newcommand{\vdao}{\vect{v}_{\mathrm{d}a0}}
\newcommand{\vdo}{\vect{v}_{\mathrm{d}0}}
\newcommand{\vEo}{\vect{v}_{E0}}
\newcommand{\vpar}{v_{||}}
\newcommand{\vperp}{v_{\bot}}
\newcommand{\rhop}{\rho_{\theta}}
\newcommand{\rT}{r_{T}}
\newcommand{\Ti}{T_{\mathrm{i}}}
\newcommand{\rTi}{r_{T\mathrm{i}}}
\newcommand{\rTe}{r_{T\mathrm{e}}}
\newcommand{\reta}{r_{\eta}}
\newcommand{\rn}{r_{n}}
\newcommand{\rperp}{r_\bot}
\newcommand{\fM}{f_{\mathrm{M}}}
\newcommand{\fMa}{f_{\mathrm{M}a}}
\newcommand{\fMi}{f_{\mathrm{M}i}}
\newcommand{\fMe}{f_{\mathrm{Me}}}
\newcommand{\fe}{f_{\mathrm{e}}}
\newcommand{\Te}{T_{\mathrm{e}}}
\newcommand{\vth}{v_{\mathrm{th}}}
\newcommand{\nuii}{\nu_{ii}}
\newcommand{\nuPrime}{\hat{\nu}}
\newcommand{\gradpar}{\nabla_{||}}
\newcommand{\kpar}{k_{||}}
\newcommand{\psia}{\psi_0}
\newcommand{\psiaHat}{\hat{\psi}_0}
\newcommand{\omegase}{\omega_{*}}
\newcommand{\nuee}{\nu_{ee}}
\newcommand{\energy}{\mathcal{E}}
\newcommand{\sgn}{\mathrm{sgn}}
\newcommand{\changed}[1]{\textcolor{red}{#1}}
\newcommand{\todo}[1]{\textcolor{green}{#1}}
\newcommand{\nescoil}{{\tt NESCOIL}}
\newcommand{\regcoil}{{\tt REGCOIL}}
\newcommand{\vmec}{{\tt VMEC}}
\newcommand{\makegrid}{{\tt MAKEGRID}}
\newcommand{\currentPot}{\Phi}
\newcommand{\currentPotSV}{\Phi_{sv}}
\newcommand{\Bnormal}{B_{\mathrm{normal}}}
\newcommand{\sincos}{\begin{pmatrix} \sin \\ \cos \end{pmatrix}}
\newcommand{\cossin}{\begin{pmatrix} \cos \\ -\sin \end{pmatrix}}
\newcommand{\Bnplasma}{B_{\mathrm{normal}}^{\mathrm{plasma}}}
\newcommand{\Bnexternal}{B_{\mathrm{normal}}^{\mathrm{external}}}
\newcommand{\Bncurrentpot}{B_{\mathrm{normal}}^{\Phi}}
\newcommand{\BnormalSV}{B_{\mathrm{normal}}^{\mathrm{sv}}}

\begin{document}

\title{Sign conventions in VMEC}

% repeat the \author .. \affiliation  etc. as needed
% \email, \thanks, \homepage, \altaffiliation all apply to the current author.
% Explanatory text should go in the []'s,
% actual e-mail address or url should go in the {}'s for \email and \homepage.
% Please use the appropriate macro for the type of information

% \affiliation command applies to all authors since the last \affiliation command.
% The \affiliation command should follow the other information.

%\author{Pavlos Xanthopoulos}
%\email[]{mattland@umd.edu}
%\homepage[]{Your web page}
%\thanks{}
%\affiliation{Max Planck Institute for Plasma Physics, Greifswald, Germany}

\author{Matt Landreman}
%\email[]{mattland@umd.edu}
%\homepage[]{Your web page}
%\thanks{}
%\affiliation{Institute for Research in Electronics and Applied Physics, University of Maryland, College Park, MD, 20742, USA}

% Collaboration name, if desired (requires use of superscriptaddress option in \documentclass).
% \noaffiliation is required (may also be used with the \author command).
%\collaboration{}
%\noaffiliation

\date{September 28, 2017}
\maketitle %\maketitle must follow title, authors, abstract and \pacs

%\section{Summary of main points}

This note is based on some preliminary numerical experiments, and I have not yet been able to confirm them by
examination of the source code, so there could well be errors.

The following points apply to the case {\ttfamily lrfp=.false.}; I am not sure if anything is different in the {\ttfamily lrfp=.true.} case.

\begin{enumerate}
\item
The toroidal angle, variously called $\phi$, $\zeta$, or $v$, always increases in a counter-clockwise direction when the plasma is viewed from above.
Hence, the cylindrical coordinate system $(R,\zeta,Z)$ is right-handed.
(I've verified this is true for \makegrid, and hence true for free-boundary \vmec, but I'm not sure it needs to be true for fixed-boundary \vmec.)
\item
The direction of the poloidal angle, variously called $\theta$ or $u$, always increases as you move from the outboard to inboard
side over the top of the plasma. If the boundary shape specified in the input file implies the opposite direction for $\theta$,
vmec will flip the sign of some of the shape coefficients to flip the sign of $\theta$. As a result, the Jacobian of the $(s,\theta,\zeta)$
coordinates
\begin{equation}
\sqrt{g} = \frac{\partial \vect{r}}{\partial s} \cdot \frac{\partial\vect{r}}{\partial\theta} \times \frac{\partial\vect{r}}{\partial\zeta}
= \frac{1} {\nabla s \cdot \nabla\theta\times\nabla\zeta}
\end{equation}
is always negative. Here, $\vect{r}$ is the position vector, and $s$ is the toroidal flux normalized to its value at the edge, so $s=0$ on the magnetic axis and $s=1$ at the outermost surface.
This sign of $\sqrt{g}$ is reflected in the output variable {\ttfamily signgs}, which is always $-1$.
(Then why is {\ttfamily signgs} saved, if it is always the same?)
\item
These previous points imply that the rotational transform $\iota = d(\theta + \lambda) / d\zeta$ is positive if the magnetic
field lines spiral with a left-handed orientation, whereas $\iota<0$ if the field lines make a right-handed spiral.
\item
A positive value for the input toroidal flux variable {\ttfamily phiedge} corresponds to the magnetic field pointing in the $\nabla \zeta$ direction,
(counter-clockwise when viewed from above.) This flux satisfies
\begin{equation}
\mathtt{phiedge} = \int_0^s ds' \int_0^{2\pi} d\theta | \sqrt{g}| \vect{B}\cdot\nabla\zeta,
\end{equation}
where the absolute value must be included around the $| \sqrt{g}|$ factor.
\item
The output toroidal flux quantities {\ttfamily phi} and {\ttfamily phipf} have the same sign as {\ttfamily phiedge}.
However, the output toroidal flux quantity {\ttfamily phips} differs in sign by {\ttfamily signgs}, i.e. it has the opposite sign.
\item
The toroidal plasma current given by the input parameter {\ttfamily curtor} and output parameter {\ttfamily ctor} is positive if the current points in the $\nabla\zeta$ direction
(counter-clockwise when viewed from above.) This current satisfies
\begin{equation}
\mathtt{curtor} = \int_0^s ds' \int_0^{2\pi} d\theta | \sqrt{g}| \vect{j}\cdot\nabla\zeta,
\end{equation}
where $\vect{j}$ is the current density, and the absolute value must be included around the $| \sqrt{g}|$ factor.
\item
In the expression for the magnetic field
\begin{equation}
\vect{B} = \nabla\psi\times\nabla(\theta + \lambda) + \iota \nabla\zeta\times\nabla\psi,
\end{equation}
the sign of the $\psi$, which is the toroidal flux divided by $2\pi$, differs from the sign of vmec's {\ttfamily phi}$/(2\pi)$
by {\ttfamily signgs}$=-1$.
\end{enumerate}

\begin{comment}
\section{Evidence}
Line 273 of {\ttfamily General/bcovar.f: \\
\\
ctor = signgs*twopi*(c1p5*buco(ns) - p5*buco(ns1))
\\
}
where {\ttfamily p5}=0.5 and {\ttfamily c1p5}=1.5.
\end{comment}

%\appendix

%\bibliography{quasisymmetricEquilibria}

\end{document}


\chapter{Variations}

Other Topics, Related Topics

\section{Static Mastermind}

\section{Dynamic Mastermind}

In the standard Mastermind game, all that the code-maker does is to set up a secret at the beginning of the game, and then \emph{passively} responds to the guesses made by the code-maker. The role played by the code-maker is rather boring.

To make the code-maker's role more interesting (and challenging), in a \emph{dynamic} Mastermind game, introduced by Bestavros and Belal \cite{bestavros86}, the codemaker is allowed to silently change the secret during the course of the game, as long as the secret is consistent with all the guesses and feedbacks so far.

For example, suppose the code-maker initially holds the secret 1234. Suppose that in the first round, the code-breaker makes the guess 1234 outright. Under the standard rules, the code-maker is obliged to respond with 4A0B and surrender the game. However, under the \emph{dynamic} rules, the code-maker is allowed to silently change the secret to, say, 3456, and reply with the feedback 0A2B. The game continues until the code-maker finally reveals the secret.

It is easy to see that under either the standard rules or the dynamic rules, the code-maker will eventually lose because there are a finite number of codewords. However, under the dynamic rules, the code-maker is able to prolong the game for more steps.

In fact, it can be shown that when both sides play optimally, the game will require exactly [7??] rounds to finish. That is, after six rounds of guesses and responses, there is only one codeword left that conforms to all the constraints so far; the code-breaker will then guess this codeword and the code-maker has to respond with 4A0B.

[Show this using exhaustive search]

[Compare different combinations of heuristic strategies used by the code-maker and code-breaker]

\section{Head-to-Head Play}

[Tanaka also noted that a strategy which produces a minimum expected
game length is not the optimal strategy for head-to-head play between two human
opponents when a win by any number of moves scores the same as a win by a
single move.] What does this mean??

\section{Mastermind with a lie}


%% thesis.tex 2014/04/11
%
% Based on sample files of unknown authorship.
%
% The Current Maintainer of this work is Paul Vojta.

\documentclass{ucbthesis}
\usepackage{biblatex}
\usepackage{rotating} % provides sidewaystable and sidewaysfigure
\usepackage{listings}
\usepackage{amsmath,amssymb}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{mathtools}      %

% To compile this file, run "latex thesis", then "biber thesis"
% (or "bibtex thesis", if the output from latex asks for that instead),
% and then "latex thesis" (without the quotes in each case).

% Double spacing, if you want it.  Do not use for the final copy.
% \def\dsp{\def\baselinestretch{2.0}\large\normalsize}
% \dsp

% If the Grad. Division insists that the first paragraph of a section
% be indented (like the others), then include this line:
% \usepackage{indentfirst}

\addtolength{\abovecaptionskip}{\baselineskip}

\newtheorem*{remark}{Remark}

\newtheorem{theorem}{Theorem}[section]
\newtheorem{corollary}{Corollary}[theorem]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{definition}{Definition}
\newtheorem{prop}{Proposition}

\DeclareMathOperator*{\calX}{\mathcal{X}}
\DeclareMathOperator*{\calY}{\mathcal{Y}}

\newcommand{\ovl}{\overline}
\newcommand{\E}{\mathrm{E}}
\newcommand{\Var}{\mathrm{Var}}
\newcommand{\Cov}{\mathrm{Cov}}
\newcommand{\Prob}{\mathrm{P}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\C}{\mathbb{C}} % complex numbers
\newcommand{\eps}{\varepsilon} % epsilon

%\newcommand{\c}{\expandafter\mathcal} % calligraphic

\DeclarePairedDelimiter\paren{(}{)}           % (parentheses)
\DeclarePairedDelimiter\ang{\langle}{\rangle} % <angle brackets>
\DeclarePairedDelimiter\abs{\lvert}{\rvert}   % |absolute value|
\DeclarePairedDelimiter\norm{\lVert}{\rVert}  % ||norm||
\DeclarePairedDelimiter\bkt{[}{]}             % [brackets]
\DeclarePairedDelimiter\set{\{}{\}}

%\addbibresource{references.bib}
\bibliography{references}

\hyphenation{mar-gin-al-ia}
\hyphenation{bra-va-do}

\begin{document}

% Declarations for Front Matter

\title{Analyses of Domain Adaptation using Optimal Transport}
\author{Yannik Pitcan}
\degreesemester{Spring}
\degreeyear{2020}
\degree{Doctor of Philosophy}
\chair{Professor Peter Bartlett}
\othermembers{Professor Steve Evans \\
  Assistant Professor Avi Feller}
% For a co-chair who is subordinate to the \chair listed above
% \cochair{Professor Benedict Francis Pope}
% For two co-chairs of equal standing (do not use \chair with this one)
% \cochairs{Professor Richard Francis Sony}{Professor Benedict Francis Pope}
\numberofmembers{3}
% Previous degrees are no longer to be listed on the title page.
% \prevdegrees{B.A. (University of Northern South Dakota at Hoople) 1978 \\
%   M.S. (Ed's School of Quantum Mechanics and Muffler Repair) 1989}
\field{Statistics}
% Designated Emphasis -- this is optional, and rare
% \emphasis{Colloidal Telemetry}
% This is optional, and rare
% \jointinstitution{University of Western Maryland}
% This is optional (default is Berkeley)
% \campus{Berkeley}

% For a masters thesis, replace the above \documentclass line with
% \documentclass[masters]{ucbthesis}
% This affects the title and approval pages, which by default calls this
% document a "dissertation", not a "thesis".

\maketitle
% Delete (or comment out) the \approvalpage line for the final version.
%\approvalpage
\copyrightpage

\include{abstract}

\begin{frontmatter}

\begin{dedication}
\null\vfil
\begin{center}
This is dedicated to my parents.
\end{center}
\vfil\null
\end{dedication}

% You can delete the \clearpage lines if you don't want these to start on
% separate pages.

\tableofcontents
\clearpage
\listoffigures
\clearpage
\listoftables

\begin{acknowledgements}

Someone once said "failure is one's own doing, but success takes a village." I forget who said that, but it could not be more apt. There are multiple people in my life to whom I am incredibly appreciative.

First and foremost, I would like to thank Dr. Peter Bartlett. He has been an incredible advisor and suggested this topic and several of the key insights. Without him, I do not know where I would be today.

I would also like to thank my colleagues Soren Kuenzel and Alexander Tsigler. Both individuals gave me many suggestions and tips that helped immensely.

Lastly, I am thankful for my parents, Grace and Clyde Pitcan, for always believing in me.

\end{acknowledgements}

\end{frontmatter}

\pagestyle{headings}

% (Optional) \part{First Part}

\include{preliminaries(pjd)}
\include{chap1(pjd)}
\include{chap2(pjd)}
\include{chap3(pjd)}
\include{chap4(pjd)}
\include{chap5(pjd)}
\include{chap6(pjd)}
\printbibliography

% \appendix
% \chapter{More Monticello Candidates}

\end{document}


\section{Our work}

Our goal is to learn semantic parsers from instances of natural language expressions paired with their structured meaning representations.

Let~$x = x_1 \cdots x_{|x|}$ denote a natural language expression, and~$y = y_1 \cdots y_{|y|}$ its meaning representation. We wish to estimate~$p\left(y | x\right)$, the conditional probability of meaning representation~$y$ given input~$x$. We decompose~$p\left(y | x\right)$ into a two-stage generation process:
\begin{equation}
\label{eq:overview}
p\left(y | x\right) = p\left(y | x, a \right) p\left(a | x\right)
\end{equation}

\subsection{Encoder-Decoder}
\label{sec:encoder}

An \textit{encoder} is used to encode the natural language input $x$ into vector representations. Then, a \textit{decoder} learns to compute $p\left( a | x \right)$ and generate the sketch $a$ conditioned on the encoding vectors.

\paragraph{Input Encoder}
Every input word is mapped to a vector via
$\mathbf{x}_t = \mathbf{W}_x \mathbf{o}\left( x_t \right) $, where
$\mathbf{W}_x \in \mathbb{R}^{n \times |\mathcal{V}_x|}$ is an
embedding matrix, $|\mathcal{V}_x|$~is the vocabulary size, and
$\mathbf{o}\left( x_t \right)$~a word embedding vector.  We use a
bi-directional recurrent neural network with gated recurrent unit as the input encoder.

\input{figures/test.tex}

\subsection{Attention Structure}
\label{sec:Attention}

Our encoder and decoder are tied to each other through a multi-hop
attention mechanism\cite{luong2015effective, vaswani2017attention}. For each decoder layer $\ell$, we compute the
attention $a^{\ell}_{ij}$ of state $i$ and source element $j$ as:
\begin{align}
a^{\ell}_{ij} = \frac{\mbox{exp}(d^{\ell}_i \cdot z^u_j)}{\sum^m_{t=1} \mbox{exp}(d^{\ell}_i \cdot z^u_t)}, \label{eq:attention}
\end{align}
\noindent where $d^{\ell}_i = W^{\ell}_dh^{\ell}_i+b^{\ell}_i+g_i$ is
the decoder state summary combining the current decoder state
$h^{\ell}_i$ and the previous output element embedding $g_i$. The
vector $\mathbf{z^u}$ is the output from the last encoder layer
$u$. The conditional input $c^{\ell}_i$ to the current decoder layer
is a weighted sum of the encoder outputs as well as the input element
embeddings $e_j$:
\begin{align}
c^{\ell}_i = \sum^m_{j=1} a^{\ell}_{ij}(z^u_j+e_j). \label{eq:decinput}
\end{align}

The attention mechanism described here performs multiple attention
``hops'' per time step and considers which words have been previously
attended to. It is therefore different from single-step attention in
recurrent neural networks \cite{bahdanau2014neural}, where the attention
and weighted sum are computed over $\mathbf{z^u}$ only.


\chapter{RV32M Standard Extension}
\label{chapter:rv32m}
\index{RV32M}

\section{Introduction}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

32-bit integer multiply and divide instructions.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{MUL rd, rs1, rs2}
\index{Instruction!MUL}

Multiply \reg{rs1} by \reg{rs2} and store the least significant 32-bits
of the result in \reg{rd}.

\DrawInsnTypeRPicture{MUL x7, x3, x31}{00000011111100111000001110110011}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{MULH rd, rs1, rs2}
\index{Instruction!MULH}

\DrawInsnTypeRPicture{MULH x7, x3, x31}{00000011111100111001001110110011}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{MULHS rd, rs1, rs2}
\index{Instruction!MULHS}

\DrawInsnTypeRPicture{MULHS x7, x3, x31}{00000011111100111010001110110011}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{MULHU rd, rs1, rs2}
\index{Instruction!MULHU}

\DrawInsnTypeRPicture{MULHU x7, x3, x31}{00000011111100111011001110110011}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{DIV rd, rs1, rs2}
\index{Instruction!DIV}

\DrawInsnTypeRPicture{DIV x7, x3, x31}{00000011111100111100001110110011}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{DIVU rd, rs1, rs2}
\index{Instruction!DIVU}

\DrawInsnTypeRPicture{DIVU x7, x3, x31}{00000011111100111101001110110011}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{REM rd, rs1, rs2}
\index{Instruction!REM}

\DrawInsnTypeRPicture{REM x7, x3, x31}{00000011111100111110001110110011}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{REMU rd, rs1, rs2}
\index{Instruction!REMU}

\DrawInsnTypeRPicture{REMU x7, x3, x31}{00000011111100111111001110110011}