%!tex root=thesis.tex
\chapter{Machine Learning on Crowds}
\label{cha:ml}

In this chapter we will discuss machine learning. While we introduce a number of
concepts that will help us develop our cross-identification method, we will not
yet apply these concepts to astronomical data, instead deferring this to Chapter
\ref{cha:cross-identification}.

In Section \ref{sec:classification}, we introduce the problem of classification,
and discuss some common methods of approach. We will later base our
cross-identification methods on these.

In Section \ref{sec:image-feature-extraction}, we look at automated feature
extraction from images. Convolutional neural networks will be introduced as
feature extractors, which we will eventually apply to radio data from ATLAS.

In Section \ref{sec:crowdsourcing}, we discuss the benefits and problems of
crowdsourcing for obtaining labels for machine learning. Finally, we will look
at different ways to handle the problems in Section \ref{sec:crowd-labels}.

\section{Classification}
\label{sec:classification}

    A common machine learning task is \emph{classification}. Given a set
    $\mathcal X$ of \emph{instances} and a set $\mathcal Y$ of \emph{labels},
    the classification task is to assign a label $y \in \mathcal Y$ to each
    instance $x \in \mathcal X$. Effectively, we want to find a map $y :
    \mathcal X \to \mathcal Y$.

    The ``true'' label of an instance is called the \emph{groundtruth}, and is
    denoted $z$. Classification thus amounts to modelling the conditional
    distribution $p(z \mid x)$. An example of classification is labelling images
    of digits, where $\mathcal X$ is a set of images and $\mathcal Y = \{0,
    \dots, 9\}$ \citep{lecun98}. A less obvious example is that of diagnosing
    breast cancer in patients, where $\mathcal X$ is a set of sets of medical
    observations and $\mathcal Y$ is the set $\{\text{malignant},
    \text{benign}\}$ \citep{wolberg90}.

    Modelling $p(z \mid x)$ requires some set of \emph{training data} $\mathcal
    D \subseteq \mathcal X \times \mathcal Y$. The training data are either used
    to find parameters for a model or to estimate the model directly. Both
    processes are called \emph{training} the model. The cardinality of the
    training data is denoted $N = |\mathcal D|$.

    \emph{Binary classification} is classification where each instance must be
    assigned one of two labels, i.e. $\mathcal Y \sim \{0, 1\}$. Instances with
    a true label of $0$ are called \emph{negative instances}, and instances with
    a true label of $1$ are called \emph{positive instances}. For this thesis,
    we will focus entirely on binary classification and set $\mathcal Y = \{0,
    1\}$.

    Instances are usually represented by a vector of \emph{features}, denoted
    $\vec x$. Choosing features is an important and non-trivial part of
    modelling a classification task, and can strongly affect the ability of a
    model to classify instances. The dimensionality of the feature space is
    denoted $D$ and we assume that $\mathcal X \subseteq \mathbb{R}^D$.

    We will now look at how to evaluate a classification model, and introduce
    three common ways of modelling binary classification: logistic regression,
    neural networks, and random forests.

    \subsection{Evaluating a Classification Model}
    \label{sec:evaluating-classification-model}

        Given a classification model $y(\vec x)$ that aims to approximate $p(z
        \mid \vec x)$, we want to know how well this model represents the
        groundtruth. In this thesis we make use of two evaluation metrics:
        cross-entropy error, and balanced accuracy.

        The \emph{cross-entropy error} \citep{bishop06} is a common method for
        evaluating a binary classification model. The cross-entropy error is
        given by
        \[
            L(\mathcal D) = -\frac{1}{N} \sum_{\vec x, z \in \mathcal D} \left(
                z \log y(\vec x) + (1 - z) \log (1 - y(\vec x))
            \right).
        \]
        Higher error indicates a ``worse'' model.

        The \emph{balanced accuracy} is another common method of evaluating
        classification models. It is the average of the accuracy of classifying
        positive instances and the accuracy of classifying negative instances,
        i.e.
        \[
            a = \frac{1}{2} \left(\frac{p_{\text{true}}}{p} + \frac{n_{\text{true}}}{n}\right),
        \]
        where $p$ is the number of instances with $z = 1$, $n$ is the number of
        instances with $z = 0$, $p_{\text{true}}$ is the number of correctly
        classified instances with $z = 1$, and $n_{\text{true}}$ is the number
        of correctly classified instances with $z = 0$.

        Unless otherwise specified, we use the cross-entropy error for training
        our models, and report the balanced accuracy.

    \subsection{Logistic Regression}
    \label{sec:logistic-regression}

        Logistic regression is a simple linear model of binary classification
        \citep{bishop06}. The conditional distribution $p(z \mid \vec x)$ is
        modelled as
        \begin{equation}
            \label{eq:logistic-regression}
            y(\vec x) = p(z = 1 \mid \vec x) = \sigma(\vec w^T \vec x + b),
        \end{equation}
        where $\vec w$ and $b$ are parameters to the model and $\sigma$ is the
        logistic sigmoid function
        \[
            \sigma(t) = \frac{1}{1 + \exp(-t)}.
        \]
        The elements of $\vec w$ are called the \emph{weights}, and control the
        effect of each feature on the output label probability. $b$ is the
        \emph{bias}, a constant added to all weighted sums of features
        independent of the features themselves. $b$ can be incorporated into
        $\vec w$ by adding an extra feature to $\vec x$ that is always $1$ and
        increasing the dimension of $\vec w$ by 1. We will adopt this convention
        whenever $b$ is not explicitly included.

        Logistic regression is one of the simplest models we can make, and is
        the classification analogue of linear regression. We can think of it as
        a linear function with a ``soft'' threshold, with all output values
        above the threshold approaching $1$ and all other outputs approaching
        $0$. The logistic sigmoid function causes this threshold effect. While
        we could instead use a step function, a differentiable function like the
        logistic sigmoid function means that logistic regression will be
        differentiable.

        Since logistic regression is differentiable, \emph{gradient descent} can
        be used to find optimum values of $\vec w$. $\vec w$ is modified by the
        update equation
        \[
            \vec w_{t+1} = \vec w_{t} - \lambda \nabla L(\vec w_{t}),
        \]
        where $L : \mathbb{R}^D \to \mathbb{R}$ is the \emph{loss} function,
        $\lambda \in (0, 1)$ is the \emph{learning rate}, and $t$ is the current
        step. This update is repeated until convergence.

        The loss function represents how well the current model fits the
        observations. For binary classification, this is usually given by the
        cross-entropy error with gradient \citep{bishop06}
        \[
            \nabla L(\vec w) = -\frac{1}{N}
                \sum_{\vec x, z \in \mathcal D} \left(z - y(\vec x)\right) \vec x.
        \]

    \subsection{Neural Networks}
    \label{sec:neural-networks}

        One key limitation of logistic regression is that it is a linear model.
        This means that the decision boundary is a hyperplane in the feature
        space, and thus logistic regression can only classify data with classes
        that are linearly separable. In general, classes may not be linearly
        separable, so logistic regression may not be able to accurately model
        the classification task. One way to improve logistic regression
        performance on non-linearly separable classes is to introduce a
        nonlinear \emph{feature map} $\vec\phi : \mathbb{R}^D \to \mathbb{R}^F$
        to transform the inputs. Logistic regression then becomes
        \[
            y(\vec x) = \sigma(\vec w^T \vec\phi(\vec x)).
        \]
        By judicious choice of feature transformations, the features may be
        transformed into a space where the classes are linearly separable. This
        raises a question: Which feature map should we choose?

        We can approximate the feature map by a simple linear function, i.e.
        \[
            \vec\phi(\vec x) = \vec\sigma(A \vec x),
        \]
        where $\vec\sigma(\vec v)$ is $\sigma$ applied elementwise to $\vec v$.
        The weight matrix $A$ can then be learned by gradient methods along with
        $\vec w$. This approximation itself has drawbacks --- perhaps a linear
        function is not powerful enough to approximate a good choice of feature
        map --- but we can resolve this by applying another nonlinear
        transformation to $\vec x$, arbitrarily many times. This leads to a new
        model with multiple weights $A_1, \dots, A_k$:
        \begin{align*}
            y(\vec x) &= \sigma(\vec w^T \vec\phi_1(\vec x))\\
            \vec\phi_1(\vec x) &= \vec\sigma(A_1 \vec\phi_2(\vec x))\\
            &\vdots\\
            \vec\phi_K(\vec x) &= \vec\sigma(A_K \vec x).
        \end{align*}
        This is a \emph{$K$-layer neural network}, so called as it resembles
        the structure of neurons in the brain. Such a network is able to
        approximate any function with sufficiently large dimensionality of the
        matrices $A_i$ \citep{gybenko89}.

        While we have viewed neural networks here as a very natural extension
        to logistic regression, the class of neural network models is far more
        varied. Interpreting each element in $\vec x, \vec \phi_K, \dots, \vec
        \phi_1$ as a node and the elements of $A_K, \dots, A_1, \vec w$ as
        weighted edges, we can interpret the above neural network as a directed
        acyclic graph (Figure \ref{fig:nn-as-dag}). In this context, each column
        of the graph is called a \emph{layer}. If the layer is fully connected
        to its inputs and outputs, then it is called a \emph{dense layer}. We
        may also introduce different kinds of layers performing arbitrary
        nonlinear functions; some examples of these will be covered in Section
        \ref{sec:convolutional-neural-networks}.

        \begin{figure}
            \centering
            \begin{tikzpicture}[scale=0.5, node distance=2.5cm]
                \tikzstyle{neuron}=[
                    circle, draw, minimum size=20pt, inner sep=0pt]
                \tikzstyle{connector}=[->, arrows={-latex}, black!50]
                \foreach \name / \y in {1, ..., 5}
                    \node [neuron] (I-\name) at (0, -\y*2) {$x_\y$};

                \foreach \name / \y in {1, ..., 6}
                    \node [neuron] (P1-\name)
                        at (5, -\y*2 + 1) {$\phi_{2, \y}$};

                \foreach \name / \y in {1, ..., 3}
                    \node [neuron] (P2-\name)
                        at (10, -\y*2 - 2) {$\phi_{1, \y}$};

                \node [neuron] (y) at (15, -6) {$y$};

                \foreach \source in {1, ..., 5}
                    \foreach \dest in {1, ..., 6}
                        \path [connector] (I-\source) edge (P1-\dest);

                \foreach \source in {1, ..., 6}
                    \foreach \dest in {1, ..., 3}
                        \path [connector] (P1-\source) edge (P2-\dest);

                \foreach \source in {1, ..., 3}
                    \path [connector] (P2-\source) edge (y);
            \end{tikzpicture}
            \caption{A 2-layer neural network represented as a directed acyclic
                graph.}
            \label{fig:nn-as-dag}
        \end{figure}

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

        A \emph{decision tree} is a classifier that classifies by repeatedly
        dividing the feature space. Generating the tree proceeds as follows. The
        tree itself is a binary tree of decisions. The input space is split
        along one feature axis, giving two subtrees with one less dimension.
        This is then recursively applied to the subtrees until each leaf of the
        tree contains less than a given number of examples or until there are no
        more features to split on. The leaf nodes are then labelled with the
        most common label of the elements they contain.

        A \emph{random forest} is a classifier that uses an ensemble of decision
        trees to classify data points \citep{kon16}. A number of decision trees
        are generated, each with a different subset of features and inputs. This
        ensures that the decision trees are different. The random forest then
        classifies by having the decision trees vote on each label, with the
        most common vote being used as the prediction. The probability of this
        label being correct can be estimated as the percentage of decision trees
        in the ensemble that agree with the prediction.

        Random forests are nonlinear classifiers which are resistant to problems of feature scale. This makes them a good off-the-shelf classifier to apply to a generic classification problem.

\section{Feature Extraction from Images}
\label{sec:image-feature-extraction}

    For instances to be input to a classification model, they must be
    represented by vectors of features. Feature selection is generally a hard
    problem, but it may be straightforward if instances are simple vectors of
    measurements (such as in the breast cancer dataset described in Section
    \ref{sec:breast-dataset}). If the instances are provided in the form of
    images, however, feature selection becomes considerably harder.

    \subsection{The Na\"ive Approach}
    \label{sec:naive-approach-image-features}

        Images can be thought of as vectors of pixels, where the value of each
        pixel is treated as an independent feature. If the image is a colour
        image, then each channel (red, blue, and green) of each pixel can be
        treated as an independent feature. This is a very simple way to obtain
        features from images, with two considerable problems.

        \begin{figure}
            \centering
            \begin{subfigure}[t]{0.5\textwidth}
                \centering
                \includegraphics[width=\textwidth]{images/face.png}
            \end{subfigure}%
            ~
            \begin{subfigure}[t]{0.5\textwidth}
                \centering
                \includegraphics[width=\textwidth]{images/face_shuffled.png}
            \end{subfigure}
            \caption{If we ignore the location of pixels when interpreting an
                image as a vector, these two images have identical feature
                vectors, despite the left image clearly containing information
                not present in the right image.}
            \label{fig:shuffled-face}
        \end{figure}

        The first problem is that using pixels directly as independent features
        fails to accurately capture the image. The pixels are assumed
        independent when this is not the case --- neighbouring pixels are likely
        to be correlated, shapes and structure within the image introduce
        further correlations, and so on. If we are only looking at certain kinds
        of images, then the pixel location may also matter --- for example, we
        might have as inputs photographs of landscapes, where the sky tends to
        be at the top of the image --- and this information is also lost. These
        effects are shown in Figure \ref{fig:shuffled-face}. Finally, with
        independent pixels as features, trained models will be sensitive to
        small distortions or translations in the input \citep{lecun98}. In
        Section \ref{sec:convolutions}, we describe a common approach for
        resolving this problem.

        The second problem with this approach is that images tend to be large
        \citep{lecun98}. Taking each pixel as a feature leads to high
        dimensional feature spaces. This is not ideal as many algorithms perform
        poorly in high dimensional spaces. This can be resolved using
        \emph{pooling}, which we describe in Section \ref{sec:pooling}.

    \subsection{Pooling}
    \label{sec:pooling}

        \begin{figure}
            \centering
            \begin{subfigure}[t]{0.5\textwidth}
                \centering
                \includegraphics[width=\textwidth]{images/face.png}
                \caption{Original image.}
                \label{fig:pooling-face-original}
            \end{subfigure}%
            ~
            \begin{subfigure}[t]{0.5\textwidth}
                \centering
                \includegraphics[width=\textwidth]{images/face_max_pooled.png}
                \caption{Max pooling.}
                \label{fig:pooling-face-max}
            \end{subfigure}
            \begin{subfigure}[t]{0.5\textwidth}
                \centering
                \includegraphics[width=\textwidth]{images/face_min_pooled.png}
                \caption{Min pooling.}
                \label{fig:pooling-face-min}
            \end{subfigure}%
            ~
            \begin{subfigure}[t]{0.5\textwidth}
                \centering
                \includegraphics[width=\textwidth]
                    {images/face_average_pooled.png}
                \caption{Average pooling.}
                \label{fig:pooling-face-average}
            \end{subfigure}%
            \caption{Examples of max, min, and average pooling applied to an
                image.}
            \label{fig:pooling}
        \end{figure}

        Pooling is a class of operations that reduce the dimensionality of an
        image, parameterised by a \emph{pool size}\footnote{Another
        parameter is the \emph{stride}, $s$, which we ignore here for simplicity,
        setting $s = p$.}, $p$. Nonoverlapping $p \times p$ squares of pixels are
        condensed into one value, which becomes the corresponding pixel in the
        output. In this way, the size of the image is reduced from $m \times n$
        to $\frac{m}{p} \times \frac{n}{p}$. This results in both a smaller
        amount of data, and some amount of translation invariance when pooling
        is used in models like neural networks \citep{scherer10}.

        We are free to choose whatever aggregation operation we like to condense
        squares of pixels; common choices are $\max$ (called \emph{max pooling})
        and $\mbox{mean}$ (called \emph{average pooling}). Some pooling examples
        are shown in Figure \ref{fig:pooling}.

    \subsection{Convolutions}
    \label{sec:convolutions}

        \begin{figure}
            \centering
            \begin{subfigure}[t]{0.3\textwidth}
                \centering
                \includegraphics[width=\textwidth]{images/face.png}
                \caption{Original image.}
                \label{fig:convolution-face-original}
            \end{subfigure}%
            ~
            \begin{subfigure}[t]{0.3\textwidth}
                \centering
                \begin{minipage}{\textwidth}
                \vspace{-75pt}
                \centering
                $
                    \begin{bmatrix}
                        -1 & 1 & 0 \\
                        -2 & 2 & 0 \\
                        -1 & 1 & 0
                    \end{bmatrix}
                $
                \end{minipage}
                % \includegraphics[width=\textwidth]
                %     {images/convolutional_filter.png}
                \caption{Convolutional filter.}
                \label{fig:convolution-face-filter}
            \end{subfigure}%
            ~
            \begin{subfigure}[t]{0.3\textwidth}
                \centering
                \includegraphics[width=\textwidth]{images/face_convolved.png}
                \caption{Convolved image.}
                \label{fig:convolution-face-convolved}
            \end{subfigure}
            \caption{Convolving an image with a $3 \times 3$ filter gives a new
                image. This filter acts as a kind of vertical edge detector.}
            \label{fig:convolved-face}
        \end{figure}

        A common way to make use of neighbourhood information in images is by
        using \emph{convolutions}. A convolution is an operation that transforms
        an image by applying an $n \times n$ \emph{filter} to each $n \times n$
        square of pixels. The filter is a matrix in $\mathbb{C}^{n \times n}$,
        and it is applied to a square of pixels by treating that square as a
        matrix, performing an elementwise multiplication between the filter
        matrix and the pixel matrix, and summing the result. Applying the filter
        to a square of pixels gives a single pixel value, so by applying the
        filter across the image, a new image is generated \citep{ludwig15}.

        One ambiguity is how to apply a filter to the edges of an image. There
        are multiple ways to resolve this. The most common method is to only
        apply the filter to squares of pixels fully contained within the image,
        making the output image smaller than the input. Another method is to
        apply the filter to the edges and assume that pixels outside the image
        have a constant value (usually 0), making the output image the same size
        as the input. These methods are commonly known as ``valid'' and ``same''
        respectively in libraries such as SciPy and Keras.

        The effect of a simple convolutional filter on an image is shown in
        Figure \ref{fig:convolved-face}, and an algorithm for performing a
        convolution is shown in Algorithm \ref{alg:convolution}.

        \begin{algorithm}
            \KwData{\\\quad{}An image $X \in \mathbb{R}^{m \times n}$%
                    \\\quad{}A filter $F \in \mathbb{C}^{d \times d}$}
            \KwResult{An image $\in
                \mathbb{R}^{(m - d + d \text{ mod } 2) \times
                            (n - d + d \text{ mod } 2)}$}

            Initialise output image $Y \in \mathbb{R}^{(m - d + d \text{ mod } 2) \times (n - d + d \text{ mod } 2)}$\;
            \For{$y \in \lfloor d/2 \rfloor, \dots, m - \lfloor d/2 \rfloor$}{
                \For{$x \in \lfloor d/2 \rfloor, \dots, n - \lfloor d/2 \rfloor$}{
                    $H \leftarrow$ $d \times d$ square of pixels centred on $(x, y)$\;
                    $Y_{y, x} \leftarrow (\vec 1^T (H \odot F) \vec 1) / (\vec 1^T F \vec 1)$\;
                }
            }

            \KwRet{$Y$}
            \caption{One method of performing a convolution. Here, we choose to
                use the ``valid'' method of handling edges, resulting in a
                smaller output than the input. $\odot$ is the elementwise
                matrix product.}
            \label{alg:convolution}
        \end{algorithm}

        By repeatedly applying convolutions and pooling, we can extract features
        from images that would not have been present using the na\"ive approach
        of Section \ref{sec:naive-approach-image-features}.

        % \begin{itemize}
        %     \item CNNs are widely used now that we have a lot of data
        %     \item Robust and require minimal pre-processing (cite 21)
        % \end{itemize}

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

        \begin{figure}
            \centering
            \includegraphics[width=\textwidth]{images/face_cnn.png}
            \caption{A convolutional neural network applied to the top-left
                image. The other images are the outputs of intermediate
                convolutional layers of the neural network, from left to right,
                top to bottom. Colours represent convolutions with different
                filters. The output, bottom-right, is a higher-level
                representation of the input image, and its values can be used
                as inputs for classification. This figure uses
                \citeauthor{baraldi15}'s implementation of the VGG-16 CNN
                \citep{simoyan14}.}
            \label{fig:face-cnn}
        \end{figure}

        While convolutions are needed to extract features from our images, there
        are no convolutions that work well in general. Convolutions must be
        chosen on a domain-dependent basis. This raises the question: Which
        convolutions should we choose?

        One way to answer this question is simply to not choose at all, and
        then learn the appropriate convolutions as part of a larger
        classification model. This gives rise to the concept of a
        \emph{convolutional neural network} (CNN). A CNN is a neural network
        with layers that convolve their inputs and layers that pool their
        inputs, called \emph{convolutional layers} and \emph{pooling layers},
        respectively. Convolutional layers may contain any number of separate
        filters. They are generally interspersed with pooling layers. The final
        layers of the CNN are usually dense layers. Additionally, CNNs introduce
        some amount of translation invariance into their outputs, since the same
        filters are applied across the image \citep{lecun98}.

        CNNs can be used for feature extraction from images. As input, they
        take images to extract features from, and they are tasked with mapping
        these to some meaningful value or the intended output of the greater
        classification problem. The convolutional and pooling layers can then
        be isolated, forming a network that extracts features from images. An
        example of a convolutional neural network applied to an image is shown
        in Figure \ref{fig:face-cnn}.

\section{Crowdsourcing Labels}
\label{sec:crowdsourcing}

    For standard supervised learning tasks, the labels are generally provided by
    some \emph{expert}. We assume that the expert provides labels that are
    correct and accurately represent the groundtruth. More recently, however,
    many projects have \emph{crowdsourced} their labels: Non-expert people (the
    \emph{crowd}) volunteer or are paid to label data. The crowd may be sourced
    from websites like Amazon Mechanical Turk\footnote{\url{http://mturk.com}}
    where small amounts of money are paid on a per-label basis, or they may
    volunteer out of interest in the labelling project.

    Crowdsourcing allows us to quickly and cheaply label large amounts of data.
    This comes at the expense of objectivity and reliability --- since the crowd
    are necessarily non-experts, they do not have domain knowledge for the
    problem, and may not provide high-quality labels \citep{raykar10}. While we
    can try to reduce noise by requesting multiple labellers label each instance
    \citep{lin16, sheng08}, this does not address the fact that the data may be
    intrinsically hard to label, the labellers may be correlated, and some
    labellers may even be actively malicious \citep{yan10}. Some strategies to
    address these problems are described in Section \ref{sec:crowd-labels}.

    % The most obvious advantage of crowdsourcing is that crowds are able to
    % cheaply or quickly label large amounts of data simply because there are so
    % many people labelling. Crowds also allow us to gather labels on a wide
    % range of data

    The form of crowdsourcing we are interested in for this thesis is
    \emph{citizen science}, as this is the form of crowdsourcing that the Radio
    Galaxy Zoo (Section \ref{sec:radio-galaxy-zoo}) uses. Citizen science is
    ``scientific work undertaken by members of the general public''
    \citep{oed-citizenscience, marshall15}, and has recently come to refer
    mainly to websites that allow non-experts to label scientific data. A
    notable example of citizen science is the Galaxy Zoo project
    \citep{lintott08}, which aims to identify morpologies of galaxies from the
    Sloan Digital Sky Survey. Galaxy Zoo has gathered tens of millions of labels
    for nearly $9 \times 10^5$ galaxies from over $8 \times 10^4$ volunteers
    \citep{lintott11}, and the data collected have been used in 48 publications
    so far\footnote{\url{https://www.zooniverse.org/about/publications}}. Many
    other citizen science projects have been hosted on the Galaxy Zoo's
    platform, Zooniverse\footnote{\url{http://zooniverse.org}}, from further
    astronomical studies like the Radio Galaxy Zoo \citep{banfield15} (Section
    \ref{sec:radio-galaxy-zoo}), which itself has labelled over $10^5$ radio
    sources from two radio surveys, to ecological studies like Snapshot
    Serengeti \citep{swanson15}, which has classified nearly 11 million camera
    trap images from Serengeti National Park.

    % Crowdsourcing is not without downsides. Since the crowd necessarily
    % consists of non-experts, there is no longer any guarantee that labels are
    % correct --- indeed, for the Radio Galaxy Zoo, balanced accuracy of
    % individual labellers varies from 40--100\%, with an average of 71\%.
    % Additionally, labels from different labellers may be correlated, different
    % labellers may be better skilled at labelling different kinds of examples,
    % some examples may be intrinsically hard for non-experts to label, and
    % labellers may even be actively malicious in giving incorrect labels
    % \citep{yan11}.

\section{Simulating a Crowd Labelling Task}
\label{sec:crowd-simulation}

    The crowd is inherently unpredictable. This makes it difficult to test
    methods for crowd learning, since there may be biases in existing
    crowd-labelled datasets, and we want our experiments to be both accurate and
    reproducible. To mitigate this problem, we instead simulate a crowd
    labelling task based on a dataset with known groundtruth. In this section,
    we describe our method for simulating a crowd labelling task, which we will
    later employ to test methods in Section \ref{sec:crowd-labels}. As part of
    this thesis, we have also implemented this simulation in Python. The
    implemention is described in Appendix \ref{sec:crowdastro-util}.

    \subsection{The Breast Cancer Wisconsin Dataset}
    \label{sec:breast-dataset}

        % This page formats really awfully due to the algorithm underneath.
        \raggedbottom

        The breast cancer Wisconsin dataset, first used by \citet{wolberg90},
        presents a classification task commonly used for testing classification
        methods. The dataset can be obtained from the UCI Machine Learning
        Repository \citep{lichman13}
        \footnote{\url{https://archive.ics.uci.edu/ml/%
                       datasets/Breast+Cancer+Wisconsin+\%28Original\%29}}.
        The classification task is to, given medical observations of a patient,
        determine if their cancer is benign or malignant. Each instance is a
        10-dimensional feature vector, and there are 699 instances. There is
        some missing data, which we chose to set to 0.

    \subsection{Simulated Labeller Representation}
    \label{sec:simulated-labellers}

        We simulate $T$ labellers. Each labeller is indexed by a number $t$. The
        $t$-th labeller is represented by their \emph{sensitivity} (or \emph{true
        positive rate}) $\alpha_t$, and their \emph{specificity} (or \emph{true
        negative rate}) $\beta_t$, i.e.
        \begin{align*}
            \alpha_t &= p(y_t = 1 \mid z = 1)\\
            \beta_t &= p(y_t = 0 \mid z = 0)
        \end{align*}
        where $y_t$ is the label assigned by the $t$-th labeller to an instance
        with groundtruth $z$.

    \subsection{Obtaining the Simulated Labels}
    \label{sec:obtaining-simulated-labels}

        To generate crowd labels from our $T$ simulated labellers for a dataset
        with $N$ instances, we follow Algorithm \ref{alg:simulated-crowd}.

        \begin{algorithm}[H]
            \KwData{\\\quad{}A set of groundtruth labels $\{z_1, \dots, z_N\}$\\\quad{}A set of labellers $\{(\alpha_1, \beta_1), \dots, (\alpha_T, \beta_T)\}$.}
            \KwResult{A set of crowd labels $\{y_{1, 1}, \dots, y_{T, N}\}$.}

            \For{$i \in 1, \dots, N$}{
                \For{$t \in 1, \dots, T$}{
                    \eIf{$z_i = 1$}{
                        \WithProb{$\alpha_t$}{
                            $y_{t, i} \leftarrow 1$\;
                        }
                        \Else{
                            $y_{t, i} \leftarrow 0$\;
                        }
                    }{
                        \WithProb{$\beta_t$}{
                            $y_{t, i} \leftarrow 0$\;
                        }
                        \Else{
                            $y_{t, i} \leftarrow 1$\;
                        }
                    }
                }
            }
            \KwRet{$\{y_{1, 1}, \dots, y_{T, N}\}$}
            \caption{Simulating a crowd labelling task.}
            \label{alg:simulated-crowd}
        \end{algorithm}

\section{Utilising Crowd Labels}
\label{sec:crowd-labels}

    % There's kind of two things going on here - using multiple labels, and
    % using labels where the groundtruth doesn't exist. I should write about
    % that.

    A common method to combat label noise in crowd learning scenarios is to
    request multiple labels from the crowd for each data point.  There is some
    basis in the literature for such redundancy, with \citet{sheng08} showing
    that repeated labelling may improve label and model quality, though
    \citet{lin14} show that this is not always the case and results depend on
    the level and kind of label noise.

    Nevertheless, this approach is used in existing citizen science projects
    such as Galaxy Zoo \citep{lintott08} and Radio Galaxy Zoo
    \citep{banfield15}, both of which request between 5 and 20 crowd labels for
    each instance.

    This raises the question of how best to make use of multiple labels to train
    classification models. In this section, we look at some methods that
    directly learn a model from multiple noisy labels, as well as some methods
    of aggregating the labels to obtain individual labels with (ideally) lower
    noise.

    \subsection{Majority Vote}
    \label{sec:majority-vote}

        One way to reduce label noise is to allow multiple labellers to label
        the same examples, and then for each example take the \emph{majority
        vote} to find a ``consensus'' label. If the label provided by the $t$-th
        labeller is denoted $y_t$ and there are $T$ labellers, then the
        consensus label is given by
        \begin{equation*}
            y = \begin{cases}
                1 & \frac{1}{T} \sum_{t = 1}^T y_t > 0.5\\
                0 & \frac{1}{T} \sum_{t = 1}^T y_t < 0.5\\
            \end{cases}
        \end{equation*}
        with the remaining case decided evenly at random \citep{raykar10}.

        The idea is that the majority of labels are correct, so with
        sufficiently large amounts of relabelling we expect the label noise to
        be reduced. How large ``sufficiently large'' is is unclear and
        domain-dependent, and is outside the scope of this thesis, though
        \citet{sheng08} and \citet{lin16} provide some information on how to
        choose relabelling rates. Of course, this fails in situations where the
        majority of labellers are not correct, which may be due to intrinsic
        difficulty or malicious labelling, or where there is no clear majority.

        One simple improvement to majority vote is to weight labels by the
        accuracy of the associated labeller, computing these accuracies based on
        some known groundtruth for a subset of the data. However, this requires
        access to the groundtruth for a subset of data, which is not available
        in general.

    \subsection{Raykar et al. Model}
    \label{sec:raykar}

        One way to learn from crowdsourced labels when no groundtruth is
        available is to jointly model both the reliability of each labeller (the
        \emph{labeller model}) and the groundtruth itself (the
        \emph{classification model}). \citet{raykar10} propose such a joint
        model, which we now describe.

        The accuracy of the $t$-th labeller is modelled by the sensitivity
        $\alpha_t$ and the specificity $\beta_t$, as described in Section
        \ref{sec:simulated-labellers}. This model assumes that labeller
        reliability is independent of the example $x$, but dependent on the
        groundtruth label $z$. Note that under this model, the probability that
        labeller $t$ will assign a given label to a positive example is given by
        \begin{equation*}
            p(y_t \mid z = 1, \alpha_t) =
                (\alpha_t)^{y_t} (1 - \alpha_t)^{1 - y_t}
        \end{equation*}
        and the probability that they will assign a given label to a negative
        example is given by
        \begin{equation*}
            p(y_t \mid z = 0, \beta_t) =
                (\beta_t)^{1 - y_t} (1 - \beta_t)^{y_t}.
        \end{equation*}
        For ease of notation, let $\vec \alpha = (\alpha_1, \dots, \alpha_t)$
        and $\vec \beta = (\beta_1, \dots, \beta_t)$.

        With this method, the classification model can be any classifier.
        \citeauthor{raykar10} choose to use logistic regression, i.e.
        \begin{equation}
            \label{eq:raykar-logreg}
            p(z = 1 \mid \vec x, \vec w) = \sigma(\vec w^T \vec x).
        \end{equation}

        The model parameters $\vec \theta = \{\vec w, \vec \alpha, \vec \beta\}$
        can be found by maximising the likelihood. Under the assumption that
        examples are independently sampled and labellers are independent, the
        likelihood is given by
        \begin{align*}
            p(\mathcal D \mid \vec \theta) &=
                \prod_{i = 1}^N
                    \prod_{t = 1}^T
                        p(y_{t, i} \mid \vec x_i, \vec w, \alpha_t, \beta_t)\\
            &\begin{aligned}=
                \prod_{i = 1}^N
                    \prod_{t = 1}^T
                        &\bigg[p(y_{t, i} \mid z_i = 1, \alpha_t)
                            p(z_i = 1 \mid \vec x_i, \vec w)\\
                        &+ p(y_{t, i} \mid z_i = 0, \beta_t)
                            p(z_i = 0 \mid \vec x_i, \vec w)\bigg].
             \end{aligned}
        \end{align*}
        Since there are unknown values $z$, the maximum likelihood problem must
        be solved using expectation-maximisation. This has closed-form solutions
        for $\vec \alpha$ (Equation \ref{eq:raykar-alpha}) and $\vec \beta$
        (Equation \ref{eq:raykar-beta}), but gradient methods must be used for
        finding $\vec w$.

        $\mu_i$ is initialised with majority vote, i.e.
        \begin{equation*}
            \mu_i = \frac{1}{T} \sum_{t = 1}^T y_{t, i}.
        \end{equation*}
        The expectation step requires us to compute
        \begin{align*}
            a_i &= \prod_{t = 1}^T
                (\alpha_t)^{y_{t, i}} (1 - \alpha_t)^{1 - y_{t, i}}\\
            b_i &= \prod_{t = 1}^T
                (\beta_t)^{1 - y_{t, i}} (1 - \beta_t)^{y_{t, i}}\\
            \mu_i &\propto
                \frac{a_i \sigma(\vec w^T \vec x_i)}
                     {a_i \sigma(\vec w^T \vec x_i) +
                      b_i (1 - \sigma(\vec w^T \vec x_i))}.
        \end{align*}
        The maximisation step requires us to compute
        \begin{align}
            \label{eq:raykar-alpha}
            \alpha_t &= \frac{\sum_{i = 1}^N \mu_i y_{t, i}}
                             {\sum_{i = 1}^N \mu_i}\\
            \label{eq:raykar-beta}
            \beta_t &= \frac{\sum_{i = 1}^N (1 - \mu_i) (1 - y_{t, i})}
                            {\sum_{i = 1}^N (1 - \mu_i)}
        \end{align}
        and find the $\vec w$ that maximises the likelihood using gradient
        methods. In our implementation of this algorithm, we initialised $\vec
        w$ using logistic regression trained on the majority vote, and then used
        the old $\vec w$ to initialise each subsequent maximisation step.

        As part of this thesis, we have produced an open source implementation
        of this algorithm, described in Appendix \ref{sec:crowdastro-raykar}. We
        then performed a series of experiments using this implementation, which
        are detailed here.

        \subsubsection{Testing the Raykar Classifier}

            \begin{figure}
                \centering
                \includegraphics[height=0.3\textheight]
                    {images/experiments/raykar.pdf}
                \caption{Performance of the \citeauthor{raykar10} classifier
                    against logistic regression (LR) on a simulated crowd
                    labelling of the breast cancer dataset \citep{wolberg90}.
                    Spread along the vertical axis represents results over
                    multiple trials; the bar represents the mean.}
                \label{fig:raykar}
            \end{figure}

            We first used the implementation to perform a simple, simulated
            crowd labelling problem. Five simulated labellers were assigned true
            positive and false positive rates uniformly distributed in the range
            $[0.25, 0.75]$. Each simulated labeller labelled 50\% of the breast
            cancer dataset (Section \ref{sec:breast-dataset}). Random samples of
            75\% of the examples were drawn 20 times and used to train both the
            \citeauthor{raykar10} classifier and a logistic regression
            classifier (using majority vote for the labels). To help find a good
            set of parameters, the \citeauthor{raykar10} classifier was
            retrained 5 times with random initial conditions, and the classifier
            attaining the highest likelihood was selected. Both logistic
            regression and \citeauthor{raykar10} classifiers were tested against
            the groundtruth of the remaining 25\%. The results are plotted in
            Figure \ref{fig:raykar}. The Raykar classifier attained a balanced
            accuracy of $(58 \pm 8)\%$ and the logistic regression classifier
            attained a balanced accuracy of $(56
            \pm 8)\%$.

            From this experiment, we can see that the \citeauthor{raykar10}
            algorithm performs comparably to logistic regression, even under
            high noise. However, training a logistic regression classifier on
            the majority vote is far simpler and faster, even in an idealised
            scenario where labeller noise is exactly modelled by the
            \citeauthor{raykar10} model. This may be an artefact of the
            expectation-maximisation algorithm, which is never guaranteed to
            converge to a global maximum. If so, then increasing the number of
            random restarts may improve results, at the cost of increased
            training time.

        \subsubsection{The Effect of Class Imbalance}

            \begin{figure}
                \centering
                \includegraphics[width=0.8\textwidth]
                    {images/experiments/raykar_class_balance_ba}
                \caption{Performance of the \citeauthor{raykar10} classifier on
                    a simulated labelling problem with different class
                    imbalance. Spread along the vertical axis represents results
                    over multiple trials; the bar represents the mean.}
                \label{fig:raykar-class-balance-ba}
            \end{figure}

            \begin{figure}
                \centering
                \includegraphics[width=0.8\textwidth]
                    {images/experiments/raykar_class_balance}
                \caption{Output $\alpha$ and $\beta$ values of the
                    \citeauthor{raykar10} classifier on a simulated labelling
                    problem with different class imbalance. Spread along the
                    vertical axis represents results for multiple labellers over
                    multiple trials; the bar represents the mean.}
                \label{fig:raykar-class-balance-ab}
            \end{figure}

            The second experiment tested the effect of class imbalance on the
            resulting balanced accuracy of the classifier, as well as on the
            predicted $\alpha$ and $\beta$ for each labeller. We used
            scikit-learn's \texttt{sklearn.datasets.make\_classification}
            function \citep{scikit-learn} to generate datasets with
            5-dimensional features (of which 3 were informative, and 2 were
            redundant) with a class separation of 1 and 1\% of true labels
            randomly flipped. We generated five datasets, each with 1000
            examples, with different ratios of negative to positive examples.
            The ratios were $4:1$, $2:1$, $1:1$, $1:2$, and $1:4$. We then
            simulated a crowd labelling task as in Section
            \ref{sec:crowd-simulation}, assigning 10 labellers true positive and
            false positive rates uniformly at random in the interval $[0.5,
            0.9]$ and allowing them to ``label'' the examples. The same
            labellers were used across all trials and datasets. We ran the
            \citeauthor{raykar10} algorithm on each dataset and recorded the
            balanced accuracy and output $\alpha$ and $\beta$ values for each
            trial and dataset. We repeated this experiment 5 times. The
            resulting balanced accuracies are plotted against the ratios of
            negative to positive examples in Figure
            \ref{fig:raykar-class-balance-ba}, and the estimated $\alpha$ and
            $\beta$ values are plotted against the ratios in Figure
            \ref{fig:raykar-class-balance-ab}.

            The balanced accuracy is similarly distributed across all trials,
            with a slight decrease as classes grow more unbalanced. The
            estimated $\alpha$ and $\beta$ values are also similar across all
            trials. This shows that our implementation of the
            \citeauthor{raykar10} algorithm is not sensitive to class imbalance.

        \subsubsection{The Effect of Label Noise}

            \begin{figure}
                \centering
                \includegraphics[width=\textwidth]
                    {images/experiments/raykar_noise}
                \caption{Output $\alpha$, $\beta$, and balanced accuracy of the
                    \citeauthor{raykar10} classifier on a simulated labelling
                    problem with different amounts of label noise. ``Estimated
                    $\alpha$'' refers to the value of $\alpha$ output by the
                    algorithm, and $\alpha$ refers to the groundtruth. Filled
                    areas represent the standard deviation of multiple
                    measurements.}
                \label{fig:raykar-noise}
            \end{figure}

            The final experiment was to determine the effect of label noise on
            the performance and output of the algorithm. 10 labellers were
            simulated with $\alpha$ ranging from $0.2$ to $1.0$ and $\beta$
            fixed at $1.0$. A dataset was generated as for the previous
            experiment (but with balanced classes), the labellers were tasked
            with labelling this dataset, and the labels were used to train the
            algorithm. The balanced accuracy and $\alpha$ values were recorded.
            This experiment was repeated $5$ times, and repeated again with
            $\beta$ replacing $\alpha$. The results are shown in Figure
            \ref{fig:raykar-noise}.

            As expected, the balanced accuracy increases as label noise
            decreases, and the output $\alpha$ and $\beta$ closely match the
            true values. This shows that our implementation of the
            \citeauthor{raykar10} algorithm is able to recover the noise
            parameters of our simulated labellers.

    \subsection{Yan et al. Model}
    \label{sec:yan}

        A similar approach is described by \citet{yan10}, again jointly learning
        the groundtruth and labeller models. Unlike \citeauthor{raykar10}, the
        \citeauthor{yan10} labeller model is data-dependent. The accuracy of the
        $t$-th labeller is modelled by a Bernoulli distribution of $\eta_t(\vec
        x)$, parametrised as a logistic regression function $\eta_t(\vec x) =
        \sigma(\vec \omega_t^T \vec x + \gamma_t)$. The labeller model is thus
        \begin{equation*}
            p(y_t \mid \vec x, z, \vec \omega_t, \gamma_t) =
                \eta_t(\vec x)^{1 - |y_t - z|} (1 - \eta_t(\vec x))^{|y_t - z|}.
        \end{equation*}
        For ease of notation, let $\Omega = (\vec \omega_1^T, \dots,
        \vec \omega_T^T)$ and let $\vec \gamma = (\gamma_1, \dots, \gamma_T)$.
        This model can be obtained from the \citeauthor{raykar10} model by
        requiring $\alpha_t = \beta_t = \eta_t(\vec x)$ and allowing these
        parameters be data-dependent.

        As with \citeauthor{raykar10}, the classification model can be any
        classifier and \citeauthor{yan10} choose to use logistic regression
        (Equation \ref{eq:raykar-logreg}). The parameters $\vec \theta =
        \{\Omega, \vec \gamma, \vec w\}$ can be found by maximising the
        likelihood with expectation-maximisation. Under the assumptions that
        examples are independently sampled and that the labellers are
        independent, the likelihood is given by
        \begin{align*}
            p(\mathcal D \mid \vec \theta)
                &= \prod_{i = 1}^N \prod_{t = 1}^T
                    p(y_{t, i} \mid \vec x_i, \vec w, \Omega, \vec \gamma)\\
                &= \prod_{i = 1}^N \prod_{t = 1}^T \sum_{z = 0}^1
                    p(y_t \mid \vec x_i, z, \vec \omega_t, \gamma_t)
                    p(z \mid \vec x_i, \vec w).
        \end{align*}
        The expectation step requires us to compute
        \[
            \mu_i \propto \prod_{t = 1}^{T}
                p(y_{t, i} \mid \vec x_i, z_i = 1, \vec \omega_t, \gamma_t)
                p(z_i = 1 \mid \vec x_i, \vec w).
        \]
        The maximisation step requires us to maximise
        \begin{equation*}
            \sum_{i = 1}^N \sum_{t = 1}^T \sum_{z_i = 0}^1
                p(z_i \mid \vec x_i, \vec w) (
                    \log p(y_{t, i} \mid \vec x_i, z, \vec \omega_t, \gamma_t) +
                    \log p(z \mid \vec x_i, \vec w))
        \end{equation*}
        with respect to $\vec w, \Omega,$ and $\vec \gamma$, where $p(z_i \mid
        \vec x_i, \vec w)$ is fixed to use the previous value of $\vec w$.

        As part of this thesis, we have produced an open source implementation
        of this algorithm, described in Appendix \ref{sec:crowdastro-yan}. After
        the algorithm was implemented, we found it to be considerably slower
        than the \citeauthor{raykar10} algorithm, so we do not use it later in
        this thesis. Its inclusion in this thesis is to show that the
        expectation-maximisation approach can be extended by choice of labeller
        model.

        \begin{figure}
            \centering
            \begin{subfigure}{\textwidth}
                \centering
                \includegraphics[width=0.9\textwidth]
                    {images/experiments/yan_25pc_noise.pdf}
                \caption{$\upsilon = 75\%$}
                \label{fig:yan-experiment-low-noise}
            \end{subfigure}
            \begin{subfigure}{\textwidth}
                \centering
                \includegraphics[width=0.9\textwidth]
                    {images/experiments/yan_75pc_noise.pdf}
                \caption{$\upsilon = 25\%$}
                \label{fig:yan-experiment-high-noise}
            \end{subfigure}
            \caption{\citeauthor{yan10} algorithm compared with logistic
                regression trained on the majority vote (LR) and logistic
                regression trained on the groundtruth (LR(Groundtruth)).
                Labellers have an accuracy of $\upsilon$ when not in
                their cluster of expertise. Points represent different trials.}
        \end{figure}

        The \citeauthor{yan10} algorithm is good for modelling labellers with
        highly feature-dependent noise. To test the algorithm, we employed it on
        the breast cancer Wisconsin dataset (Section \ref{sec:breast-dataset}),
        but using a different simulation of labellers to that used for the
        \citeauthor{raykar10} tests of Section \ref{sec:raykar}. While the
        method for generating simulated crowd labels was similar, the labeller
        model differed to show the ability of the \citeauthor{yan10} model to
        handle feature-dependent noise. Instead of using two values $\alpha$ and
        $\beta$ to describe each labeller, we clustered the data and assigned
        each labeller one cluster. The labeller had $100\%$ accuracy for that
        cluster, and a fixed accuracy $\upsilon$ for all other clusters, giving
        each labeller a ``cluster of expertise''. We tested with low noise
        ($\upsilon = 0.75$) and high noise ($\upsilon = 0.25$). The results are
        compared with logistic regression trained on the majority vote and
        logistic regression trained on the groundtruth in Figure
        \ref{fig:yan-experiment-low-noise} and Figure
        \ref{fig:yan-experiment-high-noise} for low and high noise,
        respectively.

        From these plots, we can tell that with low noise, logistic regression
        is able to learn a high quality model from the majority vote, while the
        \citeauthor{yan10} model performs more poorly. While it is possible for
        the \citeauthor{yan10} model to reduce to logistic regression, this is
        evidently not guaranteed in practice. This may be due to the difficulty
        of the expectation-maximisation problem, which is never guaranteed to
        converge to a global maximum in general. When noise is high, however,
        the \citeauthor{yan10} algorithm considerably outperforms logistic
        regression, indicating that in situations with high, feature-dependent
        noise, the \citeauthor{yan10} algorithm may be a good choice of
        classification algorithm. However, this choice of labeller model may not
        be ideal with large numbers of labellers. There are $ND$ parameters, so
        the expectation-maximisation algorithm may converge considerably slower
        and the number of local minima may quickly increase with increasing
        numbers of labellers.


\documentclass[12pt]{article}  %%%,twocolumn is too scrunched. decrease margin, increase column seperation

%%%
%%% Composition of formulas for MST Qualifying Exam
%%% All mistakes are mine, all work is cited by Author
%%% Creative Commons:
%%% Attribution-Noncommercial-Share Alike 3.0 Unported
%%% http://creativecommons.org/licenses/by-nc-sa/3.0/
%%%

\usepackage{verbatim} %%% multi-line comments
\usepackage[pdftitle={equations for the qualifying exam}, pdfauthor={Ben Payne}, pdfsubject={equations}, pdfkeywords={maxwell, lagrange}]{hyperref}
\usepackage{times}

%%% AMS packages and font files
\usepackage{amsmath} %%% necessary for gathered equations
\usepackage{amsfonts}
%%% For figures
%%%\usepackage[dvipdfm,colorlinks=true]{hyperref}
\usepackage[dvips]{graphicx}
\usepackage[usenames,dvipsnames]{color}
\usepackage{setspace}

%%% screws up the paragraph formatting
%%%\raggedright

\begin{comment}
\setlength{\topmargin}{-.5in}
\setlength{\textheight}{9.5in}
\setlength{\oddsidemargin}{0in}
\setlength{\textwidth}{6.5in}
\end{comment}
\setlength{\topmargin}{-1in}
\setlength{\textheight}{10in}
\setlength{\oddsidemargin}{-.5in}
\setlength{\textwidth}{7.5in}

%%% Commonly used macros
%%% from https://facetsproject.org/facets/browser/trunk/docs/gsdocs/nondimtf2hall.tex
\newcommand{\pfrac}[2]{\frac{\partial #1}{\partial #2}}
\newcommand{\pfraca}[1]{\frac{\partial}{\partial #1}}
\newcommand{\pfracb}[2]{\partial #1/\partial #2}

\def\includeSchaums{T}
\def\qualifyingyear{F}

\setlength{\columnsep}{.5in}
\begin{document}
%%%\twocolumn
%%% or you can put it in \documentclass[11pt,twocolumn]{article}

%%% don't hyphenate so much - default = 200, max (never hyphenate) = 10,000
\hyphenpenalty=800

\title{Physics equations}
\author{Ben~Payne\footnote{Electronic address: ben.is.located@gmail.com}}
%%%\affiliation{Department~of~Physics, Missouri~University~of~Science~\&~Technology, Rolla,~MO~65409}
\date{\today}

\thispagestyle{empty}  %%% hides page number of the title page
\pagestyle{empty} %%% no page numbers on the following pages
%%%\begin{abstract}
%%%equations for the qualifying exam
%%%\end{abstract}

version 0.64, 20090308

%%% http://clarku.edu/~djoyce/trig/identities.html
\if\includeSchaums T
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{coordinate systems}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
(from cover of \cite{GriffithED}.) Most can be found in Schaum's.
%%%\begin{comment}
 the following is in Schaum's, pg 120
\subsection{cartesian}
%%%\Huge
\begin{equation}
dV = 	dx\cdot dy\cdot dz
\label{eq:cartesian_dV}
\end{equation}
%%%\normalsize
gradient:
%%%\Huge
\begin{equation}
\vec{\nabla} t = \widehat{x} \pfrac{t}{x}  + \widehat{y} \pfrac{t}{y} + \widehat{z} \pfrac{t}{z}  %%% can't seem to get \hat to work
\label{eq:cartesian_gradient}
\end{equation}
%%%\normalsize
divergence (equ 1.40, page 17 \cite{GriffithED})
%%%\Huge
\begin{equation}
 \vec{\nabla} \cdot v = \pfrac{v_x}{x} + \pfrac{v_y}{y} + \pfrac{v_z}{z}
\label{eq:cartesian_divergence}
\end{equation}
%%%\normalsize
laplacian
\begin{equation}
\nabla^2 f = \pfrac{^2 f}{x^2} + \pfrac{^2 f}{y^2} + \pfrac{^2 f}{z^2}
\label{eq:cartesian_laplacian}
\end{equation}
%%%\end{comment}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{spherical}

\begin{equation}
dV = 	r^2 \ \sin \theta \ dr \ d\theta \ d\phi
\label{eq:spherical_dV}
\end{equation}

page 40, \cite{GriffithED}
\begin{equation}
  d \vec{a} = \hat{r} \ r^2 \sin \theta \ d\theta \ d\phi
\end{equation}

\begin{equation}
\vec{\nabla} = \hat{r}\pfraca{r}+ \hat{\theta}\frac{1}{r}\pfraca{\theta}+\hat{\phi}\frac{1}{r\sin\theta}\pfraca{\phi}
\label{eq:spherical_gradient}
\end{equation}

%%%\begin{comment}
 Schaum's, pg 126
laplacian. See \htmladdnormallink{planetMath laplacian rectangualr to cartesian}{http://planetmath.org/encyclopedia/DerivationOfTheLaplacianFromRectangularToSphericalCoordinates.html}
and \htmladdnormallink{planetMath laplacian}{http://planetmath.org/?method=l2h&from=collab&id=76&op=getobj}
(equ 3.53, page 137 \cite{GriffithED})
\begin{equation}
\nabla^2 f = {1 \over r^2} {\partial \over \partial r}  \left( r^2 {\partial f \over \partial r} \right)
+ {1 \over r^2 \sin \theta} {\partial \over \partial \theta}  \left( \sin \theta {\partial f \over \partial \theta} \right)
+ {1 \over r^2 \sin^2 \theta} {\partial^2 f \over \partial \phi^2}
\label{eq:spherical_laplacian}
\end{equation}
%%%\end{comment}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{cylindrical}

\begin{equation}
dV = 	s \ ds \ d\phi \ d\theta
\label{eq:cylindrical_dV}
\end{equation}

\begin{equation}
\vec{\nabla} = \hat{s}\pfraca{s} + \hat{\phi}\frac{1}{s} \pfraca{\phi} + \hat{z}\pfraca{a}
\label{eq:cylindrical_gradient}
\end{equation}

%%%\begin{comment}
\begin{equation}
\nabla^2 f = {1 \over \rho} {\partial \over \partial \rho}  \left( \rho {\partial f \over \partial \rho} \right)
+ {1 \over \rho^2} {\partial^2 f \over \partial \theta^2} + {\partial^2 f \over \partial z^2 }
\label{eq:cylindrical_laplacian}
\end{equation}
%%%\end{comment}
\fi
\section{formulas}

material in this section can NOT be found in Schaum's \htmladdnormallink{mathematical handbook of formulas}{http://site.ebrary.com/lib/umr/Doc?id=10015341}, which is allowed on the day of the exam.
%%%\begin{comment}
 Schaum's, 123 \\
Stoke's thm (equ 1.57, page 34 \cite{GriffithED})
\begin{equation}
\int_{surface} (\vec{\nabla}\cdot\vec{v})\cdot d\vec{a} = \oint_{volume}\vec{v}\cdot d\vec{l}
\label{eq:stokesThm}
\end{equation}
%%%\end{comment}

Greene's thm (equ 1.56, page 31 \cite{GriffithED})
\begin{equation}
\int_{volume}(\vec{\nabla}\cdot\vec{v}) d\tau = \oint_{surface} \vec{v}\cdot d\vec{a}
\label{eq:greenesThm}
\end{equation}

Taylor series expansion is in Schaum's, but the easy approximation is not. (assuming small x)
\begin{equation}
(1+x)^n \approx 1 + n x
\label{eq:TaylorSeriesApprox}
\end{equation}

%%%\begin{comment}
 in Schuam's \\
Taylor series expansion
%%% \begin{widetext} %%% not recognized
%%%\begin{multicols}{2}%%% not recognized
\begin{equation}
f(x) = f(a) + f'(x)|_a (x-a) + \frac{1}{2!} f''(x)|_a (x-a)^2 + \cdots
\label{eq:TaylorSeries}
\end{equation}
%%%\end{multicols}%%% not recognized
%%%\end{widetext} %%% not recognized
%%%\end{comment}

\section{Math}
\begin{equation}
\left[ \begin{array}{cc}
  \cos \theta & \sin \theta \\
-\sin \theta  & \cos \theta \\
 \end{array} \right]
\left[ \begin{array}{c}
A_x\\
A_y
\end{array}\right]
=
\left[ \begin{array}{c}
A_{x'}\\
A_{y'}
\end{array}\right]
\end{equation}
\begin{center}
 \includegraphics[scale=0.3]{pictures/coordinate_rotation}
\end{center}

Variance
\begin{equation}
(\Delta A)^2 = \langle A^2 \rangle - \langle A \rangle^2
\end{equation}

Quadratic equation
\begin{equation}
 x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}
\end{equation}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Electromagnetics} %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Maxwell equations} %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% see http://hyperphysics.phy-astr.gsu.edu/HBASE/electric/maxeq.html
See also page 22, \cite{ReifThermo}; page 2, \cite{JacksonED} \\
%%%\begin{align} %%% utilizes the "&"
\underline{Faraday}'s law (equation 7.16, page 302, \cite{GriffithED})
\begin{equation}
  \vec{\nabla}\times \vec{E} = -\pfrac{\vec{B}}{t}
  \label{eq:maxwellEcurl}
\end{equation}

\underline{Ampere}'s law (equation 5.54, page 225 and equation 5.44, page 222 \cite{GriffithED})
\begin{equation}
  \vec{\nabla}\times \vec{B} =  \mu_0\vec{J}+\frac{1}{c^2}\pfrac{\vec{E}}{t}
  \label{eq:maxwellBcurl}
\end{equation}
where
\begin{equation}
 c = \frac{1}{\sqrt{\epsilon_0 \mu_0}}
\end{equation}

\underline{Gauss}'s law, electricity (equation 2.14, page 69 \cite{GriffithED})
\begin{equation}
  \vec{\nabla}\cdot\vec{E} = \frac{\rho}{\varepsilon_0}
  \label{eq:maxwellEdiv}
\end{equation}

\underline{Guass}'s law, magnetism (equation 5.48, page 223 \cite{GriffithED})
\begin{equation}
  \vec{\nabla}\cdot\vec{B} = 0
  \label{eq:maxwellBdiv}
\end{equation}
%%%\end{align}
Integral forms:

flux of electric field (equation 2.11, page 67 \cite{GriffithED})
\begin{equation}
\Phi_E = \int_{any\ surface} \vec{E} \cdot d\vec{a}
\end{equation}

\underline{Gauss}'s law, electricity. (equation 2.13, page 68 \cite{GriffithED})
\begin{equation}
  \oint_{closed\ surface} \vec{E}\cdot d\vec{a} = \frac{Q_{enclosed}}{\epsilon_0}
	\label{eq:GaussLaw}
\end{equation}

\underline{Faraday}'s Law (equation 7.18, page 306 \cite{GriffithED})
\if\qualifyingyear T
(2008 A3)
\fi
\begin{equation}
  \oint \vec{E} \cdot d\vec{l} = - \frac{d\Phi _B}{dt}
	\label{eq:Faraday_law}
\end{equation}

\underline{Ampere}'s law (equation 5.55, page 225 and 5.42, page 222 \cite{GriffithED})
\if\qualifyingyear T
(2008 A3)
\fi
\begin{equation}
  \oint \vec{B} \cdot d\vec{l} = \mu_0 I_{enclosed}
	\label{eq:Ampere}
\end{equation}

\underline{Ampere}'s law (page 306, \cite{GriffithED})
\begin{equation}
  \oint \vec{B} \cdot d\vec{l} = \mu_0 I_{enclosed} + \mu_0 \epsilon_0 \int \left( \frac{d}{dt}\vec{E}\right) \cdot d\vec{a}
	\label{eq:Ampere_large}
\end{equation}

\underline{Lorentz} force law (equation 5.2, page 204 \cite{GriffithED}). Also equation 1-61, page 22 \cite{GoldsteinCM}
\begin{equation}
\vec{F} = q (\vec{E} + \vec{v}\times \vec{B})
\end{equation}

%%%%%%%%%%%%%%%%%%%%%% end maxwell %%%%%%%%%%
\subsection{general EM}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

equation 1-62, page 22 \cite{GoldsteinCM}
\begin{equation}
\vec{B} = \vec{\nabla} \times \vec{A}
\end{equation}

Coulomb's Law
\begin{equation}
\vec{F} =\frac{1}{4\pi \epsilon _{0} } \frac{q_{1} q_{2} }{r^{2} } \hat{r}
\end{equation}
 where $q_{2} $ is the test charge

\begin{equation}
\vec{E}=\frac{1}{4\pi \epsilon_0} \int_v \frac{\rho}{r^2} d \tau \hat{r}
\end{equation}

electric displacement (see also eq \ref{eq:electricDisplacementwithPolarization})
\begin{equation}
\vec{D} = \epsilon_0 \vec{E}
	\label{eq:electricDisplacement}
\end{equation}

Electric field due to point charge (equation 2.4, page 60 \cite{GriffithED})
\begin{equation}
\vec{E} = \frac{1}{4 \pi \epsilon_0} \sum_i \frac{q_i}{r_i^2} \hat{r}_i
%%%\label{eq:another}
\end{equation}

electrostatic potential (equ 2.21, page 78 and equ 7.10, page 293\cite{GriffithED})
\begin{equation}
V = - \int^r_{\infty} \vec{E}\cdot d\vec{l}
%%%\label{eq:another}
\end{equation}

electric field and electrostatic potential (equation 2.23, page 78,  \cite{GriffithED})
\begin{equation}
  \vec{E} = -\vec{\nabla}V
	\label{eq:electric_field_potential}
\end{equation}

electrostatic potential (equation 2.27, page 84 \cite{GriffithED})
\begin{equation}
 V = \frac{1}{4 \pi \epsilon_0} \sum_i \frac{q_i}{r_i}
\end{equation}

electrostatic potential (equation 2.29, page 84 \cite{GriffithED})
\begin{equation}
 V = \frac{1}{4 \pi \epsilon_0} \int \frac{\rho}{r} d \tau
\end{equation}

work (equation 2.42, page 92  \cite{GriffithED})
\begin{equation}
  W = \frac{1}{2} \sum q_i V(r_i)
%%%\label{eq:}
\end{equation}

work and electrostatic potential (equ 2.45, page 94 \cite{GriffithED})
\begin{equation}
  W = \frac{\epsilon_0}{2} \int_{all space} E^2 d \tau
\label{eq:work_in_electric_field}
\end{equation}

surface charge density and electrostatic potential (where $n$ is the normal direction \\ (equation 2.49, page 102  \cite{GriffithED})
\begin{equation}
\sigma = -\epsilon_0 \frac{\partial V}{\partial n}
\label{eq:surfacechargedensity}
\end{equation}

equation 2.48, page 102 \cite{GriffithED}
\begin{equation}
\vec{E} = \frac{\sigma}{\epsilon} \hat{n}
\end{equation}

electric displacement, including polarization (equ 4.21, page 175 \cite{GriffithED})
(see also eq \ref{eq:electricDisplacement})
\begin{equation}
\vec{D} = \epsilon_0 \vec{E} + \vec{P}
\label{eq:electricDisplacementwithPolarization}
\end{equation}

work and electrostatic potential (equ 2.55, page 106, \cite{GriffithED})
\begin{equation}
  W = \frac{1}{2} C V^2
	\label{eq:workCapacitor}
\end{equation}

electrostatic potential due to a monopole (equation 3.97, page 149  \cite{GriffithED})
\begin{equation}
V_{monopole} = \frac{1}{4 \pi \epsilon_0} \frac{Q}{r}
\end{equation}

electrostatic potential due to a dipole (equation 3.99, page 149  \cite{GriffithED})
\begin{equation}
V_{dipole} = \frac{1}{4 \pi \epsilon_0} \frac{\vec{p}\cdot \hat{r}}{r^2}
\end{equation}

where dipole moment (which points from the (-) charge to the (+) is \\
(equation 3.98, page 149  \cite{GriffithED}) (equation 3.100, page 150  \cite{GriffithED})
\begin{equation}
\vec{p} = \int \vec{r} \; ' \rho ( \vec{r}\;' ) d \tau \;' = \sum_i q_i r_i
\end{equation}

Note: $E_{dipole}$, equation 3.104, page 155; is given on 2002 B10,
but as a derivation (see also problem 3.33).

Torque ($N$) is on a dipole ($\vec{p}=q\vec{d}$) due to E field (equation 4.4, page 164, \cite{GriffithED})
\begin{equation}
\vec{N} = \vec{p} \times \vec{E}
\end{equation}

potential energy of a dipole (problem 4.7) (equation 4.6, page 165, \cite{GriffithED})
\begin{equation}
U = -\vec{p} \cdot \vec{E}
\end{equation}

Similarly for magnetic moment ($\vec{\mu} = (\vec{I} \cdot \vec{A})\hat{n}$) \\
(equation 6.1, page 257, \cite{GriffithED})
\begin{equation}
\vec{N} = \vec{\mu} \times \vec{B} \\
\end{equation}

potential energy (equation 6.34, page 281, \cite{GriffithED})
\begin{equation}
U = -\vec{\mu} \cdot \vec{B}
\end{equation}

force due to magnetic field (equ 5.16, page 205 \cite{GriffithED})
\if\qualifyingyear T
(1997 A4)
\fi
\begin{equation}
 F_{magnetic} = I \int d\vec{l} \times \vec{B}
\end{equation}

(equ 6.31, page 275 \cite{GriffithED})
\begin{equation}
 \vec{B} = \mu \vec{H}
\end{equation}

(equ 6.32, page 275 \cite{GriffithED})
\if\qualifyingyear T
(2009 A)
\fi
\begin{equation}
 \mu = \mu_0 (1+\chi_m)
\end{equation}

(equ 7.3, page 285 \cite{GriffithED})
\begin{equation}
 \vec{J} = \sigma \vec{E}
\end{equation}

flux (equ 7.12, page 295 \cite{GriffithED})
\if\qualifyingyear T
(1997 A4, 2009 A)
\fi
\begin{equation}
 \Phi = \int \vec{B} \cdot d\vec{a}
\end{equation}

work (equ 7.29, page 317 \cite{GriffithED}). Used in problems 7.26, 7.27.
\if\qualifyingyear T
(2008 A3)
\fi
\begin{equation}
  W = \frac{1}{2} L I^2
	\label{eq:work_self_inductance}
\end{equation}

work (equ 7.34, page 317 \cite{GriffithED})
\if\qualifyingyear T
(2009 A)
\fi
\begin{equation}
  W = \frac{1}{2 \mu_0} \int_{all space} B^2 d \tau
	\label{eq:work_in_magnetic_field}
\end{equation}

flux, inductance (equ 7.25, page 313 \cite{GriffithED})
\if\qualifyingyear T
(2009 A)
\fi
\begin{equation}
 \Phi = L I
\end{equation}

Power (equ 8.11, page 347 \cite{GriffithED}), positive on page 349
\begin{equation}
  Power = \int \vec{S} \cdot d\vec{a}
	\label{eq:power_fields}
\end{equation}

total potential energy in a field (equation 8.5, page 346 \cite{GriffithED}) (combines \ref{eq:work_in_magnetic_field} and \ref{eq:work_in_electric_field})
\begin{equation}
U_{em} = \frac{1}{2} \int ( \epsilon_0 E^2 + \frac{1}{\mu_0} B^2 ) d \tau
\end{equation}

Poynting vector (equation 8.10, page 347 \cite{GriffithED})
\begin{equation}
  \vec{S} = \frac{1}{\mu} \vec{E}\times\vec{B}
	\label{eq:Poynting_vector}
\end{equation}

Power and Poynting vector (equation 8.11, page 347 \cite{GriffithED})
\begin{equation}
P = \frac{dW}{dt} = - \frac{dU_{em}}{dt}- \oint \vec{S} \cdot d\vec{a}
\end{equation}

\subsection{circuits}

capacitance (equ 2.53, page 104, \cite{GriffithED})
\begin{equation}
  C \equiv \frac{Q}{V}
\end{equation}

\begin{equation}
 P=I^2 R
\end{equation}

\begin{equation}
 V=IR
\end{equation}

Power and electrostatic potential ($P=I^2 R$ can be derived from $V=IR$) \\
(equation 7.7, page 290, \cite{GriffithED})
\begin{equation}
  Power = I V
	\label{eq:power_current}
\end{equation}

circuit sum (equation 7.4, page 290, \cite{GriffithED}) [resistor, capacitor, inductor]
\begin{equation}
V = IR + \frac{Q}{C} + L \frac{dI}{dt}
\end{equation}
 \begin{center}
  \includegraphics[scale=0.3]{pictures/V_R_C_L}
 \end{center}

\begin{equation}
I = \frac{dQ}{dt}
\end{equation}

capacitance, A is the area, d is the seperation (equation 2.54, page 105 \cite{GriffithED})
\begin{equation}
C = \frac{A \epsilon_0}{d}
\end{equation}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{relativity}

Lorentz factor, [$\gamma > 1$](equation 12.6, page 486 \cite{GriffithED})
\begin{equation}
\gamma = \frac{1}{\sqrt{1-(\frac{v}{c})^2}}
\label{eq:gamma}
\end{equation}
\if\qualifyingyear T
GIVEN on 2008 A1, not given on 2001 A6\\
\fi
 total relativistic energy for free particle (equation 12.55, page 551 \cite{GriffithED})
\begin{equation}
  E = \sqrt{m^2 c^4 + p^2 c^2}
	\label{eq:relativistic_energy}
\end{equation}

\begin{equation}
  E = \gamma m c^2
	\label{eq:Einsteins_energy}
\end{equation}

relativistic momentum (equation 2-7, page 71 \cite{TiplerMP})
\if\qualifyingyear T
\\
2001 A5 d
\fi
\begin{equation}
  p = \gamma m v
  \label{eq:relativistic_momentum}
\end{equation}

\subsection{EM concepts}
\begin{itemize}
	\item hollow charged conductors have no interior electric field (page 97, \cite{GriffithED})
	\item solid evenly-charged spheres have linearly increasing electric field inside;
	outside E field falls of as $\frac{1}{r^2}$
	\item potential of a charge falls off as $\frac{1}{r}$
	\item length contraction, time dilations (chapter 12, \cite{GriffithED})
	\item images above an $\infty$ grounded conducting plane $\rightarrow$ use method of images
	(section 3.2, see also problem 4.6 in \cite{GriffithED})
	\item changing electric field induces a magnetic field (page 323, \cite{GriffithED})
	\item magnetic forces do no work (page 207, \cite{GriffithED})
	\item $E_{tangential}$ is continuous, $E_{normal}$ is discontinuous
	\item to solve Laplace's equation ($\nabla^2 V = 0$) with V specified on the
	boundaries, use seperation of variables (Chapter 3, \cite{GriffithED})
	\item magnetic forces do no work (page 207, \cite{GriffithED})
\end{itemize}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Thermodynamics}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
most generally, specific heat is
\begin{equation}
C_x = \frac{dQ}{dT}|_x
\end{equation}
where x is the variable that is held constant.
\begin{equation}
 \frac{1}{T} = \pfrac{S}{E} |_v
\end{equation}
Then from equation  $5 \cdot 6 \cdot 1$ page 164; page 153; \cite{ReifThermo}
\begin{equation}
T \cdot dS = dE + p \cdot dV
\label{eq:TdS}
\end{equation}
solve for $dE$, which is $dQ$, and hold V constant to get \\
specific heat, constant volume;
\if\qualifyingyear T
given on 2002 A6
\fi
\begin{equation}
C_V = \pfrac{E}{T}|_v
\end{equation}
using the definition of enthalpy, add $d(pV)$ to Eq.~\ref{eq:TdS} to get
\begin{equation}
dH = T \cdot dS + V \cdot dp
\end{equation}
and hold pressure p constant to get \\
specific heat, constant pressure
\begin{equation}
C_p = \pfrac{H}{T}|_p
\end{equation}
\begin{equation}
 C_P = C_V + N K_{Boltzmann} = C_V + \nu R
\end{equation}
$C_P > C_V$ always
\begin{equation}
 pV = \nu R T
\end{equation}
where $\nu$ is the number of moles, $\frac{N}{N_{Av}}$ and $R=N_{Av} K_{Boltzmann}$.

equations $3 \cdot 3 \cdot 12$; $3 \cdot 11 \cdot 6$, page 123; \cite{ReifThermo}
\if\qualifyingyear T
 \\
given on 2002 B6, 2006 A6
\fi
\begin{equation}
S = k \ln \Omega
\end{equation}

ideal gas; relating average pressure, Volume, Temperature (equations  $3 \cdot 12 \cdot 8$ page 125; $7 \cdot 2 \cdot 8$ page 241; \cite{ReifThermo})
\begin{equation}
\overline{p} V = N k_{Boltzmann} T
\end{equation}
$pV = nRT$ \\
ideal gas; relating to average Kinetic energy
\begin{equation}
\overline{p} V = \frac{2}{3} N \overline{K}
\end{equation}

where number density $ n = \frac{N}{V}$ is number of molecules per volume.

mean kinetic energy per particle; applies to fluids in closed systems
\begin{equation}
\overline{K} = \frac{3}{2} k_{boltzmann} T
\end{equation}

partition function for a single particle (equation $6 \cdot 5 \cdot 3$ page 213; \cite{ReifThermo})
\if\qualifyingyear T
\\
given 2002 A6
\fi
\begin{equation}
z \equiv \sum_r^\infty e^{-\beta E_r}
\end{equation}
and total partition function $Z = z^{3N}$ \\
partition function and energy (equation $6 \cdot 5 \cdot 4$ page 213; \cite{ReifThermo})
\if\qualifyingyear T
\\
given 2002 A6
\fi
\begin{equation}
E = - \frac{\partial (\ln Z)}{\partial \beta} |_V
\end{equation}

Fermi-Dirac distribution  (equation $9 \cdot 3 \cdot 14$ page 341; \cite{ReifThermo}) \\
mean occupation number; number of particles with energy $\epsilon_s$
\begin{equation}
n = \frac{1}{e^{\alpha + \beta \epsilon_s} +1}
\end{equation}

Bose-Einstein distribution  (equation $9 \cdot 3 \cdot 22$ page 342; \cite{ReifThermo})
\begin{equation}
n = \frac{1}{e^{\alpha + \beta \epsilon_s}-1}
\end{equation}
since when the exponent is 0, then $n \rightarrow \infty$, so all the particles form a BEC.\\
Maxwell-Boltzmann distribution  (equation $9 \cdot 4 \cdot 7$ page 345; \cite{ReifThermo})
(see also page 133, \cite{TiplerMP})
\begin{equation}
n = N \frac{ e^{-\beta \epsilon_s }}{ \sum_r e^{-\beta \epsilon_r} }
\end{equation}

\subsection{Thermodynamics concepts}
\begin{itemize}
	\item good review of basics on page 122 of \cite{ReifThermo}, including the laws
	\item second law: $\Delta S \geq 0$
	\item classical equipartition theorm: each squared term of the Hamiltonian
	has $E=\frac{1}{2}k_b T$ \\ (equation $7 \cdot 5 \cdot 7$ page 249; \cite{ReifThermo})
	\item entropy is maximum for a closed, isolated system at equilibrium
	\item all states are equally probable. Equilibrium is the most probable configuration -- the largest number of states sharing the same configuration
\end{itemize}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Classical Mechanics}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
the ``basics:'' \\
Force and potential energy, (page 20, \cite{GoldsteinCM})
\begin{equation}
\vec{F} = - \vec{\nabla} V
\end{equation}
\begin{equation}
 T = \frac{1}{2} I \omega^2
\end{equation}

for circular motion, tangential velocity is
\begin{equation}
v = \omega r
\end{equation}
and centripital acceleration (also circular motion)
\if\qualifyingyear T
(2009 A)
\fi
\begin{equation}
\frac{v^2}{R}
\end{equation}

Angular momentum $\vec{L}$
\begin{equation}
\vec{L} = \vec{r} \times \vec{p}
\end{equation}

Torque $\vec{N}$
\begin{equation}
 \vec{N} = \vec{r}\times \vec{F} = \pfrac{\vec{L}}{t}
\end{equation}

Force $F$, potential $V$, momentum $p$
\begin{equation}
 \vec{F} = -\vec{\nabla} V = \pfrac{p}{t}
\end{equation}

\begin{equation}
\begin{gathered}
F_{spring} = -k \ x \\
V_{spring} = \frac{1}{2}k \ x^2
\end{gathered}
\end{equation}

\subsection{Lagrange's Equations of Motion}

kinetic energy (cartesian, cylindrical)
\begin{equation}
T = \frac{1}{2} m v^2 = \frac{1}{2} m ( \dot{x}^2 + \dot{y}^2 + \dot{z}^2) =
\frac{1}{2} m (\dot{r}^2 + r^2 \dot{\theta}^2 + \dot{z}^2)
\end{equation}

Lagrangian
$L=L\left( q_{j} ,\dot{q} _{j} ,t\right) =T-U$ (equation 1-56, page 20 \cite{GoldsteinCM}). \\
(equation 1-57, page 21 \cite{GoldsteinCM})
\if\qualifyingyear T
(2009 A)
\fi
\begin{equation}
\frac{d}{dt} \left( \frac{\partial L}{\partial \dot{q} _{j} } \right) -\frac{\partial L}{\partial q_{j} } = 0
\end{equation}

\subsection{Hamilton's Equations of Motion}
$H=H\left( q_{j} ,p_{j} ,t\right) $ \\
usually $ H = T+V$ \\
(equation 8-8, page 341 \cite{GoldsteinCM})
\begin{equation}
H=\sum\limits_{j}p_{j}  \dot{q} _{j} -L
\end{equation}

Once Lagrangian is found, get canonical momentum
\begin{equation}
p_j \equiv \frac{\partial L}{\partial \dot{q}_j }
\label{eq:canonical_momentum}
\end{equation}

and solve for $\dot{q}_j$ for later

\begin{equation}
h = \left( \sum \dot{q_j} \frac{\partial L}{\partial \dot{q} _{j} } \right) - L
\end{equation}

then substitue in $\dot{q}$ to get H. \\
Finally, get Hamilton Equations of motion by \\
(equation 8-12, page 342 \cite{GoldsteinCM})
\begin{equation}
\begin{gathered}
\dot{q} _{j} =\frac{\partial H}{\partial p_{j} } \\
\dot{p} _{j} = - \left( \frac{\partial H}{\partial q_{j} } \right)
\end{gathered}
\end{equation}

then integrate to get $q$ and $p$

\subsection{2-body central force}
standard orbit is Counter Clock-Wise (CCW). \\
Given the Lagrangian in polar coordinates, one derives the canonical angular momentum \\
(equation 3-8, page 73 \cite{GoldsteinCM}) (see eq \ref{eq:canonical_momentum})
\begin{equation}
l = \mu r^2 \dot{\theta}
\end{equation}
for perturbed orbits, $ \tau > \tau_c$ implies CCW (positive $\Delta\theta$) motion (forward orbital motion)
\begin{equation}
\Delta \theta = \frac{l}{m r^2}(\tau - \tau_c)
\end{equation}

circular orbit condition (equation 3-12, page 74  \cite{GoldsteinCM})
\begin{equation}
f^{effective}(r_c) = 0 = f(r_c) + \frac{l^2}{\mu r_c^3}
\end{equation}
where for the kepler problem $f(r) = -\frac{k}{r^2}$

small oscillations of orbit
\if\qualifyingyear T
(2009 A)
\fi
\begin{equation}
r = r_c + \epsilon
\end{equation}

not included: small oscillation (chapter 6 of  \cite{GoldsteinCM}).

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Quantum}

expectation value, average, mean
\begin{equation}
\langle A \rangle = \langle \psi | A | \psi \rangle = \int_{-\infty}^{\infty} \psi^* A \psi \ dx
\end{equation}

probability amplitude ( \cite{LiboffQM} page 118 calls this the
add-mixture coefficient $|C_n|^2$)
\begin{equation}
| \psi | ^2 = \langle \psi | \psi \rangle = \int \langle \psi | x \rangle \langle x | \psi \rangle dx
\end{equation}

Ehrenfest Theorem
\begin{equation}
 \frac{d}{dt} \langle a\rangle = \left\langle \pfrac{a}{t} \right\rangle + i \hbar \left\langle [a,H] \right\rangle
\end{equation}

and for sudden change, from the ground state (1) to the first excited state (2), probability of transition is
\begin{equation}
\left| \langle \phi_2 | \psi_1 \rangle \right| ^2
\end{equation}

uncertianty
\begin{equation}
\Delta x = \sqrt{ \langle x^2 \rangle - \langle x \rangle ^2 }
\end{equation}

commutator (equation 7.24, page 194 \cite{LiboffQM})
\begin{equation}
\left[ x,p\right] =i\hbar
\end{equation}

\if\qualifyingyear T
GIVEN on 2005, A5:
\fi
frequency
\begin{equation}
  \omega = \sqrt{\frac{k}{m}}
	\label{eq:frequency_wavenum}
\end{equation}

time evolution (equ 2.490, page 98, \cite{ParrisQM})
\begin{equation}
  |\Psi (t)\rangle = e^{-i \frac{H}{\hbar} t} |\Psi_0\rangle
%%%\label{eq:frequency_wavenum}
\end{equation}

\begin{equation}
  |\Psi (t)\rangle = \sum_n e^{-i \frac{E_n}{\hbar} t} \Psi_n(0) |n\rangle
%%%\label{eq:frequency_wavenum}
\end{equation}

%\begin{comment}
%%% second semester graduate quantum
total spin number
\begin{equation}
m_{total} = m_1 + m_2
\end{equation}
where $m = -j,\ldots,j$

total momentum
\begin{equation}
s_{total} = (s_1 + s_2),(s_1 + s_2 -1),\ldots,| s_1 - s_2 |
\end{equation}
where $s_{total} \geq 0$
%\end{comment}

\subsection{energy eigenvalue equation}

In position representation, derive the energy eigenvalue equation from
\begin{equation}
  \vec{K} = -i \vec{\nabla}
	\label{eq:wavenumberinpositionspace}
\end{equation}
in position representation, (equation 130)
\begin{equation}
  \vec{P} = \hbar \vec{K}
	\label{eq:momentumwavenumber}
\end{equation}

thus momentum (page 14, \cite{ParrisQM}) (equation 3.2, page 69 \cite{LiboffQM}
\begin{equation}
  \vec{P} = - i \hbar \vec{\nabla}
	\label{eq:momentumtopositionspace}
\end{equation}
From eq \ref{eq:momentumtopositionspace}, knowing the Hamiltonian is $H = T+V$
\begin{equation}
  \hat{H} = \frac{p^2}{2 m} + V
	\label{eq:hamiltonian_energy}
\end{equation}
Then plug \ref{eq:momentumtopositionspace} into \ref{eq:hamiltonian_energy} and use
\begin{equation}
H \psi = E \psi
\end{equation}
 to get the energy eigenvalue equation,
\begin{equation}
  \hat{H} = \frac{-\hbar ^2 \nabla ^2}{2 m}\Psi + V\Psi = E \Psi
	\label{eq:energy_eigenvalue}
\end{equation}

Schrodinger Equation
\begin{equation}
  i \hbar \frac{d}{dt}|\Psi \rangle = H |\Psi \rangle
	\label{eq:schrodinger_equ}
\end{equation}

equation 9.19, page 358 \cite{LiboffQM}
\begin{equation}
\begin{gathered}
J_+ = J_x + i J_y \\
J_- = J_x - i J_y
\end{gathered}
\end{equation}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{harmonic oscillator}

\if\qualifyingyear T
GIVEN on 2005, A5:
\fi
SHO energy levels
\begin{equation}
  E_n = (n+\frac{1}{2})\hbar \omega
	\label{eq:SHO_energy}
\end{equation}

harmonic oscillator Hamiltonian (equation 3.2, page 103  \cite{ParrisQM})
\begin{equation}
H = \frac{p^2}{2 m}+ \frac{1}{2} m \omega^2 x^2
\label{eq:H_p_x}
\end{equation}
factor out $\frac{\hbar \omega}{2}$ to derive harmonic oscillator Hamiltonian in dimensionless operators \\
Note: $\hat{P}$ and $\hat{Q}$ are dimensionless, whereas $\hat{p}$ and $\hat{q}$ are dimensional
(equation 3.18, page 105 \cite{ParrisQM})
\begin{equation}
H = \frac{\hbar \omega}{2} (\hat{P}^2 + \hat{Q}^2)
\label{eq:H_p_q}
\end{equation}
by comparing \ref{eq:H_p_q} and \ref{eq:H_p_x} the relationship between
dimensionless q,p and dimensional x,p can be found.

in terms of energy operators, harmonic oscillator Hamiltonian (equation 3.34, page 107  \cite{ParrisQM})
\begin{equation}
H = \hbar \omega (N+ \frac{1}{2})
\end{equation}
where $N = a^+ a$ (equation 3.33)

\if\qualifyingyear T
GIVEN on 2006 A4, 1998 A3, 2009 A1.
\fi
Lowering, raising operators
\begin{equation}
\begin{gathered}
 a|n\rangle =\sqrt{n}|n-1 \rangle \\
 a^+|n\rangle =\sqrt{n+1}|n+1 \rangle
  \label{eq:raising_lowering}
\end{gathered}
\end{equation}

dimensionless position, momentum (equation 3.29, page 106 \cite{ParrisQM})
\begin{equation}
\begin{gathered}
\hat{q} = \frac{1}{\sqrt{2}} (\hat{a}^+ + \hat{a}) \\
\hat{p} = \frac{i}{\sqrt{2}} (\hat{a}^+ - \hat{a})
\label{eq:q_p_dimensionless}
\end{gathered}
\end{equation}

\subsection{time independent non-degenerate perturbation theory}
perturbation theory says the exact solution can be approximated as
\begin{equation}
E \cong E^{(0)} + E^{(1)} + E^{(2)} + \ldots
\end{equation}

(eq. \ref{eq:first_order_correction_to_energy} through \ref{eq:second_order_correction_to_energy}
\if\qualifyingyear T
given on 1998 A3, not given on 2002 A2) \\
\fi
first order correction to energy (equ 5.41, page 138, \cite{ParrisQM}), (page 685 \cite{LiboffQM})
\begin{equation}
E^{(1)}_n = \langle n^{(0)} |V|n^{(0)}\rangle
\label{eq:first_order_correction_to_energy}
\end{equation}

first order correction to state (equ 5.42, page 138, \cite{ParrisQM}), (equation 13.8, page 685 \cite{LiboffQM})
\begin{equation}
|n^{(1)}\rangle = \sum_{m \neq n} | m^{(0)}\rangle \langle m^{(0)} |n^{(1)}\rangle
\end{equation}
where (equation 5.43, page 138, \cite{ParrisQM})
\begin{equation}
\langle m^{(0)} |n^{(1)}\rangle = -\frac{\langle m^{(0)}|V|n^{(0)}\rangle}{E_m^{(0)} - E_n^{(0)}}
\end{equation}
where $m\neq n$

second order correction to energy
\begin{equation}
E_n^{(2)} = \sum_{m\neq n} \frac{ | \langle m^{(0)}|V|n^{(0)}\rangle |^2 }{E_m^{(0)} - E_n^{(0)}}
\label{eq:second_order_correction_to_energy}
\end{equation}

\subsection{time-independent degenerate perturbation theory}
characteristic equation
\begin{equation}
det(H - \lambda I) = 0
\label{eq:characteristic_equation}
\end{equation}
where $\lambda$ are eigenvalues

\subsection{particle in a box}
infinite square well of size L, $0 \leq x \leq L$ (equation 4.15, page 93 \cite{LiboffQM})
\begin{equation}
\psi_n(x) = \sqrt{\frac{2}{L}} sin \left( \frac{n \pi x}{L} \right)
\label{eq:particle_in_box_wavefuction}
\end{equation}
where $n = 1,2,3, \ldots$ (equation 4.14, page 93 \cite{LiboffQM})
\begin{equation}
E_n = \frac{n^2 \pi^2 \hbar^2}{2 m L^2}
\label{eq:particle_in_box_energy}
\end{equation}
Whereas if $\frac{-L}{2} \leq x \leq \frac{L}{2}$
\begin{equation}
\begin{gathered}
\psi_m(x) = \sqrt{\frac{2}{L}} cos \left( \frac{m \pi x}{L} \right) \\
\psi_n(x) = \sqrt{\frac{2}{L}} sin \left( \frac{n \pi x}{L} \right)
\end{gathered}
\end{equation}
where $m = 1,3, \ldots$ and $n = 2,4, \ldots$\\
this can also be derived by shifting eq. \ref{eq:particle_in_box_wavefuction} by $\frac{L}{2}$.

\subsection{free particle}
for a free particle, assume $V=0$, then $H = \frac{p^2}{2m}$. The wave function is
\begin{equation}
\phi_k(r) = \frac{1}{(2 \pi)^{3/2}} e^{i \vec{k} \cdot \vec{r}}
\label{eq:free_particle_wave}
\end{equation}
and the energy is (equation 3.19, page 71 \cite{LiboffQM})
\begin{equation}
E_k = \frac{\hbar^2 k^2}{2m}
\label{eq:energy_free_particle_wave}
\end{equation}
and since $E = \hbar \omega$, then
\begin{equation}
\omega_k = \frac{\hbar k^2}{2m}
\end{equation}
time dependent wave function
\begin{equation}
\psi(\vec{r},t) = \langle \vec{r} | \psi(t) \rangle = \langle \vec{r} | \int d^3 k \ e^{-i \omega_k t} \psi(\vec{k},0) | \vec{k} \rangle
\label{eq:time_dependent_free_particle_wave_function}
\end{equation}

\subsection{quantum concepts}
\begin{itemize}
	\item the same spectrum (eigenvalues) occur in any basis
	\item Q: when is perturbation valid? A: when the perturbation term is
	much smaller than the unperturbed term
	\item a $\delta(x)$ perturbation in the middle of an $\infty$ square well
	has no effect on even states
\end{itemize}

\begin{tabular}{l|l}
Bosons                &     Fermions \\\hline
zero or integer spin  &  half-integer spin\\
symmetric wave functions & anti-symmetric wave functions\\
Example: photons         & Example: electrons, proton, neutron\\
more than one particle may occupy the same quantum state & Pauli exclusion principle: one particle per state\\
Bose-Einstien statistics & Fermi-Dirac statistics\\
\end{tabular}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{modern}

\begin{equation}
\frac{h}{2 \pi} = \hbar
\end{equation}

period and frequency
\begin{equation}
T = \frac{1}{f}
\end{equation}

Bragg condition (equation 3-38, page 144 \cite{TiplerMP}; equ 1 page 25 {KittelSS})
\begin{equation}
2 d \ sin \theta  = m \lambda
\end{equation}
where m is an integer.

angular frequency (equation 5-13a, page 211 \cite{TiplerMP})
\begin{equation}
\omega = 2 \pi f
\end{equation}

de~Broglie relations (equation 5-1, page 198 \cite{TiplerMP})
\begin{equation}
E = h f
\end{equation}

de Broglie wavelength (equation 5-2, page 198  \cite{TiplerMP}) (equation 3.10, page 70  \cite{LiboffQM})
\begin{equation}
\lambda = \frac{h}{p}
\end{equation}

frequency
\begin{equation}
f = \frac{c}{\lambda}
\end{equation}

(page 199,  \cite{TiplerMP})
\begin{equation}
E = pc = hf = \frac{hc}{\lambda}
\end{equation}

wavenumber (equation 5-13b, page 211  \cite{TiplerMP}) (equation 3.9, page 70  \cite{LiboffQM})
\begin{equation}
k = \frac{2 \pi}{\lambda}
\end{equation}

phase velocity (equation 5-14, page 211 \cite{TiplerMP})
\begin{equation}
v_{phase} = f \lambda
\end{equation}

group velocity (equation 5-22, page 211 \cite{TiplerMP}) (equation 3.62, page 83 \cite{LiboffQM})
\begin{equation}
v_{group} = \frac{d\omega}{dk}
\end{equation}

energy and frequency (equation 5-24, page 218  \cite{TiplerMP})
\begin{equation}
E = \hbar \omega
\end{equation}

momentum (equation 5-25, page 218  \cite{TiplerMP})
\begin{equation}
p = \hbar k
\end{equation}

uncertainty (equation 5-29, page 223  \cite{TiplerMP})
(problem 5.28, page 143 \cite{LiboffQM})
\begin{equation}
\begin{gathered}
\Delta x \Delta p \geq \frac{\hbar}{2} \\
\Delta E \Delta t \geq \frac{\hbar}{2}
\end{gathered}
\end{equation}

work function: energy need to remove an electron
(equation 3-37, page 139 \cite{TiplerMP})
\if\qualifyingyear T
(1999 A4b)
\fi
\begin{equation}
\phi = h f_{threshold} = \frac{h c}{\lambda_{threshold}}
\end{equation}

\subsection{Modern concepts}
\begin{itemize}
\item The mass of a bound system is greater than that of the individual
constituent particles due to contribution of binding energy. For
instance, $E_{hydrogen} = 13.6 eV$ is the binding energy for
hydrogen. (see page 86, \cite{TiplerMP})
\item 4 forces in order of decreasing strength and [force carrier particle]
\if\qualifyingyear T
(2007 B6)
\fi
%%% http://en.wikipedia.org/wiki/Fundamental_interaction#Overview
%%% http://hyperphysics.phy-astr.gsu.edu/hbase/forces/funfor.html
\begin{enumerate}
	\item strong [gluons]
	\item electromagnetic [photon]
	\item weak [W and Z bosons]
	\item gravity [graviton]
\end{enumerate}
\end{itemize}

\subsection{constants}
\begin{itemize}
\item radius of a simple atom is $\approx .5 \dot{A}$ (half an angstrom).
(Bohr radius, page 173 \cite{TiplerMP})
\item $hc = 1240 \ eV \ nm$
\end{itemize}

%\begin{comment}
\section{optics}

snell's law
\begin{equation}
n_1 sin(\theta_1)=n_2 sin(\theta_2)
\end{equation}
%\end{comment}

\newpage

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Symbol notations}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

See page 631-642 of \cite{ReifThermo}

$C_v \equiv$ specific heat for constant volume

$k_b \equiv$ Boltzmann constant

$\vec{E} \equiv$ electric field

$\vec{B} \equiv$ magnetic field

$\vec{D} \equiv$ electric displacement, equ 4.21, page 175 \cite{GriffithED}

$\vec{N} \equiv$ torque

$W \equiv$ work

$\vec{v} \equiv$ velocity

$V \equiv$ electrostatic potential [Volts]

$V \equiv$ volume

$U \equiv$ potential energy [Volts]

$\vec{P} \equiv$ polarization, page 166 \cite{GriffithED}

$I \equiv$ current [Amps]

$\vec{F} \equiv$ force [Newtons, $\frac{kg \cdot m}{s^2}$]

$E \equiv$ energy

$T \equiv$ kinetic energy

$T \equiv$ temperature

$L \equiv$ lagrangian

$L \equiv$ capacitance

$\vec{L} \equiv$ classical (orbital) angular momentum

$l \equiv$ quantum (orbital) angular momentum

$\vec{p} \equiv$ linear momentum

$\omega \equiv$ angular frequency

$z \equiv$ single particle partition function

$Z \equiv$ total partition function

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{thebibliography}{99}

\bibitem{GriffithED}
Griffith \textit{Intro to Electrodynamics}, (1999)

\bibitem{JacksonED}
Jackson \textit{Classical Electrodynamics}, (1999)

\bibitem{GoldsteinCM}
Goldstein \textit{Classical Mechanics}, (1980) (second edition)\\
Available from Aaron

\bibitem{ReifThermo}
Reif \textit{Fundamentals of statistical and thermal physics}, (1965)

\bibitem{KittelSS}
Kittel \textit{Solit State, Eigth edition}, (19)

\bibitem{ParrisQM}
Parris's book on \textit{Quantum mechanics}, (2008) \\
\htmladdnormallink{463 course page}{http://physics.mst.edu/classes/class_463notes.html}

\bibitem{LiboffQM}
Liboff \textit{Introduction to Quantum mechanics}, (2003) Fourth edition

\bibitem{MarionCM}
Marion \textit{Classical Dynamics of Particles and systems}, (1970) Second edition. \\
Available from Prof Waddill, Elizabeth

\bibitem{TiplerMP}
Tipler, Llewellyn \textit{Modern Physics}, (1999)

\end{thebibliography}

\end{document}


\documentclass[letterpaper]{article}

\usepackage{fullpage}
\usepackage{nopageno}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{tikz}

\usetikzlibrary{graphs,graphdrawing}
\usegdlibrary{trees}

\allowdisplaybreaks

\newcommand{\abs}[1]{\left\lvert #1 \right\rvert}

\begin{document}
\title{Notes}
\date{January 16, 2015}
\maketitle
\section*{error fixup}
neighborhood is $N_G(V_i)=\{V_j|(v_i,v_j)\in E(G)\}$
\section*{degree sequences}
these will be ascending, book is descending

\subsubsection*{definitionn}
if $G$ is finite with $V(G)=\{v_1,\dots,v_n\}$ such that $d_i=\deg(v_i)\le \deg(v_j)$ for $i\le j$ then $(d_1,\dots,d_n)$ is the degree sequence of $G$.

\begin{tikzpicture}[main_node/.style={circle,fill=blue!60,minimum size=1em,inner sep=3pt]}]
    \node[main_node] (1) at (-1,1) {1};
    \node[main_node] (2) at (-1, -1)  {2};
    \node[main_node] (3) at (1, -1) {3};
    \node[main_node] (4) at (1, 1) {4};
    \draw (1) -- (2) -- (3) -- (4) -- (1) -- (3) -- (2) -- (4);
\end{tikzpicture}$=k_4$

$d=(3,3,3,3)$
three regular graph

\begin{tikzpicture}[main_node/.style={circle,fill=blue!60,minimum size=1em,inner sep=3pt]}]
    \node[main_node] (1) at (-1,1) {};
    \node[main_node] (2) at (-1, -1)  {};
    \node[main_node] (3) at (1, -1) {};
    \node[main_node] (4) at (1, 1) {};
    \node[main_node] (5) at (0, 2) {};
    \node[main_node] (6) at (0, -2) {};
    \draw (1) -- (2) -- (3) -- (4) -- (1) -- (2) -- (4) -- (5) -- (1);
    \draw (5) -- (6) -- (2) ;
\end{tikzpicture}

$d=(2,3,3,3,3,4)$

\section*{Havel, Hakimi thm}
if $(d_1,\dots,d_n)$ is a non decreasing sequence with $d_n\ge 1$ (avoid the empty graph) it is a degree sequence iff $(d_1,\dots,d_{n-d_n-1},d_{n-d_n}-1,\dots,d_{n-1}-1)$ is a degree sequence
\subsubsection*{example}
given

\begin{tikzpicture}[main_node/.style={circle,fill=blue!60,minimum size=1em,inner sep=3pt]}]
    \node[main_node] (1) at (-1,1) {};
    \node[main_node] (2) at (-1, -1)  {};
    \node[main_node] (3) at (1, -1) {};
    \node[main_node] (4) at (1, 1) {};
    \node[main_node] (5) at (0, 0) {};
    \node[main_node] (6) at (0, 2) {};

    \draw (1) -- (4) -- (5) -- (2) -- (3) -- (5) -- (1) -- (6) -- (4);
\end{tikzpicture}

$\to(2,2,2,3,3,4)\to(2,1,1,2,2)$

\begin{tikzpicture}[main_node/.style={circle,fill=blue!60,minimum size=1em,inner sep=3pt]}]
    \node[main_node] (1) at (-1,1) {};
    \node[main_node] (2) at (-1, -1)  {};
    \node[main_node] (3) at (1, -1) {};
    \node[main_node] (4) at (1, 1) {};
    %\node[main_node] (5) at (0, 0) {};
    \node[main_node] (6) at (0, 2) {};

    \draw (2) -- (3);
    \draw (1) -- (6) -- (4) -- (1);
\end{tikzpicture}

$(1,1,2,2,2)$

\subsection*{proof}

$\Rightarrow$ careful vertex deletion

$\Leftarrow$ let G have a degree sequeence $*$ then $\deg(v_i)=\begin{cases}d_i&i=1,\dots,n-d_n-1\\d_i-1&i=n-d_n,\dots,n-1\end{cases}$

add a vertex to $G$ and add edges between the new vertex and all vertices of degree $d_i-1$

the degree of the new vertex is $n-1-(n-d_n)+1=d_n$

the new graph has degree sequence $(d_1,\dots,d_n)\Box$

\subsection*{claim}
havel-hakimi can be used to verify, refute the degree sequenceness of any nondecreasing sequence of integers

i.e. we can say rather quickly that (polynomial time) if $(2,3,3,5,5,5,5,5,5,6)$ is graphical

$n=10, 10-6-1=3, d_3=3, n-d_n=4,d_4-1=4,d_9-1=5$
$(2,3,3,4,4,4,4,4,4)\dots\to\dots (1,1,2,2,2,2)$

question, if two degree sequences are the same, are the graphs isomorphic? no!

\subsection*{homework 1.2}
6a,b,7,10,15

\tikz\path [graphs/.cd, nodes={shape=circle, draw, text=black,inner sep=1pt,outer sep=0pt}]
  graph [tree layout] { 1 -- 2; 2 -- 3; 3 -- 4 --2 }
  [shift=(0:1)];
  %graph { 1 -- 2; 3 -- 4; 1 -- 4;  2 -- 3 };
\tikz\path [graphs/.cd, nodes={shape=circle, fill=blue!40, draw=none, outer sep=0pt}]
  graph [tree layout] { 1 -- {2 -- 3} -- 1 }
  [shift=(0:1)];
\end{document}