\chapter{Projective varieties}
Having studied affine varieties in $\Aff^n$, we now consider $\CP^n$.
We will also make it into a baby ringed space
in the same way as with $\Aff^n$.

\section{Graded rings}
\prototype{$\CC[x_0, \dots, x_n]$ is a graded ring.}
We first take the time to state what a graded ring is,
just so that we have this language to use (now and later).

\begin{definition}
	A \vocab{graded ring} $R$ is a ring with the following additional structure:
	as an abelian group, it decomposes as
	\[ R = \bigoplus_{d \ge 0} R^d \]
	where $R^0$, $R^1$, \dots, are abelian groups.
	The ring multiplication has the property that
	if $r \in R^d$ and $s \in R^e$, we have $rs \in R^{d+e}$.
	Elements of an $R^d$ are called \vocab{homogeneous elements};
	we write ``$d = \deg r$'' to mean ``$r \in R^d$''.

	We denote by $R^+$ the ideal $R \setminus R^0$ generated by
	the homogeneous elements of nonzero degree,
	and call it the \vocab{irrelevant ideal}.
\end{definition}
\begin{remark}
	For experts: all our graded rings are commutative with $1$.
\end{remark}
\begin{example}
	[Examples of graded rings]
	\listhack
	\begin{enumerate}[(a)]
		\ii The ring $\CC[x]$ is graded by degree: as abelian groups,
		$\CC[x] \cong \CC \oplus x\CC \oplus x^2\CC \oplus \dots$.
		\ii More generally, the polynomial ring $\CC[x_0, \dots, x_n]$
		is graded by degree.
	\end{enumerate}
\end{example}
\begin{abuse}
	The notation $\deg r$ is abusive in the case $r = 0$;
	note that $0 \in R^d$ for every $d$.
	So it makes sense to talk about ``the'' degree of $r$
	except when $r = 0$.
\end{abuse}

We will frequently refer to homogeneous ideals:
\begin{definition}
	An ideal $I \subseteq \CC[x_0, \dots, x_n]$ is \vocab{homogeneous}
	if it can be written as $I = (f_1, \dots, f_m)$
	where each $f_i$ is a homogeneous polynomial.
\end{definition}
\begin{remark}
	If $I$ and $J$ are homogeneous,
	then so are $I+J$, $IJ$, $I \cap J$, $\sqrt I$.
\end{remark}
\begin{lemma}[Graded quotients are graded too]
	Let $I$ be a homogeneous ideal of a graded ring $R$.
	Then
	\[ R/I = \bigoplus_{d \ge 0} R^d / (R^d \cap I) \]
	realizes $R/I$ as a graded ring.
\end{lemma}
Since these assertions are just algebra,
we omit their proofs here.
\begin{example}
	[Example of a graded quotient ring]
	Let $R = \CC[x,y]$ and set $I = (x^3, y^2)$.
	Let $S = R/I$. Then
	\begin{align*}
		S^0 &= \CC \\
		S^1 &= \CC x \oplus \CC y \\
		S^2 &= \CC x^2 \oplus \CC xy \\
		S^3 &= \CC x^2y \\
		S^d &= 0 \qquad \forall d \ge 4.
	\end{align*}
	So in fact $S = R/I$ is graded,
	and is a six-dimensional $\CC$-vector space.
\end{example}

\section{The ambient space}
\prototype{Perhaps $\Vp(x^2+y^2-z^2)$.}
The set of points we choose to work with is $\CP^n$ this time,
which for us can be thought of as the set of $n$-tuples
\[ \left( x_0 : x_1 : \dots : x_n \right) \]
not all zero, up to scaling.
Equivalently, it is the set of lines through the origin in $\CC^{n+1}$.
Projective space is defined in full in \Cref{sec:top_spaces},
and you should refer there if you aren't familiar with projective space.

The right way to think about it is ``$\Aff^n$ plus points at infinity'':
\begin{definition}
	We define the set
	\[ U_i = \left\{ (x_0 : \dots : x_n) \mid x_i \neq 0  \right\}
		\subseteq \CP^n. \]
	These are called the \vocab{standard affine charts}.
\end{definition}
The name comes from:
\begin{exercise}
	[Mandatory]
	Give a natural bijection from $U_i$ to $\Aff^n$.
	Thus we can think of $\CP^n$ as the affine set $U_i$
	plus ``points at infinity''.
\end{exercise}
\begin{remark}
	In fact, these charts $U_i$ make $\CP^n$ with its usual topology
	into a complex manifold with holomorphic transition functions.
\end{remark}

\begin{example}
	[Colloquially, $\CP^1 = \Aff^1 \cup \{\infty\}$]
	The space $\CP^1$ consists of pairs $(s:t)$,
	which you can think of as representing the complex number $z/1$.
	In particular $U_1 = \{ (z:1) \}$
	is basically another copy of $\Aff^1$.
	There is only one new point, $(1:0)$.
\end{example}

However, like before we want to impose a Zariski topology on it.
For concreteness, let's consider $\CP^2 = \left\{ (x_0 : x_1 : x_2) \right\}$.
We wish to consider zero loci in $\CP^2$, just like we did in affine space,
and hence obtain a notion of a projective variety.

But this isn't so easy: for example,
the function ``$x_0$'' is not a well-defined function on points in $\CP^2$
because $(x_0 : x_1 : x_2) = (5x_0 : 5x_1 : 5x_2)$!
So we'd love to consider these ``pseudo-functions''
that still have zero loci. These are just the homogeneous polynomials $f$,
because $f$ is homogeneous of degree $d$ if and only if
\[
	f(\lambda x_0, \dots, \lambda x_n)
	= \lambda^d f(x_0, \dots, x_n).
\]
In particular, the relation ``$f(x_0, \dots, x_n) = 0$'' is
well-defined if $F$ is homogeneous. Thus, we can say:
\begin{definition}
	If $f$ is homogeneous, we can then define its \vocab{vanishing locus} as
	\[
		\Vp(f)
		= \left\{ (x_0 : \dots : x_n) \mid f(x_0, \dots, x_n) = 0 \right\}.
	\]
\end{definition}

The homogeneous condition is really necessary.
For example, to require ``$x_0 - 1 = 0$'' makes no sense,
since the points $(1:1:1)$ and $(2015:2015:2015)$ are the same.

It's trivial to verify that homogeneous polynomials do exactly what we want;
hence we can now define:
\begin{definition}
	A \vocab{projective variety} in $\CP^n$
	is the common zero locus of an arbitrary
	collection of homogeneous polynomials in $n+1$ variables.
\end{definition}

\begin{example}[A conic in $\CP^2$, or a cone in $\CC^3$]
	Let's try to picture the variety
	\[ \Vp(x^2+y^2-z^2) \subseteq \CP^2 \]
	which consists of the points $[x:y:z]$ such that $x^2+y^2=z^2$.
	If we view this as subspace of $\CC^3$
	(i.e.\ by thinking of $\CP^2$ as the set of lines through the origin),
	then we get a ``cone'':
	\begin{center}
		\includegraphics{media/cone.pdf}
	\end{center}

	If we take the standard affine charts now, we obtain:
	\begin{itemize}
		\ii At $x=1$, we get a hyperbola $\VV(1+y^2-z^2)$.
		\ii At $y=1$, we get a hyperbola $\VV(1+x^2-z^2)$.
		\ii At $z=1$, we get a circle $\VV(x^2+y^2-1)$.
	\end{itemize}
	That said, over $\CC$ a hyperbola and circle
	are the same thing; I'm cheating a little by drawing $\CC$
	as one-dimensional, just like last chapter.
\end{example}
\begin{ques}
	Draw the intersection of the cone above
	with the $z=1$ plane, and check that you do in fact get a circle.
	(This geometric picture will be crucial later.)
\end{ques}

\section{Homogeneous ideals}
Now, the next thing we want to do is define $\Vp(I)$ for an ideal $I$.
Of course, we again run into an issue with things like $x_0-1$ not
making sense.

The way out of this is to use only \emph{homogeneous} ideals.
\begin{definition}
	If $I$ is a homogeneous ideal, we define
	\[ \Vp(I) = \{ x \mid f(x) = 0 \; \forall f \in I\}. \]
\end{definition}
\begin{exercise}
	Show that the notion ``$f(x) = 0 \; \forall f \in I$''
	is well-defined for a homogeneous ideal $I$.
\end{exercise}
So, we would hope for a Nullstellensatz-like theorem
which bijects the homogeneous radical ideals to projective ideals.
Unfortunately:
\begin{example}
	[Irrelevant ideal]
	To crush some dreams and hopes, consider the ideal
	\[ I = (x_0, x_1, \dots, x_n). \]
	This is called the \vocab{irrelevant ideal};
	it is a homogeneous radical yet $\Vp(I) = \varnothing$.
\end{example}

However, other than the irrelevant ideal:
\begin{theorem}
	[Homogeneous Nullstellensatz]
	Let $I$ and $J$ be homogeneous ideals.
	\begin{enumerate}[(a)]
		\ii If $\Vp(I) = \Vp(J) \neq \varnothing$ then $\sqrt I = \sqrt J$.
		\ii If $\Vp(I) = \varnothing$, then either $I = (1)$
		or $\sqrt I = (x_0, x_1, \dots, x_n)$.
	\end{enumerate}
	Thus there is a natural bijection between:
	\begin{itemize}
		\ii projective varieties in $\CP^n$, and
		\ii homogeneous radical ideals of $\CC[x_1, \dots, x_n]$
		except for the irrelevant ideal.
	\end{itemize}
\end{theorem}
\begin{proof}
	For the first part, let $V = \Vp(I)$ and $W = \Vp(J)$
	be projective varieties in $\CP^n$.
	We can consider them as \emph{affine varieties} in $\Aff^{n+1}$
	by using the interpretation of $\CP^n$
	as lines through the origin in $\CC^n$.

	Algebraically, this is done by taking the homogeneous ideals
	$I, J \subseteq \CC[x_0, \dots, x_n]$
	and using the same ideals to cut out \emph{affine} varieties
	$V_{\text{aff}} = \VV(I)$ and $W_{\text{aff}} = \VV(J)$ in $\Aff^{n+1}$.
	For example, the cone $x^2+y^2-z^2=0$ is a conic (a one-dimensional curve)
	in $\CP^2$, but can also be thought of as a cone
	(which is a two-dimensional surface) in $\Aff^3$.

	Then for (a), we have $V_{\text{aff}} = W_{\text{aff}}$,
	so $\sqrt I = \sqrt J$.

	For (b), either $V_{\text{aff}}$ is empty
	or it is just the origin of $\Aff^{n+1}$,
	so the Nullstellensatz implies either $I = (1)$
	or $\sqrt I = (x_0, \dots, x_n)$ as desired.
\end{proof}
Projective analogues of \Cref{thm:many_aff_variety}
(on intersections and unions of varieties) hold verbatim
for projective varieties as well.

\section{As ringed spaces}
\prototype{The regular functions on $\CP^1$ minus a point
are exactly those of the form $P(s/t)$.}
Now, let us make every projective variety $V$ into a baby ringed space.
We already have the set of points, a subset of $\CP^n$.

The topology is defined as follows.
\begin{definition}
	We endow $\CP^n$ with the \vocab{Zariski topology}
	by declaring the sets of the form $\Vp(I)$,
	where $I$ is a homogeneous ideal, to be the closed sets.

	Every projective variety $V$ then inherits the Zariski
	topology from its parent $\CP^n$.
	The \vocab{distinguished open sets} $D(f)$ are $V \setminus \Vp(f)$.
\end{definition}

Thus every projective variety $V$ is now a topological space.
It remains to endow it with a sheaf of regular functions $\OO_V$.
To do this we have to be a little careful.
In the affine case we had a nice little ring of functions,
the coordinate ring $\CC[x_0,\dots,x_n] / I$,
that we could use to provide the numerator and denominators.
So, it seems natural to then define:
\begin{definition}
	The \vocab{homogeneous coordinate ring} of a projective variety
	$V = \Vp(I) \subseteq \CP^n$, where $I$ is homogeneous radical,
	is defined as the ring
	\[ \CC[V] = \CC[x_0, \dots, x_n] / I. \]
\end{definition}
However, when we define a rational function we must impose
a new requirement that the numerator and denominator are the same degree.
\begin{definition}
	Let $U \subseteq V$ be an open set of a projective variety $V$.
	A \vocab{rational function} $\phi$ on a projective variety $V$
	is a quotient $f/g$, where $f,g \in \CC[V]$,
	and $f$ and $g$ are homogeneous of the same degree,
	and $\Vp(g) \cap U = \varnothing$.
	In this way we obtain a function $\phi : U \to \CC$.
\end{definition}
\begin{example}
	[Examples of rational functions]
	Let $V = \CP^1$ have coordinates $(s:t)$.
	\begin{enumerate}[(a)]
		\ii If $U = V$, then constant functions $c/1$
		are the only rational functions on $U$.
		\ii Now let $U_1 = V \setminus \{(1:0)\}$.
		Then, an example of a regular function is
		\[ \frac{s^2+9t^2}{t^2} = \left( \frac st \right)^2 + 9. \]
		If we think of $U_1$ as $\CC$
		(i.e.\ $\CP^1$ minus an infinity point, hence like $\Aff^1$)
		then really this is just the function $x^2+9$.
	\end{enumerate}
\end{example}
Then we can repeat the same definition as before:
\begin{definition}
	Let $U \subseteq V$ be an open set of a projective variety $V$.
	We say a function $\phi : U \to \CC$ is a \vocab{regular function} if
	for every point $p$, we can find an open set $U_p$ containing $p$
	and a rational function $f_p/g_p$ on $U_p$ such that
	\[ \phi(x) = \frac{f_p(x)}{g_p(x)} \qquad \forall x \in U_p. \]
	In particular, we require $U_p \cap \Vp(g_p) = \varnothing$.
	We denote the set of all regular functions on $U$ by $\OO_V(U)$.
\end{definition}
Of course, the rational functions from the previous example
are examples of regular functions as well.
This completes the definition of a projective variety $V$
as a baby ringed space.

\section{Examples of regular functions}
Naturally, I ought to tell you what the regular functions
on distinguished open sets are; this is an analog to
\Cref{thm:reg_func_distinguish_open} from last time.
\begin{theorem}
	[Regular functions on distinguished open sets for projective varieties]
	\label{thm:proj_reg_func_dist_open}
	Let $V$ be a projective variety, and let $g \in \CC[V]$ be homogeneous
	of \emph{positive degree} (thus $g$ is nonconstant).
	Then
	\[
		\OO_V(D(g))
		= \left\{ \frac{f}{g^r} \mid
		f \in \CC[V] \text{ homogeneous of degree $r\deg g$}
		\right\}.
	\]
\end{theorem}
What about the case $g = 1$?
A similar result holds, but we need the assumption that $V$ is irreducible.
\begin{definition}
	A projective variety $V$ is irreducible
	if it can't be written as the union of two proper (projective) sub-varieties.
\end{definition}
\begin{theorem}
	[Only constant regular functions on projective space]
	Let $V$ be an \emph{irreducible} projective variety.
	Then the only regular functions on $V$ are constant,
	thus we have \[ \OO_V(V) \cong \CC. \]
	This relies on the fact that $\CC$ is algebraically closed.
\end{theorem}
Proofs of these are omitted for now.
\begin{example}
	[Irreducibility is needed above]
	The reason we need $V$ irreducible is otherwise
	we could, for example, take $V$ to be the union of two points;
	in this case $\OO_V(V) \cong \CC^{\oplus 2}$.
\end{example}

\begin{remark}
	It might seem strange that $\OO_V(D(g))$ behaves so differently
	when $g = 1$. One vague explanation is that in a projective variety,
	a distinguished open $D(g)$ looks much like an affine variety if $\deg g > 0$.
	For example, in $\CP^1$ we have $\CP^1 \setminus \{0\} \cong \Aff^1$
	(where $\cong$ is used in a sense that I haven't made precise).
	Thus the claim becomes related to the corresponding affine result.
	But if $\deg g = 0$ and $g \neq 0$, then $D(g)$ is the entire projective variety,
	which does not look affine, and thus the analogy breaks down.
\end{remark}

\begin{example}[Regular functions on $\CP^1$]
	Let $V = \CP^1$, with coordinates $(s:t)$.
	\begin{enumerate}[(a)]
		\ii By \Cref{thm:proj_reg_func_dist_open},
		if $U_1$ is the standard affine chart
		omitting the point $(1:0)$, we have
		$ \OO_V(U_1) = \left\{ \frac{f}{t^n} \mid \deg f = n \right\} $.
		One can write this as
		\[ \OO_V(U_1) \cong \left\{ P(s/t) \mid P \in \CC[x] \right\}
			\cong \OO_{\Aff^1} (\Aff^1). \]
		This conforms with our knowledge that $U_1$
		``looks very much like $\Aff^1$''.
		\ii As $V$ is irreducible, $\OO_V(V) = \CC$:
		there are no nonconstant functions on $\CP^1$.
	\end{enumerate}
\end{example}

\begin{example}
	[Regular functions on $\CP^2$]
	Let $\CP^2$ have coordinates $(x:y:z)$ and
	let $U_0 = \left\{ (x:y:1) \in \CP^2 \right\}$
	be the distinguished open set $D(z)$.
	Then in the same vein,
	\[
		\OO_{\CP^2}(U_0)
		= \left\{ \frac{P(x,y)}{z^n} \mid \deg P = n \right\}
		\cong \left\{ P(x/z, y/z) \mid P \in \CC[x,y] \right\}.
	\]
\end{example}

\section\problemhead
\todo{Problems:}
% should be easy to come up with some explicit examples to play with


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Written By Michael Brodskiy
% Class: Analytic Geometry & Calculus III (Math-292)
% Professor: V. Cherkassky
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\documentclass[12pt]{article}
\usepackage{alphalph}
\usepackage[utf8]{inputenc}
\usepackage[russian,english]{babel}
\usepackage{titling}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{enumitem}
\usepackage{amssymb}
\usepackage[super]{nth}
\usepackage{everysel}
\usepackage{ragged2e}
\usepackage{geometry}
\usepackage{fancyhdr}
\geometry{top=1.0in,bottom=1.0in,left=1.0in,right=1.0in}
\newcommand{\subtitle}[1]{%
  \posttitle{%
    \par\end{center}
    \begin{center}\large#1\end{center}
    \vskip0.5em}%

}
\usepackage{hyperref}
\hypersetup{
colorlinks=true,
linkcolor=blue,
filecolor=magenta,
urlcolor=blue,
citecolor=blue,
}

\urlstyle{same}

\title{Lecture VII Notes}
\date{\today}
\author{Michael Brodskiy\\ \small Professor: V. Cherkassky}

% Mathematical Operations:

% Sum: $$\sum_{n=a}^{b} f(x) $$
% Integral: $$\int_{lower}^{upper} f(x) dx$$
% Limit: $$\lim_{x\to\infty} f(x)$$

\begin{document}

\maketitle

\subsection{Formulas From 13.3}

\begin{enumerate}

  \item $\overrightarrow{T}(t)=\frac{\overrightarrow{r}'(t)}{|\overrightarrow{r}'(t)|}$

  \item $\overrightarrow{N}(t)=\frac{\overrightarrow{T}'(t)}{|\overrightarrow{T}'(t)|}$

  \item $\overrightarrow{B}(t)=\overrightarrow{T}(t)\text{ x }\overrightarrow{N}(t)$

  \item $\kappa(t)=\frac{|\overrightarrow{T}'(t)|}{|\overrightarrow{r}'(t)|}=\frac{|\overrightarrow{r}'(t)\text{ x }\overrightarrow{r}''(t)|}{|\overrightarrow{r}'(t)|^3}$

\end{enumerate}

\section{Formulas of Frenet-Serret}

\begin{enumerate}

  \item $\frac{d\overrightarrow{T}}{ds}=\kappa\overrightarrow{N}$

  \item $\frac{d\overrightarrow{N}}{ds}=-\kappa\overrightarrow{T}+\tau\overrightarrow{B}$

  \item $\frac{d\overrightarrow{B}}{ds}=-\tau\overrightarrow{N}$

\end{enumerate}

\section{Motion in Space $-$ 13.4}

\begin{enumerate}

  \item $\overrightarrow{v}(t)=\overrightarrow{r}'(t)$

  \item $\overrightarrow{a}(t)=\overrightarrow{v}'(t)=\overrightarrow{r}''(t)$

  \item $\text{speed}=|\overrightarrow{v}(t)|$

  \item The force, $\overrightarrow{F}$ is always acting in the same direction as the acceleration, $\overrightarrow{a}$, with proportionality constant mass, $m$

  \item In a circular path, an object's position is given by: $\overrightarrow{r}(t) = a\cos \omega t \hat{\bold{i}} + a \sin \omega t \hat{\bold{j}}$, where $a$ is the radius of the circle, and $\omega$ is the constant speed of the object. The velocity is given by: $\overrightarrow{r}'(t)=\overrightarrow{v}(t)=-a\omega \sin \omega t \hat{\bold{i}} + a \omega \cos \omega t \hat{\bold{j}}$, and the acceleration is given by: $\overrightarrow{a}(t)=\overrightarrow{v}'(t)=-a\omega^2\cos \omega t \hat{\bold{i}} - a\omega^2 \sin \omega t \hat{\bold{j}}$

  \item Also in circular motion, $\overrightarrow{F}(t)=m\overrightarrow{a}(t)=-m\omega^2(a\cos \omega t \hat{\bold{i}} + a \sin \omega t \hat{\bold{j}})$

\end{enumerate}

\end{document}


\documentclass[letterpaper]{article}

\usepackage{fullpage}
\usepackage{nopageno}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[utf8]{inputenc}
\allowdisplaybreaks

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

\begin{document}
\title{Notes}
\date{September 29, 2014}
\maketitle
if $\liminf x_n=L$ then there exists $\{x_{n_k}\}$ such that $\lim x_{n_k}=L$

$l=\liminf x_n=\lim(inf\{\underbrace{x_{n_1},x_{n_2},x_{n_3},\dots}_{c_n}\}$

why not just let $c_n$ be the subseuence? because $c_n$ may not be equal to any of the $x_k$ in the sequence

$c_n=\inf\{x_{n_1},x_{n_2},\dots\}$ give $\varepsilon=2^{-n}$ there exists $x_{n_k}\in\{x_{n_1},x_{n+1},x_{n+2},\dots\}$ such that $\left\lvert c_n-x_{n_k}\right\rvert<2^{-n}$ by def of infinum

we has a sequence $\{c_n\}$ given $\varepsilon>0$ there exists $N$ such that $\left\lvert c_n-L\right\rvert<\varepsilon$ if $n\ge N$. we approximate each $c_n$ by some $x_{n_k}$ from the oricinal sequence sutch that ....

\section*{convergence test for series}
first we talk about series with positive terms $\sum\limits_{k=1}^\infty{a_k}$, $s_n=\sum\limits_{k=1}^n{a_k}$. So if $s_n$ is bounded about then the series is convergent. and if not, it is divergent.

geometric series $\sum\limits_{n=0}^\infty{r^n}$ is convergent if $\left\lvert r\right\rvert<1$. $s_n=\sum\limits_{k=0}n{r^k}=1+r+r^2+\dots+r^n, rs_n=r+r^2+r^3+\dots, sn-rSn=1-r^{n+1}$

$s_n=\frac{1-r^{n+1}}{1-r}\to\frac{1}{1-r}$

\section*{comparison test}
if $\forall n, |a_n|\le b_n$
\begin{itemize}
\item
  if $\sum\limits_{n=1}^\infty{b_n}$ is convergent then $\sum\limits_{n=1}^\infty{a_n}$ is convergent,
  \item
  if $\sum\limits{a_n}$ is divergent, so is $\sum\limits{b_n}$.
\end{itemize}
\section*{3.2.b}
show that if $\left(|a_n|\right)_{n=1}^\infty$ is summable then so is $\left(a_n\right)_{n=1}^\infty$.
\begin{align*}
  \sum\limits_{k=n+1}^m{|a_k|}&<\varepsilon\text{ for all }N\le n\le m \text{ because is is summable}\\
  \left\lvert\sum\limits_{k=n+1}^m{a_k}\right\rvert&\le\sum\limits_{k=n+1}^m{|a_k|}<\varepsilon
\end{align*}
so then $\sum\limits{a_k}$ is also cauchy and summable

\section*{cauchy-schwartz inequality}
$\sum\limits_{k=1}^n{a_kb_k}\le \left(\sum\limits_{k=1}^n{a_k^2}\right)^{1/2}\left(\sum\limits_{k=1}^n{b_k^2}\right)^{1/2}$

\section*{3.2.f}

\section*{leibniz test for alternating series}
if $\{a_n\}$ is a monotone decreasing sequence of positive terms with the $\lim a_n=0$ then $\sum\limits_{n=1}^\infty{(-1)^na_n}$ is convergent
\end{document}


\documentclass[degn-notes.tex]{subfiles}

\begin{document}

\setcounter{chapter}{1}

\chapter{Observations of Galactic Nuclei and Supermassive Black Holes}

\section{Structure of galaxies and galactic nuclei}

\subsection{Intensity profiles}

Intensity profiles are functions used to describe the intensity of a galaxy as a function of distance from the center, $I(R)$.

The \textbf{S{\'e}rsic profile} is commonly used, as it is simple and effective. The general form is:
%
\begin{displaymath}
  \ln I(R) = \ln I_e - b \, n \qty[ \qty(R/R_e)^{1/n} - 1 ].
%
  \tag{Merritt 2.3}
  \label{merritt:2.3}
\end{displaymath}
%
The \textbf{S{\'e}rsic index}, $n$, characterizes the shape of the function, and in practice, $n \in \intcc{0.5, 8}$. $b$ is typically chosen such that $R_e$, the \textbf{effective radius}, contains half of the total light. The effective intensity, $I_e$, is thus defined as $I_e \equiv I(R_e)$.

To make the function a little more intuitive, one may use differentiation to put it in the form:
%
\begin{displaymath}
  \dv{\ln I}{\ln R} = -\frac{b}{n} \qty( \frac{R}{R_e} )^{1/n}
%
  \tag{Merritt 2.4}
  \label{merritt:2.4}
\end{displaymath}
%
This form illustrates the fact that the slope on a $\log$--$\log$ plot of the intensity grows with $R$ by $(R/R_e)^{1/n}$.

In many galaxies, within a radius $R_b$, there is a break in the intensity profile (shown in Merritt Figure 2.2). For this reason, it is necessary to define a \textbf{core-S{\'e}rsic profile}:
%
\begin{displaymath}
  I(r) =
  \begin{dcases}
    I_b \qty( \frac{R_b}{R} )^\Gamma,
    & R \leq R_b,
    \\
    I_b \exp(b(R_b/R_e)^{1/n}) \exp(-b(R/R_e)^{1/n}),
    & R > R_b.
  \end{dcases}
%
  \tag{Merritt 2.8}
  \label{merritt:2.8}
\end{displaymath}

\section{Techniques for weighing black holes}

In most cases, the determination of SBH mass is done through dynamical techniques, i.e. techniques which use the motions of gas and stars to infer the black hole mass.

An important concept is the ``influence radius'', $r_m$, which is typically defined to satisfy
%
\begin{displaymath}
  M_\star(r < r_m) = 2 M_\bullet.
%
  \tag{Merritt 2.11}
  \label{merritt:2.11}
\end{displaymath}
%
In words, $r_m$ is the radius in which the enclosed mass in stars is twice that of the black hole, and the total mass is $3 M_\bullet$. The choice of 2 is somewhat arbitrary, though it is a convenient choice because of the definition of $r_h$ below. This definition, however, is only applicable to spherical galaxies, thereby leading to the alternate definitio of influence radius, $r_h$.

The alternative influence radius, $r_h$, is determined dynamically. It is defined such that the velocity of a circular orbit about the SBH from that distance, $v_c = \sqrt{G M_\bullet / r_h}$, is equal to $\sigma = v_{\rm rms} / \sqrt{3}$.
%
\begin{displaymath}
  r_h \equiv
  \frac{G M_\bullet}{\sigma^2} \approx
  10.8 \qty(\frac{M_\bullet}{10^8 \si{\solarmass}})
       \qty(\frac{\sigma}{\SI{200}{\kilo\meter\per\second}})^{-2} \si{\parsec}
%
  \tag{Merritt 2.12}
  \label{merritt:2.12}
\end{displaymath}
%
$\sigma$ is typically taken to be the rms, line-of-sight velocity of stars within the aperature, which should be centered on the SBH. This is called the \textbf{aperture dispersion}.
%
\begin{equation}
  \sigma^2 = \expval{v_{\mathrm{los}}^2}
%
  \label{eqn:aperture-dispersion}
\end{equation}

\subsection{Primary mass determination methods: Stellar and gas kinematics}

A common error is determining the mass of an SBH without being able to resolve the influence radius, $r_h$. The telescope must have an angular resolution exceeding
%
\begin{displaymath}
  \theta \lesssim
  \frac{r_h}{D} \approx
  0.02'' \qty(\frac{M_\bullet}{10^8 \si{\solarmass}})
         \qty(\frac{\sigma}{\SI{200}{\kilo\meter\per\second}})^{-2}
         \qty(\frac{D}{\SI{10}{\mega\parsec}})^{-1}
%
  \tag{Merritt 2.20}
  \label{merritt:2.20}
\end{displaymath}
%
If the influence radius is well resolved, one expects a \textbf{Keplerian rise} in velocities of stars ($v^2 = G M_\bullet / r$), leading to the definition of $r_h$ above. One should be skeptical of claims of resolving the influence radius and SBH mass in the literature. See Figure 2.5 in the text, which shows how bad some of the published data are.

In the case of galaxies with spherical symmetry, the centripetal motion of the gas near the SBH is
%
\begin{displaymath}
  v_c^2(r) = \frac{G (M_\bullet + M_\star)}{r}
%
  \tag{Merritt 2.22}
  \label{merritt:2.22}
\end{displaymath}

\setcounter{subsection}{2}
\subsection{Mass determination based on empirical correlations}

\section{Supermassive black holes in the Local Group}

\section{Phenomenology}

\setcounter{subsection}{1}
\subsection{Mass--velocity dispersion relation}

The $M_\bullet$--$\sigma$ relation is an empirical correlation between the mass of a galaxy's SBH, and the velocity dispersion of the stars in that galaxy. Typically, $\sigma$ is measured as the aperture dispersion.

The correlation is very tight, and can be expressed as
%
\begin{displaymath}
  \frac{M_\bullet}{10^8 M_\Sun} =
  (1.66 \pm 0.24)
  \qty(\frac{\sigma}{\SI{200}{\kilo\meter\per\second}})^{4.86\pm0.43}
%
  \tag{Merritt 2.33}
  \label{merritt:2.33}
\end{displaymath}

\subsection{Significance of the phenomenological relations}

The tight correlation in $M_\bullet$--$\sigma$ is quite puzzling, as one would think the velocities of stars far from the SBH would not be significantly affected by its mass.

A loose explanation works two other correlations together:
%
\begin{displaymath}
  M_{\mathrm{bulge}} \propto L^{5/4}\ \&\ L \propto \sigma^4 \implies
  M_{\mathrm{bulge}} \propto \sigma^5.
%
  \tag{Merritt 2.36}
  \label{merritt:2.36}
\end{displaymath}
%
This is very close to the observed relation, but one would not expect such a tight correlation from these.

An alternative explanation involves a negative feedback mechanism. By some mechanism, a black hole stops its own growth.

Let $L$ be the energy released in growing an SBH with mass $M(t)$, and let $\eta$ be the accretion efficiency ($\approx 10^{-1}$). Then we have the expression
%
\begin{displaymath}
  L = \eta \dot{M} c^2.
%
  \tag{Merritt 2.37}
  \label{merritt:2.37}
\end{displaymath}
%
Now, this is making a major assumption. It depends on almost all of the potential energy in the gas being released in the form of light. This would not happen if the gas fell straight in, but if it were a gradual process (as an accretion disc would be), then it works.

If we assume $\dot{M}$ to be roughly constant, then we can integrate $L(t)$ to obtain the energy released during formation
%
\begin{displaymath}
  \int_0^T L \dd{t} =
  \eta M(T) c^2 =
  \eta M_\bullet c^2.
\end{displaymath}

Consider that the bulge has a potential energy $G M_{\mathrm{bulge}}^2 / R_{\mathrm{bulge}}$, which, by the virial theorem is equal to twice the kinetic energy, or $M_{\mathrm{bulge}} \sigma^2$.

If we take the ratio of the energy released and the total gravitational potential energy of the bulge, we get
%
\begin{displaymath}
  \frac{E_{\mathrm{released}}}{E_{\mathrm{bulge}}} \approx
  \frac{\eta M_\bullet c^2}{G M_{\mathrm{bulge}}^2 / R_{\mathrm{bulge}}} \approx
  \eta \frac{M_\bullet}{M_{\mathrm{bulge}}} \frac{c^2}{\sigma^2} \approx
  225
  \qty(\frac{\eta}{0.1})
  \qty(\frac{M_\bullet / M_{\mathrm{bulge}}}{10^{-3}})
  \qty(\frac{\sigma}{\SI{200}{\kilo\meter\per\second}})^{-2} \gg
  1,
%
  \tag{Merritt 2.38}
  \label{merritt:2.38}
\end{displaymath}
%
which tells us that the energy released is much greater than that stored in the bulge.

There is more than enough energy released in growing an SBH to unbind the entire bulge.
\href{http://articles.adsabs.harvard.edu/cgi-bin/nph-iarticle_query?1998A%26A...331L...1S&data_type=PDF_HIGH&whole_paper=YES&type=PRINTER&filetype=.pdf}{Silk \& Rees (1998)}
made the argument that the SBH accretes at the Eddington limit:
%
\begin{displaymath}
  L_{\mathrm{edd}} =
  \frac{4 \pi G m_p M_\bullet c}{\sigma_e} \approx
  \num{3.2e12} \qty(\frac{M_\bullet}{10^8 M_\Sun}) L_\Sun
%
  \tag{Merritt 2.39}
  \label{merritt:2.39}
\end{displaymath}
where $m_p$ is the mass of a proton.

If we ask what SBH mass would be required to produce enough energy to unbind the bulge in a single crossing time, we wind up with the result
%
\begin{displaymath}
  M_\bullet \approx
  \frac{\sigma_e \sigma^5}{4 \pi G^2 m_p c} \approx
  \num{3e5} \qty(\frac{\sigma}{\SI{200}{\kilo\meter\per\second}})^5 M_\Sun.
%
  \tag{Merritt 2.42}
  \label{merritt:2.42}
\end{displaymath}
%
This is essentially the $M_\bullet$--$\sigma$ relation, with one caveat: the constant of proportionality is too small, by roughly $10^3$.

Andrew King proposed in 2003, that momentum is the important factor here, not energy. He proposed that the gas driven by SBH radiation will cool efficiently, and that the bulk flow is momentum driven. His proposed equation of motion is
%
\begin{displaymath}
  \dv{t}(R \dot{R}) + \frac{G M_\bullet}{R} =
  -2 \sigma^2 \qty( 1 - \frac{M_\bullet}{M_\sigma} ),
%
  \tag{Merritt 2.46}
  \label{merritt:2.46}
\end{displaymath}
%
where
%
\begin{displaymath}
  M_\sigma \equiv
  \frac{f_g \sigma_e}{\pi G^2 m_p} \sigma^4 \approx
  \num{2e8}
  \qty(\frac{f_g}{0.1})
  \qty(\frac{\sigma}{\SI{200}{\kilo\meter\per\second}})^4
  M_\Sun,
%
  \tag{Merritt 2.47}
  \label{merritt:2.47}
\end{displaymath}
%
and $f_g$ is the cosmic baryon fraction (the ratio of ordinary matter to all matter). The typically assumed value is $f_g \approx 0.16$, which leaves us with a slope on the order of what we expect. However, no mention is made in the book of the discrepancy in the exponent here ($4$) versus what is observed ($4.86\pm0.43$).

\section{Evidence for intermediate-mass black holes}

\begin{table}[h]
  \centering
  \begin{tabular}{l|l}
    \textbf{Class}    & \textbf{Mass Range}
    \\ \hline\hline
    stellar-mass      & $5$--$20$ $M_\Sun$
    \\
    intermediate-mass & $10^2$--$10^6$ $M_\Sun$
    \\
    super-massive     & $>10^6$ $M_\Sun$
  \end{tabular}
  \caption{Classification of black holes by mass}
\end{table}

\section{Evidence for binary and multiple supermassive black holes}

\section*{SBH Masses in AGN}

AGN show \emph{continuum emission} from their nuclei, i.e. emission with a spectrum characteristic of hot gas at a range of temperatures. This is believed to arise from an \emph{accretion disc}.

Broad emission lines (H$\alpha$, H$\beta$, \ldots) originating from broad emission line regions (BLR) are believed to consist of gas clouds orbiting well within the influence radius, but outside the accretion disc.

We could measure the mass of the SBH within some AGN using the relation
%
\begin{equation}
  G M_\bullet = f \times R_{\mathrm{BLR}} \times v_{\mathrm{RMS}}^2,
%
  \label{eqn:agn-mass}
\end{equation}
%
where $v_{\mathrm{RMS}}$ could be measured by the Doppler effect. One issue is that $R_{\mathrm{BLR}}$ is smaller than the influence radius, and cannot be resolved. A workaround is found by
%
\begin{equation}
  R_{\mathrm{BLR}} = c \tau,
%
  \label{eqn:blr-radius}
\end{equation}
%
where $\tau$ is the time lag between a variation in the continuum near the SBH, and a variation in the BLR luminosity. This works because of the finite speed of light.

\section{Gravitational waves}

The amplitude, $h$, of a gravitational wave is a dimensionless quantity given by
%
\begin{displaymath}
  h \approx
  \frac{G}{c^4} \frac{\ddot{Q}}{D} \approx
  \frac{G M_Q}{c^2 D} \frac{v^2}{c^2},
%
  \tag{Merritt 2.55}
  \label{merritt:2.55}
\end{displaymath}
%
where $v$ is the internal velocity of the source, $M_Q$ is the portion of the source's mass (in units of mass, not just 0--1) participating in the quadrupolar motions, and $D$ is the distance to the source.

To understand the detector size needed to observe a gravitational wave, consider the ideal case, where the entire mass is participating in quadrupolar motions ($M_Q = M_{12}$), and the binary is located at a distance $D$ from the observer and $a$ from each other. Then we have $v^2 \approx G M_{12} / a$, and from (\ref{merritt:2.55}) we have
%
\begin{align*}
  h &\approx
  \frac{G M_{12}}{c^2 D} \frac{G M_{12}}{a c^2}
  \\ &\approx
  \frac{G^2}{c^4} M_{12}^2 a^{-1} D^{-1}
  \\ &\approx
  \num{2e-16}
  \qty(\frac{M_{12}}{10^{-8} M_{\Sun}})^2
  \qty(\frac{a}{\si{\milli\parsec}})^{-1}
  \qty(\frac{D}{100\si{\mega\parsec}})^{-1}
%
  \tag{Merritt 2.58}
  \label{merritt:2.58}
\end{align*}

If you measure the rate-of-change of the frequency of gravitational waves from a binary black hole, you will not get its individual mass, but instead a combination of the two, called the ``chirp mass'', which is given by
%
\begin{equation}
  M_{\mathrm{ch}} =
  \sqrt[5]{\frac{(M_1 M_2)^3}{M_1 + M_2}}.
%
  \label{eqn:chirp-mass}
\end{equation}

\end{document}


\section*{Exercise 6.1}
\enum{
\item
There's no enough evidence that the success rate is greater for longer tears.

Large-sample test for differences in proportions will be used.

\spl{
    H_0:\ p_1-p_2=0
}
based on the statistic
\spl{
    Z=\frac{\hat{p_1}-\hat{p_2}}{\sqrt{\frac{\hat{p_1}(1-\hat{p_1})}{n_1}+\frac{\hat{p_2}(1-\hat{p_2})}{n_2}}}.
}

Here we obtain that
\spl{
    \hat{p_1}&=78\%,\\
    \hat{p_2}&=73\%,\\
    Z&=\frac{0.78-0.73}{\sqrt{\frac{0.78(1-0.78)}{18}+\frac{0.73(1-0.73)}{30}}}=0.39.
}

According to the standard normal distribution, $z_{0.05}=1.645$.
Hence $Z=0.39<z_{0.05}$, which means we have no sufficient evidence to support $p_1>p_2$.

\item

The standard deviation is
\spl{
    \sqrt{\frac{0.78(1-0.78)}{18}+\frac{0.73(1-0.73)}{30}}=0.127.
}

The 95\% confidence interval is
\spl{
    p_1-p_2>0+1.645\times0.127=0.209.
}
Thus
\spl{
    p_1-p_2>0.209.
}
}

\section*{Exercise 6.2}
\enum{
\item
The standard deviation is
\spl{
    \sqrt{\frac{\sigma_1^2}{n_1}+\frac{\sigma_2^2}{n_2}}=0.95.
}

\spl{
    \bar{x_1}-\bar{x_2}-z_{0.025}\sqrt{\frac{\sigma_1^2}{n_1}+\frac{\sigma_2^2}{n_2}}&\leq \mu_1-\mu_2\leq \bar{x_1}-\bar{x_2}+z_{0.025}\sqrt{\frac{\sigma_1^2}{n_1}+\frac{\sigma_2^2}{n_2}}\\
    -6-1.96\times0.95&\leq \mu_1-\mu_2\leq-6+1.96\times0.95\\
}
Hence,
\spl{
    \mu_1-\mu_2=(-6.00\pm1.86)cm/s.
}
\item
\spl{
    Z_0=\frac{\bar{x_1}-\bar{x_2}}{\sqrt{\frac{\sigma_1^2}{n_1}+\frac{\sigma_2^2}{n_2}}}=\frac{-6}{0.95}=-6.32<-1.96=-z_{0.025}.
}

Hence, we reject $H_0$ at a 5\% level of significance.

\item
We know that
\spl{
    \beta=1-p=0.10,\quad,\alpha=0.05,\quad \sigma=3cm/s,\quad\delta=14cm/s.
}

Hence,
\spl{
    n\approx\frac{2(z_{\alpha/2}+z_{\beta})^2\sigma^2}{\delta^2}=\frac{2(1.96+1.28)^2\times3^2}{14^2}=0.96.
}

}

\section*{Exercise 6.3}
\spl{
    H_0:\ \sigma_1^2=\sigma_2^2\quad H_1:\ |\sigma_1^2-\sigma_2^2|\geq0.5
}
Thus,
\spl{
    F_{n_1-1,n_2-1}&=F_{9,15}=\frac{s_1^2}{s_2^2}=\frac{4.7^2}{5.8^2}=0.66<f_{0.025,9,15}=3.1227\\
    F_{n_2-1,n_1-1}&=F_{15,9}=\frac{s_2^2}{s_1^2}=\frac{5.8^2}{4.7^2}=1.52<f_{0.025,15,9}=3.7694
}
We claim that $\sigma_1^2=\sigma_2^2$ at a 5\% level of significance.

Hence, there's no sufficient evidence to conclude that the two population variances differ by at least 0.5 grams per liter.

\section*{Exercise 6.4}
We set the hypotheses
\spl{
    H_0: \sigma_1^2=\sigma_2^2,\quad H_1: \sigma_1^2\neq\sigma_2^2
}
We know that
\spl{
    s_1^2=0.0015,\quad s_2^2=0.0120.
}

Then using $F$ test, we obtain
\spl{
    F_{n_1-1,n_2-1}=F_{9,9}=\frac{0.0015}{0.0120}=0.1234.
}
Hence,
\spl{
    F_{9,9}=0.1234<f_{0.025,9,9}&=4.0260\\
    F_{9,9}=0.1234<f_{0.975,9,9}&=0.2484\\
}

Thus, we claim $\sigma_1^2\neq\sigma_2^2$ at 5\% level of significance.

Since $0.1234\approx f_{0.9977,9,9}$, then the P-value is $0.0023\times2=0.0046$.

\section*{Exercise 6.5}
\enum{
\item
We set the hypothesis
\spl{
    H_0:\ \mu_1-\mu_2=0
}
We know form the table that
\spl{
    (\bar{x}_1-\bar{x}_2)=15.32-15.38=-0.06.
}
Thus we use pooled T-Test
\spl{
    S_p^2&=\frac{(9-1)\times0.0124+(9-1)\times0.0323}{9+9-2}=0.0223.\\
    T_{9+9-2}&=\frac{(\bar{X}_1-\bar{X}_2)-0}{\sqrt{0.0223(9^{-1}+9^{-1})}}=\frac{-0.06}{0.0704}=-0.852.\\
    |T_{16}|=0.852<t_{0.025,16}=2.1199.
}

Hence, we claim that $\mu_1=\mu_2$ at 5\% level of significance. The temperature does not affect the mean reading of concentration.
\item
We set the hypothesis
\spl{
    H_0:\ \mu_1-\mu_2=0
}
We know form the table that
\spl{
    (\bar{x}_1-\bar{x}_2)=0.430444-1.65844=-1.228.
}
Thus we use pooled T-Test
\spl{
    S_p^2&=\frac{(9-1)\times0.0420+(9-1)\times0.0660}{9+9-2}=0.054.\\
    T_{9+9-2}&=\frac{(\bar{X}_1-\bar{X}_2)-0}{\sqrt{0.054(9^{-1}+9^{-1})}}=\frac{-1.228}{0.110}=-11.21.\\
    |T_{16}|&=11.21>t_{0.025,16}=2.1199.
}

Hence, we claim that $\mu_1\neq\mu_2$ at 5\% level of significance. The temperature affects the mean reading of concentration.
}

\section*{Exercise 6.6}
\enum{
\item
\spl{
    H_0:\ \sigma_1^2=\sigma_2^2
}
We apply $F$ test.
\spl{
    F_{9,15}&=\frac{s_1^2}{s_2^2}=\frac{9}{7.29}=1.23\\
    f_{0.1,9,15}&=2.0862\\
    f_{0.9,9,15}&=0.4274\\
}

Since $F_{9,15}<f_{0.1,9,15}$ and $F_{9,15}>f_{0.9,9,15}$, then we claim that $\sigma_1^2=\sigma_2^2$ at 0.2 level of significance.
\item
\spl{
    s_p^2=\frac{(10-1)\times9+(16-1)\times7.9}{10+16-2}=8.3125.
}
\item
The statistic is
\spl{
    T_{24}=\frac{\mu_1-\mu_2-(64.95-57.06)}{\sqrt{8.3125(10^{-1}+16^{-1})}}=\frac{\mu_1-\mu_2-7.89}{1.16}
}
Then, the 99\% confidence interval on $\mu_1-\mu_2$ is
\spl{
    \mu_1-\mu_2&=7.89\pm t_{0.005,24}\cdot1.16\\
    \mu_1-\mu_2&=7.89\pm3.25.
}
\item
We claim the there's a difference between $\mu_1$ and $\mu_2$ because we are 99\% sure that $\mu_1-\mu_2>4.64$.
}

\section*{Exercise 6.7}
We set the hypothesis
\spl{
    H_0:\ \mu_1=\mu_2 \quad H_1:\ \mu_1<\mu_2,
}
which is a one-sided hypothesis.

We know that
\spl{
    &\bar{x}_1=0.210,\quad s_1^2=0.001116.\\
    &\bar{x}_2=0.225,\quad s_2^2=0.001099.
}
Then,
\spl{
    T_{9+9-2}&=\frac{(\bar{X}_1-\bar{X}_2)-0}{\sqrt{s_p^2(9^{-1}+9^{-1})}}\\
    &=\frac{0.210-0.225}{\sqrt{(8\times0.001116+8\times0.001099)/16\times0.22}}\\
    &=\frac{-0.015}{0.0157}\\
    &=-0.955.
}

Since $t_{0.05,16}=1.7459$, then $T_{16}>-t_{0.05,16}$.

Hence, we claim that we have no sufficient evidence to support $\mu_1<\mu_2$ at 5\% level of significance.

\section*{Exercise 6.8}
\spl{
    H_0:\ \mu_1=\mu_2,\quad H_1: \mu_1>\mu_2
}
We denote $D=X_2-X_1$, so that
\spl{
    \overline{D}=-16.93, \quad s_D=33.7.
}
\spl{
    T_{15}=\frac{-16.93}{33.7/\sqrt{15}}=-1.945.
}

Since $t_{0.05,15}=1.7531$, then $T_{15}<-t_{0.05,15}$. Hence we reject $\mu_1=\mu_2$ and claim that $\mu_1>\mu_2$ at 5\% level of significance.

Using Wilcoxon Rank-Sum Test, we set
\spl{
    H_0:\ M_D=0\quad H_1:\ M_D<0.
}

\begin{table}[H]
    \centering
    \begin{tabular}{cc}\hline
        D & Rank\\\hline
        -4 & -1.5\\
        4 & 1.5\\
        9 & 3\\
        -11 & -4.5\\
        11 & 4.5\\
        14 & 6\\
        -15 & -7.5\\
        15 & 7.5\\
        -33 & -9.5\\
        33 & 9.5\\
        -37 & -11\\
        -46 & -12\\
        -48 & -13\\
        -56 & -14\\
        -90 & -15\\\hline
    \end{tabular}
\end{table}

Thus, $W_+=32$, $W_-=88$, $W=\min(W_-,W_+)=32$.
However, for $n=15$ at 5\% level of significance, we have a critical value $n=30$ for one-sided test. $W>30$.

Thus, we claim $M_1=M_2$ at 5\% level of significance.


\documentclass[12pt]{article}
\usepackage{geometry}
\usepackage{amsmath,amssymb,amstext,amsfonts}
\usepackage{graphicx}

\begin{document}

\section*{Example Assignment}
\section*{Foundations of Computational Math}
\subsubsection*{Due date: 11:59PM on September 23rd 2048}

\vspace{0.5in}

\subsection*{Problem}

Consider the forward, backward, and central difference approximations to the derivative of $f$ at $x$, respectively:

\begin{enumerate}
    \item $\displaystyle F_h[f](x) = \frac{f(x+h) - f(x)}{h}$
    \item $\displaystyle B_h[f](x) = \frac{f(x) - f(x-h)}{h}$
    \item $\displaystyle C_h[f](x) = \frac{f(x+h) - f(x-h)}{2h}$
\end{enumerate}

\noindent Analyze the absolute error in the above numerical approximations as $h \to 0$, for the following:
\begin{enumerate}
    \item $f_1(x) = \sin(x)$ at $x=1.0$ and $x=2.0$.
    \item $f_2(x) = \exp\left(-\frac{x^2}{2}\right)$ at $x=1.1$ and $x=2.2$.
\end{enumerate}
Confirm numerically the order (with respect to $h$) of the respective numerical approximations.

\vspace{0.1in}

% \subsection*{Problem 2}
%
% Consider the interval, $[a,b]$, with $N$ equally-spaced subintervals, of spacing $h = \frac{b-a}{N}$. A function, $f(x)$, is sampled at the grid points, $x_i = a+i \cdot h$, for $i=0, 1, \ldots, N$.
%
% \vspace{0.2in}
%
% \noindent Devise a numerical approximation to $f'(x)$ using finite difference operations that is $O(h^2)$ both in the interior ($i=1,\ldots,N-1$), and at the boundaries ($i=0$, $i=N$).
%
% \vspace{0.2in}
%
% \noindent Confirm the order of your method numerically, for $f(x) = \sin(x)$ on $[0,\frac{\pi}{2}]$, for increasing values of $N$, using the norm $\displaystyle ||f'(x) - D_h[f](x)||_\infty = \max_i |f'(x_i) - D_h[f](x_i)|$, where $D_h$ is your difference operator.

\pagenumbering{gobble}

\end{document}


% 16integrationonmanifolds.tex
% Fund Science! & Help Ernest finish his Physics Research! : quantum super-A-polynomials - a thesis by Ernest Yeung
%
% http://igg.me/at/ernestyalumni2014
%
% Facebook     : ernestyalumni
% github       : ernestyalumni
% gmail        : ernestyalumni
% google       : ernestyalumni
% linkedin     : ernestyalumni
% tumblr       : ernestyalumni
% twitter      : ernestyalumni
% youtube      : ernestyalumni
% indiegogo    : ernestyalumni
%
% Ernest Yeung was supported by Mr. and Mrs. C.W. Yeung, Prof. Robert A. Rosenstone, Michael Drown, Arvid Kingl, Mr. and Mrs. Valerie Cheng, and the Foundation for Polish Sciences, Warsaw University.

\subsection*{Integration of Functions on Riemannian Manifolds}

\begin{proposition}[16.28]
  $(M,g)$ oriented Riemannian manifold with or without $\partial$ \\
Suppose $f$ compactly supported cont. on $M$, $f\in \mathbb{R}$, $f\geq 0$ \\
Then $\int_M f dV_g \geq 0$ \\
\phantom{Then } $\int_M f dV_g = 0$ iff $f=0$
\end{proposition}

\begin{proof}
  If $f$ supported in \\
\quad \, domain of single oriented smooth chart $(U,\varphi)$  \\

By Prop. 15.31

\[
\int_M f dV_g = \int_{ \varphi{(U)}} f(x) \sqrt{ \text{det}{ (g_{ij} ) } } dx^1 \dots dx^n \geq 0
\]

\end{proof}

\exercisehead{16.29} given oriented Riemannian manifold $(M,g)$ \\
\quad compact supported cont. $f: M \to \mathbb{R}$ \\

Then if $f$ supported in \\
\phantom{Then } domain of single oriented smooth chart $(U,\varphi)$

\[
\left| \int_M f dV_g \right| = \left| \int_{ \varphi{ (U)} } f(x) \sqrt{ \text{det}{ (g_{ij} )} } dx^1 \dots dx^n \right| \geq \int_{\varphi{ (U)} } |f(x) | \sqrt{ \text{det}{ (g_{ij})} } dx^1 \dots dx^n = \int_M |f| dV_g
\]

where inequality above is from some thm. in calculus.

\hrulefill

\subsection*{The Divergence Theorem}

\begin{equation}
  \begin{aligned}
    & * : C^{\infty}{ (M)} \to \Omega^n{ (N) } \\
    & * f = f dV_g
\end{aligned} \quad \quad \quad \, (16.10)
\end{equation}
smooth bundle isomorphism

EY : 20140501 smooth bundle isomorphism?

smooth bundle isomorphism

\[
\begin{aligned}
  & \beta : \mathfrak{X}{(M)} \to \Omega^{n-1}{ (M) } \\
  &  \beta(X) = X \righthalfcup dV_g
\end{aligned}
\]

technical lemma
\begin{lemma}[16.30]
  $(M,g)$ oriented Riemannian manifold with or without $\partial$ \\
  Suppose $S \subseteq M$ immersed hypersurface with orientation by \\
\phantom{Suppose } unit normal vector field $N$ and \\
\phantom{Suppose } $\widetilde{g}$ induced metric on $S$ \\

If $X$ any vector field along $S$,

\begin{equation}
  i^*_S{ (\beta{ (X)} )}  = \langle X, N \rangle_g dV_{\widetilde{g}} \quad \quad \quad \, (16.12)
\end{equation}

\end{lemma}

\begin{proof}
Define vector fields $X^T$, $X^{\perp}$ along $S$

\[
\begin{aligned}
&  X^{\perp} = \langle X, N\rangle_g N \\
&  X^T =  X - X^{\perp}
\end{aligned}
\]

\[
\beta(X) = X \righthalfcup dV_g = X^{\perp} \righthalfcup dV_g + X^T \righthalfcup dV_g
\]

pull back to $S$

Prop. 15.32

\[
i^*_S{ (X^{\perp} \righthalfcup dV_g) }  = \langle X, N \rangle_g i^*_S{ (N \righthalfcup dV_g) } = \langle X, N \rangle_g dV_{ \widetilde{g}}
\]

If $X_1 \dots X_{n-1}$ any vectors tangent to $S$

\[
(X^T \righthalfcup dV_g){ (X_1 \dots X_{n-1} ) } = dV_g{ (X^T, X_1 \dots X_{n-1} ) } = 0
\]

\end{proof}


\section{Experiments}
\label{sec:expts}
It should be noted that in the original data set if every pixel grey scale value were to be used as a feature to train for the model might result in a huge set of features. Having such set of features may cause a commnon phenomena known as "the curse of dimensionality", which implicates that the increase in the dimensional space resulted from the increase in the number of features might dilute the statisical significance of the final result.\cite{bellman}
That being said, in order to reduce the complexity of the final model in the hope of avoiding overfitting problems, a feature selection process was implemented for the experiments.\cite{hall}
\subsection{Feature Selections}
\label{feature}
According to Hall, feature selection process consists of the following steps:
\begin{itemize}
	\item Starting point
	\item Search orgnization
	\item Evaluation strategy
	\item Stopping criterion
In this section, th
\end{itemize}
As introduced in the "Data Preparation" section, after some inspections through the data sets, it was observed that some pixels's grey scale values stayed the same all the time. Those points generally are more likely to have no significant coreThus, those low-variance features could be the starting points.
The backward elemination method was adpoted, which means that only deletions were considered.
\subsection{Classifiers}
\label{class}
\paragraph{Super Vector Machines}


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

\chapter{Non-Linear Partial Differential Equations}
\label{APP: NEWTON}

The solution $u_i$ is given as a solution of
the nonlinear equation
\begin{equation} \label{APP NEWTON EQU 40}
\int_{\Omega} v_{i,j} \cdot X_{ij} + v_{i} \cdot Y_{i} \; dx
+ \int_{\partial \Omega}  v_{i} \cdot y_{i} \; ds  = 0
\end{equation}
for all smooth $v_i$ with $v_i=0$ where $q_i>0$ and
\begin{equation} \label{APP NEWTON EQU 40b}
u_i=r_i \mbox{ where } q_i>0
\end{equation}
where $X_{ij}$ and $Y_i$ are non-linear functions of the solution $u_k$ and its gradient $u_{k,l}$
and $y_i$ is a function of solution $u_k$. For further convenience we will use the
notation
\begin{equation} \label{APP NEWTON EQU 40c}
<F(u),v> :=\int_{\Omega} v_{i,j} \cdot X_{ij} + v_{i} \cdot Y_{i} \; dx
+ \int_{\partial \Omega}  v_{i} \cdot y_{i} \; ds
\end{equation}
for all smooth $v$ on $\Omega$. If one interprets $F(u)$ as defined above as a functional
over the set of admissible functions $v$
equation~(\ref{APP NEWTON EQU 40}) can be written in compact formulation
\begin{equation} \label{APP NEWTON EQU 40d}
F(u)= 0
\end{equation}

\section{Newton-Raphson Scheme}
This equation is iteratively solved by the Newton-Raphson method\index{Newton-Raphson method}, see \cite{Kelley2004a}.
Starting with the initial guess
$u^{(0)}$ the sequence
\begin{equation} \label{APP NEWTON EQU 43}
  u^{(\nu)}= u^{(\nu-1)} - \delta^{(\nu-1)}
\end{equation}
for $\nu=1,2,\ldots \;$ generates the (general) Newton-Raphson iteration for the
solution $u$. The correction $\delta^{(\nu-1)}$ is the solution of the linear problem
\begin{equation} \label{APP NEWTON EQU 43b0}
< \fracp{F}{u^{(\nu-1)}} \delta^{(\nu-1)} ,v > = <F(u^{(\nu-1)}),v>
\end{equation}
for all smooth $v$ on $\Omega$ with $v_i=0$ where $q_i>0$.
where
\begin{equation} \label{APP NEWTON EQU 43b}
< \fracp{F}{u} \cdot \delta ,v > =
\int_{\Omega} \left( \fracp{X_{ij}}{u_{k,l}} v_{i,j}\delta_{k,l} +
\fracp{X_{ij}}{u_{k}} v_{i,j}\delta_{k} + \fracp{Y_{i}}{u_{k,l}} v_{i}\delta_{k,l} +
\fracp{Y_{i}}{u_{k}} v_{i}\delta_{k} \right) \; dx
+ \int_{\partial \Omega}
\fracp{y_{i}}{u_{k}} v_{i}\delta_{k} \; ds
\end{equation}
It is assumed that the initial guess $u^{(0)}$ fulfills the constraint~(\ref{APP NEWTON EQU 40b}).
The $\delta^{(\nu-1)}$ has to fulfill the homogeneous constraint.
Notice that the calculation of $\delta^{(\nu-1)}$ requires the solution of a linear PDE
as presented in section~\ref{SEC LinearPDE}.

The Newton iteration should be stopped in the $k$-th step if for
all components of the solution the error of the Newton
approximation is lower than the given relative tolerance {rtol}:
\begin{equation}\label{APP NEWTON EQU 61}
    \| u_{i} - u_{i}^{(\nu)} \|_{\infty} \le \mbox{rtol} \cdot \|u_{i} \|_{\infty}  \; ,
\end{equation}
for all components $i$
where $\|. \|_{\infty}$ denoted the $L^{sup}$ norm. To measure the quality of the solution approximation
on the level of the equation we introduce the weak norm
\begin{equation}\label{APP NEWTON EQU 62}
  \| F(u) \|_{i} := \sup_{v , v=0 \mbox{ where } q_{i}>0 } \frac{<F(u), ve_{i}>}{\|v\|_1}
\end{equation}
where $(e_{i})_{j}=\delta_{ij}$ and $\|v\|_1=\int_{\Omega} |v| \,dx$ is the $L^1$ norm of $v$
\footnote{In practice a discretization method is applied to solve the update $\delta^{(\nu-1)}$.
In this case also an approximation of $\| F(u) \|_{i}$ is calculated taking the maximum over all
base function used to represent the solution $u$.}.

The stopping criterion (\ref{APP NEWTON EQU 61}) is changed to the level of
equation.  We use the reasonable heuristic but mathematically
incorrect argument that the change on the level of the solution and
the change on the level of the equation are proportional:
\begin{equation}\label{APP NEWTON EQU 64}
 \frac{ \| u_i - u^{(\nu)}_i \|_{\infty} }{ \| 0 - F(u^{(\nu)}) \|_{i} } =
 \frac{ \| \delta^{(\nu)}_i \|_{\infty} }{ \| F(u^{(\nu)}) - F(u^{(\nu-1)}) \|_{i} }  \; .
\end{equation}
where we assume that that component $\nu$ $F(u)$ is mainly controlled by component $\nu$ of the solution.

We assume that the term $F(u^{(\nu)})$ can be neglected versus
$F(u^{(\nu-1)})$ since $u^{(\nu)}$ is a better approximation,
and use the stopping criterion in the formulation:
\begin{equation} \label{APP NEWTON EQU 65}
        \| F(u^{(\nu)}) \|_i \le
  \frac{ \| F(u^{(\nu-1)})\|_{i} \cdot  \|u_{i} \|_{\infty} }  { \| \delta^{(\nu)}_i \| _{\infty} }
   \,\mbox{\it rtol}\, =:\, \mbox{\it qtol}_i \; ,
\end{equation}
which has to hold for all components $\nu$.
Now {\it qtol} defines a tolerance for the level of equation.  This stopping criterion is not free of problems, because a
decrease of the defect $F(u^{(\nu)})$ coupled with a constant
correction $\delta^{(\nu)}$ suggests a good approximation.
But the quality of the approximation $u^{(\nu)}$ is ensured if the
Newton iteration converges quadratically.  This convergence behavior
is given by the error estimation:
\begin{equation}
    \| u - u^{(\nu)} \|_{\infty} \le C \;
    \| u - u^{(\nu-1)} \|_{\infty}^2
\end{equation}
with a positive value $C$, see \cite{Kelley2004a}.  Therefore a quadratic
convergence of the Newton iteration can be assumed if the corrections
of the current and the last step fulfill the following condition:
\begin{equation} \label{APP NEWTON EQU 66}
  \max_{i}
  \frac{\| \delta^{(\nu)}_i \|_{\infty} }{\| \delta^{(\nu-1)}_i \|_{\infty} }
                           < \frac{1}{5} \;,
\end{equation}
where the limit $\frac{1}{5}$ was found by a large number of experiments.
The approximation $u^{(\nu)}$ is accepted if the conditions
(\ref{APP NEWTON EQU 65}) and (\ref{APP NEWTON EQU 66}) hold.  Consequently a
safe approximation requires at least two Newton steps.

To stop a divergent iteration, which occurs for a bad initial solution,
the norms of the defects for the $(k-1)$-th and $k$-th
Newton step are compared.  Here we use the estimation
\begin{equation} \label{APP NEWTON EQU 67}
  \| F(u^{(\nu)}) \|_i \le
  \gamma \| F(u^{(\nu-1)}) \|_i
\end{equation}
for the defects.  The value $0<\gamma<1$ depends on $F$
and the distance of the initial guess $u^{(0)}$ to the true solution $u$.
Since the constant $\gamma$ is unknown and can be close to one,
convergence is assumed if the following (weaker) condition holds
for all components $i$:
\begin{equation} \label{APP NEWTON EQU 68}
  \| F(u^{(\nu)}) \|_i
  < \| F(u^{(\nu-1)}) \|_i \; .
\end{equation}
If condition (\ref{APP NEWTON EQU 68}) fails, divergence may begin. Therefore
under-relaxation is started.  Beginning with $\omega=1$
the Newton-Raphson iteration is computed by
\begin{equation} \label{APP NEWTON EQU 69}
  u^{(\nu)} = u^{(\nu-1)} - \omega \, \delta^{(\nu)}
\end{equation}
instead of (\ref{APP NEWTON EQU 43}).  If this new iteration fulfills the
condition (\ref{APP NEWTON EQU 68}) of decreasing defect, we accept it.  Otherwise
we put $\omega \rightarrow \frac{\omega}{2}$, recompute $u^{(\nu)}$ from equation
(\ref{APP NEWTON EQU 69}) and retry condition (\ref{APP NEWTON EQU 68}) for the
new $u^{(\nu)}$, and so on until either condition (\ref{APP NEWTON EQU 68})
holds or $\omega$ becomes to small ($\omega < \omega_{lim}=0.01$).  In the latter case the
iteration gives up. The under-relaxation
converges only linearly for $\omega<1$. it is a rather robust
procedure.
 which switches back to $\omega=1$ as soon as possible.
The price for the robustness is the additional computation of the
defects.

Due to the quadratic convergence near the solution the error decreases
rapidly.  Then the solution will not change much and it will not be
necessary to mount a new coefficient matrix in each iteration step.
This algorithm is called the simplified Newton method.  It converges
linearly by
\begin{equation}
    \| u_i - u^{(\nu)}_i \|_{\infty} \le \gamma^{\nu}
    \| u_i - u ^{(0)}_i \|_{\infty} \; ,
\end{equation}
where $\gamma$ equals the $\gamma$ in the estimation (\ref{APP NEWTON EQU 67}).
If the general iteration converges quadratically
(condition (\ref{APP NEWTON EQU 66}) holds) and we have
\begin{equation}
   \| F(u^{(\nu)}) \|_i < 0.1
              \| F(u^{(\nu-1)}) \|_i
\end{equation}
for all components $\nu$,
we can expect $\gamma \le 0.1$.  Then the simplified iteration produces
one digit in every step and so we change from the general to the
simplified method.  The `slow' convergence requires more iteration steps,
but the expensive mounting of the coefficient matrix is saved.

The lienar PDE~(\ref{APP NEWTON EQU 43b}) is solved with with a certain tolerance, namely when
the defect of the current
approximation of $\delta^{(\nu)}$ relative to the defect of
the current Newton iteration is lower than {LINTOL}.  To avoid
wasting CPU time the FEMLIN iteration must be controlled by an
efficient stopping criterion.  We set
\begin{equation}
  \mbox{LINTOL} = 0.1 \cdot \max ( \left( \frac{\|\delta^{(\nu)}_i\|_{\infty}}{\|u_i^{(\nu)}\|_{\infty}} \right)^2
,\min_{i} \frac{\mbox{qtol}_i}{\|F(u^{(\nu)})\|_{i}} )
\end{equation}
but restrict {LINTOL} by
\begin{equation}
       10^{-4} \le \mbox{LINTOL} \le 0.1 \quad \mbox{ and } \quad
             \mbox{LINTOL}=0.1 \; \mbox{ for }\nu=0  \;.
\end{equation}
The first term means that it would be useless to compute digits by the
linear solver, which are overwritten by the next Newton step.  In the
region of quadratic convergence the number of significant digits is
doubled in each Newton step, i.e.~later digits are overwritten by the
following Newton-Raphson correction, see \cite{Schoenauer1981a}.  The second
mean that no digits should be computed which are in significance
below the prescribed tolerance {\it rtol}.  The number $0.1$ is a `safety factor' to take care
of the coarse norm estimations. Figure~\ref{APP NEWTON PIC 61} shows the workflow of
the Newton-Raphson update algorithm.

\begin{figure}
\begin{center}
{
\unitlength0.92mm
\begin{picture}(200,235) \thicklines

\put(-10,-065){\begin{picture}(170,280) \thicklines

\newsavebox{\BZar}
\savebox{\BZar}(0,0) {
   \thicklines
   \put(0,10){\line(-3,-1){30}}
   \put(0,10){\line(3,-1){30}}
   \put(0,-10){\line(-3,1){30}}
   \put(0,-10){\line(3,1){30}}
   \put(0,20){\vector(0,-1){10}}
   \put(0,-10){\vector(0,-1){10}}
   \put(30,0){\vector(1,0){25}} }
\newsavebox{\BZal}
\savebox{\BZal}(0,0) {
   \thicklines
   \put(0,10){\line(-3,-1){30}}
   \put(0,10){\line(3,-1){30}}
   \put(0,-10){\line(-3,1){30}}
   \put(0,-10){\line(3,1){30}}
   \put(0,20){\vector(0,-1){10}}
   \put(0,-10){\vector(0,-1){10}}
   \put(-30,0){\vector(-1,0){10}} }

\put(20,285){\framebox(60,20){\parbox{48mm}
           {Start: \\ $\nu=0$ , $\omega=1$ \\
            calculate $F(u^{(0)})$ }} }
\put(50,285){\vector(0,-1){10}}
\put(20,265){\framebox(60,10){\parbox{48mm}
           {next iteration: $\nu \leftarrow \nu+1$}} }
\put(50,265){\vector(0,-1){10}}
\put(20,240){\framebox(60,15){\parbox{54mm}
           {\hspace*{2.00mm} Solve \\
            $\fracp{F}{ u^{(\nu-1)}} \delta^{(\nu)} =
                                 F(u^{(\nu-1)})$}} }
\put(50,240){\vector(0,-1){10}}
\put(20,220){\framebox(60,10){\parbox{48mm}
           {$\omega = \min(2\,\omega,1)$}} }
\put(50,220){\vector(0,-1){10}}
  \put(120,225){\line(-3,-1){30}}
  \put(120,225){\line(3,-1){30}}
  \put(120,205){\line(-3,1){30}}
  \put(120,205){\line(3,1){30}}
  \put(110,214){$\omega \le \omega_{lim}$ ?}
  \put(83,219){no}
  \put(153,219){yes}
  \put(090,215){\vector(-1,0){40}}
  \put(150,215){\line(1,0){05}}
\put(20,200){\framebox(60,10){\parbox{48mm}
{$u^{(\nu)} = u^{(k-1)} - \omega\delta^{(\nu)}$}} }
\put(50,180){\usebox{\BZar}}
\put(30,179){$F(u^{(\nu)}) < F(u^{(\nu-1)})$ ?}
\put(83,184){no}
\put(55,165){yes}
  \put(105,175){\framebox(30,10){\parbox{23mm}
             {$\omega=\omega/2$}} }
  \put(120,185){\vector(0,1){20}}

\put(20,145){\framebox(60,15){\parbox{48mm}
           {evaluate stopping criteria~(\ref{APP NEWTON EQU 65})  \\
           and if not simplified mode~(\ref{APP NEWTON EQU 66}) } } }
\put(50,145){\vector(0,-1){10}}

\put(50,125){\usebox{\BZar}}
\put(34,120){\shortstack{stopping criterion \\ satisfied ?}}
\put(83,129){yes}
\put(55,110){no}
  \put(105,117.5){\framebox(30,15){\parbox{23mm}
             {Newton ends \\ successfully!}} }
  \put(135,125){\vector(1,0){20}}
\put(50,095){\usebox{\BZal}}
\put(26,093.5){$F(u^{(\nu)}) < 0.1 F(u^{(\nu-1)})$ ?}
\put(12,099){no}
\put(55,080){yes}
\put(20,065){\framebox(60,10){\parbox{48mm}
           {switch to simplified Newton!}} }
\put(20,070){\vector(-1,0){10}}

    \put(155,215){\vector(0,-1){60}}
    \put(140,145){\framebox(30,10){\parbox{23mm}
               {Newton fails!}} }
    \put(155,145){\vector(0,-1){070}}
    \put(155,070){\oval(40,10)\makebox(0,0){END}}

\put(010,280){\line(0,-1){210}}
\put(010,280){\vector(1,0){40}}

\end{picture} }
\end{picture} }
\end{center}

\caption{\label{APP NEWTON PIC 61}Flow diagram of the Newton-Raphson algorithm}
\end{figure}

\section{Local Sensitivity Analysis}
If the coefficients
$X_{ij}$, $Y_i$ and $y_{i}$ in equation~(\ref{APP NEWTON EQU 40})
depend on a vector of input factors $f_i$ index{input factor} and its gradient one is interested in how the solution $u_i$
is changing if the input factors are changed. This problem is called a local sensitivity
analysis \index{local sensitivity analysis}. If $u(f)$ denotes the
solution of equation~(\ref{APP NEWTON EQU 40}) for the input factor $p$
and $u(f+\alpha \cdot g)$ denotes the solution
for a perturbed value  $f+\alpha \cdot g$ for input factor $f$ where
$q$ denotes the direction of perturbation and $\alpha$ is the small scaling factor.
The derivative of the solution in the direction $g$ is defined as
\begin{equation}
\fracp{u}{g} : = \lim_{\alpha \rightarrow 0} \frac{ u(f+\alpha \cdot g) - u(f)}{\alpha}
\end{equation}
In practice one needs to distinguish between the cases of a spatially constant
spatially variable. In the first case $g$ is set to a unit vector while
in a second case an appropriate function needs to be given for $g$.

The function  $\fracp{u}{g}$ is calculated from solving the equation
\begin{align} \label{APP NEWTON EQU 100}
\int_{\Omega} \left( \fracp{X_{ij}}{u_{k,l}} v_{i,j} \left(\fracp{u_k}{g}\right)_{,l} +
\fracp{X_{ij}}{u_{k}} v_{i,j}\fracp{u_k}{g} + \fracp{Y_{i}}{u_{k,l}} v_{i}\left(\fracp{u_k}{g}\right)_{,l}  +
\fracp{Y_{i}}{u_{k}} v_{i}\fracp{u_k}{g}\right) \; dx
+ \int_{\partial \Omega}
\fracp{y_{i}}{u_{k}} v_{i}\fracp{u_k}{g}\; ds \\
+ \int_{\Omega} v_{i,j}  \left( \fracp{X_{ij}}{f_{k,l}} g_{k,l} + \fracp{X_{ij}}{f_{k}} g_k \right)
+ v_{i} \left( \fracp{Y_{i}}{f_{k,l}} g_{k,l} +  \fracp{Y_{i}}{f_{k}} g_k \right) \; dx
+ \int_{\partial \Omega}  v_{i}
\fracp{y_{i}}{f_{k}}  g_k\; ds
\end{align}
for all smooth $v$ on $\Omega$ with $v_i=0$ where $q_i>0$
for the unknown sensitivity $\fracp{u}{g}$.
Notice that this equation is similar to the equation which needs to be solved for
the Newton-Raphson correction $\delta_k$, see equation~(\ref{APP NEWTON EQU 43b}).


\chapter{Position of starting node}\label{ch:starting-node}

In the analysis done in \chref{ch:analysis} we have ignored a factor that
influence the performance of the network: the position in the floorplan of the
user that sends out the first message (the ``starting user''). To understand why
this factor is important, see \figref{fig:startnodeexplain}. When the starting
user (the blue node) is in the center (\figref{subfig:startnodecenter}), the
message is sent radially in all the directions. In the general case, the ``area
of reachability'' is equal to \(\alpha\cdot\pi\cdot R^2\) where \(\alpha\) is a
constant that it is equal to \(1\) when the starting user is in the center;
\(\frac{1}{2}\) when the starting user is at the border
(\figref{subfig:startnodeborder}); \(\frac{1}{4}\) when the starting user is in
the corner (\figref{subfig:startnodecorner}). This may limit the capability of
the network to reach the full coverage and it may also increase the total
broadcast time.

\begin{figure}[hbt]
	\centering
	\begin{subfigure}{0.25\textwidth}
		\centering
		\includegraphics[width=\textwidth]{img/start-node-position-center}
		\caption{The starting user (blue) placed in the center can reach
		all the users inside the green
		area (\(\alpha = 1\))}\label{subfig:startnodecenter}
	\end{subfigure}
	\begin{subfigure}{0.35\textwidth}
		\centering
		\includegraphics[width=\textwidth]{img/start-node-position-border}
		\caption{The starting user (blue) placed in the border can reach
		all the users inside the green
		area (\(\alpha = \frac{1}{2}\))}\label{subfig:startnodeborder}
	\end{subfigure}
	\begin{subfigure}{0.35\textwidth}
		\centering
		\includegraphics[width=\textwidth]{img/start-node-position-corner}
		\caption{The starting user (blue) placed in the corner can reach
		all the users inside the green
		area (\(\alpha = \frac{1}{4}\))}\label{subfig:startnodecorner}
	\end{subfigure}
	\caption{The area of reachability for the first message changes based on
	where the starting user is placed}\label{fig:startnodeexplain}
\end{figure}

Of course, the best scenario for both the coverage and the total broadcast time,
is the one where the starting user is in the center of the floorplan; the worst
is when the starting user is in the corner.

The Jupyter notebooks used for the analysis of this factor are placed in the
\code{analysis/StartNode/} folder.

\input{starting-node/coverage}
\input{starting-node/time}


\subsection{Sequential games}

\subsubsection{Introduction}

A game can have multiple rounds. For example an agent could offer a trade, and the other agent could choose to accept or reject the trade. As later agents know the other choices, and the earlier agents know their choices will be observed, the games can change.

This doesn’t change games with pure strategies, but does affect those with mixed strategies. For example, even if prisoners could see earch other in the prisoners dilemma we would still get the same outcome. The last agent still prefers to “tell”, and earlier agents know this and have no reason to not also “tell”.

But consider the football/opera game. Here the first mover is better off, and there is a pure strategy, while in the rock paper scissors game the first mover loses.

We can solve more complex games backwards. As the actions in the last round of a game have no impact on others, they can be solved separately. Agents then know what the outcome will be if an outcome is arrived at, and can treat that “subgame” as a pay-off.

This method is known as backwards induction.

\subsubsection{One-round sequential games}

\subsubsection{Backwards induction}

\subsubsection{Zero-sum games}

\subsubsection{Subgame perfect equilibrium}

\subsubsection{Nash equilibrium}


\chapter{d'Alembert's Principle}\label{c1}
\section{Beyond Newton's laws}\label{c1s1}
Newton's programme of classical mechanics has a few limitations.
\begin{enumerate}
\item It needs a frame of reference in which Newton's first law is valid.
\item Newton's second law
\begin{equation}\label{c1s1e1}
m\ddot{x} = F_x, m\ddot{y} = F_y, m\ddot{z} = F_z
\end{equation}
requires that we use the Cartesian coordinate system. However, the symmetry of
a few problems suggests that we use other systems. If $q_i$ are the coordinates
in the other systems then in general,
\begin{equation}\label{c1s1e2}
m\ddot{q}_i \ne F_i,
\end{equation}
where $F_i$ in this case is the $q_i$ component of the force which \emph{may
not} be the same as the $F_i$ in equation \eqref{c1s1e1}.
\item Equation \eqref{c1s1e1} requires that we know $F_i$. This is often not the
case when the motion is constrained. When a bead is constrained to move along
the wire in which it is woven we do not know the force that stops the bead
from leaving the wire.
\item Newton's third law does not hold good when electromagnetic forces are
involved.
\end{enumerate}

The first of these limitations can be overcome by introducing pseudo-forces.
The second one can be circumvented by carefully evaluating the components of
the acceleration in coordinate systems other than the Cartesian. The third one
is can be tamed by using d'Alembert's principle which we introduce next. The
fourth one requires a redefinition of momentum which can be done systematically
in Lagrange's formulation of classical mechanics.

\section{d'Alembert's principle}\label{c1s2}
Consider a few examples of constrained motion.
\begin{enumerate}
\item A beam constrained to move along a circular hoop. If the hoop is centred
at the origin and in the $xy$ plan then the constraint is
\begin{equation}\label{c1s2e1}
x^2 + y^2 = a^2,
\end{equation}
where $a$ is the radius of the hoop.
\item A particle constrained to move along an inclined plane. If $x, y,
z$ are the coordinates of the particle then they must be confined to
the plane
\begin{equation}\label{c1s2e2}
lx + my + nz = p
\end{equation}
where $l, m, n$ are the direction cosines of the normal to the plane
and $p$ is its distance from the origin.
\item Particles of a rigid body in which the distances between the particles
is constant. If $(x_n, y_n, z_n$ denote the coordinates of the $n$th particle
then
\begin{equation}\label{c1s2e3}
\sum_{i=1}^3\sqrt{(x_n-x_m)^2 + (y_n-y_m)^2 + (z_n-z_m)^2} = \text{constant}
\end{equation}
for all $n, m = 1, \ldots, N$, $N$ being the number of particles of the rigid
body.
\item Molecules of a monoatomic gas confined to a box. If the box is centred
at the origin and is a cube of side $a$ then
\begin{equation}\label{c1s2e4}
-\frac{a}{2} \le x_n, y_n, z_n \le \frac{a}{2},
\end{equation}
where $(x_n, y_n, z_n)$ are the coordinates of the $n$th gas molecule.
\item A disc rolling without slipping on a plane. Let us assume that the disc
has a radius $a$ and it rolls on the $xy$ plane. To specify the motion we
need to know where on the plane the disc is, which point of the disc is in
contact with the plane and how is the disc oriented. The point of contact can
be specified by its coordinates $(x, y)$, the point of the disc by its
angular separation $\phi$ from a fixed line on the disc and the orientation
of the disc by another angle $\theta$ between the disc and the $x$ direction.
The velocity of the point of contact has a magnitude $a\dot{\phi}$ and a
direction perpendicular to the plane of the disc. The plane of the disc makes
an angle $\theta$ with the positive $x_1$ direction. Therefore, the velocity
makes an angle $\pi/2 - \theta$ with the positive $x$ direction. Thus,
\begin{eqnarray}
v_x &=& a\sin\theta\dot{\phi} \label{c1s2e5} \\
v_y &=& a\cos\theta\dot{\phi} \label{c1s2e6}
\end{eqnarray}
We can write these equations in terms of the coordinates $(x, y, \phi,
\theta)$ used to specify the motion.
\begin{eqnarray}
dx &=& a\sin\theta d\phi \label{c1s2e7} \\
dy &=& a\cos\theta d\phi \label{c1s2e8}
\end{eqnarray}
\end{enumerate}
Refer to section 1.2 of Rana and Joag's book \cite{rc} for many more examples
of contraints of various kinds. Constraints in the first three examples are
called \emph{holonomic} because they can be expressed as a (whole) function
\begin{equation}\label{c1s2e9}
f(q_1, q_1, \ldots) = 0.
\end{equation}
The constraint of equation \eqref{c1s2e4} is not holonomic because it involves
inequalities. The constraints of equations \eqref{c1s2e7} and \eqref{c1s2e8}
are not holonomic because the two equations cannot be integrated unless we
fix $\theta$ \cite{goldstein2002classical}. We further note that for all
holonomic constraints the force of constraint is perpendicular to the direction
of motion of the particles. Therefore, the forces of constraint do not do any
work on the particles. This is not the case when the holonomic constraints
depend on time. For example, if the length of the bob changes with time, the
actual motion of the bob is not perpendicular to the tension in the string.
In order to treat such constraints like the time-independent ones, d'Alembert
introduced the idea of a \emph{virtual displacement}. A virtual displacement
happens instantaneously without violating the constraint. In the case of the
bob of a pendulum whose length varies with time, the virtual displacement is
always perpendicular to the tension in the string because it happens without
a passage of time. The work done in a virtual displacement is called the
\emph{virtual work}.

d'Alembert proposed the principle that infinitesimal virtual work by forces of
constraint is zero when the virtual displacement is reversible. The condition
of reversibility rules out dissipative constraints like frictional forces.

Let us now consider Newton's equation for a single particle. We can write the
total force on the particle as sum of external forces
$F_i$ and constraint forces $F^c_i$ so that
\begin{align}
\left.
\begin{array}{ll}
m\ddot{x} &= F_x + F^c_x \\
m\ddot{y} &= F_y + F^c_y \\
m\ddot{z} &= F_z + F^c_z
\end{array}
\right\}\label{c1s2e10}
\end{align}
If $\delta x, \delta y, \delta z$ denote an infinitesimal virtual displacement
in each coordinate then
\begin{equation}\label{c1s2e11}
(m\ddot{x} - F_x)\delta x + (m\ddot{y} - F_y)\delta y + (m\ddot{z} - F_z)
\delta z = F^c_x\delta x + F^c_y\delta y + F^c_z\delta z
\end{equation}
d'Alembert's principle of virtual work states that the right hand side is zero
so that
\begin{equation}\label{c1s2e12}
(m\ddot{x} - F_x)\delta x + (m\ddot{y} - F_y)\delta y + (m\ddot{z} - F_z)
\delta z = 0.
\end{equation}
This is the mathematical form of d'Alembert's principle. Its chief advantage
is that it does not involve the forces of constraint. However, it is not at
all as simple as equation \eqref{c1s1e1} because the virtual displacements
$\delta x, \delta y, \delta z$ are not independent. We can generalise it to a
system of $N$ particles as
\begin{equation}\label{c1s2e13}
\sum_{i=1}^N\left(
(m_i\ddot{x}_i - X_i)\delta x_i + (m\ddot{y_i} - Y_i)\delta y_i +
(m_i\ddot{z}_i - Z_i) \delta z_i\right) = 0,
\end{equation}
where $X_i, Y_i, Z_i$ are the $x, y, z$ components of the external forces on
the $i$th particle. Once again we emphasize that the virtual displacements
$\delta x_i, \delta y_i, \delta z_i$ are not independent if the system moves
under constraints.  Therefore, there is no way to simplify \eqref{c1s2e13}
any further.

Examples of d'Alembert's principle.
\begin{enumerate}
\item Consider the motion of a simple pendulum in $xz$ plane. The motion
of the bob is constrained by the equation
\begin{equation}\label{c1s2e14}
x^2 + z^2 = l^2,
\end{equation}
where $l$ is the length of the string. We can express it as
\begin{equation}\label{c1s2e15}
x\delta x + z\delta z = 0,
\end{equation}
where we interpret $\delta x$ and $\delta z$ as virtual displacements.
From d'Alembert's principle of equation \eqref{c1s2e13} we get
\begin{equation}\label{c1s2e16}
(m\ddot{x} - F_x)\delta x + (m\ddot{z} - F_z)\delta z = 0.
\end{equation}
$F_x = 0$ and $F_z = -mg$ gives
\begin{equation}\label{c1s2e17}
\ddot{x} \delta x + (\ddot{z} + g)\delta z = 0.
\end{equation}
For small oscillations $z \approx -l$ (origin being at the point the string
is held fixed) so that equation \eqref{c1s2e15} becomes
$x \delta x \approx l \delta z$ so that equation \eqref{c1s2e17} can
be written as
\begin{equation}\label{c1s2e18}
\ddot{x} \delta x + (0 + g)\left(\frac{x}{l}\right)\delta x = 0
\Rightarrow \left(\ddot{x} + \frac{g}{l}x\right)\delta x = 0.
\end{equation}
If this equation must be true for all virtual displacements,
\begin{equation}\label{c1s2e19}
\ddot{x} + \frac{g}{l}x = 0.
\end{equation}
Note that the d'Alembert's principle of equation \eqref{c1s2e17} could be
simplified only after we used the equation of constraint \eqref{c1s2e15}. This
theme will recur each time we apply d'Alembert's principle for constrained
dynamical systems.

\item Consider Atwood's machine with masses $m_1$ and $m_2$ connected with
an ideal string wound aroung an ideal pulley. If $x_1$ and $x_2$ denote their
displacements then the equation of constraint is
\begin{equation}\label{c1s2e20}
x_1 + x_2 = l,
\end{equation}
$l$ being the length of the string connecting the two masses. In terms of
virtual displacement, the equation of constraint becomes
\begin{equation}\label{c1s2e21}
\delta x_1 + \delta x_2 = 0.
\end{equation}
d'Alembert's principle applied to the system gives
\begin{equation}\label{c1s2e22}
(m_1\ddot{x}_1 - F_1)\delta x_1 + (m_2\ddot{x}_2 - F_2)\delta x_2
= 0.
\end{equation}
Since $F_1 = -m_1g, F_2 = -m_2g$ we have
\begin{equation}\label{c1s2e23}
m_1(\ddot{x}_1 + g)\delta x_1 + m_2(\ddot{x}_2 + g)\delta x_2 = 0.
\end{equation}
From equation \eqref{c1s2e20} $\ddot{x}_1 = -\ddot{x}_2$ and from equation
\eqref{c1s2e21} we have $\delta x_1 = -\delta x_2$ so that \eqref{c1s2e23}
becomes
\begin{equation}
\left(m_1(\ddot{x}_1 + g) - m_2(-\ddot{x}_1 + g)\right)\delta x_1 = 0.
\end{equation}
As this equation is valid for all virtual displacements we have
\begin{equation}\label{c1s2e25}
\ddot{x}_1 = -\frac{m_1 - m_2}{m_1 + m_2}g.
\end{equation}

\item If a particle is constrained to move along a circle of radius $a$,
centred at the origin and if there are no external forces then d'Alembert's
principle gives
\begin{equation}\label{c1s1e26}
m\ddot{x}\delta x + m\ddot{y}\delta y = 0.
\end{equation}
Since the particle is constrained to move on the circle, $x = a\cos\theta$
and $y = a\sin\theta$. Therefore,
\begin{eqnarray}
\delta x &=& -a\sin\theta \delta\theta \\
\delta y &=& a\cos\theta  \delta\theta
\end{eqnarray}
and
\begin{eqnarray}
\dot{x} &=& -a\sin\theta\dot{\theta} \\
\ddot{x} &=& -a\cos\theta\dot{\theta}^2 - a\sin\theta\ddot{\theta} \\
\dot{y} &=& a\cos\theta\dot{\theta} \\
\ddot{y} &=& -a\sin\theta\dot{\theta}^2 + a\cos\theta\ddot{\theta}
\end{eqnarray}
so that equation \eqref{c1s1e26} becomes
\[
\ddot{x}\delta x + \ddot{y}\delta y = (a^2\sin\theta\cos\theta
\dot{\theta}^2 + a^2\sin^2\theta\ddot{\theta} - a^2\sin\theta\cos\theta
\dot{\theta}^2 + a^2\cos^2\theta\ddot{\theta})\delta\theta = 0
\]
or $\ddot{\theta}\delta\theta = 0$ which implies that $\dot{\theta} = $ a
constant. In this problem we used the equation of constraint to replace
the two coordinates $x$ and $y$ with a single one $\theta$.
\end{enumerate}

Some more examples of constraints.
\begin{enumerate}
\item A rigid rod is constrained to move within a spherical bowl so that
is tends always touch the bowl's inner surface \cite[Problem 3, chapter 2]
{akr}. Without the constraint of the bowl, six degrees of freedom suffice t
describe the motion of the rod.  If $x_1, y_1, z_1$ and $x_2, y_2, z_2$ are
the coordinates of the end-points of the rod then then equations of
constraint are
\begin{eqnarray}
x_1^2 + y_1^2 + z_1^2 &=& a^2 \\
x_2^2 + y_2^2 + z_2^2 &=& a^2 \\
(x_1 - x_2)^2 + (y_1 - y_2)^2 + (z_1 - z_2)^2 &=& l^2 \\
l &\le& a
\end{eqnarray}
Thus, the motion of the rod can be described by two coordinates alone. One
of them tells the `latitude' of the centre of the rod and the other one the
`longitude'.

\item A spherical pendulum is not restricted to move in a plane. Therefore,
we need three coordinates $x, y, z$ to describe its motion. They are
constrained to obey
\begin{equation}\label{c1s2e37}
x^2 + y^2 + z^2 = l^2.
\end{equation}
Expressing the constraint in terms of virtual displacements,
\begin{equation}\label{c1s2e38}
x\delta{x} + y\delta{y} + z\delta{x} = 0
\end{equation}
d'Alembert's principle gives
\begin{equation}\label{c1s2e39}
\ddot{x}\delta{x} + \ddot{y}\delta{y} + (\ddot{z} + g)\delta{z} = 0
\end{equation}
\end{enumerate}

\section{Lagrange's equations of the first kind}\label{c1s3}
We mentioned that the virtual displacements $\delta x_i, \delta y_i,
\delta z_i$ are not
independent in a system under constraints. If we restrict ourselves to
holonomic constraints then each constraint is an equation of the form
\begin{equation}\label{c1s3e1}
\varphi_i(x_1, \ldots, z_N) = 0.
\end{equation}
The index $i$ ranges from $1$ to $m$, the number of constraints. We can
write each of these equations as
\begin{equation}\label{c1s3e2}
\sum_{j=1}^{N}\left(\pd{\varphi_i}{x_j}\delta x_j
+ \pd{\varphi_i}{y_j}\delta y_j
+ \pd{\varphi_i}{z_j}\delta z_j\right) = 0
\end{equation}
We now multiply each of these equations with a constant $\lambda_i$ and
add them to \eqref{c1s2e13} to get
\begin{align}
\sum_{j=1}^N \left(m_j\ddot{x}_j - X_j +
\sum_{k=1}^m \lambda_k\pd{\varphi_i}{x_j} \right)\delta x_j & + \nonumber \\
\sum_{j=1}^N \left(m_j\ddot{y}_j - Y_j +
\sum_{k=1}^m \lambda_k\pd{\varphi_i}{y_j} \right)\delta y_j & + \nonumber \\
\sum_{j=1}^N \left(m_j\ddot{z}_j - Z_j +
\sum_{k=1}^m \lambda_k\pd{\varphi_i}{z_j} \right)\delta z_j & = 0 \label{c1s3e3}
\end{align}
This equation has $3N$ terms on the left hand side. Choose $\lambda_k$
such that for the first $m$ terms
\begin{equation}\label{c1s3e4}
\sum_{j=1}^N \left(m_j\ddot{u}_j - U_j +
\sum_{k=1}^m \lambda_k\pd{\varphi_i}{u_j} \right)\delta u_j = 0,
\end{equation}
where $u$ and $U$ could denote $x, y, z$ or $X, Y, Z$ depending on $m$.
Equation \eqref{c1s3e3} now has only $3N - m$ terms. The virtual displacements
in each of these can be considered to be independent. Therefore, \eqref{c1s3e4}
can be considered to be true for all $3N$ terms. Equation \eqref{c1s3e4} is
called \emph{Lagrange's equation of the first kind}. In fact,
\begin{equation}
Q_i = \left(\sum_{k=1}^r\lambda_k \pd{\varphi_k}{x_i},
            \sum_{k=1}^r\lambda_k \pd{\varphi_k}{y_i},
            \sum_{k=1}^r\lambda_k \pd{\varphi_k}{z_i}\right)
\end{equation}
is the force of constraint on the $i$th particle.

As an example of this approach, consider the equation of constraint of a
spherical pendulum given in \eqref{c1s2e38}. We can combine it with
d'Alembert's equation \eqref{c1s2e39} to get
\begin{equation}\label{c1s3e6}
(\ddot{x} + \lambda x)\delta{x} + (\ddot{y} + \lambda y)\delta{y} +
(\ddot{z} + g + \lambda z)\delta{z} = 0
\end{equation}
Now we consider the amplitude of oscillation to be small, that is $x_3 \approx
-l$ and $\ddot{x}_3 \approx 0$ so that the third term \eqref{c1s3e6} is
\[
0 + g - \lambda l.
\]
It vanishes if we choose $\lambda = g/l$ and we get
\begin{eqnarray}
\ddot{x} + \frac{g}{l}x &=& 0 \\
\ddot{y} + \frac{g}{l}y &=& 0
\end{eqnarray}
are the equations of motion of the spherical pendulum.

We next use Lagrange's method to find the force of constraint in Atwood
machine. Combining the equation of constraint \eqref{c1s2e21} with
d'Alembert's equation \eqref{c1s2e23} we get
\begin{equation}
m_1\left(\ddot{x}_1 + g + \frac{\lambda}{m_1}\right)\delta x_1 +
m_2\left(\ddot{x}_2 + g + \frac{\lambda}{m_2}\right)\delta x_2 = 0.
\end{equation}
Choose $\lambda$ such that
\begin{equation}
\ddot{x}_1 + g + \frac{\lambda}{m_1} = 0
\end{equation}
that is
\begin{equation}
\lambda = -m_1(\ddot{x}_1 + g).
\end{equation}
Using equation \eqref{c1s2e25} we get
\begin{equation}
\lambda = \frac{2m_1m_2}{m_1 + m_2}g
\end{equation}
as the tension in the string.

Lagrange's equations of the first kind solve the problem of involving the
forces of constraint in the problem. Yet, they are firmly rooted in the
Cartesian coordinate system. In the next chapter we will severe this connection
with the Cartesian coordinates.

Before we close we remark that the framework of this section can be used
for time-dependent constraints. If equation \eqref{c1s3e1} is written as
\begin{equation}\label{c1s3e13}
\varphi_i(x_1, \ldots, z_N, t) = 0
\end{equation}
then equation \eqref{c1s3e2} becomes
\begin{equation}\label{c1s3e14}
\sum_{j=1}^{N}\left(\pd{\varphi_i}{x_j}\delta x_j
+ \pd{\varphi_i}{y_j}\delta y_j
+ \pd{\varphi_i}{z_j}\delta z_j + \pd{\varphi_i}{t}\delta t\right) = 0
\end{equation}
However, when we interpret $\delta x_j, \delta y_j, \delta z_j$ as virtual
displacements then $\delta t$ is zero and the rest of the analysis applies
without change.


% Created 2021-11-30 Tue 08:25
% Intended LaTeX compiler: pdflatex
\documentclass[presentation,aspectratio=169]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{grffile}
\usepackage{longtable}
\usepackage{wrapfig}
\usepackage{rotating}
\usepackage[normalem]{ulem}
\usepackage{amsmath}
\usepackage{textcomp}
\usepackage{amssymb}
\usepackage{capt-of}
\usepackage{hyperref}
\usepackage{khpreamble}
\DeclareMathOperator{\atantwo}{atan2}
\usetheme{default}
\author{Kjartan Halvorsen}
\date{\today}
\title{Sensitivity and robustness}
\hypersetup{
 pdfauthor={Kjartan Halvorsen},
 pdftitle={Sensitivity and robustness},
 pdfkeywords={},
 pdfsubject={},
 pdfcreator={Emacs 26.3 (Org mode 9.4.6)},
 pdflang={English}}
\begin{document}

\maketitle

\section{Intro}
\label{sec:org4453306}

\section{The sensitivity function}
\label{sec:org37d7547}

\begin{frame}[label={sec:org140e392}]{Sensitivity and complementary sensitivity}
\small

\begin{center}
\includegraphics[width=0.8\linewidth]{../../figures/2dof-block-complete}
\end{center}
\pause
\begin{enumerate}
\item Determine the closed-loop transfer function \(G_v(s)\) from \(v(t)\) to \(y(t)\) and the transfer function \(G_n(t)\) from \(n(t)\) to \(y(t)\).
\end{enumerate}
\pause
\begin{enumerate}
\setcounter{enumi}{1}
\item Show that if \(F_{fb}(s)\) and/or \(G(s)\) contains an integrator (pole in the origin), then \(G_v(0) = 0\) and \(G_n(0) = -1\). This means that constant disturbances are completely eliminated, but a constant measurement error (sensor bias) is passed unattenuated to the output.
\end{enumerate}
\end{frame}

\begin{frame}[label={sec:org08e019f}]{The Nyquist plot and stability margins}
\begin{center}
\includegraphics[width=0.4\linewidth]{../../figures/implane-nyquist-margins}
\end{center}
\end{frame}

\begin{frame}[label={sec:org7251ce2}]{The sensitivity function}
\begin{center}
\includegraphics[width=0.4\linewidth]{../../figures/implane-sensitivity}
\end{center}

\[ S(i\omega) = G_v(i\omega) = \frac{1}{ 1 + G_o(i\omega)} = \frac{1}{1 + G(i\omega)F_{fb}(i\omega)} \]
\end{frame}

\begin{frame}[label={sec:orgeec76bd}]{The sensitivity function}
\begin{center}
\includegraphics[width=0.7\linewidth]{../../figures/sensitivity-example}
\end{center}
\end{frame}

\section{Stein}
\label{sec:orgace975b}

\begin{frame}[label={sec:orgb1d669d}]{Interpretations of the sensitivity function}
Several important interpretations of the sensitivity function \(S(s)\)
\begin{enumerate}
\item \(S(i\omega)\) tells us how well our closed-loop system attenuates disturbances of different frequencies
\item Its maximum value is a measure of how close the closed-loop system is to being unstable.
\item \(S(i\omega)\) tells us how modelling errors or modelling variations of the plant influences the closed-loop system
\end{enumerate}
\end{frame}

\begin{frame}[label={sec:orgee41180}]{An important limitation}
\begin{center}
\includegraphics[width=0.5\linewidth]{../../figures/Stein-title.png}
\end{center}
\end{frame}

\begin{frame}[label={sec:orgc23a577}]{An important limitation}
\begin{center}
\includegraphics[width=0.5\linewidth]{../../figures/stein-serious-design.png}
\end{center}

\[ \int _{0}^{\infty }\ln |S(i\omega )|d\omega =\int _{0}^{\infty }\ln \left|{\frac {1}{1+G_o(i\omega )}}\right|d\omega =\pi \sum Re(p_{k}) \]
\end{frame}

\begin{frame}[label={sec:org16d9c7b}]{An important limitation}
\begin{center}
\includegraphics[width=0.6\linewidth]{../../figures/sensitivity-linear.png}
\end{center}
\end{frame}
\section{Robustness}
\label{sec:orga013b17}
\end{document}


\section{Functional analysis}\label{sec:functional_analysis}

\Fullref{sec:real_analysis} and \fullref{sec:complex_analysis} study certain functions with values in \hyperref[def:vector_space_dimension]{finite-dimensional} \hyperref[def:hilbert_space]{Hilbert spaces}. Functional analysis studies spaces of functions arising from real or complex analysis. These spaces are mostly infinite-dimensional, and a lot of results hold for general infinite-dimensional \hyperref[def:vector_space]{vector spaces}.

Nevertheless, we will only study vector spaces over \hyperref[def:set_of_real_numbers]{\( \BbbR \)} or \hyperref[def:set_of_complex_numbers]{\( \BbbC \)}. This is justified by \fullref{rem:real_field_extensions}. As in \fullref{sec:complex_analysis}, through this section, \( \BbbK \) will refer to either \( \BbbR \) or \( \BbbC \).


\chapter{Statistical Inference}
\chaptermark{Inference}
\label{sec:inference}

The idea of extrapolating knowledge from a \emph{sample} to a population is known as \emph{statistical inference}.
It encompasses the ideas of \emph{parameter estimation}, \emph{confidence intervals}, and \emph{hypothesis testing}.
We will assume the reader is familiar with these, but recall some required terminology.
The QC and SPC terminology are not always consistent with statisticians' terminology. When new names are given to old ideas, we will emphasize this in the text.

\begin{description}
\item [Null/Alternative Hypothesis] Some statement about the world we wish to test with data. The frequentist argument follows a Popperian philosophy\footnote{Following Karl Popper's philosophy of science, we can never know that something is true, we can only know when it is not true. Popper philosophy was motivated by the fact that no one suspected Isaac Newton's mechanics to be wrong, until relativity theory was proposed by Einstein.}: to show the alternative hypothesis is true, we will show that the null hypothesis is not true.
In the context of quality control, the null hypothesis will be the process is \emph{in statistical control}, while the alternative will be that it is \emph{out of control}.\marginnote{In Control}
Other terms for the alternative hypothesis are the \emph{research hypothesis}, or simply the \emph{signal}.
\item [Statistical Test] The procedure of inferring from data on the truthfulness of the alternative hypothesis.
\item [Assumptions] As the name suggests, these are assumptions. We stress that unlike hypothesis, assumptions are not being tested in a statistical test.
\item [Test Statistic] The function of the data to be computed for the purpose of inference. As such, it is a random variable.
May also be though of as a \emph{signal detector}.
\item [Null/Alternative Distribution] The distribution of the test statistic under the null/alternative hypothesis.
\item [Type I/II error] See Figure~\ref{fig:confusion_table}.
\item [False/True Positive/Negative] See Figure~\ref{fig:confusion_table}.
\item [Rejection Region] The collection of event that will lead us to reject the null hypothesis, and believe in the alternative hypothesis.
\item [p-value] A.k.a. \emph{observed significance}. The null probability of the observed (or ``more extreme'') event.
\item [Significance Level] A.k.a. $\alpha$. The probability of a false positive.
\item [Power] The probability of a true positive.
\item [i.i.d.] ``Independent and identically distributed'' (i.i.d.) is an assumption made on the sampling distribution, meaning that samples are statistically independent, and all originating from the same distribution.

\end{description}

\begin{figure}
\centering
\includegraphics[width=0.8\linewidth]{art/Beware-of-False-Positives-Chart-1}
\caption[Confusion Table]{Type I/II error confusion table. \newline \url{https://infocus.emc.com/william_schmarzo/beware-of-false-positives/}}
\label{fig:confusion_table}
\end{figure}

\begin{extra}[ROC termininology]
%TODO: ROC terminology

The engineering, statistical, and information retrieval literature, define error and precision criteria\footnote{\url{https://en.wikipedia.org/wiki/Receiver_operating_characteristic}}:
\begin{description}
	\item[True Positive Rate] ...
	\item[Sensitivity] ...
	\item[Recall] ...
	\item[False Positive Rate] ...
	\item[Fallout] ...
	\item[Specificity]
	\item[Miss Rate]
	\item[Prevalence]
	\item[True Negative Rate]
	\item[Accuracy]
	\item[Positive Predictive Value]
	\item[Precision]
	\item[False Omission rate]
	\item[False Discovery Rate]
	\item[Negative Predictive Value]
	\item[Positive Likelihood Ratio]
	\item[Negative Likelihood ratio]
	\item[Disgnostic odds ratio]
\end{description}
\end{extra}

The following sections of this chapter present particular statistical inference methods we will be using in the following chapters.

\begin{think}
Can you design a test with type I error larger its power?
Would you ever want such a test?
Think about it using the analogy to statistical tests and criminal courts.
\end{think}


\documentclass{subfile}

\begin{document}
	\section{APC}\label{sec:apc}

		\begin{problem}[APC $2006$, problem $5$]
			Prove that for all positive integer $n$ and positive real numbers $a,b,c$, the following inequality holds:
				\begin{align*}
					\dfrac{a^{n+1}}{a^{n}+a^{n-1}b+\ldots+b^{n}}+\dfrac{b^{n+1}}{b^{n}+b^{n-1}c+\ldots+c^{n-1}}+\dfrac{c^{n+1}}{c^{n}+c^{n-1}+\ldots+a^{n}}
						& \geq\dfrac{a+b+c}{n+1}
				\end{align*}
		\end{problem}

		\begin{problem}[APC $2005$, problem $3$]
			Let $a_{0},\ldots,a_{n}$ be real numbers such that
				\begin{enumerate}[(a)]
					\item $0= a_{0}\leq\ldots\leq a_{n}$
					\item For $0\leq i<j\leq n$, $a_{j}-a_{i}\leq j-i$
				\end{enumerate}
			Prove that
				\begin{align*}
					\sum_{i=0}^{n}a_{i}^{2}
						& \geq\sum_{i=0}^{n}a_{i}^{3}
				\end{align*}
		\end{problem}

		\begin{problem}[APC $2005$, problem $10$]%Radon
			Determine all pairs of non-negative integers $(k,n)$ such that the following inequality holds for all positive real numbers $x,y$:
				\begin{align*}
					1+\dfrac{y^{n}}{x^{k}}
						& \geq\dfrac{(1+y)^{n}}{(1+x)^{k}}
				\end{align*}
		\end{problem}

		\begin{problem}[APC $2003$, problem $8$]
			Given real numbers $x_{1}\geq\ldots\geq x_{2003}\geq0$. Show that
				\begin{align*}
					x_{1}^{n}-x_{2}^{n}+\ldots+x_{2003}^{n}
						& \geq (x_{1}-x_{2}+\ldots+x_{2003})^{n}
				\end{align*}
			for any positive integer $n$.
		\end{problem}

		\begin{problem}[APC $2001$, problem $3$]
			Let $a,b,c$ be sides of a triangle. Prove that
				\begin{align*}
					2
						& \leq \dfrac{a+b}{c}+\dfrac{b+c}{a}+\dfrac{c+a}{b}-\dfrac{a^{3}+b^{3}+c^{3}}{abc}\leq3
				\end{align*}
		\end{problem}

		\begin{problem}[APC $2000$, problem $9$]
			Let $a,b,c$ be non-negative real numbers such that $a+b+c=1$. Prove that
				\begin{align*}
					2\leq(1-a^{2})^{2}+(1-b^{2})^{2}+(1-c^{2})^{2}
						& \leq (1+a)(1+b)(1+c)
				\end{align*}
		\end{problem}

		\begin{problem}[APC $1999$, problem $2$]
			Find the best possible $k,l$ such that
				\begin{align*}
					k
						& <\dfrac{v}{v+w}+\dfrac{w}{w+x}+\dfrac{x}{x+y}+\dfrac{y}{y+z}+\dfrac{z}{z+x}<l
				\end{align*}
			for all positive real numbers $v,w,x,y,z$.
		\end{problem}

		\begin{problem}[APC $1998$, problem $1$]
			Let $x_{1},x_{2},y_{1},y_{2}$ be real numbers such that $x_{1}^{2}+x_{2}^{2}\leq1$. Prove that
				\begin{align*}
					(x_{1}y_{1}+x_{2}y_{2}-1)^{2}
						& \geq(x_{1}^{2}+x_{2}^{2}-1)(y_{1}^{2}+y_{2}^{2}-1)
				\end{align*}
		\end{problem}

		\begin{problem}[APC $1997$, problem $7$]
			Let $p,q$ be arbitrary real numbers.
				\begin{enumerate}[(a)]
					\item Prove that $p^2+q^2+1>p(q+1)$.
					\item Determine the largest possible $b$ such that $p^{2}+q^{2}+1>bp(q+1)$ for all $p,q$.
					\item Determine the largest possible $c$ such that $p^{2}+q^{2}+1>cp(q+1)$ for all integer $p,q$.
				\end{enumerate}
		\end{problem}

		\begin{problem}[APC $1995$, problem $9$]
			Prove that for all positive integers $m,n$ and all real numbers $x,y$, the following inequality holds:
				\begin{align*}
					(n-1)(m-1)\left(x^{n+m}+y^{n+m}\right)+(n+m-1)\left(x^{n}y^{m}+x^{m}y^{n}\right)
						& \geq nm\left(x^{n+m-1}y+y^{n+m-1}x\right)
				\end{align*}
		\end{problem}

		\begin{problem}[APC $1993$, problem $6$]
			If $a,b$ are non-negative real numbers, prove the inequality
				\begin{align*}
					\left(\dfrac{\sqrt{a}+\sqrt{b}}{2}\right)^{2}
						& \leq \dfrac{a+\sqrt[3]{a^{2}b}+\sqrt[3]{ab^{2}}+b}{4}\leq\dfrac{a+\sqrt{ab}+b}{3}\leq\sqrt{\left(\dfrac{a^{2/3}+b^{2/3}}{2}\right)^{3}}
				\end{align*}
		\end{problem}
\end{document}


\section{Uniqueness of Analytic Continuation; Gluing}
\subsection{Analytic Continuation Revisited}
The space of germs contains information about the class of analytic functions that agree on a neighbourhood of some given point.
Since we have seen that the space of germs admits a natural topological and analytical stucture, there should be some correlation between paths in this space and the analytic continuations along some paths in the original domain.
\begin{theorem}
    Let $(f,U),(g,V)$ be function elements on a domain $D\subset\mathbb C$ and $\gamma:[0,1]\to D$ be a path starting in $U$ and ending in $V$.
    Then $(f,U)\approx_\gamma (g,V)$ iff $\gamma$ lifts to some $\tilde{\gamma}$ in (a component of) $\mathcal G$ joining $[f]_{\gamma(0)}$ and $[g]_{\gamma(1)}$.
\end{theorem}
\begin{proof}
    Suppose $(f,U)\approx_\gamma(g,V)$, then we have $(f,U)=(f_1,U_1)\sim\cdots\sim (f_n,U_n)=(g,V)$ and a dissection $0=t_0<t_1<\cdots <t_{n-1}<t_n=1$ such that $\gamma([t_{i-1},t_i])\subset U_i$ for all $i\in\{1,\ldots,n\}$.
    Now define a lift $\tilde{\gamma}$ of $\gamma$ to $\mathcal G$ via $\tilde{\gamma}(t)=[f_i]_{\gamma(t)}$ for $t\in[t_{i-1},t_i]$.
    It is well-defined since $f_i|_{U_i\cap U_{i+1}}=f_{i+1}|_{U_i\cap U_{i+1}}$ as $(f_i,U_i)\sim (f_{i+1},U_{i+1})$ is a direct analytic continuation.
    Also observe that on $[t_{i-1},t_i]$ we have $\tilde{\gamma}=(\pi|_{[f_i]_{U_i}})^{-1}\circ\gamma$ which is continuous.
    Therefore $\tilde{\gamma}|_{[t_{i-1},t_i]}$ is continuous for all $i$, hence it is continuous.
    Now for each $t\in[t_{i-1},t_i]$, $\pi\circ\tilde{\gamma}(t)=\pi([f_i]_{\gamma(t)})=\gamma(t)$, so $\tilde{\gamma}$ does lift $\gamma$.
    Easily $\tilde{\gamma}(0)=[f_1]_{\gamma(0)}=[f]_{\gamma(0)}$ and $\tilde{\gamma}(1)=[f_n]_{\gamma(1)}=[g]_{\gamma(1)}$ by construction, as required.\\
    Conversely, suppose such $\tilde\gamma$ exists, then every point $\tilde{\gamma}(t)$ has a neighbourhood $[f_t]_{U_t}$ where $(f_t,U_t)$ is a function element on $D$ and each $U_t$ is a disk.
    Compactness of $[0,1]$ we can choose a finite collection of function elements $(f_1,U_1),\ldots,(f_n,U_n)$ among them and a dissection $0=t_0<t_1<\cdots <t_{n-1}<t_n=1$ such that $\tilde{\gamma}([t_{i-1},t_i])\subset [f_i]_{U_i}$.
    Then as $\tilde\gamma$ is a lift of $\gamma$, $\gamma([t_{i-1},t_i])\subset U_i$ for any $i$.
    Also for any $i$, $[f_{i-1}]_{\gamma(t_{i-1})}=\tilde{\gamma}(t_{i-1})=[f_i]_{\gamma(t_{i-1})}$, therefore $f_{i-1}$ and $f_i$ agrees on a neighbourhood of $\gamma(t_{i-1})\in U_{i-1}\cap U_i$.
    But since $U_{i-1},U_i$ are disks, $U_{i-1}\cap U_i$ is connected and hence $f_{i-1}=f_i$ on $U_{i-1}\cap U_i$ by the identity principle.
    Therefore it indeed gives the desired analytic continuation.
\end{proof}
\begin{corollary}
    Let $\mathcal F$ be a complete analytic function on a domain $D\subset\mathbb C$, then
    $$\mathcal G_{\mathcal F}=\bigcup_{(f,U)\in\mathcal F}[f]_U$$
    is a path component of $\mathcal G$.
\end{corollary}
Therefore complete analytic functions on a domain $D\subset\mathbb C$ are equivalent to Riemann surfaces equipped with covering maps defined by the restriction of the forgetful map.
\begin{definition}
    The component $\mathcal G_{\mathcal F}$ is the Riemann surface associated to $\mathcal F$.
\end{definition}