\documentclass{article}
\usepackage[top=2cm,bottom=2cm,left=2cm,right=2cm]{geometry}
\usepackage{amsmath, amssymb, amsthm}
\usepackage{hyperref}

\usepackage{datetime}
\newdateformat{petsa}{\the\day\ \shortmonthname[\the\month] \the\year}

\newtheorem{definition}{Definition}[section]
\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{conjecture}[theorem]{Conjecture}

\title{The Diagonal Argument, Clarified and Generalized}
\author{poypoyan}
\date{\petsa\today}

\begin{document}

\maketitle

\begin{abstract}
The diagonal argument is a key ingredient in proving both the uncountability of $2^{\omega}$ (which is a celebrated Cantor's usage of the argument) and the same-named diagonal lemma (which is used in proving Gödel's first incompleteness theorem). In this short note we present a simple formulation of the diagonal argument that is applicable to both results, and hopefully to a lot more.
\end{abstract}

\section{Introduction}
Well the abstract introduced already. We think that doing this formulation ``exercise" provided us with a clearer understanding of the concepts surrounding diagonal lemma and Cantor's diagonal argument. Now let's get into the main thing!

\section{Diagonal Argument}
\begin{lemma}\label{diag-arg}
Let $A, B, C$ be sets such that:
\begin{enumerate}
	\item $C$ is a set of functions from $A \rightarrow B$.
	\item There exists a bijection $f:A \rightarrow C$.
\end{enumerate}
Then there exists a function $d:A \rightarrow B$ such that $d(x) = (f(x))(x)$.
\end{lemma}
\begin{proof}
Trivial! For every $x \in A$, $f(x)$ is unique in $C$. Letting $c = f(x)$, $c(x)$ is unique in $B$ because $c:A \rightarrow B$.
\end{proof}

\section{Cantor's Diagonal Argument}
We follow Cantor's original diagonal argument for the uncountability of $2^{\omega}$ in \cite{cantor}, which he further used to show the uncountability of the set of real numbers $\mathbb{R}$. We'll interpret $2^{\omega}$ as the set of \textit{all} functions from $\omega \rightarrow 2$.

The proof starts by assuming that there is a bijection $f:\omega \rightarrow 2^{\omega}$. This $f$ is actually the indexing of elements of $2^{\omega}$, more commonly shown as the ``listing" of infinite binary sequences. Applying Lemma \ref{diag-arg} to $A = \omega$, $B = 2$, $C = 2^{\omega}$, and $f$ gives the diagonal function $d:\omega \rightarrow 2$. What we really need is $d':\omega \rightarrow 2$ such that $d'(x) = 1 - d(x)$; $d'$ is more commonly shown as the ``diagonal" sequence constructed from the one's complement of the diagonal bits in the list. Now one may notice that for all $c \in 2^{\omega}$, $c \ne d'$ because $c(f^{-1}(c)) \ne d'(f^{-1}(c))$. Hence $d' \not\in 2^{\omega}$, but this is in contradiction to the definition of $2^{\omega}$. Therefore the initial assumption of existence of bijection $f:\omega \rightarrow 2^{\omega}$ is false, and this completes the proof.

One may notice that the more general \textit{Cantor's theorem}, $2^{A} > A$ for any set $A$, can be proven similarly.

\section{Gödel-Carnap Diagonal Lemma}
We'll just do an informal sketch. Setup first: let $\Gamma$ be a logic on a language $\mathcal{L}$, $N \subset \mathcal{L}$ be the set of all ``objects of study" of $\Gamma$, $P \subset \mathcal{L}$ be the set of all ``definable" propositions, and $C \subset \mathcal{L}$ be the set of all definable predicates with only one free variable $x$. For example, if $\Gamma = \textsf{PA}$, (Classical) Peano Arithmetic, then the strings $``\textsf{S0}", ``\textsf{SS0}" \in N$, and $``x + \textsf{S0} = \textsf{SS0}" \in C$. In an abuse of notation, while $c \in C$ is a string, it can also be treated as a function $c:N \rightarrow P$. For example in \textsf{PA}, $``x + \textsf{S0} = \textsf{SS0}"(``\textsf{S0}") = ``\textsf{S0} + \textsf{S0} = \textsf{SS0}"$.

One requirement of the lemma is the existence of the so-called \textit{Gödel numbering} which is an injective (total) function $g:\mathcal{L} \rightarrow N$. We can now apply the diagonal argument: applying Lemma \ref{diag-arg} to $A = \{x \in N \mid g^{-1}(x) \in C\}$, $B = P$, $C$ is itself, and $f = g^{-1}$ restricted to $A$, gives the diagonal function $d: A \rightarrow B$ such that $d(x) = (g^{-1}(x))(x)$. We can now present a strong variant of the lemma:

\begin{lemma}
If $d$ is definable in $\mathcal{L}$ (in short, $d \in C$) and for all $c_1, c_2 \in C$, $c_1 \circ g \circ c_2 \in C$, then for every $c \in C$, there exists a predicate $x \in C$ such that $x = c \circ g \circ x$.
\end{lemma}
\begin{proof}
Define a new predicate $h = c \circ g \circ d$. This is in $C$ because both $c, d \in C$. We can now define $x = h \circ g \circ h$. This works because $h \circ g \circ h = c \circ g \circ d \circ (g \circ h) = c \circ g \circ (g^{-1}(g \circ h))(g \circ h) = c \circ g \circ (h \circ g \circ h)$.
\end{proof}

This proof is based from Section 2.2 of \cite{salehi} \footnote{The``$\varrho$" there is defined as $g \circ d$ here.} which ultimately came from \cite{jeroslow}. The name of lemma is not due to the resemblance to the statement, but to the usage of a diagonal function in its proof!

Lastly, the reason we say that the presented lemma is ``strong" is that the more commonly presented property of $x$ is something like $\Gamma \vdash x(n) \leftrightarrow (c \circ g \circ x)(n)$ \footnote{Note that the weaker property requires $``\leftrightarrow" \in \mathcal{L}$.} with a valid $n \in N$, and surely that is weaker than $x = c \circ g \circ x$.

\bibliographystyle{plain}
\bibliography{diagonal}
\end{document}


\lab{Algorithms}{B-Splines}{B-Splines}
Though B\'{e}zier curves are good for a variety of things, they have certain limitations.
\begin{itemize}
\item As the number of control points increases it becomes very expensive to compute the points on the curve.
\item Changes in the placement of a single control point affect the shape of the entire curve.
\item Since a change in any control point affects the entire curve, it is necessary to recompute the entire curve to account for any change in any control point.
\item As the number of points increases, individual points have progressively less affect on the portions of the curve that lie nearest to them.
\end{itemize}

B-Splines are an ideal way to answer these limitations.
A B-Spline is, roughly speaking, a piecewise B\'{e}zier curve.
In order to better explain what a Basis function is.

\section*{B-Spline Basis Functions}

In the previous lab we introduced a way to represent B\'{e}zier curves as a linear combination of Bernstein Polynomials.
Notice the convenient property that the coefficient of each Bernstein polynomial for the B\'{e}zier curve formed from a given control point is simply the control point itself.

\begin{figure}
\includegraphics[width=\textwidth]{bernstein_basis}
\caption{5th degree Bernstein basis functions}
\end{figure}

This is a useful property.
B-splines are a generalization of B\'{e}zier curves which allow us to use piecewise basis functions.
Using piecewise basis functions allows us to make local changes to the curve we are representing.
This makes it so that we do not have to recompute the entire curve when we change only one control point.
This also makes control of the curve easier because changes from each contro point are only applied locally.
Another useful effect is that this makes the individual pieces of the B-Spline more responsive to changes in the control points that are used in creating it.
This, again, makes the curve easier to control.
The idea is that each point has a strictly local influence on the curve so that each point has a larger effect on a smaller portion of the curve.

We would like to be able to do this without loosing the useful properties of B\'{e}zier curves.
Simply using basis functions guarantees that each point of the curve will be a linear combination of the control points.
It would be best if we could make it so that this curve has the convex hull property (i.e. that it lies within the area bounded by the outermost control points).
B\'{e}zier curves also allow easy computation of their derivatives, so we would hope that B-Splines would allow this as well.
One of the largest constraints we need is that the curve we are forming be continuous.
It would be even better if it were differentiable, or even twice-differentiable.
The construction of the B-Spline Basis functions takes all of these factors into account.

There are a number of ways the B-Spline basis functions can be defined.
A common approach is to use recursion.
Let $U = \lbrace u_0, u_1, ... , u_m \rbrace$ be a nondecreasing sequence of real numbers.
$U$ is called the knot vector.
The $u_i$ are called the knots.
Note that each $u_i$ is not necessarily distinct.
$N_{i,p}(u)$, the $i$'th B-Spline basis function of degree $p$, or order $p+1$ is defined as:

\begin{equation}
N_{i,0}(u) =
\begin{cases}
1 & \text{if } u_i \leq u < u_{i+1} \\
0 & \text{otherwise}
\end{cases}
\end{equation}

\begin{equation}
N_{i,p}(u) = \frac{u - u_i}{u_{i+p} - u_i} N_{i,p-1}(u) + \frac{u_{i + p + 1} - u}{u_{i + p + 1} - u_{i + 1}} N_{i+1,p-1}(u)
\end{equation}

This is known as the Cox-De Boor recursion formula.
This algorithm is the De Boor algorithm.
When implemented properly, this algorithm is both fast and numerically stable.

Notice that we defined $U$ to be nondecreasing, which means some $u_i$ may be repeated.
When programming this algorithm as written, be careful to avoid division by zero.
When we get the indeterminate form $\frac{0}{0}$ we define these terms to be zero.

Also note that $N_{i,0}$ is a step function which is zero except on $[u_i, u_{i+1})$.
The other basis functions are piecewise polynomials of degree $p$ that are nonzero on $[u_{i-p}, u_{i+1+p})$.
This is also nice because computation of a set of basis functions requires only a knot vector $U$ and a degree $p$, so we can predefine basis functions before we know the actual positions of the control points.

\begin{problem}
Use the De Boor algorithm to write a recursive python function to evaluate a b-spline basis function for some $u$ spanned by the knot vector.
\end{problem}

Upon considering the computation involved in the previous problem, we see that this recursion, particularly for higher order splines, involves a massive amount of repetitive calculation.
Some of this excess computation can be eliminated while still using recursion, but we will do this by forming an iterative solution to the problem.

First, notice that for splines of order $2$ and higher, we actually compute the values of some splines multiple times.
A simple way to avoid this is to figure out which of the 0-order splines we will actually use in our computation, compute them all, then compute all the needed splines of order 1, 2, etc.

There is also some redundant computation in the computation of the coefficients used at each stage of the recursion.
This can be eliminated by using good control structure and a temporary variable.

We will label the left and right coefficients in the formula $L$ and $R$ respectively, so we have $L(n,p,u) = \frac{u - u_i}{u_{i+p} - u_i}$ and $R(n,p,u) = \frac{u_{i + p + 1} - u}{u_{i + p + 1} - u_{i + 1}}$. Notice that $L(n+1,p,u) = 1 - R(n,p,u)$. We can eliminate much of the duplicate computation by computing the new left hand side coefficient the iteration before we actually need it. This avoids nearly all the repeated computation.

\begin{problem}
Write an iterative function that computes the values for all the b-spline basis functions of a given power $p$ for a given array of $u$ values. Return the answer as a two dimensional array.
\end{problem}

It is worth noting that you can remove further excess computation when evaluating a single function and even further when evaluating a single function at a single point.
This can be done by figuring out in advance which of the $N_{i,p}$ will be nonzero and only iterating over those terms.
This approach may or may not be faster depending on the form of the problem.

Scipy has some built in functions and a built in class for B-splines.
They are all part of the scipy.interpolate package.


\section{The Bootstrap}

Bootstrap allows for investigating the variance of a statistic by calculating the statistic many times on samples drawn from the empirical CDF. This amounts to sampling from the dataset with replacement (i.e. datapoints may be included in a sample several times).

There are two approximations in play: first, the true CDF is approximated using the empirical CDF. Second, the variance of the statistic is estimated based on a sample.

Uncertainty in terms of bootstrap estimates may be calculated in terms of normal, pivotal or percentile intervals. The normal interval is valid when the statistic is approximately normally distributed.

\section{Jackknife}
The Jackknife method is less computationally expensive, but less general than the bootstrap. For a dataset of $n$ elements, the Jackknife method calculates the statistic $n$ times, each time removing one of the estimates from the calculation. The jackknife does not produce consistent estimators of the standard error of sample quantiles.


\section{The Wave Equation}
\subsection{Waves on an Elastic String}
Consider small displacements $y(x,t)$ on a stretched string with fixed ends at $x=0$ and $x=L$, that is with boundary conditions $y(0,t)=y(L,t)=0$.
We want to determine the string's motion subject to initial conditions
$$y(x,0)=p(x),\frac{\partial y}{\partial t}(x,0)=q(x)$$
We want to derive its equation of motion.
We try to obtain a differential equation by balancing the forces on string segment $x,x+\delta x$ and taking $\delta x\to 0$.
By resolving in $x$ direction we get that the tension $T$ on the string is independent of $x$.
By resolving in $y$ direction we arrive at
$$(\mu\delta x)\frac{\partial^2y}{\partial t^2}=T\frac{\partial^2y}{\partial x^2}\delta x-g\mu\delta x$$
where $\mu$ is the mass per unit length (aka linear mass density).
Write $c=\sqrt{T/\mu}$ the wave speed and assume the acceleration due to gravity is negligible, then this equation is just
$$\frac{1}{c^2}\frac{\partial^2y}{\partial t^2}=\frac{\partial^2y}{\partial x^2}$$
which is called the one-dimensional wave equation.
\subsection{Seperation of Variables}
Our first attempt at a solution is to guess a solution of seperable form, that is $y(x,t)=X(x)T(t)$, then substitution gives
$$\frac{1}{c^2}X\ddot{T}=X^{\prime\prime}T\implies \frac{1}{c^2}\frac{\ddot{T}}{T}=\frac{X^{\prime\prime}}{X}$$
The left hand side depends only on $t$ and the right hand side depends only on $x$, so they can only equal if both sides equal a constant $-\lambda$ (called the seperation constant), then we get
$$\begin{cases}
    X^{\prime\prime}+\lambda X=0\\
    \ddot{T}+\lambda c^2T=0
\end{cases}$$
Such nice things don't always happen, but we are glad it happened in this particular case.
\footnote{Whether we can do it depends on the existence of symmetry in the boundary conditions, which is probably not going to be discussed here.}
So we reduced a PDE to two independent ODEs, which we know how to solve.
\subsection{Boundary Conditions and Normal Modes}
There are a few possibilities depending on the sign of $\lambda$.\\
If $\lambda<0$, then taking $\chi^2=-\lambda$ gives the general solution
$$X(x)=Ae^{\chi x}+Be^{-\chi x}=\tilde{A}\cosh(\chi x)+\tilde{B}\sinh(\chi x)$$
where $A,B,\tilde{A},\tilde{B}$ are constants.
But the boundary conditions $X(0)=X(L)=0$ would yield $X=0$ everywhere, so this is just the trivial solution.\\
Now if $\lambda=0$, then $X(x)=Ax+B$ where $A,B$ are constants, but again we must have $A=B=0$ as $X(0)=X(L)=0$.
Trivial solution again.\\
What is left is $\lambda>0$, so $X(x)=A\cos(\sqrt{\lambda}x)+B\sin(\sqrt{\lambda}x)$, then the boundary condition $X(0)=X(L)=0$ gives the family of solutions
$$\lambda_n=\left( \frac{n\pi}{L} \right)^2,X_n(x)=B_n\sin\frac{n\pi x}{L}$$
where $B_n$ are constants.
It is not hard to observe that they are just our familiar Fourier eigenvalues and eigenfunctions.
These are called the normal modes of the system since its spacial shape in $x$ does not change in time but the amplitudes may vary.
\footnote{Well, duh!}
The case $n=1$ is called the fundamental mode.
A plot shows the modes are simply just the patterns of simple vibrations we expect.
\subsection{Initial Conditions and Temporal Solutions}
Substituting $\lambda_n=(n\pi/L)^2$ into the time ODE gives
$$T_n(t)=C_n\cos\frac{n\pi ct}{L}+D_n\sin\frac{n\pi ct}{L}$$
where $C_n,D_n$ are constants.
So we obtain the family of solutions
$$y_n(x,t)=T_n(t)X_n(x)=\left( C_n\cos\frac{n\pi ct}{L}+D_n\sin\frac{n\pi ct}{L} \right)\sin\frac{n\pi x}{L}$$
As the system we are trying to deal with is homogeneous and linear, we have the superposition principle, so the general solution is
$$y(x,t)=\sum_{n=1}^\infty\left( C_n\cos\frac{n\pi ct}{L}+D_n\sin\frac{n\pi ct}{L} \right)\sin\frac{n\pi x}{L}$$
assuming it converges sufficiently well.
This satisfies the boundary conditions as $X_n$ does.
Substituting into the initial condition, we get
$$p(x)=\sum_{n=1}^\infty C_n\sin\frac{n\pi x}{L},q(x)=\sum_{n=1}^\infty\frac{n\pi c}{L}D_n\sin\frac{n\pi x}{L}$$
which allows us to find $C_n,D_n$ by expanding $p,q$ as Fourier sine series.
In particular,
$$C_n=\frac{2}{L}\int_0^Lp(x)\sin\frac{n\pi x}{L}\,\mathrm dx,D_n=\frac{2}{n\pi c}\int_0^Lq(x)\sin\frac{n\pi x}{L}\,\mathrm dx$$
This is possible (well, assuming everything), so we have found a particular solution to the system.
\begin{example}
    We pluck string at $x=\xi$, which requires
    $$y(x,0)=p(x)=\begin{cases}
        x(1-\xi)\text{, for $0\le x\le \xi$}\\
        \xi(1-x)\text{, for $\xi\le x\le 1$}
    \end{cases},\frac{\partial y}{\partial t}(x,0)=q(x)=0$$
    Then with our formulas we obtain
    $$C_n=\frac{2\sin(n\pi\xi)}{(n\pi)^2},D_n=0\implies y(x,t)=\sum_{n=1}^\infty\frac{2}{(n\pi)^2}\sin(n\pi\xi)\sin(n\pi x)\cos(n\pi ct)$$
    Of course, this case happens to be the way of making sound on a string instrument, where guitar has $\xi\in [1/4,1/3]$ and violin has $\xi\approx 1/7$.
\end{example}
By the usual trigonometric identities, the general solution we found earlier becomes $y(x,t)=f(x-ct)+g(x+ct)$ where
$$f(x-ct)=\frac{1}{2}\sum_{n=1}^\infty\left(C_n\sin\frac{n\pi(x-ct)}{L}+D_n\cos\frac{n\pi(x-ct)}{L}\right)$$
and
$$g(x+ct)=\frac{1}{2}\sum_{n=1}^\infty\left(C_n\sin\frac{n\pi(x+ct)}{L}-D_n\cos\frac{n\pi(x+ct)}{L}\right)$$
So the standing wave solution can be interpreted as a superposition of a right-moving wave (along $x-ct=\eta$, $\eta$ constant) and a left-moving wave (along $x+ct=\xi$, $\xi$ constant).
We can generalise this idea later.
\begin{example}
    In the special case where $q=0$, we have $f=g=p/2$, so
    $$y(x,t)=\frac{p(x-ct)+p(x+ct)}{2}$$
\end{example}
\subsection{Oscillation Energy}
A vibrating string has kinetic energy due to the motion of the particles in the string.
This is given by $mv^2/2$.
So the total kinetic energy on the string would be the integral
$$\operatorname{KE}=\frac{1}{2}\int_0^L\left(\frac{\partial y}{\partial t}\right)^2\mu\,\mathrm dx$$
where $\mu$ is the mass per unit length.
The (elastic) potential energy due to streching $\Delta x$ is then
$$\operatorname{PE}=T\int_0^L\left( \sqrt{1+\left( \frac{\partial y}{\partial x} \right)^2} -1\right)\,\mathrm dx\approx\frac{1}{2}T\int_0^L\left( \frac{\partial y}{\partial x} \right)^2\,\mathrm dx$$
for small $|\partial y/\partial x|$.
So the total summed energy of the string is then, via $c^2=T/\mu$,
$$E=\frac{1}{2}\mu\int_0^L\left( \left( \frac{\partial y}{\partial t} \right)^2+c^2\left(\frac{\partial y}{\partial x}\right)^2 \right)\,\mathrm dx$$
So by substituting our generalisation and using orthogonality,
$$E=\frac{1}{2}\mu\sum_{n=1}^\infty (A_n+B_n)$$
where
$$A_n=\int_0^L \left( \frac{n\pi c}{L}C_n\sin\frac{n\pi ct}{L}+ \frac{n\pi c}{L}D_n\cos\frac{n\pi ct}{L}\right)^2\sin^2\frac{n\pi x}{L}\,\mathrm dx$$
and
$$B_n=\int_0^Lc^2\left( C_n\cos\frac{n\pi ct}{L}+ D_n\sin\frac{n\pi ct}{L}\right)^2\frac{n^2\pi^2}{L^2}\cos^2\frac{n\pi x}{L}\,\mathrm dx$$
Simplifying this mess gives
$$E=\frac{1}{4}\mu\sum_{n=1}^\infty\frac{n^2\pi^2c^2}{L}(C_n^2+D_n^2)$$
which can be interpreted as the sum of the energy of all normal modes.
Also, this is constant, so it is conserved in time.
\subsection{Wave Reflection and Transmission}
Recall the travelling wave solution along the $x\pm ct$ directions.
We want to further develop this idea
\begin{definition}
    A simple harmonic travelling wave is defined as
    $$t=\operatorname{Re}(Ae^{i\omega (t-x/c)})=|A|\cos(\omega(t-x/c)+\phi)$$
    where $\phi=\arg A$ is the phase and $2\pi c/\omega$ is the wavelength.
\end{definition}
Sometimes we will just assume the $\operatorname{Re}$ is there without writing it out explicitly.\\
Consider a density discontinuity on the string at $x=0$ with
$$\mu=\begin{cases}
    \mu_-\text{, for $x<0$}\implies c_-=\sqrt{T/\mu_-}\\
    \mu_+\text{, for $x>0$}\implies c_+=\sqrt{T/\mu_+}
\end{cases}$$
So a wave $Ae^{i\omega (t-x/c_-)}$ approaching $0$ from left will break down to two parts:
The reflected wave $Be^{i\omega (t+x/c_-)}$ and the transmitted wave $De^{i\omega (t-x/c_+)}$.
The continuity condition on $y$ gives $A+B=D$ and by balancing the forces
$$T\left.\frac{\partial y}{\partial x}\right|_{x=0_-}=T\left.\frac{\partial y}{\partial x}\right|_{x=0_+}$$
(which is basically the continuity condition on $\partial y/\partial x$) it gives $2A=D(c_++c_-)/c_+$.
Combining them all gives
$$D=\frac{2c_+}{c_-+c_+},B=\frac{c_+-c_-}{c_-+c_+}A$$
In general, it is possible to have different phase shifts $\phi$.\\
Now, if $c_+=c_-$, then $D=A$ and $B=0$, so there is no reflection, which is intuitive.
If we have the Dirichlet boundary conditions $\mu_+/\mu_-\to\infty$ (interpreted as a fixed end $y=0$ at $x=0$), then $c_+/c_-\to 0$, so $D=0$ and $B=-A$ where we get total reflection (with opposite phase $\phi=\pi$).
This is also what is expected.
If we have the Neumann boundary conditions $\mu_+/\mu_-\to 0$ (interpreted as an extremely light string in $x>0$), then $c_+/c_-\to\infty$, so $D=2A$ and $B=A$, so we get total reflection with same phase $\phi=0$.
\subsection{Wave Equation in the Plane Polar Coordinates}
The wave equation in two dimensions is
$$\frac{1}{c^2}\frac{\partial^2u}{\partial t^2}=\nabla^2u$$
Under plane polar coordinates $u=u(r,\theta,t)$, we impose the boundary condition $u(1,\theta,t)=0$ for any $\theta,t$ (interpreted as a fixed rim) and initial conditions
$$u(r,\theta,0)=\phi(r,\theta),\frac{\partial u}{\partial t}(r,\theta,0)=\psi(r,\theta)$$
We use seperation of variables again.
If we substitute $u(r,\theta,t)=T(t)V(r,\theta)$, then we obtain the decoupled system
$$\begin{cases}
    \ddot{T}+\lambda c^2T=0\\
    \nabla^2V+\lambda V=0
\end{cases}$$
where $\lambda$ is a seperation constant.
Note that in plane polar,
$$\nabla^2V=\frac{\partial^2V}{\partial r^2}+\frac{1}{r}\frac{\partial V}{\partial r}+\frac{1}{r^2}\frac{\partial^2V}{\partial\theta^2}+\lambda V=0$$
We seperate the variables further by writing $V(r,\theta)=R(r)\Theta(\theta)$.
This gives
$$\begin{cases}
    \Theta^{\prime\prime}+\mu\Theta=0\\
    r^2R^{\prime\prime}+rR^\prime+(\lambda r^2-\mu)R=0
\end{cases}$$
where $\mu$ is again a seperation constant.
Assuming $\mu>0$.
Solving for $\Theta$ subject to $\Theta(0)=\Theta(\pi)$ gives our old friend
$$\Theta_m(\theta)=A_m\cos(m\theta)+B_m\sin(m\theta),m\in\mathbb Z_{>0}$$
with $\mu_m=m^2$.
For $R$, we divide the equation by $r$ and transform it into Sturm-Liouville form
$$\frac{\mathrm d}{\mathrm dr}(rR^\prime)-\frac{m^2}{r}=-\lambda rR$$
Note that the boundary condition means we only care about $r\in[0,1]$.
The boundary condition are self-adjoint, which is convenient.
\subsection{Bessel's Equation}
Substitute $z=\sqrt{\lambda}r$ gives
$$z^2\frac{\mathrm d^2R}{\mathrm dz^2}+z\frac{\mathrm dR}{\mathrm dz}+(z^2-m^2)R=0\iff (zR^\prime)^\prime+\left( z-\frac{m^2}{z} \right)R=0$$
Apparently $0$ is a regular singular point, so we substitute the power series
$$R=z^p\sum_{n=0}^\infty a_nz^n$$
which gives
$$\sum_{n=0}^\infty (a_n(n+p)(n+p-1)z^{n+p}+(n+p)z^{n+p}+z^{n+p+2}+m^2z^{n+p})=0$$
The indivial equation is then $p^2-m^2=0$, so $p=\pm m$.
For $p=m$, it is called the regular solution (otherwise you get a singular point at $0$).
Here we have the recurrence
$$(n+m)^2a_n+a_{n-2}-m^2a_n=0\implies a_n=-\frac{1}{n(n+2m)}a_{n-2}$$
This gives the even series with solutions
$$a_{2n}=a_0\frac{(-1)^n}{2^{2n}n!(n+m)(n+m-1)\cdots (m+1)}$$
Conveniently we set $a_0=1/(2^mm!)$ which gives the Bessel function
$$J_m(z)=\left( \frac{z}{2} \right)^m\sum_{n=0}^\infty\frac{(-1)^n}{n!(n+m)!}\left( \frac{z}{2} \right)^{2n}$$
Actually, if we set $y=\sqrt{z}R$, then we will obtain
$$y^{\prime\prime}+y\left( 1+\frac{1}{4z}-\frac{m^2}{z^2} \right)=0$$
which, as $z\to\infty$, gives the approximation $y^{\prime\prime}\approx -y$ which has (approximated) solutions $R\approx z^{-1/2}(A\cos z+B\sin z)$ for $A,B$ constants.\\
Back to Bessel's function.
In fact, when $m=\nu\notin\mathbb Z$, this power solution also works but replace $(n+m)!$ by $\Gamma(n+\nu+1)$.
The second solution with $p=-m$ is known as the Neumann functions (or Bessel functions of second kind) which satisfies
$$Y_m(z)=\lim_{\nu\to m}\frac{J_\nu(z)\cos(\nu\pi)-J_{-\nu}(z)}{\sin(\nu\pi)}$$
As one can verify, there are a number of identities associated with Bessel functions, e.g. we have $(z^mJ_m(z))^\prime=z^mJ_{m-1}(z)$.
This also implies
$$\begin{cases}
    J_m^\prime(z)+mJ_m(z)/z=J_{m-1}(z)\\
    J_{m-1}(z)+J_{m+1}(z)=2mJ_m(z)/z\\
    2J_m^\prime(z)=J_{m-1}(z)-J_{m+1}(z)
\end{cases}$$
Naturally, we want to study the aymptopic behaviour of $J_m$ and $Y_m$.
As $z\to 0$, easily $J_0(z)\to 1$, $J_m(z)\sim (z/2)^m/m!$ and $Y_0(z)\to 2\log(z/2)/\pi$, $Y_m(z)=-(m-1)!(2/z)^m/\pi$.
So $0$ is a singularity of $Y_m$.\\
For large $z\to\infty$, $J_m,Y_m$ converges to $0$ oscillatorily, i.e.
$$J_m(z)\sim\sqrt{\frac{2}{\pi z}}\cos\left( z-\frac{m\pi}{2}-\frac{\pi}{4} \right),Y_m(z)\sim\sqrt{\frac{2}{\pi z}}\sin\left( z-\frac{m\pi}{2}-\frac{\pi}{4} \right)$$
This hints that we might want to take a look at the infinitely many zeros in $\mathbb R_{>0}$ of Bessel function.
Let $j_{m,n}$ to be the $n^{th}$ positive zero of $J_m$.
So the asymptopic formula above shows approximately $j_{m,n}\approx \tilde{j}_{m,n}=n\pi +m\pi/2-\pi/4$ with accuracy $|(j_{m,n}-\tilde{j}_{m,n})/j_{m,n}|<1/(10n)$ for $n>m^2/2$.
A few of the actual values are below:
$$j_{0,1}\approx 2.405,j_{0,2}\approx 5.520,j_{0,3}\approx 8.653$$
It is a fun activity for the reader to try and draw $J_m$.
\subsection{A Vibrating Drum}
So the radial solutions become
$$R_m(z)=R_m(\sqrt{\lambda}r)=AJ_m(\sqrt{\lambda}r)+BY_m(\sqrt{\lambda} r)$$
For $A,B$ constants.
But we want the solution to be bounded near zero which would mean $B=0$.
We also need $R(1)=0$, therefore $\lambda_{m,n}=j_{m,n}^2$ are the eigenvalues.
Therefore the spacial solutions are
$$V_{m,n}(r,\theta)=\Theta_m(\theta)R_{m,n}(\sqrt{\lambda_{m,n}}r)=(A_{m,n}\cos(m\theta)+B_{m,n}\sin(m\theta))J_m(j_{m,n}r)$$
Putting these eigenvalues to the temporal equation then shows $T_{m,n}$ are just linear combinations of $\cos(j_{m,n}ct)$ and $\sin(j_{m,n}ct)$.
Putting everything together we get $u(r,\theta,t)=A+B+C$ where
$$A=\sum_{n=1}^\infty J_0(j_{0n})r(A_{0n}\cos(j_{0n}ct)+C_{0n}\sin(j_{0n}ct))$$
$$B=\sum_{m=1}^\infty\sum_{n=1}^\infty J_m(j_{m,n}r)(A_{m,n}\cos(m\theta)+B_{m,n}\sin(m\theta))\cos(j_{m,n}ct)$$
$$C=\sum_{m=1}^\infty\sum_{n=1}^\infty J_m(j_{m,n}r)(C_{m,n}\cos(m\theta)+D_{m,n}\sin(m\theta))\sin(j_{m,n}ct)$$
We still have to impose the initial conditions.
$$\phi(r,\theta)=u(r,\theta,0)=\sum_{m=0}^\infty\sum_{n=1}^\infty J_m(j_{m,n}r)(A_{m,n}\cos(m\theta)+B_{m,n}\sin(m\theta))$$
$$\psi(r,\theta)=\frac{\partial u}{\partial t}(r,\theta,0)=\sum_{m=0}^\infty\sum_{n=1}^\infty j_{mn}cJ_m(j_{m,n}r)(C_{m,n}\cos(m\theta)+D_{m,n}\sin(m\theta))$$
As usual, we find the coefficient by orthogonality of these eigenfunctions.
We do already know that they are orthogonal, what we really need is the normalisation constant.
Some calculation then reveals
$$\int_0^1J_m(j_{m,n}r)J_m(j_{m,k}r)r\,\mathrm dr=\frac{1}{2}(J_m^\prime(j_{m,n}))\delta_{nk}=\frac{1}{2}J_{m+1}(j_{m,n})^2\delta_{n,k}$$
Therefore for $p>0$,
$$A_{pq}=\left(\int_0^{2\pi}\int_0^1\cos(p\theta)J_p(j_{pq}r)\phi(r,\theta)r\,\mathrm dr\mathrm d\theta\right)\left( \frac{\pi+\delta_{0p}\pi}{2}J_{p+1}(j_{pq})^2 \right)^{-1}$$
We can obtain $B_{m,n},C_{m,n},D_{m,n}$ in similar ways.
\begin{example}
    Consider $\phi=1-r^2$, so we have $\forall m,B_{m,n}=0$ and $\forall m\neq 0,A_{m,n}=0$.
    We also set $\psi=0$, which means $C_{m,n}=D_{m,n}=0$ for all $m,n$.
    By calculations,
    $$A_{0,n}=\frac{2}{J_1(j_{0,n})^2}\frac{J_2(j_{0,n})}{j_{0,n}^2}\approx\frac{J_2(j_{0,n})}{n}$$
    for large $n$.
    So the solution is
    $$u(r,\theta,t)=\sum_{n=1}^\infty\frac{2}{J_1(j_{0,n})^2}\frac{J_2(j_{0,n})}{j_{0,n}^2}J_0(j_{0,n}r)\cos(j_{0,n}ct)$$
    So the fundamental frequency is $\omega=j_{0,1}c(2/d)\approx 4.8c/d$ which is higher than the value for a string, whose value is approximately $77\%$ of the figure for the drum.\\
    A sketch of the nodal lines will then show that the solution is pretty close to our intuition.
\end{example}


\section{Normalized Cuts and Image Segmentation}
\label{ch:jianbo00}

\textit{Normalized Cuts and Image Segmentation} by Jianbo Shi(Associate Professor at the University of Pennsylvania, Computer and Information Science). \\
Cited by 9393. \textit{Pattern Analysis and Machine Intelligence, IEEE, 2000}
\newline

\textbf{Main point} is that the normalized cut algorithm \begin{inparaenum}[\itshape a\upshape)]
\item partitioning algorithm to disjoint the graph into two cluster.
\item and it solves NP-hard problem by approximate solution.
\end{inparaenum}

\subsection{Normalized cut algorithm}
A graph $G = (V, E)$ can be partitioned into two disjoint sets $A, B$ by removing edges connecting two parts. The goal of algorithm is that computes the cut cost as a fraction of the total edge connections to all the nodes in the graph. It can be founded in polynomial time but often divide with small cluster. Normalized cut solves this problem.

\begin{figure}[ht]
\begin{mdframed}
$Ncut(A,B) = \frac{cut(A,B)}{assoc(A,V)} + \frac{cut(A,B)}{assoc(B,V)}$ \\
\\
where \\
$cut(A,B) = \sum_{u \in A, v \in B} w(u, v)$,\\
$assoc(A,V) = \sum_{u \in A, t \in V} w(u, t)$
\end{mdframed}
\caption{Nomalized cut algorithm}
\end{figure}

Basic idea is that big clusters will inclease $assoc(A,B)$, thus decreasing $Ncut(A,B)$. It is NP-Hard problem though, it can find approximate solution by finding the eigenvector with the second-smallest eigenvalue of this generalized eigenvalue problem. This splits the data into two clusters. We can recursively partition data to find more clusters.
\begin{figure}[ht]
\begin{mdframed}
$(D - W)y = \lambda D y$
\end{mdframed}
\caption{Generalized eigenvalue system to solve}
\end{figure}