%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                                 %
%  GEANT manual in LaTeX form                              %
%                                                                 %
%  Michel Goossens (for translation into LaTeX)                   %
%  Version 1.00                                                   %
%  Last Mod. Jan 24 1991  1300   MG + IB                          %
%                                                                 %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Origin{L.Urb\'{a}n}
\Version{Geant 3.16}\Routid{PHYS440}
\Submitted{26.10.84}  \Revised{16.12.93}
\Makehead{Total cross-section and energy loss for bremsstrahlung by
Muons}
\section{Subroutines}
\Shubr{GBRELA}{}
{\tt GBRELA} fills the tables for continuous energy loss of electrons,
positrons and muons due to bremsstrahlung during initialisation time.
The energy binning is determined by
the array {\tt ELOW} (common \FCind{/CGMULO/}) in the
routine \Rind{GPHYSI}. In the tables, the $dE/dx$ due to bremsstrahlung
is summed with that due to the ionisation. For energy loss
of muons, \Rind{GBRELA} calls the function \Rind{GDRELM}.
The following pointers are used:
\begin{DLtt}{MMMMMMMMMMMMMMMMMM}
\item[JMA = LQ(JMATE-I)] pointer to the I$^{th}$ material;
\item[JEL1 = LQ(JMA-1)]  pointer to dE/dx for electrons;
\item[JEL1+NEK1]           pointer to dE/dx for positrons;
\item[JEL2 = LQ(JMA-2)]  pointer to dE/dx for electrons.
\end{DLtt}
\Rind{GBRELA} is called by \Rind{GPHYSI}.
\Sfunc{GBRELM}{VALUE = GBRELM(Z,T,BCUT)}
\begin{DLtt}{MMMMMMMM}
\item[Z] ({\tt REAL}) atomic number of the material;
\item[T] ({\tt REAL}) kinetic energy of the muon;
\item[BCUT] ({\tt REAL}) {\it soft} bremsstrahlung cut.
\end{DLtt}
\Rind{GBRELM} calculates the muon energy loss due to bremsstrahlung
of photons with energy below {\tt BCUT}, (variable {\tt BCUTM} in the
common \FCind{/GCCUTS/}).
Above this value, the bremsstrahlung process is simulated
explicitly (see {\tt [PHYS441]}) and the energy lost by the muons is
not included in the tables.
In the tables, the $dE/dx$ due to bremsstrahlung is summed with
the energy lost coming from ionisation, pair production and nuclear interaction.
\Rind{GBRELM} is called by \Rind{GBRELA}.
\Shubr{GBRSGA}{}
{\tt  GBRSGA} calculates the total cross-section for bremsstrahlung.
It tabulates the mean free path
in cm as a function of the medium and the energy. The energy
binning is determined by the array {\tt ELOW} (common \FCind{/CGMULO/}).
The following pointers are used:
\begin{DLtt}{MMMMMMMMMMMMMMMMMM}
\item[JMA = LQ(JMATE-I)]pointer to the I$^{th}$ material;
\item[JBREM = LQ(JMA-9)]pointer to bremsstrahlung cross-sections;
\item[JBREM            ]pointer for \Pem;
\item[JBREM+NEK1       ]pointer for \Pep;
\item[JBREM+2*NEK1     ]pointer for $\mu^+/\mu^-$.
\end{DLtt}
\Rind{GBRSGA} is called during initialisation by \Rind{GPHYSI}.
\Sfunc{GBRSGM}{VALUE = GBRSGM(Z,T,BCUT)}
\begin{DLtt}{MMMMMMMM}
\item[Z] ({\tt REAL}) atomic number of the materian;
\item[T] ({\tt REAL}) kinetic energy of the muon;
\item[BCUT] ({\tt REAL}) {\it soft} bremsstrahlung cut.
\end{DLtt}
\Rind{GBRSGM} calculates the total bremsstrahlung cross-section for
muons when the emitted photon has an energy greater than {\tt BCUT},
(variable {\tt BCUTM} in the common \FCind{/GCCUTS/}). It is called
by \Rind{GBRSGA}.
\section{Method}

The mean value of the energy lost by the muon due to bremsstrahlung of
photons of energy $<k_{c}$ = {\tt BCUTM} is:
\begin{equation}
\label{eq:phys440-1}
E_{loss}^{brem}(Z,T,k_c ) = \int_{0}^{k_c} k
        \frac{d \sigma (Z,T,k)}{dk}dk
\end{equation}
and the total cross-section for the emission of a photon of energy
$ > k_c $ is
\begin {equation}
\label{eq:phys440-2}
 \sigma (Z,T,k_c ) = \int_{k_c}^{T}
        \frac{d \sigma (Z,T,k)} {dk} dk
\end{equation}
Accurate cross-section formula for the high energy ($T \geq 1$ GeV)
muon bremsstrahlung can be found in \cite{bib-LOHM}.

\subsection{Parameterisation of energy loss and total cross-section}
The cross-sections from \cite{bib-LOHM} have been used to calculate
{\it data} points for (\ref{eq:phys440-1}) and (\ref{eq:phys440-2}).
These have been parameterised as:
\[ \begin{array}{LcLl}
 \sigma (Z,T,k_c)& =& Z[Z+ \xi_{\sigma}(1+ \gamma \ln Z)]
       \left[\ln \frac{k_{max}}{k_c}\right]^{\alpha}
       F_{\sigma}(Z,X,Y) & \mbox{ in barn} \\
  E_{loss}^{brem} (Z,T,k_c)   & = & Z[Z+\xi_l(1+\delta\ln Z)]
   \left[\ln\frac {k_c} {E} \right]^{\beta}
    F_l(Z,X,Y) & \mbox{ in GeV barn}
\end{array} \]
\[ \begin{array}{LcL@{\hspace{2cm}}LcL}
k_{max} & = & E-0.75 \sqrt {e}m_{\mu}Z^{1/3} & X & = & \ln \frac{E}{m_{\mu}} \\
Y & = & \ln \frac{k_c}{m_{\mu}} & E & = & T+m_{\mu}
\end{array} \]
where  $k_{max}$ is the maximum
possible value of the photon energy.
The functions $F_i(Z,X,Y)$ ($i=\sigma ,l$) are polynomials:
\begin{eqnarray}
\label{eq:phys440-3}
F_i(Z,X,Y) & = & (C_1+C_2X+\cdots +C_6X^5)+(C_7+C_8X+\cdots+C_{12}X^5)Y
\nonumber \\
        & + & \cdots + (C_{31}+C_{32}X+\cdots+C_{36}X^5)Y^5
\nonumber \\
           & + & Z[(C_{37}+C_{38}X+\cdots+C_{40}X^3)+(C_{41}+C_{42}X+
                   \cdots+C_{44}X^3)Y \nonumber \\
           & + & \cdots + (C_{48}+C_{49}X+\cdots+C_{52}X^3)Y^3)]
\end{eqnarray}
A least-squares fit has been performed on more than 2000 points for
$Z = 1, 6, 13, 26, 50, 82, 92$ and 1 GeV $\leq T \leq $ 10 TeV and
10 keV $\leq k_c \leq T $. The resulting values of
$\xi_{\sigma,l}$, $\gamma$, $\alpha$ ,$C_i$, $\xi_l$, $\delta$ and $\beta$
can be found in the {\tt DATA} statements within the functions
\Rind{GBRSGM} and \Rind{GBRELM} which
compute formulae (\ref{eq:phys440-1}) and (\ref{eq:phys440-2}) respectively.

The accuracy of the fit can be estimated as:\\

\[ \begin{array}{LcL}
\frac{\Delta \sigma}{\sigma} & = & \left \{
\begin{array}{p{2cm}lL}
$\displaystyle 10-12\%$ & \mbox{if} & T \leq 5 \: \mbox{GeV} \\
$\displaystyle \leq 4\%$ & \mbox{if} & T > 5 \: \mbox{GeV}
\end{array} \right . \\ [0.5cm]
\frac{\Delta E_{loss}^{brem}}{E_{loss}^{brem}} & = & \left \{
\begin{array}{p{2cm}lL}
$\displaystyle 10\%$ & \mbox{if} & T \leq 5 \: \mbox{GeV} \\
$\displaystyle \leq 3\%$ & \mbox{if} & T > 5 \: \mbox{GeV}
\end{array} \right .
\end{array} \]

The contribution of the bremsstrahlung to the total energy loss of
the muons is less than 1\% for $ T \leq$ 5 GeV.

When $k_{c} \geq k_{max}$, a parameterisation different from
(\ref{eq:phys440-3}) can be used for the total muon energy loss due to
bremsstrahlung:
\begin{eqnarray}
\label{eq:phys440-4}
E_{loss}^{brem} (Z,T) & = & E_{loss}^{brem}(Z,T,k=k_{max})
\nonumber\\
& = & Z(Z+1) k_{max}[d_1+(d_2X+d_3Y) + (d_4X^2+d_5 XY+d_6 Y^2) \nonumber \\
& + & \cdots+(d_{22}X^6+d_{23}X^5 Y+\cdots+d_{28}Y^6)]
\end{eqnarray}
where $Y=Z^{1/3}$.
The accuracy of the formula (\ref{eq:phys440-4}) for $1 \leq Z \leq 100$
is rather good:
\[
\frac{\Delta E_{loss}^{brem}}{E_{loss}^{brem}} = \left \{
\begin{array}{LlL}
\leq 1.5\% & \mbox{if} & T > 1  \; \mbox{GeV} \\
\leq 1\%  & \mbox{if} & T > 5 \; \mbox{GeV}
\end{array} \right .
\]


\documentclass[11 pt]{scrartcl}
\usepackage[header, margin, koma, stylish]{tyler}

\newcommand{\hwtitle}{Discussion 3B Recap}

\pagestyle{fancy}
\fancyhf{}
\fancyhead[l]{\hwtitle{}}
\fancyhead[r]{Tyler Zhu}
\cfoot{\thepage}

\begin{document}
\title{\Large \hwtitle{}}
\author{\large Tyler Zhu}
\date{\large\today}

\maketitle

\section{Quiz Review}
We went over the following problem in discussion.
\begin{problem}
    If all vertices of an undirected graph have degree 4, the graph must be the complete graph on five vertices, $K_5$.
\end{problem}
The answer is no, and there are \emph{many} examples (in fact, a whole class of graphs called the \href{https://en.wikipedia.org/wiki/Regular_graph}{4-regular graphs}). These counter-examples are all quite instructive:
\itemnum
    \ii $K_{4,4}$, the complete bipartite graph on two sets of 4 vertices
    \ii $H_4$, the 4-dimensional hypercube (in scope)
    \ii $K_5\cup K_5$, the union of two $K_5$'s (albeit disconnected)
    \ii The double of any 3-regular graph (see Homework 3).
    \ii \dots and many more
\itemend

In our proof that all trees with at least 2 vertices are bipartite, we used the following fact:
\begin{fact}
    Every tree has at least 2 leaves, or vertices of degree 1.
\end{fact}
I'll present two proofs of this fact, one constructive and one not (but only for the existence of one leaf).
\begin{proof}[Extremal Proof]
    Take any longest path in the tree. The two endpoints of this path must be leaves, as otherwise I could further traverse them and create a longer path, contradiction.
\end{proof}

Here's the second proof, which I actually got from one of my students. It only shows that there is one leaf, but that's all we need for our proof actually.

\begin{proof}[Non-constructive Proof]
    We use the following fact:
    \begin{fact}
        A graph with $k$ edges and $n$ vertices has a vertex of degree at most $2k/n$.
    \end{fact}
    The proof is exactly the same as Problem 2(a), since some number must be $\leq$ the average. But a tree has $n-1$ edges and $n$ vertices, so there is a vertex of degree $2(n-1)/n < 2$, which means there exists a vertex of degree 1.
\end{proof}

In our first proof, we made use of the \emph{Extremal Principle}, which is just a fancy way of saying to look at the extreme cases. Here's one cute example, and one slightly harder exercise.

\begin{exercise}
    There are $n$ students standing in a field such that the distance between each pair is distinct. Each student is holding a ball, and when the teacher blows a whistle, each student throws their ball to the nearest student. Prove that there is a pair of students that throw their balls to each other.
\end{exercise}
\begin{exercise}
    Suppose $n$ people are attending a banquet, and each of them has at least $m$
friends $(2 \leq m \leq n)$, where friendship is mutual. Prove that we can put at least $m + 1$ of the attendants on the same round table, so that each person sits next to his or her friends on both sides.
\end{exercise}

\section{Fermat's Little Theorem}
\begin{theorem}[Fermat's Little Theorem]
    For all prime $p$ with $\gcd(a,p) = 1$, $a^{p-1} \equiv 1 \pmod{p}$.
\end{theorem}

Use this theorem to help you reduce arbitrary powers more easily. For example, the theorem makes $23^{36}\equiv 1 \pmod{37}$ obvious immediately. Combined with CRT, powers become a piece of cake.

\section{Bijections}
A \emph{function} maps inputs from a set $A$ to elements in a set $B$. We denote them as $f: A\to B$. You've already seen many examples of functions. In fact, any mod operator like $f(x) = x\pmod{m}$ is also a function (what are $A$ and $B$?).

There are two main types of functions that we're interested in (fix a function $f:A\to B$):
\itemnum
    \ii $f$ is \textbf{onto} (surjective) if $\forall b\in B, \exists a\in A$ s.t. $f(a) = b$
    \itemnum
        \ii i.e. every $b\in B$ has a pre-image.
    \itemend
    \ii $f$ is \textbf{one-to-one} (injective) if $\forall a,a' \in A, f(a) = f(a') \implies a = a'$.
    \itemnum
        \ii i.e. different inputs map to different outputs,
    \itemend
\itemend

    If $f$ is both onto and one-to-one, we say that $f$ is \textbf{bijective}. Bijections are useful because they have formalize what it means for a function to be invertible.

\begin{theorem}
    A function $f:A\to B$ is a bijection if and only if it has an inverse, i.e. there exists a bijection $g: B\to A$ for which $\forall a\in A, g(f(a)) = a$ and $\forall b\in B, f(g(b)) = b$.
\end{theorem}

Here's a helpful graphic illustrating the differences between all of these functions.
\begin{figure}[!htb]
    \centering
    \includegraphics[scale=0.75]{function-mapping.png}
    \caption{Examples of the four types of functions, and a non-function. Source: Math is Fun.}
\end{figure}

One interesting observation you might make is that for $f:A\to B$ to be injective, $|A| \leq |B|$ must hold. Similarly, if $f:A\to B$ is surjective, $|A| \geq |B|$ must hold. Therefore if $f$ is bijective, $|A| = |B|$ must be true. For finite sets this isn't so remarkable, but later on in the course we will see how this gives us a method of comparing sets that are infinite in size!

\section{Chinese Remainder Theorem}

I will first begin with the formal statement of the theorem.
\begin{theorem}[Chinese Remainder Theorem]
    Let $m_1, \dots, m_k$ be pairwise\footnote{Every pair of integers is relatively prime, as opposed to being relatively prime as a whole.} relatively prime positive integers, and let
    \[ M = m_1 \dots m_k.\]
    Then for every $k$-tuple $(x_1, \dots, x_k)$ of integers, there is exactly one residue class $x \pmod{M}$ such that
    \begin{align*}
        x &\equiv x_1 \pmod{m_1} \\
        x &\equiv x_2 \pmod{m_2} \\
          &\vdots  \\
        x &\equiv x_k \pmod{m_k}.
    \end{align*}
\end{theorem}

We call this a theorem, but it's really just a formalization of an intuition you should have. In other words, every integer mod $M$ can be uniquely identified by its values mod $m_1$, mod $m_2$, and so on.

For example, knowing that $x\equiv 10 \pmod{15}$ is equivalent to knowing that $x\equiv 1\pmod{3}$ and $x \equiv 0 \pmod{5}$. The first condition restricts the possibilities to 5 different values (1, 4, 7, 10, 13), and the second condition tells you exactly which of these 5 the number is (10, being the only multiple of 5). You should expect this to happen in general.

\begin{example}
    Suppose we're trying to determine $8^{39} \pmod{15}$. Without using CRT, we're pretty much stuck with hand computation. But let's break this down mod 3 and mod 5. We have that
    \[ 8^{39} \equiv (-1)^{39} \equiv -1 \equiv 2 \pmod{3} \]
    and
    \[ 8^{39} \equiv 3^{39} \equiv 3\cdot 9^{19} \equiv 3\cdot (-1)^{19} \equiv 2\pmod{5} \]
    so by CRT, $8^{39}\equiv 2 \pmod{15}$.
\end{example}

Extending the previous analogy, we can interpret this equivalence as understanding $x$ mod $M$ in terms of its basis vectors (1 mod $m_1$), (1 mod $m_2$), $\cdots$, (1 mod $m_k$). Each one specifies $x$'s value along that dimension (or that mod space). Then all we need to do is find out the correct coefficients to multiply each of the vectors by to create a linear combination that produces $x$ mod $M$.

Let's create a general method for finding $x\mod{M}$ based on its values mod $m_1, \dots,$ mod $m_k$. Throughout this section, we will be using a fact that you have seen already, so we will refer to it by its common name.

\begin{theorem}[Bezout's Lemma]
    Let $a,b$ be integers with $\gcd(a,b) = d$. Then there exists integers $x,y$ such that $ax+by = d$. Furthermore, all integers of the form $ax+by$ are multiples of $d$.
\end{theorem}

First we will do a short, concrete example.

\begin{example}[Dis 3B \#3]
    Let's find the $x$ for which
    \begin{align*}
        x&\equiv 3 \pmod{11} \\
        x&\equiv 7 \pmod{13}.
    \end{align*}
    Recall that since $\gcd(11,13) = 1$, by Bezout's Lemma there are integers $a,b$ so that
    \[ x = 11a + 13b.\]
    We just need to pick them so that $x$ satisfies our above constraints (which will be unique mod 143 by CRT). First, let's take our equation mod 11 and use our constraint; this gives
    \[ 3\equiv x \equiv 13b \pmod{11}.\]
    So $b = 13^{-1}\times 3 \equiv 6\times 3 \equiv 7 \pmod{11}$. Now let's take our equation mod 13 and use the other constraint to get
    \[ 7\equiv x \equiv 11a \pmod{13}.\]
    So $a = 11^{-1}\times 7 \equiv 6\times 7 \equiv 3\pmod{13}$. Putting this all together, we find that
    \[ x = 11a + 13b = 11\times 3 + 13\times 7 = 33 + 91 \implies  \boxed{x \equiv 124 \pmod{143}}.\]
\end{example}

With this example in mind, let's see how we would carry out these steps in general. Suppose we have just two equations
    \begin{align*}
        x &\equiv x_1 \pmod{m_1} \\
        x &\equiv x_2 \pmod{m_2}.
    \end{align*}

    Since $\gcd(m_1, m_2) = 1$, by Bezout's Lemma there are integers $c_1, c_2$ for which
    \[ x = c_1m_1 + c_2m_2\]
    unique up to mod $m_1m_2$. Taking this mod $m_1$, we find
    \[ x_1 \equiv x \equiv  c_2m_2 \pmod{m_1} \implies c_2 \equiv m_2^{-1} x_1 \pmod{m_1}.\]

    Taking the equation mod $m_2$, we also get
    \[ x_2 \equiv x \equiv  c_1m_1 \pmod{m_2} \implies c_1 \equiv m_1^{-1} x_2 \pmod{m_2}.\]

    Putting this together, we find that

    \[ \boxed{x \equiv (m_1)^{-1}_{m_2}m_1 x_2 + (m_2)^{-1}_{m_1}m_2 x_1 \pmod{m_1m_2}}\]

    where $(a)^{-1}_m$ denotes $a^{-1}$ mod $m$.

    This looks complicated, but remember that what we did was pretty natural. We simply had a system of equations with some constraints, and using those constraints we found out what each of the required coefficients are.

    Having seen the case of two moduli, we can proceed with the general case. Let $M = m_1\dots m_k$ be a product of pairwise coprime integers, and suppose we have the system
    \begin{align*}
        x &\equiv x_1 \pmod{m_1} \\
        x &\equiv x_2 \pmod{m_2} \\
          &\vdots  \\
        x &\equiv x_k \pmod{m_k}.
    \end{align*}

    Fix an $m_i$. Since $\gcd(M/m_i, m_i) = 1$, by Bezout's Lemma, there are integers $C_i, c_i$ for which
    \[ x = C_i \left(\dfrac{M}{m_i}\right) + c_i m_i.\]

    Taking this mod $m_i$, we find that

    \[ x_i \equiv x \equiv C_i \left(\dfrac{M}{m_i}\right) \implies C_i \equiv \left(\dfrac{M}{m_i}\right)^{-1} x_i \pmod{m_i}.\]

    I claim that these coefficients create a solution for $x$, i.e. that
    \[ x = \sum_{i = 1}^k C_i \left(\dfrac{M}{m_i}\right) \equiv \sum_{i=1}^k \left(\dfrac{M}{m_i}\right)^{-1}_{m_i} \left(\dfrac{M}{m_i}\right) x_i \pmod{M}.\]

    If I took this expression mod $m_i$, every term that's not the $x_i$ term would be 0 as $\frac{M}{m_j}$ would contain $m_i$. The $i$th term would cancel out to just $x_i$, which is precisely what we wanted.

    In a sense, these coefficients are our ``basis coefficients'' which are always 1 mod $m_i$ and 0 otherwise, so that $x$ mod $m_i$ is always $x_i$. When we study Lagrange Interpolation, you will see a deep connection between these two concepts, as they are essentially the same idea applied in two different contexts.

\subsection{Quick Remark}
Here's a quick and dirty way to solve Question 3.
\begin{example}[Very, Very Fast]
    Let's find the $x$ for which
    \begin{align*}
        x&\equiv 3 \pmod{11} \\
        x&\equiv 7 \pmod{13}.
    \end{align*}
    The second equation tells us that $x = 7 + 13k$ for some $k\in \ZZ$. If we take this equation mod 11, we know it must be equivalent to 3, so
    \[ 3 \equiv x \equiv 7 + 2k \implies 2k \equiv 7\pmod{11}\]
    from which it's easy to tell that $k = 9$. Thus, $x = 7 + 13\cdot 9 \equiv 128 \pmod{143}$ is our answer.
\end{example}

\end{document}


% ===========================
%     PREAMBLE
% ===========================

\documentclass{amsart}

% ==============================
% PACKAGES
%
% Add your own packages here
% ==============================

\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{caption}
\usepackage[inline]{enumitem}
\setlist{itemsep=0em, topsep=0em, parsep=0em}
\setlist[enumerate]{label=(\alph*)}
\usepackage{etoolbox}
\usepackage{stmaryrd}
\usepackage[dvipsnames]{xcolor}
\usepackage[]{hyperref}
\hypersetup{
  colorlinks,
  linkcolor=blue,
  citecolor=blue,
  urlcolor=blue}
\usepackage{graphicx}
\graphicspath{{assets/}}
\usepackage{mathtools}

\usepackage{tikz}
\usetikzlibrary{
  matrix,
  arrows,
  shapes
}

\setcounter{tocdepth}{1} % Sets depth for table of contents.

% ======================================
% STYLING
%
% For those papers that need tikz (etc.) styles included
%
% ======================================

\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{arrows}
\usetikzlibrary{shapes.geometric}

\pgfdeclarelayer{edgelayer}
\pgfdeclarelayer{nodelayer}
\pgfsetlayers{edgelayer,nodelayer,main}
\tikzstyle{none}=[inner sep=0pt]

% ======================================
% MACROS
%
% Add your own macros below here
% ======================================

% Use \iam for your primary reading response
\newcommand{\iam}[1]{
  \hrule
  \vspace{0.25em}
  \textbf{{#1}'s Reading Response}
  \vspace{0.25em}
  \hrule
  \vspace{1em}
}

% Use \respond to respond to someone's primary response
\newcommand{\respond}[1]{
  \vspace{1em} \textbf{#1}
}

% Draw an (in-line) drawing of the node, given by its tikz style
% e.g. ` \node{P1X}{X} ` draws a node with style given by P1X in ./assets/paper1.tikzstyle, and labelled by `X`
\newcommand{\node}[2]{
	\begin{tikzpicture}[scale=0.3,
    every node/.style={scale=0.75}]
	\begin{pgfonlayer}{nodelayer}
		\node [style=#1] (1)   at (0, 0)   {#2};
		\node [style=none] (2)   at (-1, 0)   {};
		\node [style=none] (3)   at (1, 0)   {};
	\end{pgfonlayer}
	\begin{pgfonlayer}{edgelayer}
		\draw [-] (1.center) to (2.center);
		\draw [-] (1.center) to (3.center);
	\end{pgfonlayer}
	\end{tikzpicture}
}

% Include a tikz figure, found in the ./assets/ folder
% e.g. ` \tikzfig{paper1-CNOT} ` includes the file `./assets/paper1-CNOT.tikz`
% This makes life a lot easier if you need to move folders around.
\newcommand{\tikzfig}[1]{
\InputIfFileExists{#1}{}{\input{./assets/#1.tikz}}
}

% Refer to composition with the command \comp
\newcommand{\comp}{\circ}
% Refer to tensor product with the command \tensor
\newcommand{\tensor}{\otimes}

% bra-kets for quantum computing
\newcommand\bra[1]{\left< \, #1\, \right|}
\newcommand\ket[1]{\left|\, #1 \, \right>}
\newcommand\braket[2]{\left<\, #1 \,|\, #2 \,\right>}

% ======================================
% FRONT MATTER
% ======================================

\author{Forum Participants}
\title{Reading Responses}
\begin{document}
\maketitle{}

% ======================================
% RESPONSES FOR PAPER 0
% Example Reading Response
% ======================================

\section*{Example Reading Response}
\label{sec:ex-response}

\iam{Daniel}

This is an example of how to enter your response. The
content of your response can include anything relevant to
the paper.  Some prompts are
\begin{itemize}
\item thoughts and ideas
\item worked examples
\item what you liked or disliked
\item questions about things you didn't understand
\item questions and thoughts about extentions of the paper.
\end{itemize}
But really feel free to be as creative and out of the box,
as long winded or short winded as you like.  Make
connections to other topics.

Note how I used the \verb|\iam{}| macro to introduce my primary
reading response and see how it appears on the compiled pdf.
If you have any favorite macros, feel free to include them
in the preamble. To keep this document tidy, please place
them in the MACRO's section of the preamble.  If you would
like to include any packages, you can do that in the
``packages'' sections of the preamble.

\respond{Jules} This forum is also for starting
conversations, not just giving one-off responses.  So if
you'd like to respond to someone else, you can use the
\verb|\respond{}| macro for this. Do this to answer
questions posed, ask follow-up questions, react to ideas, or
to respond with anything relevant.

You can also support your claims by citing papers. Write
the bibliography entry at the bottom of the LaTeX file. Cite
it using the command
\begin{verbatim}
    \cite{ENTRY}
\end{verbatim}
where ENTRY is what you named your reference.  Use any
format you like, this forum is an internal document only to
be seen by school participants. If the paper is available
online, link to it for convenience. Note the entry
\verb|\bibitem{CatSem}| in bibilography which, when called,
appears as \cite{CatSem}.

Quick question: what if I want to include an image into a
response?

\respond{Daniel} Even though I'm the original poster, I'm
responding to Jules, so I'll use the \verb|\respond{}|
macro.

To include images, place the file in the \verb|\assets\|
directory then by typing
\begin{verbatim}
   \begin{center}
     \includegraphics[scale=s]{FILE-NAME.XXX}
   \end{center}
\end{verbatim}
where $ 0< s \leq 1 $, FILE-NAME the name of your file, and XXX is the
extension.

%For example, note the file \verb|groth.jpg| in
%the \verb|\assets\| directory. By including it as stated, you will see
%\begin{center}
%  \includegraphics[scale=0.25]{groth.jpg}
%\end{center}
%in the compiled document.

% =============================
% BIBLIOGRAPHY
%
% Add any citations here.
% Use whatever style you like.
% It's only for us
% =============================

\begin{thebibliography}{99}

\bibitem{CatSem} Bob Coecke, Samson Abramsky. A categorical
  semantics of quantum protocols. \url{https://ieeexplore.ieee.org/abstract/document/1319636}

\end{thebibliography}

\end{document}


\section{A stateless forging policy language}
\label{sec:fps-language}

The domain-specific language for forging policies strikes a balance between expressiveness and simplicity. It particular, it is stateless and of bounded computational complexity. Nevertheless, it is sufficient to support the applications described in Section~\ref{sec:applications}.

\paragraph{Semantically meaningful token names.}

The policy ID is associated with a policy script (it is the hash of it),
so it has a semantic meaning that is identified with that of the script.
In the clauses of our language, we give semantic meaning
to the names of the tokens as well. This allows us to make some
judgements about them in a programmatic way, beyond confirming that the
preservation of value holds, or
which ones are fungible with each other.
For example, the $\texttt{FreshTokens}$ constructor gives us a way to programmatically generate
token names which, by construction, mean that these tokens are unique, without
ever checking the global ledger state.

\paragraph{Forging policy scripts as output-locking scripts.}

As with
currency in the non-digital world, it is a harder problem to control the transfer of assets once
they have come into circulation (see also Section~\ref{sec:discussion}). We can, however,
specify directly in the forging policy that the assets being forged must
be locked by an output script of our choosing.
Moreover, since both output addresses and policies are hashes of scripts,
we can use the asset policy ID and the address interchangeably.
The $\texttt{AssetToAddress}$ clause is used for this purpose.

\begin{figure}[t]
    \begin{lstlisting}
    $\llbracket$JustMSig(msig)$\rrbracket$(h, tx, utxo) = checkMultiSig(msig, tx)

    $\llbracket$SpendsOutput(o)$\rrbracket$(h, tx, utxo) = o $\in $ { i.outputRef : i $\in $ tx.inputs }

    $\llbracket$TickAfter(tick1)$\rrbracket$(h, tx, utxo) = tick1 $\leq$ min(tx.validityInterval)

    $\llbracket$Forges(tkns)$\rrbracket$(h, tx, utxo) = (h $\mapsto$ tkns $\in$ tx.forge) && (h $\mapsto$ tkns $\geq$ 0)

    $\llbracket$Burns(tkns)$\rrbracket$(h, tx, utxo) = (h $\mapsto$ tkns $\in$ tx.forge) && (h $\mapsto$ tkns $\leq$ 0)

    $\llbracket$FreshTokens$\rrbracket$(h, tx, utxo) =
       $\forall$ pid $\mapsto$ tkns $\in$ tx.forge, pid == h $\Rightarrow$
         $\forall$ t $\mapsto$ q $\in$ tkns,
           t == hash(indexof(t, tkns), tx.inputs) && q == 1

    $\llbracket$AssetToAddress(addr)$\rrbracket$(h, tx, utxo) =
       $\forall$ pid $\mapsto$ tkns $\in$ utxo.balance, pid == h $\Rightarrow$
          addr == _ $\Rightarrow$ (h, pid $\mapsto$ tkns) $\in$ utxo
        $\wedge$ addr $\neq$ _ $\Rightarrow$ (addr, pid $\mapsto$ tkns) $\in$ utxo

    $\llbracket$DoForge$\rrbracket$(h, tx, utxo) = h $\in$ supp(tx.forge)

    $\llbracket$SignedByPIDToken$\rrbracket$(h, tx, utxo) =
       $\forall$ pid $\mapsto$ tkns $\in$ utxo.balance, pid == h $\Rightarrow$
         $\forall$ s $\in$ tx.sigs, $\exists$ t $\in$ supp(tkns),
           isSignedBy(tx, s, t)

    $\llbracket$SpendsCur(pid)$\rrbracket$(h, tx, utxo) =
         pid == _ $\Rightarrow$ h $\in$ supp(utxo.balance)
       $\wedge$ pid $\neq$ _ $\Rightarrow$ pid $\in$ supp(utxo.balance)
    \end{lstlisting}
    \caption{Forging Policy Language}
    \label{figure:fps-language}
\end{figure}
%
\paragraph{Language clauses.}
%
The various clauses of the validator and forging policy language are as described below, with their formal semantics as in Figure~\ref{figure:fps-language}. In this figure, we use the notation
$\texttt{x}\mapsto \texttt{y}$ to represent a single key-value pair of a finite map.
Recall form Rule~\ref{rule:all-mps-validate} that the arguments passed to the validation
function $\llbracket \texttt{s} \rrbracket$ $\texttt{h}$ are: the hash of the forging (or output
locking) script being validated, the transaction $\texttt{tx}$ being validated,
and the ledger outputs which the transaction $\texttt{tx}$ is spending (we denote
these $\texttt{utxo}$ here).
%
\begin{itemize}
  \item \texttt{JustMSig(msig)}
  verifies that the $m$-out-of-$n$ signatures required by $s$ are in the
  set of signatures provided by the transaction. We do not give the
  multi-signature script evaluator details as this is a common concept, and
  assume a procedure \texttt{checkMultiSig} exists.

  \item \texttt{SpendsOutput(o)} checks that the transaction spends
  the output referenced by $\texttt{o}$ in the \UTXO.

  \item \texttt{TickAfter(tick1)} checks that the validity interval
  of the current transaction starts after time $\texttt{tick1}$.

  \item \texttt{Forges(tkns)} checks that the transaction forges exactly
  $\texttt{tkns}$ of the asset with the policy ID that is being validated.

  \item \texttt{Burns(tkns)} checks that the transaction burns exactly
  $\texttt{tkns}$ of the asset with the policy ID that is being validated.

  \item \texttt{FreshTokens}
  checks that all tokens of the asset being forged are non-fungible.

  This script must check that the names of the tokens in this token bundle
  are generated by hashing some unique data. This data must be unique to both
  the transaction itself and the token within the asset being forged.
  In particular, we can hash a pair of
  %
  \begin{enumerate}
    \item some \emph{output} in the \UTXO\ that the
    transaction consumes, and
    \item the \emph{index} of the token name in (the
    list representation of) the map of tokens being
    forged (under the specific policy, by this transaction). We denote the
    function that gets the index of a key in a key-value map by $\texttt{indexof}$.
  \end{enumerate}

  \item \texttt{AssetToAddress(addr)}
  checks that all the tokens associated with the policy ID that
  is equal to the hash of the script being run are output
  to an \UTXO\ with the address $\texttt{addr}$. In the case that no $\texttt{addr}$ value is
  provided (represented by $\_$), we use the $\texttt{addr}$ value passed to the evaluator as
  the hash of the policy of the asset being forged.

  \item \texttt{DoForge}
  checks that this transaction forges tokens in the bundle controlled by the policy ID that is passed
  to the FPS script evaluator (here, again, we make use of the separate passing of
  the FPS script and the policy ID).

  \item \texttt{SignedByPIDToken(pid)} verifies the hash of every key that has signed the transaction.

  \item \texttt{SpendsCur(pid)}
  verifies that the transaction is spending assets in the token bundle with policy
  ID $\texttt{pid}$ (which is specified as part of the \emph{constructor}, and may be different
  than the policy ID passed to the evaluator).

\end{itemize}


\PassOptionsToPackage{pdfpagelabels=false}{hyperref}
\documentclass[fleqn,usenatbib,usedcolumn]{mnras}
%==============================================================================%
\usepackage[british]{babel}             % British English hyphenation
\usepackage{txfonts}                  % Good fonts
% Use vector fonts, so it zooms properly in on-screen viewing software
% Don't change these lines unless you know what you are doing
%\usepackage[T1]{fontenc}
%\usepackage{ae,aecompl}
%%%%% AUTHORS - PLACE YOUR OWN PACKAGES HERE %%%%%
\usepackage{graphicx}	% Including figure files
\usepackage{hyperref} % hyperlinks
\usepackage{natbib}
\usepackage{aastexmacros}
\usepackage{tikz}
\usepackage[caption=false]{subfig}
\usepackage[mediumspace,mediumqspace,Grey,squaren]{SIunits}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%% AUTHORS - PLACE YOUR OWN COMMANDS HERE %%%%%
\usetikzlibrary{shapes,arrows,calc,positioning}

\renewcommand{\vec}[1]{\mathbf{#1}}
% \newcommand{\text}{\mathrm}
\newcommand{\jansky}{\text{Jy}}
\newcommand{\cheng}[1]{ {\color{teal}[{\bf Cheng TODO:~{#1}}]} }
\newcommand{\matthew}[2]{ {\color{white!20!violet}[{\bf TODO(#1):~{#2}}]} }
\newcommand{\todo}[1]{ {\color{red}[{\bf TODO:~{#1}}]} }

\newcommand{\underset}[2]{\mathop{#2}\limits_{#1}}

\let\subsectionautorefname\sectionautorefname
\let\subsubsectionautorefname\sectionautorefname

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

%%%%%%%%%%%%%%%%%%% TITLE PAGE %%%%%%%%%%%%%%%%%%%

\title[Supplement: ML for radio X-id]{Supplement to Radio Galaxy Zoo: Machine learning methods for radio source host galaxy cross-identification}

\author[Alger et al.]{
  M.~J.~Alger$^{1}$,
  J.~K.~Banfield$^{2, 1}$,
  C.~S.~Ong$^{3, 4}$,
  O.~I.~Wong$^{5, 2}$,
  L.~Rudnick$^{6}$,
  R.~P.~Norris$^{7, 8}$, others
\\
% List of institutions
$^{1}$Research School of Astronomy and Astrophysics, The Australian National University, Canberra, ACT 2611, Australia\\
$^{2}$ARC Centre of Excellence for All-Sky Astrophysics (CAASTRO)\\
$^{3}$Data61, CSIRO, Canberra, ACT 2601, Australia\\
$^{4}$Research School of Computer Science, The Australian National University, Canberra, ACT 2601, Australia\\
$^{5}$International Centre for Radio Astronomy Research-M468, The University of Western Australia, 35 Stirling Hwy, Crawley, WA 6009, Australia\\
$^{6}$Minnesota Institute for Astrophysics, University of Minnesota, 116 Church St. SE, Minneapolis, MN 55455\\
$^{7}$Western Sydney University, Locked Bag 1797, Penrith South, NSW 1797, Australia\\
$^{8}$CSIRO Astronomy \& Space Science, PO Box 76, Epping, NSW 1710, Australia
}

% These dates will be filled out by the publisher
\date{Accepted XXX. Received XXX}

% Enter the current year, for the copyright statements etc.
\pubyear{2017}

% Don't change these lines
\begin{document}
\label{firstpage}
\pagerange{\pageref{firstpage}--\pageref{lastpage}}
\maketitle

  \section{Classifiers}\label{sec:classifiers}

    We use three different classifiers as our binary classification model:
    logistic regression, convolutional neural networks, and random forests.

    \subsection{Logistic Regression}
    \label{sec:logistic-regression}
      Logistic regression is a binary classification model. It is linear in the
      feature space and outputs the probability that the input has a positive
      label. The model is \citep{bishop06ml}:

      \begin{equation}
          f(\vec x) = \sigma(\vec w \cdot \vec x + b) \,\,\,\,,
      \end{equation}
      where $\vec w \in \mathbb{R}^D$ is a weight vector,
      $b \in \mathbb{R}$ is a bias term, $\vec x \in \mathbb{R}^D$ is the
      feature representation of a candidate host, and $\sigma$ is the
      logistic sigmoid function: \begin{equation}
          \sigma(a) = (1 + \mathrm{exp}(-a))^{-1}\,\,\,\,.
      \end{equation}%
      The logistic regression model is fully differentiable, and the weight
      vector $\vec w$ can therefore be learned using gradient methods.

    \subsection{Convolutional neural networks}
    \label{sec:convolutional-neural-networks}

      Convolutional neural networks (CNN) are a biologically-inspired
      prediction model for prediction with image inputs. The input image is
      convolved with a number of filters to produce output images called
      feature maps. These feature maps can then be convolved again with other
      filters on subsequent layers, producing a network of convolutions. The
      whole network is differentiable with respect to the values of the
      filters and the filters can be learned using gradient methods. The final
      layer of the network is logistic regression, with the convolved outputs
      as input features. For more detail, see \citet[subsection
      II.A][]{lecun98}. We use \textsc{Keras} \citep{chollet15keras} to
      implement our CNN.

      \begin{figure}
        \includegraphics[width=\linewidth]{images/cnn_model_graph}
        \caption{Architecture of our CNN. The concatenate layer flattens the
          output of the previous layer and adds the 10 features derived from
          the candidate host in SWIRE, i.e. the flux ratios, stellarity
          indices, and distance. The dropout layer randomly sets $25\%$ of its
          inputs to zero during training to prevent overfitting. Diagram based
          on \url{ https://github.com/dnouri/nolearn}.}
        \label{fig:cnn}
      \end{figure}

      CNNs have recently produced good results on large image-based datasets
      in astronomy \citep[e.g.][; Lukic et al. in prep]{dieleman15cnn}. We
      employ only a simple CNN model in this paper as a proof of concept that
      CNNs may be used for class probability prediction on radio images. The
      model architecture we use is shown in \autoref{fig:cnn}.

    \subsection{Random Forests}
    \label{sec:random-forests}

      Random forests are an ensemble of decision
      trees~\citep{breiman01random-forest}. It considers multiple subsamples
      of the training set, where each bootstrap subsample is sampled with
      replacement from the training set. For each subsample a decision tree
      classifier is constructed by repeatedly making axis-parallel splits
      based on individual features. In a random forest the split decision is
      taken based on a random subset of features. To classify a new data
      point, the random forest takes the weighted average of all
      classifications produced by each decision tree.

%%%%%%%%%%%%%%%%%%%% REFERENCES %%%%%%%%%%%%%%%%%%
\bibliographystyle{mnras}
\bibliography{rgz-cdfs-ms}

% Don't change these lines
\bsp	% typesetting comment
\label{lastpage}
\end{document}


\chapter{Techniques I:  Disequality Constraints}\label{diseqchapter}

In this chapter we naively translate a Scheme program to miniKanren,
and observe that the miniKanren relation exhibits undesirable
behavior.  This behavior is due to our inability to express negation
in core miniKanren.  We improve our miniKanren relation through the use of
disequality constraints, which can express a limited form of negation.

This chapter is organized as follows.  In
section~\ref{translaterember} we translate the Scheme function
\mbox{\scheme|rember|} into the miniKanren relation \mbox{\scheme|rembero|}.
In section~\ref{remberotrouble} we observe that
\mbox{\scheme|rembero|} produces unexpected answers that do not
correspond to answers produced by \mbox{\scheme|rember|}.  In
section~\ref{reconsiderrember} we show that the unexpected answers are
due to our failure to translate implicit tests in the
\mbox{\scheme|rember|} function.  Section~\ref{diseqsection}
introduces disequality constraints, which allow us to express a
limited form of negation.  In section~\ref{fixingrembero} we fix our
definition of \mbox{\scheme|rembero|} by adding a disequality
constraint, thereby eliminating the unexpected answers.  Finally in
section~\ref{diseqlimits} we point out several disadvantages of
disequality constraints, and discuss when these constraints should be
used.

\section{Translating {\rembersymbol} into miniKanren}\label{translaterember}

We begin by naively translating the \scheme|rember| function into
miniKanren.  \mbox{\scheme|rember|} takes two arguments: a symbol \scheme|x| and a
list of symbols \scheme|ls|, and removes the first occurrence of
\scheme|x| from \scheme|ls|.

\wspace

\noindent\mbox{\scheme|(rember 'b '(a b c b d)) => |}\mbox{\schemeresult|`(a c b d)|}

\wspace

\noindent\mbox{\scheme|(rember 'd '(a b c)) => |}\mbox{\schemeresult|`(a b c)|}

%\wspace

\newpage

Here is \mbox{\scheme|rember|}

\schemedisplayspace
\begin{schemedisplay}
(define rember
  (lambda (x ls)
    (cond
      ((null? ls) '())
      ((eq? (car ls) x) (cdr ls))
      (else (cons (car ls) (rember x (cdr ls)))))))
\end{schemedisplay}

To translate \mbox{\scheme|rember|} into the miniKanren relation
\mbox{\scheme|rembero|} we add a third argument \mbox{\scheme|out|},
change \mbox{\scheme|cond|} to \mbox{\scheme|conde|}, and replace uses
of \mbox{\scheme|null?|}, \mbox{\scheme|eq?|}, \mbox{\scheme|cons|},
\mbox{\scheme|car|}, and \mbox{\scheme|cdr|} with calls to
\mbox{\scheme|==|}.  We also unnest the recursive call, using a
temporary variable \mbox{\scheme|res|} to hold the ``output'' value of
the recursive call.

\schemedisplayspace
\begin{schemedisplay}
(define rembero
  (lambda (x ls out)
    (conde
      ((== '() ls) (== '() out))
      ((exist (a d)
         (== `(,a . ,d) ls)
         (== a x)
         (== d out)))
      ((exist (a d res)
         (== `(,a . ,d) ls)
         (== `(,a . ,res) out)
         (rembero x d res))))))
\end{schemedisplay}

\section{The Trouble with {\remberosymbol}}\label{remberotrouble}

For simple tests, it may seem that \mbox{\scheme|rembero|} works as
expected, mimicking the behavior of \mbox{\scheme|rember|}.

\wspace

\noindent\mbox{\scheme|(run1 (q) (rembero 'b '(a b c b d) q)) => |} \mbox{\schemeresult|`((a c b d))|}

\wspace

\noindent\mbox{\scheme|(run1 (q) (rembero 'd '(a b c) q)) => |} \mbox{\schemeresult|`((a b c))|}

\wspace

\noindent However, we notice a problem if we replace the \mbox{\scheme|run1|}
with \mbox{\scheme|run*|}.

\wspace

\noindent\mbox{\scheme|(run* (q) (rembero 'b '(a b c b d) q)) => |} \mbox{\schemeresult|`((a c b d) (a b c d) (a b c b d))|}

\wspace

\noindent Now there are multiple answers.  The first answer is expected, but in
the second answer \mbox{\scheme|rembero|} removes the second
occurrence of \mbox{\scheme|`b|} rather than the first occurrence.  The
last answer is even worse---\mbox{\scheme|rembero|} does not remove
either \mbox{\scheme|`b|}, as is evidenced by the \mbox{\scheme|run|}
expression

\wspace

\noindent\mbox{\scheme|(run* (q) (rembero 'b '(b) '(b))) => |} \mbox{\schemeresult|`(_.0)|}

\section{Reconsidering {\rembersymbol}}\label{reconsiderrember}

Where did we go wrong?  Is our miniKanren translation not faithful to
the original Scheme program?

Not quite. The problem is that \mbox{\scheme|cond|} tries its clauses
in order, stopping at the first clause whose test evaluates to a true
value, while \mbox{\scheme|conde|} tries every possible clause.  But
isn't there only one \mbox{\scheme|cond|} clause that matches any
given values of \mbox{\scheme|x|} and \mbox{\scheme|ls|}?  Actually,
no.

Let us examine the definition of \mbox{\scheme|rember|} once again.

\schemedisplayspace
\begin{schemedisplay}
(define rember
  (lambda (x ls)
    (cond
      ((null? ls) '())
      ((eq? (car ls) x) (cdr ls))
      (else (cons (car ls) (rember x (cdr ls)))))))
\end{schemedisplay}

\noindent Consider the call \mbox{\scheme|(rember 'a '(a b c))|}.
Clearly the \mbox{\scheme|null?|} test keeps the first clause from
returning an answer, while the \mbox{\scheme|eq?|} test allows the
second clause to produce an answer.  But the test of the final clause,
the ``always-true'' \mbox{\scheme|else|} keyword,
is equivalent to the trivial \mbox{\scheme|#t|} test.

\schemedisplayspace
\begin{schemedisplay}
(define rember
  (lambda (x ls)
    (cond
      ((null? ls) '())
      ((eq? (car ls) x) (cdr ls))
      (#t (cons (car ls) (rember x (cdr ls)))))))
\end{schemedisplay}

\noindent If it were not for the second clause, the third clause would produce
an answer for the call \mbox{\scheme|(rember 'a '(a b c))|}.  In fact,
if we swap the last two clauses

\schemedisplayspace
\begin{schemedisplay}
(define rember
  (lambda (x ls)
    (cond
      ((null? ls) '())
      (#t (cons (car ls) (rember x (cdr ls))))
      ((eq? (car ls) x) (cdr ls)))))
\end{schemedisplay}

\noindent the call \mbox{\scheme|(rember 'a '(a b c))|} returns
\mbox{\scheme|`(a b c)|} rather than \mbox{\scheme|`(b c)|}.

What does the \mbox{\scheme|else|} test really mean in the original
definition of \scheme|rember|?  It means that the tests in all the above
clauses must evaluate to \mbox{\scheme|#f|}.  Similar reasoning holds
for the \mbox{\scheme|eq?|} test of the second clause---the test
implies that the \mbox{\scheme|null?|} test in the first clause
returned \mbox{\scheme|#f|}.  We can therefore redefine
\mbox{\scheme|rember|} to make the implicit tests explicit.

\newpage

%\schemedisplayspace
\begin{schemedisplay}
(define rember
  (lambda (x ls)
    (cond
      ((null? ls) '())
      ((and (not (null? ls)) (eq? (car ls) x))
       (cdr ls))
      ((and (not (null? ls)) (not (eq? (car ls) x)))
       (cons (car ls) (rember x (cdr ls)))))))
\end{schemedisplay}

\mbox{\scheme|rember|} now produces the same answers no matter how we
reorder the clauses; the clauses are now \emph{non-overlapping},
since only a single clause can produce an answer for any specific call
to \mbox{\scheme|rember|}\footnote{Throughout this dissertation we strive to write programs that adhere to the \emph{non-overlapping principle}, to avoid duplicate or misleading answers.  Such programs are similar to the guarded command programs described in \citet{guardedcommands,disciplineprog}.}.

\schemedisplayspace
\begin{schemedisplay}
(define rember
  (lambda (x ls)
    (cond
      ((and (not (null? ls)) (not (eq? (car ls) x)))
       (cons (car ls) (rember x (cdr ls))))
      ((and (not (null? ls)) (eq? (car ls) x))
       (cdr ls))
      ((null? ls) '()))))
\end{schemedisplay}

\noindent Even though we have reordered the \scheme|cond| clauses,
\scheme|rember| works as expected.

\wspace

\noindent\mbox{\scheme|(rember 'a '(a b c)) => |}\mbox{\schemeresult|`(b c)|}

\section{Disequality Constraints}\label{diseqsection}

Now we can reconsider our definition of \mbox{\scheme|rembero|},
adding the equivalent of the explicit tests to make our
\mbox{\scheme|conde|} clauses non-overlapping\footnote{More than one
  \mbox{\scheme|conde|} clause may succeed if \mbox{\scheme|rembero|}
  is passed fresh variables.  However, only one clause will succeed if
  the first two arguments to \mbox{\scheme|rembero|} are fully
  ground.}.

Unfortunately, we do not have a way to express negation in core
miniKanren\footnote{The impure operators \scheme|conda| and
  \scheme|condu| from section~\ref{impureoperatorssection} can be used to express
  ``negation as failure'', as is commonly done in Prolog programs, but
  we eschew this non-declarative approach.}.  However, we do not need
full negation to express the test \mbox{\scheme|(not (null? ls))|},
since if \mbox{\scheme|ls|} is not null it must be a
pair\footnote{This assumes, of course, that the second argument to
  \mbox{\scheme|rembero|} can be unified with a proper list.  Passing
  in \mbox{\scheme|5|} as the \mbox{\scheme|ls|} argument makes no
  more sense for \mbox{\scheme|rembero|} than it does for
  \mbox{\scheme|rember|}.}.  In fact, we are already expressing the
\mbox{\scheme|(not (null? ls))|} test implicitly, through the
unification \mbox{\scheme|(== `(,a . ,d) ls)|} that appears in the
last two \mbox{\scheme|conde|} clauses.

The only remaining test is \mbox{\scheme|(not (eq? (car ls) x))|} in
the last clause.  How might we express that the car of
\mbox{\scheme|ls|} is not \mbox{\scheme|x|}?  We could attempt to
unify the car of \mbox{\scheme|ls|} with every symbol other than
\mbox{\scheme|x|}.  Even if \mbox{\scheme|x|} were instantiated, to the
symbol \mbox{\scheme|`a|} for example, we would have to unify
\mbox{\scheme|x|} with every symbol \emph{other} than
\mbox{\scheme|`a|}, of which there are infinitely many.  Clearly this
is problematic: enumerating an infinite domain can easily lead to
divergent behavior\footnote{It is possible to enumerate some infinite
  domains using a finite number of cases, through the use of clever
  data representation.  For example, using the binary list notation
  from Chapter~\ref{arithchapter} we can express that a natural number
  \mbox{\scheme|x|} is not \mbox{\scheme|5|} by unifying
  \mbox{\scheme|x|} with the patterns \mbox{\scheme|`()|},
  \mbox{\scheme|`(1)|}, \mbox{\scheme|`(,a 1)|}, \mbox{\scheme|`(0 ,a 1)|},
  \mbox{\scheme|`(1 1 1)|}, and \mbox{\scheme|`(,a ,b ,c ,d . ,rest)|}.  Although this
  approach avoids divergence, it requires us to know the domain and
  representation of \mbox{\scheme|x|}.  Furthermore, this approach may result in
  duplicate answers even for programs that adhere to the
  non-overlapping principle, which can be a problem even when
  enumerating finite domains.}.

Compare the tests in the second and third \mbox{\scheme|rember|} clauses: \mbox{\scheme|(eq? (car ls) x)|} and \mbox{\scheme|(not (eq? (car ls) x))|}.  We use \mbox{\scheme|(== a x)|} to express that
the car of \mbox{\scheme|ls|} (which is \mbox{\scheme|a|}) is equal to \mbox{\scheme|x|}.  What we need is the ability
to express the \emph{disequality constraint}\footnote{As opposed to an \emph{equality constraint}, such as \mbox{\scheme|(== a x)|}.  Disequality is also known as \emph{disunification}.} \mbox{\scheme|(=/= a x)|}\footnote{We may also wish to introduce an operator \mbox{\scheme|=/=-no-check|} that performs \emph{unsound} disunification, to avoid the cost of the occurs check.}, which
asserts that \mbox{\scheme|a|} and \mbox{\scheme|x|} are not equal, and can never be made equal
through unification.

Before we add a disequality constraint to \mbox{\scheme|rembero|}, let us examine some
simple uses of \mbox{\scheme|=/=|}.
In the first example, we unify \mbox{\scheme|q|} with
\mbox{\scheme|5|}, then specify that \mbox{\scheme|q|} can never be
\mbox{\scheme|5|}.  As expected, the call to \mbox{\scheme|=/=|}
fails.

\wspace

\noindent\mbox{\scheme|(run* (q) (== 5 q) (=/= 5 q)) => |} \mbox{\schemeresult|`()|}

\wspace

If we swap the goals, the program behaves the same.

\wspace

\noindent\mbox{\scheme|(run* (q) (=/= 5 q) (== 5 q)) => |} \mbox{\schemeresult|`()|}

\wspace

\mbox{\scheme|=/=|} can take arbitrary expressions, as shown in the next two examples.

\wspace

\noindent\mbox{\scheme|(run* (q) (=/= (+ 2 3) 5)) => |} \mbox{\schemeresult|`()|}

\wspace

\noindent\mbox{\scheme|(run* (q) (=/= (* 2 3) 5)) => |} \mbox{\schemeresult|`(_.0)|}

\wspace

In this \mbox{\scheme|run*|} expression we assert that
\mbox{\scheme|q|} can never be \mbox{\scheme|5|} or \mbox{\scheme|6|}.
We express the latter constraint indirectly, by constraining
\mbox{\scheme|x|}.

\schemedisplayspace
\begin{schemedisplay}
(run* (q)
  (exist (x)
    (=/= 5 q)
    (== x q)
    (=/= 6 x))) =>
\end{schemedisplay}
\nspace
\begin{schemeresponse}
`((_.0 : (never-equal ((_.0 . 5)) ((_.0 . 6)))))
\end{schemeresponse}

\noindent The answer includes two reified constraints indicating that the output
variable (\mbox{\scheme|q|}) can never be \mbox{\scheme|5|} or \mbox{\scheme|6|}.

\newpage

Consider this \mbox{\scheme|run*|} expression.

\schemedisplayspace
\begin{schemedisplay}
(run* (q)
  (exist (y z)
    (=/= `(,y . ,z) q))) =>
\end{schemedisplay}
\nspace
\begin{schemeresponse}
`(_.0)
\end{schemeresponse}

\noindent It may seem that the constraint on \mbox{\scheme|q|} should
be reified.  However, this constraint can only be violated if
\mbox{\scheme|q|} is unified with \mbox{\scheme|`(,y . ,z)|}.  Since
\mbox{\scheme|y|} and \mbox{\scheme|z|} are not reified, the
constraint is not \emph{relevant} and is therefore not reified.

To reify a constraint, we must reify all of the variables involved in the constraint.

\schemedisplayspace
\begin{schemedisplay}
(run* (q)
  (exist (x y z)
    (=/= `(,y . ,z) x)
    (== `(,x ,y ,z) q))) =>
\end{schemedisplay}
\nspace
\begin{schemeresponse}
`(((_.0 _.1 _.2) : (never-equal ((_.0 _.1 . _.2)))))
\end{schemeresponse}

\noindent The constraint is easier to interpret if we remember that
\mbox{\scheme|`(never-equal ((_.0 _.1 . _.2)))|} is equivalent to
\mbox{\scheme|`(never-equal ((_.0 . (_.1 . _.2))))|}.

Here is a slightly more complicated example of \mbox{\scheme|=/=|}.

\schemedisplayspace
\begin{schemedisplay}
(run* (q)
  (exist (x y z)
    (== `(,y . ,z) x)
    (=/= '(5 . 6) x)
    (== 5 y)
    (== `(,x ,y ,z) q))) =>
\end{schemedisplay}
\nspace
\begin{schemeresponse}
`((((5 . _.0) 5 _.0) : (never-equal ((_.0 . 6)))))
\end{schemeresponse}

Here is the same program, but with \mbox{\scheme|(== 6 y)|} instead of \mbox{\scheme|(== 5 y)|}.

\schemedisplayspace
\begin{schemedisplay}
(run* (q)
  (exist (x y z)
    (== `(,y . ,z) x)
    (=/= '(5 . 6) x)
    (== 6 y)
    (== `(,x ,y ,z) q))) =>
\end{schemedisplay}
\nspace
\begin{schemeresponse}
`(((6 . _.0) 6 _.0))
\end{schemeresponse}

\noindent Since \mbox{\scheme|y|} cannot be \mbox{\scheme|5|}, \mbox{\scheme|(=/= '(5 . 6) x)|} cannot be violated and is
therefore discarded.

We end this section with a final example, to demonstrate how to interpret more complicated reified constraints.

\newpage

%\schemedisplayspace
\begin{schemedisplay}
(run* (q)
  (exist (x y z)
    (=/= 5 x)
    (=/= 6 x)
    (=/= `(,y 1) `(2 ,z))
    (== `(,x ,y ,z) q))) =>
\end{schemedisplay}
\nspace
\begin{schemeresponse}
`(((_.0 _.1 _.2) : (never-equal ((_.1 . 2) (_.2 . 1)) ((_.0 . 6)) ((_.0 . 5)))))
\end{schemeresponse}

\noindent The constraints \mbox{\scheme|`((_.0 . 6))|} and
\mbox{\scheme|`((_.0 . 5))|} are independent of each other, and
indicate that \mbox{\scheme|x|} can never be \mbox{\scheme|5|} or
\mbox{\scheme|6|}. However, \mbox{\scheme|`((_.1 . 2) (_.2 . 1))|}
represents a \emph{single} constraint, indicating that
\mbox{\scheme|y|} cannot be \mbox{\scheme|2|} if \mbox{\scheme|z|} is
\mbox{\scheme|1|}\footnote{Reifying constraints in a friendly manner
  is non-trivial, as we will see in Chapter~\ref{diseqimplchapter}.}.

\section{Fixing {\remberosymbol}}\label{fixingrembero}
\enlargethispage{2em}

Now that we understand \mbox{\scheme|=/=|}, and how to interpret reified constraints,
we are ready to add the disequality constraint \mbox{\scheme|(=/= a x)|} to the last
clause of \mbox{\scheme|rembero|}.

\schemedisplayspace
\begin{schemedisplay}
(define rembero
  (lambda (x ls out)
    (conde
      ((== '() ls) (== '() out))
      ((exist (a d)
         (== `(,a . ,d) ls)
         (== a x)
         (== d out)))
      ((exist (a d res)
         (== `(,a . ,d) ls)
         (=/= a x)
         (== `(,a . ,res) out)
         (rembero x d res))))))
\end{schemedisplay}

If we re-run the programs from section~\ref{remberotrouble} we see
that \mbox{\scheme|rembero|}'s behavior is consistent with that of \mbox{\scheme|rember|}.

\wspace

\noindent\mbox{\scheme|(run* (q) (rembero 'b '(a b c b d) q)) => |} \mbox{\schemeresult|`((a c b d))|}

\wspace

\noindent\mbox{\scheme|(run* (q) (rembero 'b '(b) '(b))) => |} \mbox{\schemeresult|`()|}

\wspace

Of course, \mbox{\scheme|rembero|} is more flexible than \mbox{\scheme|rember|}.

\schemedisplayspace
\begin{schemedisplay}
(run* (q)
  (exist (x out)
    (rembero x '(a b c) out)
    (== `(,x ,out) q))) =>
\end{schemedisplay}
\nspace
\begin{schemeresponse}
`((a (b c))
  (b (a c))
  (c (a b))
  ((_.0 (a b c)) : (never-equal ((_.0 . c)) ((_.0 . b)) ((_.0 . a)))))
\end{schemeresponse}

The final answer indicates that removing a symbol \mbox{\scheme|x|}
from the list \mbox{\scheme|`(a b c)|} results in the original list,
provided that \mbox{\scheme|x|} is not \mbox{\scheme|`a|},
\mbox{\scheme|`b|}, or \mbox{\scheme|`c|}.

\section{Limitations of Disequality Constraints}\label{diseqlimits}

Disequality constraints add expressive power to core
miniKanren\footnote{It seems that disequality constraints were present
  in a very early version of Prolog~\cite{birthofprolog}, although
  they were apparently removed after several years.  Prolog
  II~\cite{prologtenfigs} reintroduced disequality constraints, which
  are now standard in most Prolog systems.}, allowing us to express a
limited form of negation.  However, disequality constraints have
several limitations and disadvantages.

First, the \mbox{\scheme|=/=|} operator can only express that two
terms are never the same.  This is much more limited than the ability
to express full negation.  For example, consider the test
\mbox{\scheme|(and (not (null? ls)) (not (eq? (car ls) x)))|} from the
version of \mbox{\scheme|rember|} in section~\ref{reconsiderrember}.
By de Morgan's law, this test is logically equivalent to
\mbox{\scheme|(not (or (null? ls) (eq? (car ls) x)))|}.  We can use
disequality constraints to express the first version of the test, but
not the second.

Answers containing reified disequality constraints can be more
difficult to interpret than answers without constraints.  Also, it is
not always obvious why a constraint was \emph{not} reified (whether it
was not relevant or could not be violated).

Disequality constraints also complicate the implementation of the
unifier, and especially the reifier.  Disequality constraints can also
be expensive, since every constraint must be checked after each
successful unification.

Because of these disadvantages, it is preferable to use
\mbox{\scheme|==|} rather than \mbox{\scheme|=/=|} whenever practical.
For example, it is better to express the test \mbox{\scheme|(not (null? ls))|}
as \mbox{\scheme|(== `(,a . ,d) ls)|} rather than as
\mbox{\scheme|(=/= '() ls)|}.

Still, disequality constraints add expressive power to core miniKanren, and are
generally preferable to enumerating infinite (or even finite) domains.

% [membero example]

% [rembero  (Scheme -> mk translation)
% duplicate answers

% simplest example of CLP

% implicit negation in cond lines

% Dijkstra guard

% must be able to swap cond clauses in Scheme

% tagging (for application expressions in lambda calculus, for example)]

% [surpriseo]

% [an arithmetic example---some number is not 5]

% can represent infinitely many terms using a single constraint---useful
% in avoiding divergence

% only relevant constraints are printed

% pairs

% constraint simplification

% [look at test programs from =/= test cases]

% [all-different]


\section{Lightning Rune}\label{rune:lightning}
\textbf{Cost:} See Runes\\
\textbf{Requirements:} -\\
\textbf{Rune, Weapon, Active, Repeatable, Source (See Runes)}\\
You have mastered the Lightning Rune.
% TODO Add description

\subsection{Rank I Abilities}

\subsubsection{Lightning Bolt}
For 4 AP and 8 Mana, you create a lightning bolt from your rune that targets a creature in a range of~\passus{9}.
Make a ranged spell attack.
On a hit, the lightning bolt deals 3d4 lightning damage, and 2 AP damage.


% !TEX root = ../../main.tex
\chapter{Results}
\label{ch:results}

The results after performing the statistical analysis outlined in \Ch{\ref{ch:stats}} are presented in this chapter. In~\Sect{\ref{sec:results:bkgonly}}, a background-only fit is performed to the data. Signal region $m(\ell\nu J)$ distributions, event yields for observed data and all fitted SM backgrounds, and the fitted normalizations for the \Wjets and \ttbar backgrounds are presented. In~\Sect{\ref{sec:limits}}, model-dependent fits are performed using the profile likelihood ratio to set upper limits on the expected and observed cross sections times branching ratio to $WV$, for the selected benchmark signal models. The systematic uncertainties (\Ch{\ref{ch:syst}}) with the largest impact on the signal strength fits are discussed. Event displays showcasing signal region events with the highest invariant mass are presented in \App{\ref{ch:eventDisplay}}.

%%
\section{Background-Only Fit}
\label{sec:results:bkgonly}
No significant excesses above the SM prediction are observed after the simultaneous binned likelihood fit to the data with the background-only hypothesis (fixed signal strength $\mu=0$). The post-fit $m(\ell\nu J)$ distributions for the VBF selection are shown for the HP and LP regions in~\Fig{\ref{fig:pf_hp_vbf}} and~\Fig{\ref{fig:pf_lp_vbf}}, respectively. The corresponding distributions for the ggF selection are shown for the HP and LP regions in~\Fig{\ref{fig:pf_hp_ggf}} and~\Fig{\ref{fig:pf_lp_ggf}}, respectively. Pre-fit signal distributions for $m=2\,\TeV$\, ($m=1.2\,\TeV$) are overlaid for the ggF (VBF) selection regions. The total post-fit uncertainty, accounting for both statistical uncertainties and systematic uncertainties, is included.

% Post fit plots
\begin{figure}[htb]
\centering
\subfloat[]{\includegraphics[width=.48\textwidth]{figures/Results/new/final_pf/postFit_VBF_HVTWW_1000_SRWW_HP}\label{fig:pf_hp_vbf:a}}
\subfloat[]{\includegraphics[width=.48\textwidth]{figures/Results/new/final_pf/postFit_VBF_HVTWZ_1000_SRWZ_HP}\label{fig:pf_hp_vbf:b}}\\
\subfloat[]{\includegraphics[width=.48\textwidth]{figures/Results/new/final_pf/postFit_VBF_HVTWW_1000_WCR_HP}\label{fig:pf_hp_vbf:c}}
\subfloat[]{\includegraphics[width=.48\textwidth]{figures/Results/new/final_pf/postFit_VBF_HVTWW_1000_TCR_HP}\label{fig:pf_hp_vbf:d}}
\caption[Post-fit $m(\ell\nu J)$ distribution for high purity, vector boson fusion selection]{The post-fit $m(\ell\nu J)$ distributions for the HP VBF selection in \protect\subref{fig:pf_hp_vbf:a} the $WW$ SR, \protect\subref{fig:pf_hp_vbf:b} the $WZ$ SR, \protect\subref{fig:pf_hp_vbf:c} the \Wjets CR, and   \protect\subref{fig:pf_hp_vbf:d} the \ttbar CR. The pre-fit HVT (VBF production) signal prediction for $m=1.2\,\TeV$\, is overlaid. The shaded band denotes the total post-fit statistical and systematic uncertainty on the background. The ratio of the observed data to SM background prediction is shown in the lower panel. All overflow events are included in the final bin. }
\label{fig:pf_hp_vbf}
\end{figure}

\begin{figure}[htb]
\centering
\subfloat[]{\includegraphics[width=.48\textwidth]{figures/Results/new/final_pf/postFit_VBF_HVTWW_1000_SRWW_LP}\label{fig:pf_lp_vbf:a}}
\subfloat[]{\includegraphics[width=.48\textwidth]{figures/Results/new/final_pf/postFit_VBF_HVTWZ_1000_SRWZ_LP}\label{fig:pf_lp_vbf:b}}\\
\subfloat[]{\includegraphics[width=.48\textwidth]{figures/Results/new/final_pf/postFit_VBF_HVTWW_1000_WCR_LP}\label{fig:pf_lp_vbf:c}}
\subfloat[]{\includegraphics[width=.48\textwidth]{figures/Results/new/final_pf/postFit_VBF_HVTWW_1000_TCR_LP}\label{fig:pf_lp_vbf:d}}
\caption[Post-fit $m(\ell\nu J)$ distribution for low purity, vector boson fusion selection]{The post-fit $m(\ell\nu J)$ distributions for the LP VBF selection in \protect\subref{fig:pf_lp_vbf:a} the $WW$ SR, \protect\subref{fig:pf_lp_vbf:b} the $WZ$ SR, \protect\subref{fig:pf_lp_vbf:c} the \Wjets CR, and   \protect\subref{fig:pf_lp_vbf:d} the \ttbar CR.  The pre-fit HVT (VBF production) signal prediction for $m=1.2\,\TeV$\, is overlaid. The shaded band denotes the total post-fit statistical and systematic uncertainty on the background. The ratio of the observed data to SM background prediction is shown in the lower panel. All overflow events are included in the final bin.}
\label{fig:pf_lp_vbf}
\end{figure}

\begin{figure}[htb]
\centering
\subfloat[]{\includegraphics[width=.48\textwidth]{figures/Results/new/final_pf/postFit_HVTWW_2000_SRWW_HP}\label{fig:pf_hp_ggf:a}}
\subfloat[]{\includegraphics[width=.48\textwidth]{figures/Results/new/final_pf/postFit_HVTWZ_2000_SRWZ_HP}\label{fig:pf_hp_ggf:b}}\\
\subfloat[]{\includegraphics[width=.48\textwidth]{figures/Results/new/final_pf/postFit_HVTWW_2000_WCR_HP}\label{fig:pf_hp_ggf:c}}
\subfloat[]{\includegraphics[width=.48\textwidth]{figures/Results/new/final_pf/postFit_HVTWW_2000_TCR_HP}\label{fig:pf_hp_ggf:d}}
\caption[Post-fit $m(\ell\nu J)$ distribution for high purity, gluon-gluon fusion selection]{The post-fit $m(\ell\nu J)$ distributions for the HP ggF selection in \protect\subref{fig:pf_hp_ggf:a} the $WW$ SR, \protect\subref{fig:pf_hp_ggf:b} the $WZ$ SR, \protect\subref{fig:pf_hp_ggf:c} the \Wjets CR, and   \protect\subref{fig:pf_hp_ggf:d} the \ttbar CR. The pre-fit HVT (qqF production) signal prediction for $m=2.0\,\TeV$\, is overlaid. The shaded band denotes the total post-fit statistical and systematic uncertainty on the background. The ratio of the observed data to SM background prediction is shown in the lower panel. All overflow events are included in the final bin.}
\label{fig:pf_hp_ggf}
\end{figure}

\begin{figure}[htb]
\centering
\subfloat[]{\includegraphics[width=.48\textwidth]{figures/Results/new/final_pf/postFit_HVTWW_2000_SRWW_LP}\label{fig:pf_lp_ggf:a}}
\subfloat[]{\includegraphics[width=.48\textwidth]{figures/Results/new/final_pf/postFit_HVTWZ_2000_SRWZ_LP}\label{fig:pf_lp_ggf:b}}\\
\subfloat[]{\includegraphics[width=.48\textwidth]{figures/Results/new/final_pf/postFit_HVTWW_2000_WCR_LP}\label{fig:pf_lp_ggf:c}}
\subfloat[]{\includegraphics[width=.48\textwidth]{figures/Results/new/final_pf/postFit_HVTWW_2000_TCR_LP}\label{fig:pf_lp_ggf:d}}
\caption[Post-fit $m(\ell\nu J)$ distribution for low purity, gluon-gluon fusion selection]{The post-fit $m(\ell\nu J)$ distributions for the LP ggF selection in \protect\subref{fig:pf_lp_ggf:a} the $WW$ SR, \protect\subref{fig:pf_lp_ggf:b} the $WZ$ SR, \protect\subref{fig:pf_lp_ggf:c} the \Wjets CR, and   \protect\subref{fig:pf_lp_ggf:d} the \ttbar CR. The pre-fit HVT (qqF production) signal prediction for $m=2.0\,\TeV$\, is overlaid. The shaded band denotes the total post-fit statistical and systematic uncertainty on the background. The ratio of the observed data to SM background prediction is shown in the lower panel. All overflow events are included in the final bin.}
\label{fig:pf_lp_ggf}
\end{figure}

\clearpage
Across all SRs and CRs, the fitted background distributions agree well with the observed data distributions, within the total estimated uncertainty. The shape of the $m(\ell\nu J)$ distribution is modeled well, with no apparent trends in the ratio plots in the lower panels.
%Several bins show small fluctuations outside the estimated uncertainty bands; however, these fluctuations are mostly accompanied by nearby fluctuations in the opposite direction.
The strong agreement in the CRs, where no signal leak is expected, lends confidence to the estimation and modeling of the two principal backgrounds, \Wjets and \ttbar.

The \Wjets and \ttbar normalization factors, defined as the ratio of the number of simulated events after the fit to the number of simulated events before the fit, are shown in~\Tab{\ref{tab:bkg_norms}}. The values were constrained by the simultaneous fit to the SRs and dedicated CRs, but allowed to float. Fitted normalization factors close to unity indicate accurate modeling of the cross sections of the respective background processes.  All normalization factors are consistent with unity, within approximately one standard deviation of the measured value. The uncertainty on the normalization factor includes statistical and systematic uncertainties.

For each of the four fits, the event yields for the observed data and the post-fit simulated SM backgrounds are calculated for the HP SR and CRs, and the LP SR and CRs. In~\Tab{\ref{tab:yields_VBFWW}}, the event yields are shown for the $WW$ and $WZ$ channel fits, with VBF selection. In~\Tab{\ref{tab:yields_WW}}, the event yields are shown for the $WW$ and $WZ$ channel fits, with ggF selection. The numbers of observed data events are listed without uncertainty. The SM background event yields include statistical and systematic uncertainties. Event yields for each individual background process, and the total background prediction, are included. Correlations between the SM backgrounds are taken into account; therefore, the quoted uncertainty for the total background prediction does not necessarily correspond to the sum in quadrature of each individual background uncertainty. For each region, the observed number of data events matches the total SM prediction within the estimated uncertainty.

% Normalization factors
\begin{table}[tb]
\centering
\caption[Normalization factors for the \Wjets and $\ttbar$ backgrounds]{Normalization factors for the \Wjets and \ttbar backgrounds for the $WW$ and $WZ$ channels, separated into ggF and VBF selections. The normalization factor is the ratio between the number of fitted events from simulation to the number of predicted events from simulation. The uncertainties include both statistical and systematic uncertainties.}
\begin{tabular}{r|cc|cc}
\hline\hline
Bkg. & \multicolumn{2}{c|}{$WW$ Selection} & \multicolumn{2}{c}{$WZ$ Selection}\\\cline{2-5}
Norm. & ggF & VBF & ggF & VBF \\\hline
\Wjets&$0.95\pm0.06$&$0.89\pm0.18$&$0.97\pm0.06$&$0.84\pm0.16$\\\hline
\ttbar&$1.03\pm0.06$&$1.21\pm0.18$&$1.00\pm0.06$&$1.10\pm0.17$\\\hline\hline
\end{tabular}
\label{tab:bkg_norms}
\end{table}

% Yields
\input{tex/data/yields/VBFWW_yields.tex}
%\input{figures/Results/new/VBFWZ_yields.tex}
\input{tex/data/yields/WW_yields.tex}
%\input{figures/Results/new/WZ_yields.tex}

%%
\clearpage
\section{Expected and Observed Upper Limits}
\label{sec:limits}

With no significant excesses above the SM background prediction observed, the fit is performed again with the signal plus background hypothesis (signal with strength $\mu$ not fixed at zero). In~\Tab{\ref{tab:NPranks}}, the top five systematic uncertainties after the fit are listed. The dominant systematic uncertainties for the ggF (VBF) selection are evaluated for the fit performed with the 2\,\TeV\, (1.2\,\TeV) signal mass hypothesis, where the search has a high sensitivity. Additionally, the contributions to the total uncertainty from data statistics and total systematic uncertainties are provided. The uncertainty from data statistics is estimated using a conditional fit, with all the NPs fixed to their best-fit values, $\hat{\theta}$.
%, while the total uncertainty on the signal strength, $\Delta\mu_{\rm tot}$, is estimated from the unconstrained fit where all NPs are floated.
%The uncertainties listed for each NP, $\Delta\hat{\mu}$, represent the uncertainty on the best-fit signal strength when all the NPs are floated, except the NP in question which is fixed to it's best-fit value.
%, subtracted in quadrature from the total uncertainty: $\Delta\mu_{NP}=\sqrt{(\Delta\mu_{\rm tot})^2-(\Delta\mu_{\rm tot}^{NP {\rm\, fixed}})}$.
The impact on signal strength is calculated by fixing only the selected NP at its best-fit value, $\hat{\theta}$, and then performing the fit again.
%, varying the NP by its post-fit uncertainty, $\pm\sigma_{\hat{\theta}}$.
The change in the signal strength from its best-fit value is denoted $\Delta\hat{\mu}$, and indicates how sensitive the signal strength is to the specified NP.

Data statistics are a dominant source of uncertainty in the high mass region, while in the lower mass region, systematic uncertainties related to large-R jet kinematics dominate.  Most of the leading systematic uncertainties are due to modeling of the \Wjets and \ttbar backgrounds.  The relatively conservative uncertainty placed on the SM diboson cross section increases its impact on the signal strength uncertainty.
The systematic uncertainties related to the large-R jet mass resolution and $D_2^{\beta=1}$ resolution also have significant contributions. As discussed in~\Sect{\ref{ch:syst:largerjets}}, both of these systematic uncertainties have a conservative estimation.
%For the VBF selection, the \ttbar background comprises a larger percentage of the total SM background with respect to the ggF selection. Consequently, the sensitivity of the signal strength to $b$-tagging increases in this region.

% Systematic uncertainty impact
\begin{table}[tb]
\centering
\caption[Leading systematic uncertainties after the combined fit]{Relative change in signal strength ($\Delta \hat{\mu}$) with respect to the best-fit value after the fit to data. The five dominant uncertainty sources are presented for the ggF and VBF selections, along with the effect of the data statistical uncertainties. These are evaluated from the 2\,\TeV\, (1.2\,\TeV) mass point for the ggF (VBF) selection. To evaluate the impact on $\mu$, the production cross section is assumed the be the expected upper limit at the mass point.}
\vspace{7pt}
\label{tab:NPranks}
\resizebox{\textwidth}{!}{%
\begin{tabular}{cc|cc}
\hline
\hline
 %\multicolumn{2}{c|}{ggF Selection (Fractional uncertainties)} &  \multicolumn{2}{c}{VBF Selection (Fractional uncertainties)} \\
%\hline
%Source & $\Delta \mu_{\rm NP} / \Delta \mu_{\rm total}$ (\%) & Source & $\Delta \mu_{\rm NP} / \Delta \mu_{\rm total}$ (\%) \\
%& $m(WZ) =$  2000 \GeV&  &  $m(WW) =$ 1200 \GeV \\
%\hline
%Simulation statistics              & 28  & Simulation statistics              & 34 \\
%$W$+jets modeling \textsc{MadGraph}& 20  & \Wjets PDF          & 12 \\
%$W$+jets normalization             & 13  & \Wjets $\alpha_s$       & 9 \\
%SM diboson normalization           & 11  & \Wjets normalization    & 9 \\
%$W$+jets modeling scale             & 8   & Top modeling radiation                 & 7 \\
%Top modeling \textsc{MC@NLO}             & 8   & $b$-tagging                        & 7 \\
%\hline
%Total systematic uncertainties     & 41  & Total systematic uncertainties     & 45 \\
%Data statistics                    & 91  & Data statistics                    & 89 \\
%\hline\hline
 %\multicolumn{4}{c}{}\\
 %\multicolumn{4}{c}{}\\
%\hline\hline
 \multicolumn{2}{c|}{ggF Selection (Impact on $\mu$)} &  \multicolumn{2}{c}{VBF Selection (Impact on $\mu$)} \\\hline
%Source & $\Delta \mu_{\rm NP} / \mu$ (\%) & Source & $\Delta \mu_{\rm NP} / \mu$ (\%) \\
Source & $\Delta \hat{\mu} / \mu$ (\%) & Source & $\Delta \hat{\mu} / \mu$ (\%) \\
& $m(WZ) =$  2000 \GeV&  &  $m(WW) =$ 1200 \GeV \\
\hline
$W$+jets modeling \textsc{MadGraph} &  8 & Large-$R$ jets mass resolution           & 5 \\
$W$+jets modeling scale               &  5 & \Wjets PDF                        & 5 \\
SM diboson normalization            &  4 & Top modeling \textsc{Herwig}            & 5 \\
Large-$R$ jets mass resolution      &  4 & $W$+jets normalization & 5 \\
Large-$R$ jets D$_{2}$ resolution   &  4 & Top modeling radiation                  &  4 \\
\hline
Total systematic uncertainties      & 20  & Total systematic uncertainties     & 24 \\
Data statistics                     & 50  & Data statistics                    & 52 \\
\hline \hline
\end{tabular}
}
\end{table}

For each simulated mass point of the selected benchmark signal models, the test statistic $\tilde{q}_{\mu}$, based on the profile log likelihood ratio, is used to set upper limits on the production cross section times branching ratio to $WV$. The $CL_s$ method is used to determine the 95\,\% CL upper limits. The expected upper limit corresponds to the value of $\mu$ such that $\tilde{q}_{\mu}$ is the median of the background-only hypothesis (i.e. evaluated from the distribution, $f(\tilde{q}_{\mu}|\mu=0)$, of the test statistic), and produces a $p$-value at the given threshold (i.e $0.05$ for 95\,\% CL) for the signal plus background hypothesis (i.e. evaluated from the distribution, $f(\tilde{q}_{\mu}|\mu)$, of the test statistic). This is evaluated with the so-called ``Asimov'' dataset\footnote{
	The Asimov dataset, or ``representative'' dataset, is determined by suppressing all statistical fluctuations, and setting all observed values to their expected values, and all NPs to their nominal values.
} in the asymptotic limit, and with pseudo-experiments for signal masses above $1.6\,\TeV$\,($1.0\,\TeV$) for fits with ggF (VBF) selection.  Due to statistical fluctuations in data, the measured upper limit may not correspond to the median expected value, even if the true signal strength is zero. Thus, uncertainty bands corresponding to $\pm 1\sigma$ and $\pm 2\sigma$ for the expected upper limits are estimated and overlaid.

The expected and observed upper limits on the cross section times branching ratio for the RS $G^*\ra WW$ benchmark signal model are shown in~\Fig{\ref{fig:lim_RSGWW}}, for $k/\overline{M}_{\rm Pl}=1.0$ and $k/\overline{M}_{\rm Pl}=0.5$. The theoretical cross sections are overlaid. In~\Fig{\ref{fig:lim_HVT}}, the expected and observed upper limits on the cross section times branching ratio are shown for the HVT $W'\ra WZ$ and HVT $Z'\ra WW$ signal models, with the ggF selection. As discussed in~\Sect{\ref{ch:anstrat:sm}}, the HVT signal samples are generated in the NWA, thus model-A ($g_v=1$) samples are used for the interpretation of both model-A and model-B ($g_v=3$). The theoretical cross sections for both model-A and model-B are overlaid.

For VBF and scalar signal models, no theoretical cross sections are provided; thus, only the expected and observed upper limits on the production cross section times branching ratio to $WV$ are presented. In~\Fig{\ref{fig:lim_VBF_HVT}}, the upper limits are shown for the HVT $W'jj\ra WZjj$ and HVT $Z'jj\ra WWjj$ signal models, with the VBF selection. The VBF topology is denoted by the two VBF-tagged small-R jets, ``jj''. Finally, in~\Fig{\ref{fig:lim_scalar}}, the upper limits are shown for the heavy neutral Higgs model, for both the ggF and VBF selections.

% Upper limits
\clearpage
\begin{figure}[H]
\centering
\subfloat[]{\includegraphics[width=0.8\textwidth]{figures/Results/new/final_lim/RSGWW_LPHP_ggF}\label{fig:lim_RSGWW:a}}\\
\subfloat[]{\includegraphics[width=0.8\textwidth]{figures/Results/new/final_lim/RSGWW_ReWeight_LPHP_ggF}\label{fig:lim_RSGWW:b}}\\
\caption[Observed and expected upper limits for RS $G^*$ model (gluon-gluon fusion selection)]{The observed and expected 95\,\% CL upper limits on cross section times branching ratio for RS $G* \rightarrow WW$ in the combined LP and HP signal regions, for the ggF selection, are shown for \protect\subref{fig:lim_RSGWW:a} $k/\overline{M}_{\rm Pl}=1.0$ and  \protect\subref{fig:lim_RSGWW:b} $k/\overline{M}_{\rm Pl}=0.5$. The theoretical cross sections for the signal models are overlaid. Limits are calculated with an asymptotic approximation for mass points below 1.6\,\TeV, and with pseudo-experiments above 1.6\,\TeV.}
\label{fig:lim_RSGWW}
\end{figure}
\begin{figure}[H]
\centering
\subfloat[]{\includegraphics[width=0.8\textwidth]{figures/Results/new/final_lim/HVTWW_LPHP_ggF}\label{fig:lim_HVT:a}}\\
\subfloat[]{\includegraphics[width=0.8\textwidth]{figures/Results/new/final_lim/HVTWZ_LPHP_ggF}\label{fig:lim_HVT:b}}\\
\caption[Observed and expected upper limits for HVT $Z'$ and $W'$ model (gluon-gluon fusion selection)]{The observed and expected 95\,\% CL upper limits on cross section times branching ratio for \protect\subref{fig:lim_HVT:a} HVT $Z' \rightarrow WW$ and \protect\subref{fig:lim_HVT:b} HVT $W' \rightarrow WZ$, in the combined LP and HP signal regions, for the ggF selection. The theoretical cross sections for model-A ($g_V=1$) and model-B ($g_V=3$) are overlaid. Limits are calculated with an asymptotic approximation for mass points below 1.6\,\TeV, and with pseudo-experiments above 1.6\,\TeV.}
\label{fig:lim_HVT}
\end{figure}
\begin{figure}[H]
\centering
\subfloat[]{\includegraphics[width=0.8\textwidth]{figures/Results/new/final_lim/VBF_HVTWW_LPHP_VBF}\label{fig:lim_VBF_HVT:a}}\\
\subfloat[]{\includegraphics[width=0.8\textwidth]{figures/Results/new/final_lim/VBF_HVTWZ_LPHP_VBF}\label{fig:lim_VBF_HVT:b}}\\
\caption[Observed and expected upper limits for HVT $Z'$ and $W'$ model (vector boson fusion selection)]{The observed and expected 95\,\% CL upper limits on cross section times branching ratio for \protect\subref{fig:lim_VBF_HVT:a} HVT $Z' jj\rightarrow WWjj$ and \protect\subref{fig:lim_VBF_HVT:b} HVT $W'jj \rightarrow WZjj$, in the combined LP and HP signal regions, for the VBF selection. The mass region greater than 1.5\,\TeV\, is covered by two bins in the final discriminant, while the observed limit markers represent the tested signal points. Limits are calculated with an asymptotic approximation for mass points below 1.0\,\TeV, and with pseudo-experiments above 1.0\,\TeV.}
\label{fig:lim_VBF_HVT}
\end{figure}
\begin{figure}[H]
\centering
\subfloat[]{\includegraphics[width=0.8\textwidth]{figures/Results/new/final_lim/ggHWWNWA_LPHP_ggF}\label{fig:lim_scalar:a}}\\
\subfloat[]{\includegraphics[width=0.8\textwidth]{figures/Results/new/final_lim/VBFWWNWA_LPHP_VBF}\label{fig:lim_scalar:b}}\\
\caption[Observed and expected upper limits for narrow, heavy Higgs model (gluon-gluon fusion and vector boson fusion selection)]{The observed and expected 95\,\% CL upper limits on cross section times branching ratio for a neutral heavy scalar (NWA) in the combined LP and HP signal regions, for the \protect\subref{fig:lim_scalar:a} ggF selection and \protect\subref{fig:lim_VBF_HVT:b} VBF selection. Signal samples generated with ggF (VBF) production are used for the ggF selection (VBF selection). The mass region greater than 1.5\,\TeV\, is covered by two bins in the final discriminant, while the observed limit markers represent the tested signal points. For the ggF (VBF) selection, limits are calculated with an asymptotic approximation for mass points below $1.6\,\TeV$\, ($1.0\,\TeV$), and with pseudo-experiments above $1.6\,\TeV$\,($1.0\,\TeV$).}
\label{fig:lim_scalar}
\end{figure}

The largest discrepancy between the expected and observed upper limits occur for signal models with VBF production, for masses between approximately $1.5-2.0\,\TeV$. The local $p$-values for the background-only hypothesis are shown in~\Fig{\ref{fig:p0}},  for the tested HVT $W'$ and $Z'$ signal models with VBF production. For the $Z'$ model, the maximum local significance, which does not take into account the look-elsewhere effect, is approximately $2.6\sigma$ for the fit at $m(W')=1.7\,\TeV$. In the post-fit plot for the HP SR with VBF selection (\Fig{\ref{fig:pf_hp_vbf}}), there are three events observed in the bin at 1.7\,\TeV, with less than one expected in the $WW$ channel. In the $WZ$ channel (which has a large overlap), three events are observed in the bin at 1.7\,\TeV\, as well, but the background expectation is slightly higher at $\sim1.5$ events. With only two bins covering the region $m(\ell\nu J)>1.5\,\TeV$, the larger than expected upper limits for tested mass points in this region are mostly due to the entries in this single bin.

\begin{figure}[H]
\centering
\subfloat[]{\includegraphics[width=0.49\textwidth]{figures/Results/new/final_lim/VVM_p0_VBF_HVTWW_VBF}\label{fig:p0:a}}
\subfloat[]{\includegraphics[width=0.49\textwidth]{figures/Results/new/final_lim/VVM_p0_VBF_HVTWZ_VBF}\label{fig:p0:b}}
\caption[Local $p$-value for HVT signal (vector boson fusion selection)]{Local $p$-value for the tested \protect\subref{fig:p0:a} HVT $W'$ and \protect\subref{fig:p0:b} HVT $Z'$ signal models. The mass region greater than 1.5\,\TeV\, is covered by two bins in the final discriminant. }
\label{fig:p0}
\end{figure}

%Excluded Masses
%\afterpage{\clearpage}
\section{Comparison with Previous Results}

Signal masses for which the theoretical cross section is larger than the observed cross section can be excluded at 95\,\% CL. The expected and observed excluded masses are shown in~\Tab{\ref{tab:excluded}}. The most recent CMS result~\cite{CMS_diboson_run2} included up to $2.7\,\ifb$\,of $pp$ data with center-of-mass energy $\sqrt{s}=13\,\TeV$, and excluded $W'$ and $Z'$ resonance masses below $2.3\,\TeV$\,($2.4\,\TeV$) for HVT model-A (model-B). The most recent ATLAS result~\cite{diboson_comb_2016} included $3.2\,\ifb$\, of $pp$ data with center-of-mass energy $\sqrt{s}=13\,\TeV$, and excluded $W'$ and $Z'$ resonance masses below $2.35\,\TeV$\,($2.6\,\TeV$) for HVT model-A (model-B). This thesis extends the excluded mass range from the ATLAS result by $450\,\GeV$\,($390\,\GeV$) for $W'$ resonances and by $380\,\GeV$\,($400\,\GeV$) for $Z'$ resonances in model-A (model-B).

The most recent ATLAS result excluded bulk RS graviton masses below $1.1\,\TeV$ for $k/\overline{M}_{\rm Pl}=1.0$, while this thesis extends the excluded mass range by $650\,\GeV$. Upper limits on production cross section times branching ratio to $VV=WW/ZZ$\footnote{
	 For heavy scalar models (NWA) and bulk RS $G^{*}$ models, the most recent results present upper limits on the cross section times branching ratio to $VV=WW/ZZ$. For comparison, the ratio of the $WW:ZZ$ decay is approximately $2:1$. Thus, upper limits for the $VV$ combined channel are approximately 1.5 times the upper limits for $WW$ channel presented here.
} for a bulk RS $G^{*}$ with $k/\overline{M}_{\rm Pl}=0.5$ were set by CMS ranging from $1.2\,$pb ($600\,\GeV$) to $3\,$fb ($4\,\TeV$). This thesis improves upon those results and sets upper limits on cross section times branching ratio to $WW$ ranging from $0.5\,$pb (500\,\GeV) to $0.6\,$fb (5\,\TeV), and presents the first excluded mass range for a bulk RS graviton with $k/\overline{M}_{\rm Pl}=0.5$.

ATLAS set upper limits on production cross section times branching ratio to $VV=WW/ZZ$ for a narrow scalar resonance ranging from $1\,$pb at $500\,\GeV$\,to $6\,$fb at $3\,\TeV$~\cite{diboson_comb_2016}. This thesis improves upon those results and sets upper limits on production cross section times branching ratio to $WW$ for a narrow scalar resonance ranging from $0.2\,$pb at $500\,\GeV$\,(model with VBF production) to $1.8\,$fb at $3\,\TeV$\,(model with ggF production). Finally, the first upper limits on production cross section times branching ratio to $WV$ are set for HVT $W'$ and $Z'$ resonances with VBF production.
%
% Excluded Masses
\begin{table}[htb]
\centering
\begin{tabular}{l|c|c}
\hline\hline
\textbf{Signal Model}\quad\quad\quad\quad\,&\multicolumn{2}{c}{\textbf{Excluded Masses at 95\,\% CL}}\\\hline%\cline{2-3}
$WZ$ Selection&Expected [\GeV]&Observed [\GeV]\\\hline
%&&\\
\rule{0pt}{2.5ex}\,\,\,HVT $W'$&&\\
\,\hfill Model A ($g_v=1$)&$<2880$&$<2800$\\
\,\hfill Model B ($g_v=3$)&$<3220$&$<2990$\\\hline
\multicolumn{3}{c}{\,}\\\hline
$WW$ Selection\quad\quad\quad\quad\,&Expected [\GeV]&Observed [\GeV]\\\hline
\rule{0pt}{2.5ex}\,\,\,HVT $Z'$&&\\
\,\hfill Model A ($g_v=1$)&$<2830$&$<2730$\\
\,\hfill Model B ($g_v=3$)&$<3170$&$<3000$\\
\rule{0pt}{2.5ex}\,\,\,RS $G^*$&&\\
\,\hfill $k/\overline{M}_{\rm Pl}=1.0$&$<1740$&$<1750$\\
\,\hfill $k/\overline{M}_{\rm Pl}=0.5$&$<1250$&$<980$ and $1020-1350$\\
\hline\hline
\end{tabular}
\caption[Observed and expected excluded masses at 95\,\% confidence level]{Observed and expected excluded masses at 95\,\% CL for HVT $W'$, HVT $Z'$, and RS $G^*$ signal models.}
\label{tab:excluded}
\end{table}

\clearpage