\input{../t2jPreamble}

% newcommands don't have to be before begin document, but cleaner if they are
\newcommand{\bcite}[1]{\href{#1}{\textbf{Link}.}}
\newcommand{\RR}{$\mathbb R$}
\newcommand{\eqa}[1]{\begin{eqnarray}#1\end{eqnarray}}

\title{Example on how to use tex2jem}

\begin{document}
\maketitle

\section{Text format}
\subsection{Basics}
\begin{itemize}
    \item Bold: \textbf{bold}
    \item Emph: \emph{emph}
    \item Underline: \underline{underline}
    \item Combo: \textbf{bold \emph{bold emph \underline{everything}} blah}
    \item Color: \textcolor{DarkMagenta}{this in color} (not embeddable)
\end{itemize}

\subsection{References}
Hyperreferrences to other sections \hyperref[sec:newcom]{section on newcoms}\\
Referrences to the outside world: \href{http://www.mathjax.org}{\textbf{Link to Mathjax.org}}\\
Referrences to equations: (this shows that you \emph{can} write everything in line, it will be handled but it's not nice, if you write everything out nicely it will also work obviously)
\eqa{ \mathbb I_3 &:=& \left(\begin{array}{ccc}1&0&0\\0&1&0\\0&0&1 \end{array}\right).\label{eq:def id}}
which can then be referred to as \eqref{eq:def id} follows...\\

Raw jem can be inserted at any point (eg., handy for insite short links)
%jem: this a *raw* /jem/ block (see also jemdoc & co)
\section{Environments}
\subsection{Highlighted boxes}
\begin{ybox} This is a highlighted box \end{ybox}

\subsection{Figures}
At the moment, no option allowed (do all that outside, rule of thumb 340x240)
\begin{figure}[!h]\center\includegraphics{_figs/rubber-duck.jpg}\end{figure}

\subsection{Equations}
Inline \textbf{small} mode: $4 \ge 3$ is simple inline math\\
Inline \textbf{big} mode:   $$\pi\ge3$$\\
Inline \textbf{big} mode(2) $$\pi\ge3$$\\
Multiline
\begin{eqnarray} 1+1&=&2\end{eqnarray}
Multiline with tag and label
\begin{align}
  \sin^2(x)+\cos^2(x) &= 1, \qquad \forall x\in\mathbb R \label{eq:A}\tag{A}
  % some comment
\end{align}
which can then be referred by \eqref{eq:A}, easy enough.\\

Array of equations:
\begin{eqnarray}
    \sin^2(x)+\cos^2(x) - 1 &=& 0\nonumber\\
    |\exp(i\theta)|-1 &=& 0.
\end{eqnarray}

\section{\label{sec:newcom}Using new commands}
Cf definition of some of the newcommands at the beginning of the document:
\begin{itemize}
    \item No arg embedded math: the reals \RR blah
    \item One arg embedded href: \bcite{http://www.openstreetmap.org}
\end{itemize}

\section{Tricks}
Raw html insertion:
%jem: {{Some text here}}
and continue here

\end{document}


Sample LaTeX file
The name of this file is intro.tex.

\documentclass[12pt]{article}

\usepackage{amsmath}    % need for subequations
\usepackage{graphicx}   % need for figures
\usepackage{verbatim}   % useful for program listings
\usepackage{color}      % use if color is used in text
\usepackage{subfigure}  % use for side-by-side figures
\usepackage{hyperref}   % use for hypertext links, including those to external documents and URLs

% don't need the following. simply use defaults
\setlength{\baselineskip}{16.0pt}    % 16 pt usual spacing between lines

\setlength{\parskip}{3pt plus 2pt}
\setlength{\parindent}{20pt}
\setlength{\oddsidemargin}{0.5cm}
\setlength{\evensidemargin}{0.5cm}
\setlength{\marginparsep}{0.75cm}
\setlength{\marginparwidth}{2.5cm}
\setlength{\marginparpush}{1.0cm}
\setlength{\textwidth}{150mm}

\begin{comment}
\pagestyle{empty} % use if page numbers not wanted
\end{comment}

% above is the preamble

\begin{document}

\begin{center}
{\large Introduction to \LaTeX} \\ % \\ = new line
\copyright 2006 by Harvey Gould \\
December 5, 2006
\end{center}

\section{Introduction}
\TeX\ looks more difficult than it is. It is
almost as easy as $\pi$. See how easy it is to make special
symbols such as $\alpha$,
$\beta$, $\gamma$,
$\delta$, $\sin x$, $\hbar$, $\lambda$, $\ldots$ We also can make
subscripts
$A_{x}$, $A_{xy}$ and superscripts, $e^x$, $e^{x^2}$, and
$e^{a^b}$. We will use \LaTeX, which is based on \TeX\ and has
many higher-level commands (macros) for formatting, making
tables, etc. More information can be found in Ref.~\cite{latex}.

We just made a new paragraph. Extra lines and spaces make no
difference. Note that all formulas are enclosed by
\$ and occur in \textit{math mode}.

The default font is Computer Modern. It includes \textit{italics},
\textbf{boldface},
\textsl{slanted}, and \texttt{monospaced} fonts.

\section{Equations}
Let us see how easy it is to write equations.
\begin{equation}
\Delta =\sum_{i=1}^N w_i (x_i - \bar{x})^2 .
\end{equation}
It is a good idea to number equations, but we can have a
equation without a number by writing
\begin{equation}
P(x) = \frac{x - a}{b - a} , \nonumber
\end{equation}
and
\begin{equation}
g = \frac{1}{2} \sqrt{2\pi} . \nonumber
\end{equation}

We can give an equation a label so that we can refer to it later.
\begin{equation}
\label{eq:ising}
E = -J \sum_{i=1}^N s_i s_{i+1} ,
\end{equation}
Equation~\eqref{eq:ising} expresses the energy of a configuration
of spins in the Ising model.\footnote{It is necessary to process (typeset) a
file twice to get the counters correct.}

We can define our own macros to save typing. For example, suppose
that we introduce the macros:
\begin{verbatim}
 \newcommand{\lb}{{\langle}}
 \newcommand{\rb}{{\rangle}}
\end{verbatim}
\newcommand{\lb}{{\langle}}
\newcommand{\rb}{{\rangle}}
Then we can write the average value of $x$ as
\begin{verbatim}
\begin{equation}
\lb x \rb = 3
\end{equation}
\end{verbatim}
The result is
\begin{equation}
\lb x \rb = 3 .
\end{equation}

Examples of more complicated equations:
\begin{equation}
I = \! \int_{-\infty}^\infty f(x)\,dx \label{eq:fine}.
\end{equation}
We can do some fine tuning by adding small amounts of horizontal
spacing:
\begin{verbatim}
 \, small space       \! negative space
\end{verbatim}
as is done in Eq.~\eqref{eq:fine}.

We also can align several equations:
\begin{align}
a & = b \\
c &= d ,
\end{align}
or number them as subequations:
\begin{subequations}
\begin{align}
a & = b \\
c &= d .
\end{align}
\end{subequations}

We can also have different cases:
\begin{equation}
\label{eq:mdiv}
m(T) =
\begin{cases}
0 & \text{$T > T_c$} \\
\bigl(1 - [\sinh 2 \beta J]^{-4} \bigr)^{\! 1/8} & \text{$T < T_c$}
\end{cases}
\end{equation}
write matrices
\begin{align}
\textbf{T} &=
\begin{pmatrix}
T_{++} \hfill & T_{+-} \\
T_{-+} & T_{--} \hfill
\end{pmatrix} , \nonumber \\
& =
\begin{pmatrix}
e^{\beta (J + B)} \hfill & e^{-\beta J} \hfill \\
e^{-\beta J} \hfill & e^{\beta (J - B)} \hfill
\end{pmatrix}.
\end{align}
and
\newcommand{\rv}{\textbf{r}}
\begin{equation}
\sum_i \vec A \cdot \vec B = -P\!\int\! \rv \cdot
\hat{\mathbf{n}}\, dA = P\!\int \! {\vec \nabla} \cdot \rv\, dV.
\end{equation}

\section{Tables}
Tables are a little more difficult. TeX
automatically calculates the width of the columns.

\begin{table}[h]
\begin{center}
\begin{tabular}{|l|l|r|l|}
\hline
lattice & $d$ & $q$ & $T_{\rm mf}/T_c$ \\
\hline
square & 2 & 4 & 1.763 \\
\hline
triangular & 2 & 6 & 1.648 \\
\hline
diamond & 3 & 4 & 1.479 \\
\hline
simple cubic & 3 & 6 & 1.330 \\
\hline
bcc & 3 & 8 & 1.260 \\
\hline
fcc & 3 & 12 & 1.225 \\
\hline
\end{tabular}
\caption{\label{tab:5/tc}Comparison of the mean-field predictions
for the critical temperature of the Ising model with exact results
and the best known estimates for different spatial dimensions $d$
and lattice symmetries.}
\end{center}
\end{table}

\section{Lists}

Some example of formatted lists include the
following:

\begin{enumerate}

\item bread

\item cheese

\end{enumerate}

\begin{itemize}

\item Tom

\item Dick

\end{itemize}

\section{Figures}

We can make figures bigger or smaller by scaling them. Figure~\ref{fig:lj}
has been scaled by 60\%.

\begin{figure}[h]
\begin{center}
\includegraphics{figures/sine}
\caption{\label{fig:typical}Show me a sine.}
\end{center}
\end{figure}

\begin{figure}[h]
\begin{center}
\scalebox{0.6}{\includegraphics{figures/lj}}
\caption{\label{fig:lj}Plot of the
Lennard-Jones potential
$u(r)$. The potential is characterized by a length
$\sigma$ and an energy
$\epsilon$.}
\end{center}
\end{figure}

\section{Literal text}
It is desirable to print program code exactly as it is typed in a
monospaced font. Use \verb \begin{verbatim} and
\verb \end{verbatim} as in the following example:
\begin{verbatim}
double y0 = 10; // example of declaration and assignment statement
double v0 = 0;  // initial velocity
double t = 0;   // time
double dt = 0.01; // time step
double y = y0;
\end{verbatim}
The command \verb \verbatiminput{programs/Square.java}\ allows
you to list the file \texttt{Square.java} in the directory
programs.

\section{Special Symbols}

\subsection{Common Greek letters}

These commands may be used only in math mode. Only the most common
letters are included here.

$\alpha,
\beta, \gamma, \Gamma,
\delta,\Delta,
\epsilon, \zeta, \eta, \theta, \Theta, \kappa,
\lambda, \Lambda, \mu, \nu,
\xi, \Xi,
\pi, \Pi,
\rho,
\sigma,
\tau,
\phi, \Phi,
\chi,
\psi, \Psi,
\omega, \Omega$
\subsubsection{Test for ctags}
\subsection{Special symbols}

The derivative is defined as
\begin{equation}
\frac{dy}{dx} = \lim_{\Delta x \to 0} \frac{\Delta y}
{\Delta x}
\end{equation}
\begin{equation}
f(x) \to y \quad \mbox{as} \quad x \to
x_{0}
\end{equation}
\begin{equation}
f(x) \mathop {\longrightarrow}
\limits_{x \to x_0} y
\end{equation}

\noindent Order of magnitude:
\begin{equation}
\log_{10}f \simeq n
\end{equation}
\begin{equation}
f(x)\sim 10^{n}
\end{equation}
Approximate equality:
\begin{equation}
f(x)\simeq g(x)
\end{equation}
\LaTeX\ is simple if we keep everything in proportion:
\begin{equation}
f(x) \propto x^3 .
\end{equation}

Finally we can skip some space by using commands such as
\begin{verbatim}
\bigskip    \medskip    \smallskip    \vspace{1pc}
\end{verbatim}
The space can be negative.

\section{\color{red}Use of Color}

{\color{blue}{We can change colors for emphasis}},
{\color{green}{but}} {\color{cyan}{who is going pay for the ink?}}

\section{\label{morefig}Subfigures}

As soon as many students start becoming comfortable using \LaTeX, they want
to use some of its advanced features. So we now show how to place two
figures side by side.

\begin{figure}[h!]
\begin{center}
\subfigure[Real and imaginary.]{
\includegraphics[scale=0.5]{figures/reim}}
\subfigure[Amplitude and phase.]{
\includegraphics[scale=0.5]{figures/phase}}
\caption{\label{fig:qm/complexfunctions} Two representations of complex
wave functions.}
\end{center}
\end{figure}

We first have to include the necessary package,
\verb+\usepackage{subfigure}+, which has to go in the preamble (before
\verb+\begin{document}+). It sometimes can be difficult to place a figure in
the desired place.

Your LaTeX document can be easily modified to make a poster or a screen
presentation similar to (and better than) PowerPoint. Conversion to HTML is
straightforward. Comments on this tutorial are appreciated.

\begin{thebibliography}{5}

\bibitem{latex}Helmut Kopka and Patrick W. Daly, \textsl{A Guide to
\LaTeX: Document Preparation for Beginners and Advanced Users},
fourth edition, Addison-Wesley (2004).

\bibitem{website}Some useful links are
given at \url{}.

\end{thebibliography}

{\small \noindent Updated 5 December 2006.}
\end{document}

Updated 6 February 2006.


\newpage
\section{Results and evaluation of methods}\label{section:statistics_results}

In this section, different schemes of sampling in the context of Stratified sampling are compared in the context of synthetic data, primarily in the context of Beta-distributed data, and also in a more specific Bernoulli-uniform data set.
In the next subsection \ref{sec:shapley} we consider the effectiveness of these different methods of sampling specifically to approximate the Shapley Value in the context of various cooperative games.
The results and analysis of these methods are discussed in the following discussion section \ref{sec:discussion}.\footnote{
Sourcecode for all the experiments in this paper are available at:\\ \href{https://github.com/Markopolo141/Stratified\_Empirical\_Bernstein\_Sampling}{https://github.com/Markopolo141/Stratified\_Empirical\_Bernstein\_Sampling
}}

\subsection{Benchmarks algorithms}
We outline a range of benchmark algorithms used to evaluate the performance of various methods in the context of synthetic data sets.
Then Section~\ref{ssec:SyntheticDists} describes two synthetic data sets and reports on the resulting distribution of errors under our benchmarks algorithms.

In the numerical evaluations for synthetic data, we compare the following sampling methods:
\begin{itemize}
\item
\textsc{SEBM} (Stratified empirical Bernstein method, without replacement):
our SEBM method (per Algorithm \ref{alg2}) of iteratively choosing samples from strata to minimise the SEBB, given in Equation~\eqref{big_equation}.
An initial sample of two data points from each strata is used to initialise the sample variances of each, with additional samples made to maximally minimise the inequality at each step. All samples are drawn \textit{without} replacement.
\item
\textsc{SEBM-W} (Stratified empirical Bernstein method with replacement):
as above, with the exception that all samples are drawn \textit{with} replacement, and consequently the inequality does not utilise the martingale inequality given in Lemma~\ref{martingale0}.
\item
\textsc{Simple} (Simple random sampling, without replacement): simple random sampling from the population irrespective of strata \textit{without} replacement.
\item
\textsc{Simple-W} (Simple random sampling with replacement):
simple random sampling from the population irrespective of strata \textit{with} replacement.
\item \textsc{Ney} (Neyman sampling, without replacement): the method of maximally choosing samples \textit{without} replacement from strata proportional to the strata variance (via Theorem \ref{thm:neyman_selection}).
\item \textsc{Ney-W} (Neyman sampling with replacement): the method of choosing samples \textit{with} replacement proportional to the strata variance (via Theorem \ref{thm:neyman_selection}).
\item \textsc{SEBM*} (Stratified empirical Bernstein method with variance assistance): the method of iteratively choosing samples \textit{without} replacement from strata to minimise Equation~\eqref{eq1}, utilizing martingale Lemma~\ref{martingale0}.
\item \textsc{SEBM*-W} (Stratified empirical Bernstein method with variance assistance): the method of iteratively choosing samples \textit{with} replacement from strata to minimise Equation~\eqref{eq1}.
\item \textsc{SECM} (Stratified empirical Chernoff method): the method of iteratively choosing samples from strata \textit{without} replacement to minimize the SECB, given in Equation~\eqref{another_big_equation}.
An initial sample of two data points from each strata is used to initialise the sample variances of each, with additional samples made to maximally minimize the inequality at each step. All samples are drawn \textit{without} replacement.
\item \textsc{Hoeffding} (Unionised EBBs with Hoeffding's inequality): The method of sampling \textit{with} replacement to minimise probability bound of Theorem \ref{triangle_theorem2} applied with Hoeffding's inequality (Theorem \ref{Hoeffdings_inequality_proper})
\item \textsc{Audibert} (Unionised EBBs with Audibert et.al's EBB): The method of sampling \textit{with} replacement to minimise probability bound of Theorem \ref{triangle_theorem2} applied with Audibert et.al's EBB (Theorem \ref{AudibertsEBB})
\item \textsc{Maurer} (Unionised EBBs with Maurer \& Pontil's EBB): The method of sampling \textit{with} replacement to minimise probability bound of Theorem \ref{triangle_theorem2} applied with Maurer \& Pontil's EBB (Theorem \ref{MandPsEBB})
\item \textsc{EEBB} (Unionised EBBs with our Engineered EBB): The method of sampling to \textit{with} replacement to minimise the probability bound of Theorem \ref{triangle_theorem2} applied with our fitted EBB (Equation \ref{eq:prob_bound})
\item \textsc{Random} (stratified sampling with random samples from strata): The process of stratified sampling \textit{with} replacement, choosing random numbers of samples from each of the strata.
\end{itemize}
We consider that the three methods (\textsc{Ney},\textsc{Ney-W} and SEBM*) are built apon the assumption of known variances for the strata, which are supplied to them, so that they may serve as a comparrison with the performance which would be possible for various methods which such information.
Additionally we note that for all other methods (where appropriate) we selected for minimising a 50\% confidence interval (i.e. constant $p=0.5$ and $t=0.5$).

The differences between these methods provide comparisons of different algorithmic factors, such as the dynamics of sampling: with and without replacement; with stratification and without; between our method and Neyman sampling, and; with and without perfect knowledge of stratum variances.
For these methods, we consider the effectiveness of sampling Beta distributed data and for a case of uniform-and-Bernoulli data.
% Detailed analysis of the results is left to Section~\ref{sec:discussion}.

\subsection{Synthetic data}
\label{ssec:SyntheticDists}
The most immediate way to compare the effectiveness of our method(s) is to generate sets of synthetic data, and then numerically examine the distribution of errors generated by the different methods of choosing samples.
In this section, we describe two types of synthetic data sets used in this evaluation, namely:
\begin{enumerate}
\item Beta distributed stratum data, which are intended reflect possible real-world data, and
\item a particular form of uniform and Bernoulli distributed stratum data, where our sampling method (SEBM) was expected to perform poorly.
\end{enumerate}

\subsubsection{Beta-distributed data}\label{sec:beta_distributed_data}
The first pool of synthetic data % sets are intended to be representative of potential real-world data.
% These sets
have between 5 and 21 strata, with the number of strata drawn with uniform probability,
and each strata sub-population has sizes ranging from 10 to 201, also drawn uniformly.
The data values in each strata are drawn from Beta distributions, with classic probability density function:
$$\phi(x)_{\{\alpha,\beta\}}
=\frac{\Gamma(\alpha+\beta)}{\Gamma(\alpha)\Gamma(\beta)}
    x^{\alpha-1}(1-x)^{\beta-1} $$
with $\alpha$ and $\beta$ parameters drawn uniformly between 0 and 4 for each stratum, and $\Gamma$ is the gamma function.

\input{figs/big_table1.tex}

\input{figs/big_table2.tex}

Figures \ref{Table1} and \ref{Table111} compare the distribution of absolute errors achieved by each of the sampling methods over 5000 rounds of these data sets.
Each panel presents the results that the methods achieve for a given budget of samples,
expressed as a multiple of the number of strata (noting that data sets where the sampling budget exceeded the volume of data were excluded).
From the plots in Figures \ref{Table1} and \ref{Table111}, we can see that our sampling technique (SEBM and SEBM-W) performs comparably to
% competitive-to and sometimes better-than
Neyman sampling (\textsc{Ney} and \textsc{Ney-W}) despite not having access to knowledge of stratum variances.
Also, there is a notable similarity between SEBM* and SEBM.
As expected, sampling without replacement always performs better than sampling with replacement for the same method, and this difference is magnified as the number of samples grows large in comparison to the population size.
Finally, simple random sampling almost always performs worst, because it fails to take advantage of any variance information.
These results and their interpretation are discussed and detailed in Section~\ref{sec:discussion} along with results from the other test cases discussed below.

\subsubsection{A uniform and Bernoulli distribution}
\label{sec:dataset2}
We also to examine data distributions in which our sampling method (SEBM) performs poorly, particularly compared to Neyman sampling (\textsc{Ney}).
For this purpose, a data-set with two strata is generated, with each stratum containing $1000$ points.
The data in the first stratum is uniform continuous data in range $[0,1]$, while the data in the second is Bernoulli distributed, with all zeros except for a specified small number $a$ of data points, with value 1.
For this problem, we conduct stratified random sampling with a budget of $300$ samples, comparing the SEBM*, SEBM and \textsc{Ney} methods.
The average error returned by the methods across 20,000 realisations of this problem, plotted against the number of successes $a$, are shown as a graph in Figure \ref{biggraph3}.
This figure demonstrates that SEBM and SEBM* perform poorly when $a$ is small.
This under-performance is not simply a result of the SEBM method oversampling in a process of learning the stratum variances (which was the intended demonstration), but the under-performance was present in SEBM* as well.
The reasons for this under-performance are discussed in in more detail in Section~\ref{subsection:main_discussion}.
But before this discussion, we also considered the approximation of the Shapley Value as an example application of our stratified sampling method.

\input{figs/bernoulli_table.tex}


%!TEX root = thesis-kdyoung.tex

% \begin{savequote}%[45mm]
% ---Essentially, all models are wrong, but some are useful.
% \qauthor{George Box}
% \end{savequote}

\chapter{Conclusion}
\label{chap:conc}

In this thesis we devised a logic-based Benders decomposition
of the \sua{2}.
The natural division between the assignment and scheduling
variables led us to believe that this approach would be
well-suited to the problem.
Our formulation resulted in a classical \sab{2}
being solved by the master problem while
a sub-problem for each station was created.
We considered multiple ways of formulating and solving the sequencing
problems that arose in each station.

Logic-based Benders decomposition allowed us to
formulate a sub-problem as either a MIP or a constraint program and
using its inference dual to generate Bender cuts.
Employing CP solving technology resulted in marginal
improvements to the runtime and solution quality when compared
to MIP sub-problems.
However the CP solver \chuffed was only able to
operate on one core while the MIP solver \gurobi was able to utilize
all four cores.
The inclusion of the global constraint \cumu in the CP model
and investigating the possible search strategies of the CP solver,
both contributed to the CP model outperforming the
MIP sub-problem formulation.

Both feasibility and optimality Benders cuts were devised.
Solving each sub-problem to optimality allowed a much wider
range of cuts to be generated at each iteration of the Benders
algorithm.
We provided a detailed analysis into the advantages and disadvantages
of each possible cutting procedure and after performing experiments,
we were able to conclude that combining the global upper bound, $\mathcal{C}_{gb}$,
with our strongest inference cut, $\mathcal{C}_{iii}$, resulted
in the most effective cutting planes added to the relaxed master problem.

In summary, our decomposition approach was able to solve
100\% of the smallest class of instances in an average runtime of
0.41 seconds.
For the second class, which contained small-to-medium sized instances,
our method was able to solve 61.6\% of the instances, while also
finding superior gap values compared to pure MIP models solved with \gurobi.
In the case of largest class we considered, only 15.3\% of optimal solutions
were proven in the 30 minute time limit.
Of the 396 instances we tested which had up to 58 tasks and 31 stations,
the Benders decomposition was able to solve 51.5\% to optimality.

\section{Future Work}
\label{sec:conc:future}
The work and results we have reported on in this thesis
stand as only the very beginning of the research which
could be done into decomposition approaches to the \sua{}.
The logic-based Benders decomposition we devised can be viewed
simply as a framework for a solution procedure to this problem.
As such this framework presents a range of possible future research directions;
some of which we will now detail.

Firstly, applying our Benders decomposition to the type-1 problem
of \sua{} is a straight forward extension.
This will result in $m$ sub-problems needing to be solved
where $m$ is a variable, while each station has an upper bound
on its load.
We can again view these sequencing problems as asymmetric TSPs, however
now not only is the number of cities within each TSP unknown,
but the number of TSPs to be solved is also a decision.
As each sub-problem has a pre-defined upper bound, feasibility
cuts may be better suited in the type-1 case.

The final results we presented in the previous chapter tell us that
the vast majority of solve time in our decomposition is due to
the relaxed master problem.
We only considered a full mixed integer programming approach for the
master however this was not exclusively necessary.
Any procedure which can return an assignment of tasks to the stations and provides
a lower bound on the cycle time would be applicable.
Thus, developing heuristic procedures to replace our current formulation of
the \rmp{} may be a fruitful direction of investigation.
In fact, it is very possible that implementing such a procedure --- even if it is
relatively simple --- could significantly improve the results
found here.

In this thesis, we considered few ways of formulating the MIP
version of the sub-problems.
Further investigation into valid inequalities of this program
or simply a different set of decision variables could lead
to better results.
Regarding the CP sub-problems, the lack of parallelization
of the \chuffed solver hindered its capabilities somewhat.
So when this feature becomes available, re-running the
experiments to check the reduction in runtime
would provide a useful comparison between different
solution technologies.

Finally, we emphasise the limited amount of research which
has been done into the \sua{}.
This variant of the \albp{} presents a non-trivial layer of complexity
with a set of scheduling decisions,
however this consideration is applicable to a wide variety of assembly lines.
Thus, including setup costs in other well-known variants of the
\albp{} would lead to a range of possible research directions.


\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{geometry}
\usepackage{enumerate}
\usepackage{natbib}
\usepackage{float}%稳定图片位置
\usepackage{graphicx}%画图
\usepackage[english]{babel}
\usepackage{a4wide}
\usepackage{indentfirst}%缩进
\usepackage{enumerate}%加序号
\usepackage{multirow}%合并行
\title{\large UM-SJTU JOINT INSTITUTE\\DISCRETE MATHEMATICS\\(VE203)\\\ \\\ \\\ \\\ \\\ \\\ \\\ \\\ \\\ \\\ \\\
ASSIGNMENT 3\\\ \\\ \\\ \\\ \\\ \\\ }
\author{Name: Pan Chongdan\\ID: 516370910121}
\date{Date: \today}

\begin{document}
\maketitle
\newpage
\section{Q1}
Assume $A=\{x\in L|x\preceq f(x)\}$, then $\forall x\in A,x\preceq f(x)\preceq f(f(x))$. Let $y=\vee A\Rightarrow f(y)=\vee A\Rightarrow y=f(y)$ Since $X\subseteq A$,$y$ is the greatest upper bound in $X$. Similarly, there exists $z$ is the least lower bound in $X$.
\par $\forall i\in I(x_i\in f(x))$,let $B=\{x\in L|\forall i\in I(x_i\preceq f(x)\preceq x)\}.$
Assume $u=\wedge B,\forall x\in B,u\preceq x\Rightarrow f(u)\preceq f(x)\preceq x\Rightarrow f(u)\preceq u$.
\par $\forall x_i$ which is the lower bound of $B,x_i\preceq u,x_i\preceq u\Rightarrow x_i=f(x_i)\preceq f[f(u)]\preceq f(u)\preceq u,\therefore u\in B\Rightarrow u\preceq f(u)\Rightarrow u=f(u)\Rightarrow u\in X.\forall x_i,u$ is the least upper bound,similarly, we can find the greatest lower bound,so $(x,\preceq)$ is a complete lattice.
\par$f=2xsin(8x)$, it has 4 points of intersection with the graph of $y=x$ during the interval [0,1].
\begin{figure}[H]
\centering
\includegraphics[scale=0.75]{P1.jpg}
\end{figure}
\section{Q2}
Let $f:\mathbb{N}\times\mathbb{N}\rightarrow\mathbb{N}$ defined by
$$f(x,y)=x^2+2y(x\geq y)$$
$$f(x,y)=2x+1+y^2(x<y)$$
So $f(0,0)=0,f(1,0)=1,f(0,1)=2,f(1,1)=3,f(2,0)=4,f(2,1)=5...$
\\$\therefore$ f is an injection and $|\mathbb{N}\times\mathbb{N}|\leq|\mathbb{N}|$ and $\mathbb{N}\times\mathbb{N}$ is countable.
\par Since Cantor function Function is bijection,so its inverse function satisfies $|\mathbb{N}\times\mathbb{N}|\geq|\mathbb{N}|$
$\therefore|\mathbb{N}\times\mathbb{N}|=|\mathbb{N}|$
\section{Q3}
\begin{enumerate}[(i)]
\item Since every natural number has a unique factorisation into primes, assume $f={(0,a_0),(1,a_1)...(n,a_n)}$. n means the $(n+1)_{th}$ prime and $a_n$ is (n+1)'s power-1.
\\For example, assume $f={(0,0),(1,1)}\rightarrow 2^{(0+1)}*3^2=18$,so there exists a function g:$S\rightarrow\mathbb{N}\setminus\{0,1\},$which is countable because $\mathbb{N}\setminus\{0,1\}\subset\mathbb{N}$.
$\therefore S$ is countable and $|S|\leq|\mathbb{N}|$.
\par There also exists a injection from $\mathbb{N}\rightarrow S,n\rightarrow\{(0,0),(1,1),(2,2)...(n,n)\}$, so $|\mathbb{N}|=|S|$
\item $f\preceq_1 f$ because $\forall i\in A((f(i)=f(i))\wedge([n]=[n])),\therefore (S,\preceq)$ is symmetric.
\par Assume $f\preceq_1 g$ and $\forall i\in A((f(i)=g(i))\wedge([n]\preceq_1[m]))$, it's clearly $g\npreceq_1 f$ because $\forall i\in A((f(i)=g(i))$and$([n]\nsubseteq[m]))$.
\\Assume $f\preceq_1 g$ and $(\exists i\in A)(f(i)<g(i)\wedge(\forall j<i)(f(i)=g(j)))$ then the $i_g$ satisfying $g\preceq f$ is bigger than $i$, but $g(i)\neq f(i)\therefore (S,\preceq_1)$ is antisymmetric.
\par Assume $(f\preceq_1 g$ with $j=j_1)\wedge(g\preceq_1 h$ with $j=j_2)$ and $h:[k]\rightarrow \mathbb{N}$,then$f\preceq_1 h$ with $j_=$min$\{j_1,j_2\}\therefore(S,\preceq_1)$ is transitive and it's a partial order.
\\It's a linear order as long as we choose $i$ as 0, then $\forall f,g$ has such relationship.
\\It;s also a well order because I can find the least element as $\{(0,0)\}$
\\It's not a chain complete or a lattice because $f=\{(0,1),(1,2),(2,5)\},g=\{(0,5),(1,3),(2,4)\}$\\$,{f,g}$ doesn't have a upper bound.
\item$\because (f(i)=f(i))\wedge ([n]=[n])\therefore f\preceq_2 f$
\\Assume $(f\preceq_2 g)\wedge([n]\subset[m])$ then $g\npreceq_2 g$ because $[m]\nsubseteq[m]$.
\\Assume $f\preceq_2 g$ and $g\preceq_2 h:[k]\rightarrow \mathbb{N}$ then $f\preceq_2 h$ because $([n]\subseteq[m]\subseteq[k])\wedge(f(i)\leq g(i)\leq h(i))$
\\$\therefore (S,\preceq_2)$ is a partial order.
\\It's not a linear order if $f={(0,1),(1,5)},g={(0,5),(1,2)}$ then they have no relationship.
\\It's not a chain complete because the chain may not have a upper bound.
\\$\forall f,g\in S,f=\{(0,a_0),(1,a_1)...(n,a_n)\}$ and $g=\{(0,b_0),(1,b_1)...(m,b_m)\}$.\\Let $c_n=$max$(a_n,b_n)$,$d=$max$(m,n)$, then $h=\{(0,c_0),(1,c_1)...(d,c_d)\}$ is the least upper bound.
\\Similarly, I can find the greatest lower bound,so it's a complete lattice.
\end{enumerate}
\section{Q4}
$$f(x,y,z)=\frac{1}{2}(\pi(x,y)+z)(\pi(x,y)+z+1)+z$$
\section{Q5}
\begin{enumerate}[(i)]
\item
$\forall A,B,C\in X,A\subseteq A,$ so $(X,\subseteq)$ is reflexive.
\\if $A\subseteq B,$ since $A\neq B\therefore B\nsubseteq A$, so$(X,\subseteq)$ is antisymmetric.
\\if $A\subseteq B,B\subseteq C,$ then $A\subseteq C$, so$(X,\subseteq)$ is transitive.
\\$\therefore(X,\subseteq)$ is a partial order.
\\if $A=\{(1,2),(2,3)\}, B=\{(1,3),(2,4)\}$ then $A\nsubseteq B$ and $B\nsubseteq A$, so $(X,\subseteq)$ is not a linear order.
\\$A$ and $B$ don't have a greatest lower bound, so $(X,\subseteq)$ is not a lattice.
\\$(X,\subseteq)$ is chain complete because $\forall A\in X$,if $A$ is a linear order, then$\vee A$ is the least upper bound.
\item $\forall f_1,f_2\in X$, if $f_1\preceq f_2$ and $f_1=\{(a_1,b_1),(a_2,b_2)...(a_n,b_n)\},f_2=\{(a_1,b_1)...(a_n,b_n)...(a_m,b_m)\}$
\\$(m>n)$
\\$g_1=\{(a_1,b_1+1),(a_2,b_2+1)...(a_n,b_n+1)\},g_2=\{(a_1,b_1+1)...(a_n,b_n+1)...(a_m,b_m+1)\}$
\\$\therefore g_1\preceq g_2\Rightarrow\phi_1$ is order preserving and it  has a fixed point when $f=\emptyset$.
\item Assume $f_1=\{(1,1),(2,2)\},f_2=\{(1,1),(2,2),(3,3)\}$, so $ f_1,f_2\in X$ and $f_1\preceq f_2 $. Then $g_1=\{(0,0),(1,1),(2,2),(3,0),(4,0)...\},g_2=\{(0,0),(1,1),(2,2),(3,3),(4,0)...\}$
\\$g_1\npreceq g_2\Rightarrow\phi_2$ is not order preserving and it doesn't has a fixed point because $f_n\neq g_n$.
\item  Assume $f_1=\{(1,1),(2,2)\},f_2=\{(1,1),(2,2),(3,3)\}$, so $ f_1,f_2\in X$ and $f_1\preceq f_2 $. Then $g_1=\{(1,0),(2,2),(3,3),(4,0),...\},g_2=\{(1,0),(2,2),(3,3),(4,4),(5,0)...\}$
\\$g_1\npreceq g_2\Rightarrow\phi_3$ is not order preserving.
\\If $f=\{(1,0),(2,1),(3,2),...(n,n-1)...\}$,then $g=\{(1,0),(2,1),(3,2),...(n,n-1)...\}$
\\So it has a fixed point.
\item$X$ is not countable.
\par $\forall M\in P(\mathbb{N}),M=\{N_0,N_1,N_2...\},$ there exists function $f: P(\mathbb{N})\rightarrow X$ such that $f(M)=\{(N_0,0),(N_1,0),(N_2,0)...\}$
\\Since $N_0\neq N_1 \neq N_2,f(M)$ is a function $\in X$ and $f$ is a injection$\therefore|P(\mathbb{N})|\leq X$
\\$\because |\mathbb{N}|<|P(\mathbb{N})|\therefore |\mathbb{N}|<|X|$ and X is uncountable.
\end{enumerate}
\section{Q6}
Since every non-zero rational number can be represented in the form	$\frac{(-1)^ka}{b}$ where $k\in{0,1}$ and $a,b\in \mathbb{N}$ with $a,b\neq0$ and the greatest common divisor of a and b is 1, let $Q=f(a,b,k)$ and assume $0=f(0,1,0)$, so there exists an injection $f:\mathbb{Q}\rightarrow\mathbb{N}\times\mathbb{N}\times\{0,1\}$
\par Note that the cardinality of the range of $f$ is actually smaller than $|\mathbb{N}\times\mathbb{N}\times\{0,1\}|$ because the greatest common divisor of a and b
is 1.
\\$\therefore |\mathbb{Q|}\leq|\mathbb{N}\times\mathbb{N}\times\{0,1\}|\leq|\mathbb{N}\times\mathbb{N}\times\mathbb{N}|=|\mathbb{N}|$,so $\mathbb{Q}$ is countable.
\\Since $\mathbb{N}\subset\mathbb{Q}$, there also exists an injection $g: \mathbb{N}\rightarrow \mathbb{Q},g(x)=x$, so $|\mathbb{N}|\leq|\mathbb{Q}|$
\\$\therefore|\mathbb{N}|=|\mathbb{Q}|$
\section{Q7}
$\frac{x(x+1)}{2}\leq223+1\Rightarrow x<21$,since $223=\frac{20*21}{2}+13$
\\$\therefore x+y=20,x=7,y=13$
\end{document}


\documentclass[12pt,preprint]{aastex}
\usepackage{geometry}                % See geometry.pdf to learn the layout options. There are lots.
\geometry{letterpaper}                   % ... or a4paper or a5paper or ...
%\geometry{landscape}                % Activate for for rotated page geometry
%\usepackage[parfill]{parskip}    % Activate to begin paragraphs with an empty line rather than an indent
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{epstopdf}
\usepackage{hyperref}
\DeclareGraphicsRule{.tif}{png}{.png}{`convert #1 `dirname #1`/`basename #1 .tif`.png}

\title{Planetary Astrophysics: Homework 3}
\author{Samuel Factor}
\date{\today}                                           % Activate to display a given date or no date

\begin{document}
\maketitle
Code for this assignment can be found at \url{https://github.com/sfxfactor/PlanetaryHW3}

\section{Part 1}
The method \texttt{calcF} in \texttt{diskModel} returns the flux density, $F_\nu$, of a star with temperature $T$, radius $R_s$, at a distance of $D_p$. A plot of the flux density of Fomalhaut at orbital radii of 10 and 130 AU is shown in Figure \ref{fig:FomFnu}. Stellar parameters are from \citet{Fom} ($T_\mathrm{eff}=8590$, $R_*=1.842 R_\odot$).

\begin{figure}[htbp]
\begin{center}
\includegraphics[width=0.8\textwidth]{FomFnu.pdf}
    \caption{Flux density of Fomalhaut}
    \label{fig:FomFnu}
\end{center}
\end{figure}

\section{Part 2}
The method \texttt{Pin} in \texttt{diskModel} returns the total power absorbed by a grain of radius $r_g$ [$\mu$m] and in a radiation field with flux density $F_\nu$. It first imports the $Q$ data obtained from the ``Smoothed UV Astronomical Silicate" models found at \url{http://www.astro.princeton.edu/~draine/dust/dust.diel.html} and extrapolates $Q_\mathrm{abs}$ to longer wavelengths with a $1/\lambda^2$ power-law. It then numerically integrates, using the trapezoid rule, Equation \ref{eq:Pin} from $\lambda=1$ cm -- 1 nm, where $r_g$ is now in cgs units. $P_\mathrm{in}$ for different grain sizes, $r_g$ for different orbital radii $D_p$ are given in Table \ref{tab:Pin}.

\begin{equation}
P_\mathrm{in}=\pi r_g^2 \int Q_\mathrm{abs,\nu} F_\nu d\nu
\label{eq:Pin}
\end{equation}

\begin{table}[h]
\begin{center}
    \begin {tabular}{ccc}
    \tableline\tableline
    $r_g$ & $D_p$ [AU] & $P_\mathrm{in}$ [erg s$^{-1}$] \\
    \tableline
    0.1 $\mu$m & 10 & $1.46\times10^{-5}$\\
    1 $\mu$m & 10 & $6.25\times10^{-3}$\\
    10 $\mu$m & 10 & $6.61\times10^{-1}$\\
    1 mm & 10 & $7.13\times10^{3}$\\
    0.1 $\mu$m & 130 & $8.66\times10^{-8}$\\
    1 $\mu$m & 130 & $3.70\times10^{-5}$\\
    10 $\mu$m & 130 & $3.91\times10^{-3}$\\
    1 mm & 130 & $4.22\times10^{1}$\\
    \tableline
\end{tabular}
    \caption{$P_\mathrm{in}$ for Fomalhaut}\label{tab:Pin}
\end{center}
\end{table}

\section{Part 3}
The method \texttt{Teq} in \texttt{diskModel} returns the equilibrium temperature of a grain of radius $r_g$ [$\mu$m] and incident power $P_\mathrm{in}$. Similar to \texttt{Pin}, it first imports the $Q$ data and extrapolates $Q_\mathrm{abs}$ to longer wavelengths with a $1/\lambda^2$ power-law. It then finds $T$ such that Equation \ref{eq:Teq}, where $B_\nu$ is the Planck function, is satisfied, using \texttt{scipy.optimize.root}. Again the integration uses the trapezoid rule. The luminosity of each grain is then simply equal to the input power given in Table \ref{tab:Pin}.

\begin{equation}
P_\mathrm{in}-4\pi^2 r_g^2 \int_{\lambda=1~\mathrm{cm}}^{\lambda=1~\mathrm{nm}} Q_\mathrm{abs,\nu} B_\nu(T) d\nu =0
\label{eq:Teq}
\end{equation}

The method \texttt{calcFQ} in \texttt{diskModel} returns the flux density, $F_\nu$ of a grain with temperature $T$, radius $r_g$, at a distance (from the observer) of D. Figures \ref{fig:Fnu10AU} and \ref{fig:Fnu130AU} show the flux density of a given set of grains at orbital radii of 10 and 130 AU, respectively, around Fomalhaut at a distance of 7.7 pc \citep{Fom}. The general trends of the flux densities make sense: smaller grains are fainter, as they have less surface area, but are hotter, as they are less like black-bodies.

%\subsection{}

\begin{figure}[htbp]
\begin{center}
\includegraphics[width=0.8\textwidth]{Fnu10AU.pdf}
    \caption{Flux density of grains at 10 AU around Fomalhaut.}
    \label{fig:Fnu10AU}
\end{center}
\end{figure}

\begin{figure}[htbp]
\begin{center}
\includegraphics[width=0.8\textwidth]{Fnu130AU.pdf}
    \caption{Flux density of grains at 130 AU around Fomalhaut.}
    \label{fig:Fnu130AU}
\end{center}
\end{figure}

\section{Part 4}
An SED of Fomalhaut from \citet{SED} is shown in Figure \ref{fig:SED}. By scaling the peak flux density of the SED of a single grain up to the full SED, we can estimate the number of grains in the disk. If we then assume a density of 2 g cm$^{-3}$ we can also calculate a rough disk mass. These values are given in Table \ref{tab:mass}. Based on the peak of the spectrum and slope of the long wavelength emission, the qualitative best fit grain size for the 10 and 130 AU belt is 1 mm and 10 $\mu$m, respectively.

\begin{figure}[htbp]
\begin{center}
\includegraphics[width=0.5\textwidth]{apj455657f8_hr.jpg}
    \caption{SED of the two component disk around Fomalhaut from \citet{SED}.}
    \label{fig:SED}
\end{center}
\end{figure}

\begin{table}[h]
\begin{center}
    \begin {tabular}{cccc}
    \tableline\tableline
    $r_g$ & $D_p$ [AU] & $N$ & $M_\mathrm{dust}$ [g] \\
    \tableline
    0.1 $\mu$m & 10 & $5\times10^{26}$ & $4\times10^{12}$\\
    1 $\mu$m & 10 & $1\times10^{24}$ & $1\times10^{13}$\\
    10 $\mu$m & 10 & $9\times10^{21}$ & $7\times10^{13}$\\
    1 mm & 10 & $1\times10^{18}$ & $8\times10^{15}$\\
    0.1 $\mu$m & 130 & $9\times10^{29}$ & $7\times10^{15}$\\
    1 $\mu$m & 130 & $2\times10^{27}$ & $2\times10^{16}$\\
    10 $\mu$m & 130 & $6\times10^{24}$ & $5\times10^{16}$\\
    1 mm & 130 & $8\times10^{20}$ & $7\times10^{18}$\\
    \tableline
\end{tabular}
    \caption{Number of Grains and Dust Mass in Fomalhaut}\label{tab:mass}
\end{center}
\end{table}

\section{Part 5}
Since we have already calculated the power absorbed by each grain it is simple to calculate the force due to radiation pressure ($F_\mathrm{rad}=P_\mathrm{in}/c$) and Poynting-Robertson drag ($F_\mathrm{pr}=P_\mathrm{in}\sqrt{GM_*/D}/c^2$, where $D$ is the orbital radius and $M_*$ is the mass of the central star). If we define $\beta=F_\mathrm{rad}/F_\mathrm{grav}$, we can calculate the characteristic timescale, $\tau$ in years, for dust grains to be removed from the system from Equation \ref{eq:time}, where $r$ is the initial orbital radius in AU and $M_*$ is the mass of the central star in $M_\odot$ \citep{beta}. These values are given in Table \ref{tab:forces}.

\begin{equation}
\tau=400\frac{r^2}{\beta M_*}
\label{eq:time}
\end{equation}

\begin{table}[h]
\begin{center}
    \begin {tabular}{cccccc}
    \tableline\tableline
    $r_g$ & $D_p$ [AU] & $F_\mathrm{rad}$ [dyn] & $F_\mathrm{pr}$ [dyn] & $\beta$ & $\tau$ [yr] \\
    \tableline
    0.1 $\mu$m & 10 & $4.9\times10^{-16}$ & $2.1\times10^{-20}$ & 5.1 & $4.1\times10^{3}$\\
    1 $\mu$m & 10 & $2.1\times10^{-13}$ & $9.1\times10^{-18}$ & 2.2 & $9.5\times10^{3}$\\
    10 $\mu$m & 10 & $2.2\times10^{-11}$ & $9.6\times10^{-16}$ & 0.23 & $9.0\times10^{4}$\\
    1 mm & 10 & $2.4\times10^{-7}$ & $1.0\times10^{-11}$ & $2.5\times10^{-3}$ & $8.4\times10^{6}$\\
    0.1 $\mu$m & 130 & $2.9\times10^{-18}$ & $3.5\times10^{-23}$ & 5.1 & $6.9\times10^{5}$\\
    1 $\mu$m & 130 & $1.2\times10^{-15}$ & $1.5\times10^{-20}$ & 2.2 & $1.6\times10^{6}$\\
    10 $\mu$m & 130 & $1.3\times10^{-13}$ & $1.6\times10^{-18}$ & 0.23 & $1.5\times10^{7}$\\
    1 mm & 130 & $1.4\times10^{-9}$ & $1.7\times10^{-14}$ & $2.5\times10^{-3}$ & $1.4\times10^{9}$\\
    \tableline
\end{tabular}
    \caption{Number of Grains and Dust Mass in Fomalhaut}\label{tab:forces}
\end{center}
\end{table}

\bibliographystyle{apj}
\bibliography{sources}

\end{document}