\chapterimage{head2.png} % Chapter heading image
\chapter{EM: Position-Dependent D}
\section{Basic Equations}
\begin{definition}[Likelihood function]
\begin{align}
\label{eq:prodterms}
\mathcal{L}[\theta] &= \sum_{\substack{\{i_\tau\}}} \sum_{\substack{\{j_\tau\}}} \prod_{\tau}^{N_{\mathrm{P}}} \langle \psi_{i_{\tau-1}} | \bm{y}_{\tau} | \psi_{j_\tau} \rangle \langle \psi_{j_\tau} | e^{-\bm{H}\Delta t_{\tau}} | \psi_{i_{\tau+1}} \rangle.
\end{align}
$\prod_{\tau} \langle |\rangle$ is used as a shorthand notation for the summand in Eq.\,\ref{eq:prodterms}, and
\begin{align}
\label{eq:PiTau}
\mathcal{P}(X,Y ; \theta) = {\prod}_{\tau} \langle |\rangle.
\end{align}
\end{definition}

\begin{definition}[log-likelihood function]
\begin{equation}
    \ell [\theta] = \ln \mathcal{P}(Y;\theta)=\ln \mathcal{P}(Y,X ; \theta) - \ln \mathcal{P}(X | Y;\theta).
\end{equation}
With the eigenbasis decomposition:
\begin{align}
\label{eq:EMEigen}
\ell[\theta] = \ln {\prod}_{\tau} \langle |\rangle - \ln \frac{\prod_{\tau} \langle |\rangle}{\mathcal{L}[\theta]}.
\end{align}
\end{definition}

\begin{definition}[Expectation]
\begin{equation}
    \mathbb{E}^k_{X|Y}[\cdot] = \int \mathcal{D} X(t) (\cdot) \mathcal{P}(X(t)|Y(t);\theta^k)
\end{equation}
\begin{align}
    \mathbb{E}^k_{X|Y}[\cdot] \equiv \sum_{\substack{\{i_\tau\}}} \sum_{\substack{\{j_\tau\}}} \frac{\prod^k_{\tau} \langle |\rangle}{\mathcal{L}^k}\cdot.
\end{align}
\begin{align}
    \mathbb{E}^k_{X|Y}[\cdot] = \sum_{i,j} \left( \cdot \right)  \mathbb{E}^k_{X|Y}[a_ib_j]
\end{align}
\end{definition}

\begin{definition}[Decomposition of log-likelihood]
\begin{align}
\label{eq:EM}
\ell [\theta] &= Q^k(\theta) + S^k(\theta)\\
\label{eq:EMQ}
Q^k[\theta] &=  \int \mathcal{D} X \; \mathcal{P}(X|Y;\theta^k)  \ln \mathcal{P}(Y,X ; \theta)
\end{align}
With the eigenbasis:
\begin{align}
    \label{eq:DiracQ}
    Q^k[\theta] = \frac{1}{\mathcal{L}^k} \sum_{\tau} \langle \alpha^k_{t_\tau} | e^{-\bm{H} \Delta t_{\tau} } | \beta^k_{t_{\tau+1}} \rangle.
\end{align}
\end{definition}

\begin{definition}[The maximization step in EM]
\begin{align}
\label{eq:Qder}
\frac{\delta Q^k[\theta]}{\delta \theta} = -\frac{1}{\mathcal{L}^k}\sum_{i,j} \frac{\delta \langle \psi_i | \textbf{H} | \psi_j \rangle}{\delta \theta}  \mathbb{E}^k_{X|Y}[a_ib_j] = -\frac{1}{\mathcal{L}^k} \mathbb{E}^k_{X|Y}[ \frac{\delta \langle \psi_i | \textbf{H} | \psi_j \rangle}{\delta \theta} ].
\end{align}
\end{definition}

\begin{definition}[Euler-Lagrange equation]
\begin{align}
        \frac{\delta \langle \psi_i|\bm{H}|\psi_j \rangle}{\delta \theta(x)} = \frac{\partial (\psi_i(x)\bm{H}\psi_j(x))}{\partial \theta(x)} - \frac{d}{dx}\frac{\partial (\psi_i(x)\bm{H}\psi_j(x))}{\partial \theta'(x)}.
\end{align}
\end{definition}

\section{Mean Force-H0 version}
\begin{definition}[H0]
\begin{align*}
    \textbf{H}^0 = -D \frac{\partial^2}{\partial x^2} + \frac{1}{2}D\frac{d F(x)}{dx} + \frac{1}{4} D F^{2}(x)
\end{align*}
Here, we let $\psi_i(x)$
\begin{align*}
    \textbf{H}^0\psi_i(x) = \lambda_i \psi_i(x)
\end{align*}
\end{definition}

\begin{definition}[Functional derivative]
\begin{align*}
        \frac{\delta \langle \psi_i|\textbf{H}^0|\psi_j \rangle}{\delta F(x)} = \frac{\partial (\psi_i(x)\textbf{H}^0\psi_j(x))}{\partial F(x)} - \frac{d}{dx}\frac{\partial (\psi_i(x)\textbf{H}^0\psi_j(x))}{\partial F'(x)}.
\end{align*}
First,
\begin{align*}
    \psi_i(x)\textbf{H}^0\psi_j(x) &= -D \psi_i(x) \frac{\partial^2 \psi_j(x)}{\partial x^2} + \frac{1}{2}D\frac{d F(x)}{dx} \psi_i(x)\psi_j(x) + \frac{1}{4} D F^{2}(x)\psi_i(x)\psi_j(x) \\
    \frac{\partial (\psi_i(x)\textbf{H}^0\psi_j(x))}{\partial F(x)} &= \frac{1}{2} D F(x)\psi_i(x)\psi_j(x) \\
    \frac{\partial (\psi_i(x)\textbf{H}^0\psi_j(x))}{\partial F'(x)} &= \frac{1}{2} D \psi_i(x)\psi_j(x) \\
    \frac{d}{dx}\frac{\partial (\psi_i(x)\textbf{H}^0\psi_j(x))}{\partial F'(x)} &= \frac{1}{2} D \frac{d}{dx}\left( \psi_i(x)\psi_j(x) \right)
\end{align*}
Therefore,
\begin{align}
\label{eq:FuncDelF}
\frac{\delta \langle \psi_i|\textbf{H}^0|\psi_j \rangle}{\delta F(x)} &= \frac{D}{2} \left( F(x)\psi_i(x)\psi_j(x) - \frac{d}{dx}\left( \psi_i(x)\psi_j(x) \right) \right).
\end{align}
\end{definition}

\begin{definition}[generalized PDF]
For a discrete random variable $X$ with range $R_x=\{x_1, x_2, x_3,... \}$ and $P_X(x_k)$, we define the (generalized) probability density function(PDF) as
\begin{equation}
    f_X(x) = \sum_{x_k \in R_x}P_X(x_k)\delta(x-x_k)
\end{equation}
\end{definition}

\begin{definition}[F and p]
\begin{align*}
    V(x) &= - \ln{(p_{\rm eq}(x))} \\
    F(x) &= -\frac{d V(x)}{dx} = \frac{d \ln{(p_{\rm eq}(x))}}{dx} = \frac{ \frac{d}{dx} p_{\rm eq}(x) }{  p_{\rm eq}(x) }
\end{align*}
\end{definition}

\begin{definition}[Maximization Step]
Eq.(\ref{eq:FuncDelF}) is applied to eq.(\ref{eq:Qder}), we get
\begin{align}
    \mathbb{E}^k_{X|Y}\left [F^{k+1}(x)\frac{D}{2} \psi_i(x)\psi_j(x) - \frac{D}{2}\frac{d}{dx}\left( \psi_i(x)\psi_j(x) \right) \right ] &= 0.
\end{align}
The above becomes
\begin{align*}
    F^{k+1}(x)\frac{D}{2} \mathbb{E}^k_{X|Y}\left[  \psi_i(x)\psi_j(x) \right] -  \frac{D}{2} \mathbb{E}^k_{X|Y}\left[  \frac{d}{dx}\left( \psi_i(x)\psi_j(x) \right) \right] = 0
\end{align*}
Then
\begin{align}
    F^{k+1}(x) = \frac{\frac{d}{dx} \left(\mathbb{E}^k_{X|Y}\left[ \psi_i(x)\psi_j(x)\right]\right)}{ \mathbb{E}^k_{X|Y}\left[  \psi_i(x)\psi_j(x) \right]} = \frac{ \frac{d}{dx} p^{k+1}_{\rm eq}(x) }{  p^{k+1}_{\rm eq}(x) }
\end{align}
Therefore, the update equation for the equilibrium probability density in an EM iteration is:
\begin{align}
p_{\rm eq}^{k+1}(x) &= \mathbb{E}^k_{X|Y}\left[  \psi_i(x)\psi_j(x) \right]\\
&= \mathbb{E}^k_{X|Y}\left[  \rho_{\rm{eq}}(x) \phi_i(x)  \rho_{\rm{eq}}(x) \phi_j(x) \right] = p^k_{\rm{eq}}(x) \sum_{i,j} \mathbb{E}^k_{X|Y}[a_ib_j] \phi_i(x)\phi_j(x).
\end{align}
\end{definition}

\section{Constant Diffusion coefficient-H0 version}
\begin{definition}[First persepctive]
\begin{align*}
    \langle \psi_i|\textbf{H}^0|\psi_j \rangle = \lambda^0_j \langle \psi_i|\psi_j \rangle = \lambda_i \delta_{ij}
\end{align*}
Since the Hamiltonian and its eigenvalues scale linearly with the diffusion coefficient D,
\begin{align*}
    \lambda_i &= c_i D \\
    \frac{d \lambda_i}{d D} &= c_i \\
    c_i &= \frac{\lambda_i}{D}
\end{align*}
Therefore, the derivative is
\begin{align}
    \frac{d \langle \psi_i|\textbf{H}^0|\psi_j \rangle}{d D} = c_i \delta_{ij} = \frac{\lambda_i}{D} \delta_{ij}
\label{deltaD}
\end{align}
\end{definition}

\begin{definition}[Second persepctive]
\begin{align*}
    \psi_i(x)\textbf{H}^0\psi_j(x) &= -D \psi_i(x) \frac{\partial^2 \psi_j(x)}{\partial x^2} + \frac{1}{2}D\frac{d F(x)}{dx} \psi_i(x)\psi_j(x) + \frac{1}{4} D F^{2}(x)\psi_i(x)\psi_j(x)
\end{align*}
and
\begin{align*}
    \langle \psi_i|\textbf{H}^0|\psi_j \rangle = \int \psi_i(x)\textbf{H}^0\psi_j(x) dx
\end{align*}
The first term
\begin{align*}
    -D\int_{-\infty}^{\infty} \psi_i(x) \frac{\partial^2 \psi_j(x)}{\partial x^2} dx &= -D[\psi_i(x) \frac{\partial \psi_j(x)}{\partial x}]_{-\infty}^{\infty} + D\int_{-\infty}^{\infty} \frac{\partial \psi_i(x)}{\partial x} \frac{\partial \psi_j(x)}{\partial x}dx\\
    & = D\int_{-\infty}^{\infty} \frac{\partial \psi_i(x)}{\partial x} \frac{\partial \psi_j(x)}{\partial x}dx
\end{align*}
Therefore,
\begin{align*}
    \langle \psi_i|\textbf{H}^0|\psi_j \rangle &= D\int_{-\infty}^{\infty} \frac{\partial \psi_i(x)}{\partial x} \frac{\partial \psi_j(x)}{\partial x}dx + \frac{1}{2}D \int \frac{d F(x)}{dx} \psi_i(x)\psi_j(x)dx\\
    &+ \frac{1}{4} D \int F^{2}(x)\psi_i(x)\psi_j(x)dx
\end{align*}
and
\begin{align*}
    \frac{d \langle \psi_i|\textbf{H}^0|\psi_j \rangle}{d D} &= \int_{-\infty}^{\infty} \frac{\partial \psi_i(x)}{\partial x} \frac{\partial \psi_j(x)}{\partial x}dx + \frac{1}{2} \int \frac{d F(x)}{dx} \psi_i(x)\psi_j(x)dx\\
    &+ \frac{1}{4}  \int F^{2}(x)\psi_i(x)\psi_j(x)dx
\end{align*}
Furthermore, compare to eq.(\ref{deltaD}), we know if $i \neq j$
\begin{align*}
    \int_{-\infty}^{\infty} \frac{\partial \psi_i(x)}{\partial x} \frac{\partial \psi_j(x)}{\partial x}dx + \frac{1}{2} \int \frac{d F(x)}{dx} \psi_i(x)\psi_j(x)dx + \frac{1}{4}  \int F^{2}(x)\psi_i(x)\psi_j(x)dx &= 0
\end{align*}
and
\begin{align*}
    \int_{-\infty}^{\infty} \frac{\partial \psi_i(x)}{\partial x} \frac{\partial \psi_i(x)}{\partial x}dx + \frac{1}{2} \int \frac{d F(x)}{dx} \psi_i(x)\psi_i(x)dx + \frac{1}{4}  \int F^{2}(x)\psi_i(x)\psi_i(x)dx &= \lambda^0_i
\end{align*}
\end{definition}

\begin{definition}[Maximization Step]
In order to do maximization, we want
\begin{align*}
    \frac{\delta Q^k[\theta]}{\delta D} = -\frac{1}{\mathcal{L}^k}\mathbb{E}^k_{X|Y}[ \frac{d \langle \psi_i | \textbf{H}^0 | \psi_j \rangle}{d D} ] = 0
\end{align*}
so
\begin{align*}
    \mathbb{E}^k_{X|Y}[ \frac{d \langle \psi_i | \textbf{H}^0 | \psi_j \rangle}{d D} ] =  \mathbb{E}^k_{X|Y}[ \frac{\lambda_i}{D} \delta_{ij} ]= 0
\end{align*}
then
\begin{align*}
    \mathbb{E}^k_{X|Y}[ \frac{\lambda_i}{D} \delta_{ij} ] =  \sum_{i,j} \mathbb{E}^k_{X|Y}[a_ib_j] \frac{\lambda_i}{D} \delta_{ij} = \sum_i \mathbb{E}^k_{X|Y}[a_ib_i] \frac{\lambda_i}{D}  = 0
\end{align*}
Finally, we get the equation
\begin{align*}
    \frac{1}{D} \left[ \sum_i \mathbb{E}^k_{X|Y}[a_ib_i] \lambda_i \right] = 0
\end{align*}
Therefore, we can not have an explicit expression for updating $D^{k+1}$. We only can do linear search of D for maximizing log-likelihood.
\end{definition}

\section{Mean Force-H version}
\begin{definition}[H]
\begin{align*}
    \textbf{H} &= -D(x) \frac{\partial^2}{\partial x^2} + \frac{1}{2}D(x)\frac{d F(x)}{dx} + \frac{1}{4} D(x) F^{2}(x) -\frac{\partial D(x)}{\partial x}\frac{\partial }{\partial x} + \frac{1}{2} \frac{\partial D(x)}{\partial x} F(x)
\end{align*}
Here, we let $\psi_i(x)$
\begin{align*}
    \textbf{H}\psi_i(x) = \lambda_i \psi_i(x)
\end{align*}
\end{definition}

\begin{definition}[Functional derivative]
\begin{align*}
    \frac{\delta \langle \psi_i|\textbf{H}|\psi_j \rangle}{\delta F(x)} = \frac{\partial (\psi_i(x)\textbf{H}\psi_j(x))}{\partial F(x)} - \frac{d}{dx}\frac{\partial (\psi_i(x)\textbf{H}\psi_j(x))}{\partial F'(x)}.
\end{align*}
First,
\begin{align*}
    \psi_i(x)\textbf{H}\psi_j(x) &= -D(x) \psi_i(x) \frac{\partial^2 \psi_j(x)}{\partial x^2} + \frac{1}{2}D(x)\frac{d F(x)}{dx} \psi_i(x)\psi_j(x)\\
    &+ \frac{1}{4} D(x) F^{2}(x)\psi_i(x)\psi_j(x) -\frac{\partial D(x)}{\partial x} \psi_i(x) \frac{\partial \psi_j(x)}{\partial x} \\
    &+ \frac{1}{2} \frac{\partial D(x)}{\partial x} F(x) \psi_i(x)\psi_j(x)
\end{align*}
Then,
\begin{align*}
        \frac{\partial (\psi_i(x)\textbf{H}\psi_j(x))}{\partial F(x)} &= \frac{1}{2} D(x) F(x)\psi_i(x)\psi_j(x) + \frac{1}{2} \frac{\partial D(x)}{\partial x} \psi_i(x)\psi_j(x)\\
        \frac{\partial (\psi_i(x)\textbf{H}\psi_j(x))}{\partial F'(x)} &= \frac{1}{2} D(x) \psi_i(x)\psi_j(x) \\
        \frac{d}{dx}\frac{\partial (\psi_i(x)\textbf{H}\psi_j(x))}{\partial F'(x)} &= \frac{1}{2} \frac{d}{dx}\left( D(x) \psi_i(x)\psi_j(x) \right)
\end{align*}
Notice that
\begin{align*}
    \frac{d}{dx}\frac{\partial (\psi_i(x)\textbf{H}\psi_j(x))}{\partial F'(x)} &= \frac{1}{2} \frac{\partial D(x)}{\partial x}\psi_i(x)\psi_j(x) +  \frac{1}{2} D(x) \frac{\partial \psi_i(x)}{\partial x} \psi_j(x)+ \frac{1}{2} D(x) \psi_i(x) \frac{\partial \psi_j(x)}{\partial x} \\
    &= \frac{1}{2} \frac{\partial D(x)}{\partial x}\psi_i(x)\psi_j(x) + \frac{1}{2}D(x)\frac{d}{dx}\left( \psi_i(x)\psi_j(x) \right)
\end{align*}
Therefore,
\begin{equation}
\label{eq:FuncDelFH}
\begin{split}
    \frac{\delta \langle \psi_i|\textbf{H}|\psi_j \rangle}{\delta F(x)} &= \frac{1}{2} D(x) F(x)\psi_i(x)\psi_j(x) + \frac{1}{2} \frac{\partial D(x)}{\partial x} \psi_i(x)\psi_j(x) \\
    &- \frac{1}{2} \frac{\partial D(x)}{\partial x}\psi_i(x)\psi_j(x) - \frac{1}{2}D(x)\frac{d}{dx}\left( \psi_i(x)\psi_j(x) \right) \\
    &=  \frac{1}{2} D(x) F(x)\psi_i(x)\psi_j(x) -  \frac{1}{2}D(x)\frac{d}{dx}\left( \psi_i(x)\psi_j(x) \right)
\end{split}
\end{equation}
\end{definition}

\begin{definition}[Maximization Step]
Eq.(\ref{eq:FuncDelFH}) is applied to eq.(\ref{eq:Qder}), we get
\begin{align}
    \mathbb{E}^k_{X|Y}\left [F^{k+1}(x)  \frac{1}{2} D(x) \psi_i(x)\psi_j(x) - \frac{1}{2}D(x)\frac{d}{dx}\left( \psi_i(x)\psi_j(x) \right) \right ] &= 0.
\end{align}
The above becomes
\begin{align*}
    F^{k+1}(x)\frac{1}{2} \mathbb{E}^k_{X|Y}\left[ D(x) \psi_i(x)\psi_j(x) \right] -  \frac{1}{2} \mathbb{E}^k_{X|Y}\left[ D(x) \frac{d}{dx}\left( \psi_i(x)\psi_j(x) \right) \right] = 0
\end{align*}
Furthermore,
\begin{align*}
    &\mathbb{E}^k_{X|Y}\left[ D(x) \psi_i(x)\psi_j(x) \right] = \sum_{i,j} \mathbb{E}^k_{X|Y}[a_ib_j] D(x) \psi_i(x)\psi_j(x) \\
    &= D(x)  \sum_{i,j} \mathbb{E}^k_{X|Y}[a_ib_j] \psi_i(x)\psi_j(x) =D(x) \mathbb{E}^k_{X|Y}\left[  \psi_i(x)\psi_j(x) \right]
\end{align*}
and
\begin{align*}
    &\mathbb{E}^k_{X|Y}\left[ D(x) \frac{d}{dx}\left( \psi_i(x)\psi_j(x) \right) \right] = \sum_{i,j} \mathbb{E}^k_{X|Y}[a_ib_j] D(x)\frac{d}{dx}\left( \psi_i(x)\psi_j(x) \right) \\
    &= D(x) \sum_{i,j} \frac{d}{dx}\left( \psi_i(x)\psi_j(x) \right) = D(x) \mathbb{E}^k_{X|Y}\left[\frac{d}{dx}\left( \psi_i(x)\psi_j(x) \right) \right]
\end{align*}
Then, we get the same result as constant-D version
\begin{align}
    F^{k+1}(x) = \frac{\frac{d}{dx} \left(\mathbb{E}^k_{X|Y}\left[ \psi_i(x)\psi_j(x)\right]\right)}{ \mathbb{E}^k_{X|Y}\left[  \psi_i(x)\psi_j(x) \right]} = \frac{ \frac{d}{dx} p^{k+1}_{\rm eq}(x) }{  p^{k+1}_{\rm eq}(x) }
\end{align}
The update equation for the equilibrium probability density in an EM iteration is:
\begin{align}
    p_{\rm eq}^{k+1}(x) &= \mathbb{E}^k_{X|Y}\left[  \psi_i(x)\psi_j(x) \right]\\
    &= \mathbb{E}^k_{X|Y}\left[  \rho_{\rm{eq}}(x) \phi_i(x)  \rho_{\rm{eq}}(x) \phi_j(x) \right] = p^k_{\rm{eq}}(x) \sum_{i,j} \mathbb{E}^k_{X|Y}[a_ib_j] \phi_i(x)\phi_j(x).
\end{align}
\end{definition}

\section{Diffusion coefficient D(x)}
\begin{definition}[H]
\begin{align*}
    \textbf{H} &= -D(x) \frac{\partial^2}{\partial x^2} + \frac{1}{2}D(x)\frac{d F(x)}{dx} + \frac{1}{4} D(x) F^{2}(x) -\frac{\partial D(x)}{\partial x}\frac{\partial }{\partial x} + \frac{1}{2} \frac{\partial D(x)}{\partial x} F(x)
\end{align*}
Here, we let $\psi_i(x)$
\begin{align*}
    \textbf{H}\psi_i(x) = \lambda_i \psi_i(x)
\end{align*}
\end{definition}

\begin{definition}[Functional derivative]
\begin{align*}
    \frac{\delta \langle \psi_i|\textbf{H}|\psi_j \rangle}{\delta D(x)} = \frac{\partial (\psi_i(x)\textbf{H}\psi_j(x))}{\partial D(x)} - \frac{d}{dx}\frac{\partial (\psi_i(x)\textbf{H}\psi_j(x))}{\partial D'(x)}.
\end{align*}
First,
\begin{align*}
    &\psi_i(x)\textbf{H}\psi_j(x) = -D(x) \psi_i(x) \frac{\partial^2 \psi_j(x)}{\partial x^2} + \frac{1}{2}D(x)\frac{d F(x)}{dx} \psi_i(x)\psi_j(x)\\
    &+ \frac{1}{4} D(x) F^{2}(x)\psi_i(x)\psi_j(x) -\frac{\partial D(x)}{\partial x} \psi_i(x) \frac{\partial \psi_j(x)}{\partial x} + \frac{1}{2} \frac{\partial D(x)}{\partial x} F(x) \psi_i(x)\psi_j(x)
\end{align*}
Then,
\begin{align*}
    \frac{\partial (\psi_i(x)\textbf{H}\psi_j(x))}{\partial D(x)} &=  -\psi_i(x) \frac{\partial^2 \psi_j(x)}{\partial x^2}+ \frac{1}{2}\frac{d F(x)}{dx} \psi_i(x)\psi_j(x)+ \frac{1}{4} F^{2}(x)\psi_i(x)\psi_j(x)\\
    \frac{\partial (\psi_i(x)\textbf{H}\psi_j(x))}{\partial D'(x)} &= -\psi_i(x) \frac{\partial \psi_j(x)}{\partial x} + \frac{1}{2} F(x) \psi_i(x)\psi_j(x) \\
    \frac{d}{dx}\frac{\partial (\psi_i(x)\textbf{H}\psi_j(x))}{\partial D'(x)} &= -\psi_i(x) \frac{\partial^2 \psi_j(x)}{\partial x^2} - \frac{\partial \psi_i(x)}{\partial x} \frac{\partial \psi_j(x)}{\partial x} + \frac{1}{2}\frac{d F(x)}{dx} \psi_i(x)\psi_j(x) \\
    & + \frac{1}{2} F(x) \frac{\partial \psi_i(x)}{\partial x} \psi_j(x) + \frac{1}{2} F(x) \psi_i(x) \frac{\partial \psi_j(x)}{\partial x}
\end{align*}
Therefore,
\begin{align*}
    \frac{\delta \langle \psi_i|\textbf{H}|\psi_j \rangle}{\delta D(x)} &=  -\psi_i(x) \frac{\partial^2 \psi_j(x)}{\partial x^2}+ \frac{1}{2}\frac{d F(x)}{dx} \psi_i(x)\psi_j(x)+ \frac{1}{4} F^{2}(x)\psi_i(x)\psi_j(x) \\
    & +\psi_i(x) \frac{\partial^2 \psi_j(x)}{\partial x^2} + \frac{\partial \psi_i(x)}{\partial x} \frac{\partial \psi_j(x)}{\partial x} - \frac{1}{2}\frac{d F(x)}{dx} \psi_i(x)\psi_j(x) \\
    & - \frac{1}{2} F(x) \frac{\partial \psi_i(x)}{\partial x} \psi_j(x) - \frac{1}{2} F(x) \psi_i(x) \frac{\partial \psi_j(x)}{\partial x}
\end{align*}

\begin{equation}
\begin{split}
    \frac{\delta \langle \psi_i|\textbf{H}|\psi_j \rangle}{\delta D(x)} &=  \frac{1}{4} F^{2}(x)\psi_i(x)\psi_j(x) + \frac{\partial \psi_i(x)}{\partial x} \frac{\partial \psi_j(x)}{\partial x}  \\
    & - \frac{1}{2} F(x) \frac{\partial \psi_i(x)}{\partial x} \psi_j(x) - \frac{1}{2} F(x) \psi_i(x) \frac{\partial \psi_j(x)}{\partial x}
\end{split}
\end{equation}
\end{definition}

\begin{definition}[Maximization Step]
In order to do maximization, we want
\begin{align*}
    \frac{\delta Q^k[\theta]}{\delta D(x)} = -\frac{1}{\mathcal{L}^k} \mathbb{E}^k_{X|Y}[ \frac{\delta \langle \psi_i | \textbf{H} | \psi_j \rangle}{\delta D(x)} ] = 0
\end{align*}
so
\begin{align*}
    &\mathbb{E}^k_{X|Y}[ \frac{\delta \langle \psi_i | \textbf{H} | \psi_j \rangle}{\delta D(x)} ] = \mathbb{E}^k_{X|Y}[\frac{1}{4} F^{2}(x)\psi_i(x)\psi_j(x)] + \mathbb{E}^k_{X|Y}[\frac{\partial \psi_i(x)}{\partial x} \frac{\partial \psi_j(x)}{\partial x}]\\
    &- \mathbb{E}^k_{X|Y}[\frac{1}{2} F(x) \frac{\partial \psi_i(x)}{\partial x} \psi_j(x)] - \mathbb{E}^k_{X|Y}[\frac{1}{2} F(x) \psi_i(x) \frac{\partial \psi_j(x)}{\partial x}] = 0
\end{align*}
It further becomes
\begin{align*}
    &\frac{1}{4} F^{2}(x) \mathbb{E}^k_{X|Y}[\psi_i(x)\psi_j(x)] + \mathbb{E}^k_{X|Y}[\frac{\partial \psi_i(x)}{\partial x} \frac{\partial \psi_j(x)}{\partial x}]\\
    &- \frac{1}{2} F(x)\mathbb{E}^k_{X|Y}[ \frac{\partial \psi_i(x)}{\partial x} \psi_j(x)] - \frac{1}{2} F(x) \mathbb{E}^k_{X|Y}[\psi_i(x) \frac{\partial \psi_j(x)}{\partial x}] = 0
\end{align*}
becuase $\mathbb{E}^k_{X|Y}[ \frac{\partial \psi_i(x)}{\partial x} \psi_j(x)] = \mathbb{E}^k_{X|Y}[\psi_i(x) \frac{\partial \psi_j(x)}{\partial x}]$, so
\begin{align*}
    \mathbb{E}^k_{X|Y}[\frac{\partial \psi_i(x)}{\partial x} \frac{\partial \psi_j(x)}{\partial x}] = F(x)\mathbb{E}^k_{X|Y}[ \frac{\partial \psi_i(x)}{\partial x} \psi_j(x)] - \frac{1}{4} F^{2}(x) \mathbb{E}^k_{X|Y}[\psi_i(x)\psi_j(x)]
\end{align*}
and
\begin{align*}
    \mathbb{E}^k_{X|Y}[\frac{\partial \psi_i(x)}{\partial x} \frac{\partial \psi_j(x)}{\partial x}] = F(x) \left\{ \mathbb{E}^k_{X|Y}[ \frac{\partial \psi_i(x)}{\partial x} \psi_j(x)] - \frac{1}{4} F(x) \mathbb{E}^k_{X|Y}[\psi_i(x)\psi_j(x)]\right\}
\end{align*}
Finally,
\begin{align}
    F(x) = \frac{ \mathbb{E}^k_{X|Y}[\frac{\partial \psi_i(x)}{\partial x} \frac{\partial \psi_j(x)}{\partial x}] }{ \left\{ \mathbb{E}^k_{X|Y}[ \frac{\partial \psi_i(x)}{\partial x} \psi_j(x)] - \frac{1}{4} F(x) \mathbb{E}^k_{X|Y}[\psi_i(x)\psi_j(x)]\right\}  }
\end{align}
\end{definition}

\begin{definition}[Eigenvalue]
\begin{align*}
    \langle \psi_i|\textbf{H}|\psi_j \rangle = \lambda_j \langle \psi_i|\psi_j \rangle = \lambda_i \delta_{ij}
\end{align*}
It also can be expressed
\begin{align*}
    &\langle \psi_i|\textbf{H}|\psi_j \rangle = \int \psi_i(x)\textbf{H}\psi_j(x) dx = -\int D(x) \psi_i(x) \frac{\partial^2 \psi_j(x)}{\partial x^2} dx \\
    &+ \int \frac{1}{2}D(x)\frac{d F(x)}{dx} \psi_i(x)\psi_j(x)dx + \int \frac{1}{4} D(x) F^{2}(x)\psi_i(x)\psi_j(x) dx \\
    &- \int \frac{\partial D(x)}{\partial x} \psi_i(x) \frac{\partial \psi_j(x)}{\partial x} dx + \int \frac{1}{2} \frac{\partial D(x)}{\partial x} F(x) \psi_i(x)\psi_j(x)dx
\end{align*}
The first term is
\begin{align*}
    &-\int_{-\infty}^{\infty} D(x) \psi_i(x) \frac{\partial^2 \psi_j(x)}{\partial x^2} dx = -{\Big [} D(x) \psi_i(x)  \frac{\partial \psi_j(x)}{\partial x}{\Big ]}_{-\infty}^{\infty} \\
    &+ \int_{-\infty}^{\infty} D(x) \frac{\partial \psi_i(x)}{\partial x}  \frac{\partial \psi_j(x)}{\partial x} dx + \int_{-\infty}^{\infty}  \frac{\partial D(x)}{\partial x} \psi_i(x)  \frac{\partial \psi_j(x)}{\partial x} dx
\end{align*}
Then, we get
\begin{align*}
    &\langle \psi_i|\textbf{H}|\psi_j \rangle = \int_{-\infty}^{\infty} D(x) \frac{\partial \psi_i(x)}{\partial x}  \frac{\partial \psi_j(x)}{\partial x} dx + \int \frac{1}{2}D(x)\frac{d F(x)}{dx} \psi_i(x)\psi_j(x)dx\\
    &+ \int \frac{1}{4} D(x) F^{2}(x)\psi_i(x)\psi_j(x) dx + \int \frac{1}{2} \frac{\partial D(x)}{\partial x} F(x) \psi_i(x)\psi_j(x)dx
\end{align*}
If $i \neq j$,
\begin{align*}
    &\int_{-\infty}^{\infty} D(x) \frac{\partial \psi_i(x)}{\partial x}  \frac{\partial \psi_j(x)}{\partial x} dx + \int \frac{1}{2}D(x)\frac{d F(x)}{dx} \psi_i(x)\psi_j(x)dx\\
    &+ \int \frac{1}{4} D(x) F^{2}(x)\psi_i(x)\psi_j(x) dx + \int \frac{1}{2} \frac{\partial D(x)}{\partial x} F(x) \psi_i(x) \psi_j(x)dx = 0
\end{align*}
and
\begin{align*}
    &\int_{-\infty}^{\infty} D(x) \frac{\partial \psi_i(x)}{\partial x}  \frac{\partial \psi_i(x)}{\partial x} dx + \int \frac{1}{2}D(x)\frac{d F(x)}{dx} \psi_i(x)\psi_i(x)dx\\
    &+ \int \frac{1}{4} D(x) F^{2}(x)\psi_i(x)\psi_i(x) dx + \int \frac{1}{2} \frac{\partial D(x)}{\partial x} F(x) \psi_i(x)\psi_i(x)dx = \lambda_i
\end{align*}
\end{definition}


\documentclass[a4paper]{article}
\usepackage{amsmath}

\title{Negative pair sampling}
\author{Bugert}

\begin{document}

\maketitle

\paragraph{Starting point} In a CDCR corpus, there will be positive and negative pairs of multiple types: within-document, within-subtopic, cross-subtopic, cross-topic. How many possible pairs there are per type depends on the corpus structure. Note there can be (close to) 0 positive training pairs for a type, depending on how a corpus was annotated.

We need to sample a number of negative (i.e. non-coreferring) mention pairs for training. Negative pairs will typically outnumber positive pairs at least by a factor of 10, for cross-topic links it can be a factor of 1000 easily. Training with all negative pairs would take very long and would bias the model towards predicting non-coreferential for most pairs. Possible ways around this are either class reweighting (lower the impact of negative training pairs) or undersampling negative pairs. We follow the undersampling route.

\paragraph{Goal} Assume there are $\text{\#pos}$ positive pairs for a coref link type, then we want to include at least $\text{n2p} \cdot \text{\#pos}$ negative pairs of the same type.

If $\text{\#pos} = 0$, we need a different approach. Taking cross-topic links as an example: Realize that adding one additional topic to a corpus with $n$ topics produces $n$ new cross-topic pairings, i.e. there is a quadratic increase in (topic, topic) pairs with each topic added. To reduce the number of negative cross-topic mention pairs, we want to compute an upper bound for the number of negative pairs which is linear w.r.t. the number of topics. Meaning: Given the total number of negative pairs we could sample for a type (cross-topic), we want to sample by the number of times this type appears in the corpus (i.e. the number of topics).

\paragraph{Approach}
We use pairs of type cross-subtopic as an example here.
The average number of subtopics per topic is
\[\frac{\text{\#subtopics}}{\text{\#topics}}\]
The total number of (subtopic, subtopic) pairings in the corpus is
\[{\frac{\text{\#subtopics}}{\text{\#topics}}\choose 2} \cdot \text{\#topics}\]
In a corpus, the number of mentions per subtopic will vary. With $\text{\#mentions}$ being the number of mentions in the whole corpus, the average subtopic has \[\frac{\text{\#mentions}}{\text{\#subtopics}}\] mentions.
On average, the number of cross-subtopic mention pairs (both positive and negative) therefore is \[{\frac{\text{\#subtopics}}{\text{\#topics}}\choose 2} \cdot \text{\#topics} \cdot \left(\frac{\text{\#mentions}}{\text{\#subtopics}}\right)^2\]
This scales quadratically with the number of subtopics. We divide by the number of subtopics to keep it linear:
\begin{align*}
&& \text{upper\_bound} &= \frac{{\frac{\text{\#subtopics}}{\text{\#topics}}\choose 2} \cdot \text{\#topics} \cdot \left(\frac{\text{\#mentions}}{\text{\#subtopics}}\right)^2}{\text{\#subtopics}} \\
\Longleftrightarrow && &= \frac{1}{2} \cdot \left(\frac{\text{\#subtopics}}{\text{\#topics}} - 1\right) \cdot \left(\frac{\text{\#mentions}}{\text{\#subtopics}}\right)^2 \\
\end{align*}

This can analogously be applied to compute an upper bound for sampling within-subtopic pairs (using $\frac{\text{\#documents}}{\text{\#subtopics}}$) and for sampling within-document pairs (using $\frac{\text{\#mentions}}{\text{\#documents}}$).

\end{document}


\documentclass[]{article}
\usepackage{array}
\usepackage{graphicx} % Required for including pictures
\usepackage{float} % float package used so figure location can be forced

\usepackage[top=1in,bottom=1in,left=1in,right=1in,headsep=10pt,letterpaper]{geometry} % Page margins

%----------------------------------------------------------------------------------------
%	FONTS
%----------------------------------------------------------------------------------------

\usepackage{avant} % Use the Avantgarde font for headings
%\usepackage{times} % Use the Times font for headings
\usepackage{mathptmx} % Use the Adobe Times Roman as the default text font together with math symbols from the Symbol, Chancery and Computer Modern fonts

\usepackage{microtype} % Slightly tweak font spacing for aesthetics
\usepackage[utf8]{inputenc} % Required for including letters with accents
\usepackage[T1]{fontenc} % Use 8-bit encoding that has 256 glyphs

\newenvironment{conditions}
{\par\vspace{\abovedisplayskip}\noindent\begin{tabular}{>{$}l<{$} @{${}={}$} l}}
	{\end{tabular}\par\vspace{\belowdisplayskip}}

%opening
\title{Thermal Load Card Pitot Static Tube Calibration}
\author{Phil Spindler}

\begin{document}

\maketitle

\begin{abstract}

The following summarizes the process for calibrating the thermal load card pitot static tube velocity measurements.  During this process a wind tunnel was used to provide a uniform stream of air with controllable velocity and a hot wire anemometer was used to provide the reference velocity measurements.  The resulting calibration allows for the pitot static tube to produce results within $5\%$ of the hot wire anemometer readings for velocities above $30 \frac{ft}{min}$.

\end{abstract}

\section{Physics Based Calculation}

The primary calculation to convert the differential pressure measured across the ports of the pitot static tube is shown in Equation \ref{basePhysics}.

\begin{equation}\label{basePhysics}
V = \frac{P_0}{P}\sqrt{\frac{T}{T_0}}\sqrt{2 \frac{\partial P_{sensor}}{\rho_0}}
\end{equation}
where:
\begin{conditions}
 V		& velocity in $\frac{m}{s}$ \\
 P_0	& sensor reference pressure $\left[ 966 \mbox{ mbar} \right] $ \\
 P		& atmospheric pressure $\left[1013.25 \mbox{ mbar} \right] $ \\
 T_0	& sensor reference temperature $\left[298.15 \mbox{ K} \right] $ \\
 T		& sensor measured temperature in K \\
 \partial P_{sensor}	& sensor zero calibrated differential pressure in Pa \\
 \rho_0	& density of air $ \left[ 1.1289 \frac{kg}{m^3} \right] $ \\
\end{conditions}

\noindent
Simplifying Equation \ref{basePhysics} gives

\begin{equation}\label{simplifiedPhysics}
V = 0.073490358 \sqrt{ T * \partial P_{sensor} }
\end{equation}

\noindent
Equation \ref{simplifiedPhysics} can be converted from $\frac{m}{s}$ to $\frac{ft}{min}$ by multiplying by $196.85$ leading to Equation \ref{simplifiedPhysicsFt}.

\begin{equation}\label{simplifiedPhysicsFt}
V = 14.4665769723 \sqrt{ T * \partial P_{sensor} }
\end{equation}

\noindent
Equation \ref{simplifiedPhysicsFt} provides the basis to convert the temperature and differential pressure readings from the pitot static tube sensor to velocity.  The calculated velocity values were then put through a calibration process to better match readings from the hot wire anemometer.

\section{Calibration}

The calibration was performed by taking measurements from the pitot static tube on the card and a hot wire anemometer next to the card (approximately 1in away).  The thermal load card was setup in a wind tunnel and the wind tunnel speed was varied through it's entire range (0-100\%) in 1\% increments.  The wind tunnel was held at a constant speed for 30 seconds between each step as shown in Figure \ref{fig:tunnelSetting}.

\begin{figure}[H]
	\centering\includegraphics[width=0.9\textwidth]{cardCalibration_01}
	\caption{Wind Tunnel Setting}
	\label{fig:tunnelSetting}
\end{figure}

\noindent
The velocity in the wind tunnel as recored by the hot wire anemometer and results from the pitot static tube based on Equation \ref{simplifiedPhysicsFt} are shown in Figure \ref{fig:rawVelocity}.  The results shown here (and used in subsequent analysis) are an average of 10 seconds of data centered on the middle of the wind tunnel speed steps shown in Figure \ref{fig:tunnelSetting}.  The 10 second subset of data was selected to avoid velocity instabilities in the wind tunnel immediately after wind tunnel setting changes.

\begin{figure}[H]
	\centering\includegraphics[width=0.9\textwidth]{cardCalibration_04}
	\caption{Uncalibrated Velocity}
	\label{fig:rawVelocity}
\end{figure}

\noindent
Figure \ref{fig:calibration} shows the physics based calculation of velocity relative to readings from the hot wire anemometer.  This relation was used to create a two part curve fit to calibrate the pitot static tube results with the hot wire anemometer results.  The correlation is linear for velocities above $362.645 \frac{ft}{min}$.  Below that point, the pitot static tube response is non-linear and fit with a second order polynomial.

\begin{figure}[H]
	\centering\includegraphics[width=0.9\textwidth]{cardCalibration_02}
	\caption{Pitot Tube Calibration Curves}
	\label{fig:calibration}
\end{figure}

\noindent
Figure \ref{fig:result} shows the calibrated velocity results.  In this image, the $1:1$ Line shows an ideal fit between the two parameters.  When the airflow velocity is less than approximately $30 \frac{ft}{min}$ the pitot static tube provides unreliable results (with errors up to $93\%$).  Beyond this lower threshold the average error is $1.02\%$ and the maximum error is $4.59\%$.

\begin{figure}[H]
	\centering\includegraphics[width=0.9\textwidth]{cardCalibration_03}
	\caption{Calibration Result}
	\label{fig:result}
\end{figure}

\end{document}

pitot static tube calibration process/Thermal Load Card Pitot Static Tube Calibration.tex


\documentclass[../PHYS306Notes.tex]{subfiles}

\begin{document}
\section{Lecture 24}
\subsection{Lecture Notes - Phase Space \& Canonical Transformations}
\subsubsection{Cyclic/Ignorable Coordinates}
If $\LL$ is independent of a generalized coordinate $q_i$, then for the associated generalized momentum we have that $\dot{p}_i = 0$ and hence the generalized momentum is conserved. Equivalently, if $\HH$ is independent of of a generalized coordinate $q_i$, the same conclusion holds (as $\pd{\LL}{q_i} = -\pd{\HH}{q_i}$.) With Hamiltonian dynamics, you can do another thing; consider $\HH = \HH(q_1, p_1, p_2)$ and with $p_2 = \text{Const.} = K$, then we can reduce the degrees of freedom by one explicitly; that is, $\HH(q, p_1, K)$. Hence we have one fewer equations of motion directly. We have reduced the complexity by 1 DoF. It's not necessarily easier to solve Hamilton's equations than Lagrange's, but we may be able to reduce the number of coordinates by using Hamilton's formalism.

\subsubsection{Phase Space Vectors}
In the Lagrangian formulation, the equations of motion are of the form $f(\ddot{q}, \dot{q}, q) = 0$ (2nd order DEs). As we have said in this course before (and has been covered in differential equations courses), we can convert this second order DE into a system of two differential equations. If we define $s = \dot{q}, \dot{s} = \ddot{q}$, then we have:
\[f(\dot{s}, s, q) = 0\]
Hence we have the two first order differential equations:
\[\dot{s} = \ddot{q}, f(\dot{s}, s, q) = 0\]
Hamilton's equations of motion read:
\[\dot{q}_i = \dpd{\HH}{p_i} = f_i(\v{q}, \v{p})\]
\[\dot{p}_i = -\dpd{\HH}{q_i} = g_i(\v{q}, \v{p})\]
Both p and q are independent variables, so we might as well combine them into a single vector, which is the \textit{phase space vector}:
\[\v{z} = (\v{q}, \v{p})\]
Hence we may write the equations as:
\[\dot{\v{z}} = \v{f}(\v{z})\]
So we have a system of first order DEs. This may be beneficial as we have many mathematical techniques to solve first order DEs. Note that in particular we may write:
\[\dot{\v{z}} = J \cdot \nabla_{\v{z}}\HH(z, t)\]
What is the form of the matrix $J$?
\begin{s}
\[J = \m{0 & \cdots & I \\ \vdots & \ddots & \vdots \\ -I & \cdots & 0}\]
Where the $0$s and $I$s represent blocks of the matrices. Note that $\dot{q}_i = \pd{\HH}{p_i}$ and $\dot{p}_i = - \pd{\HH}{q_i}$. Note that $J$ is known as the "metric of phase space".
\end{s}

\subsubsection{Canonical Transformations}
In Lagrangian mechanics, we can take the generalized coordinates $\v{q} = \v{q}(q_1, \ldots, q_n)$ that can be replaced by $Q = (Q_1, \ldots, Q_n)$ with $\v{Q} = \v{Q}(\v{q})$ and for which the Euler-Lagrange equations are still valid. The question becomes: Can we do something similar with Hamilton's equations? Can we transform $q_i \mapsto Q_i = Q_i(q, p, t)$ and $p_i \mapsto P_i = P_i(q, p, t)$ so that:
\[\dot{Q}_i = \dpd{K}{P_i}\]
\[\dot{P}_i = -\dpd{K}{Q_i}\]
with a new hamiltonian $K$? The answer turns out to be not in general.

\noindent As a counterexample, we can have $Q = p, P = q$ with $H = K$. The transform of phase space is a wider class than the transformation of just the coordinate space, so there will only be a subset of the many possible transformation that leave the Hamilton's equation of motion form invariant. Such a subset is known as the canonical transformations.

\noindent Recall in Lecture 6 that we talked about how general the Lagrangian was, and we showed that one can add a total derivative $\od{F}{t}$ to $\LL$ and not change the equations of motion. This is because adding $\od{F}{t}$ does not contribute to the variation, that is:
\[\delta \int_{t_1}^{t_2} \dod{F}{t}dt = \left. \delta F\right|_{t_1}^{t_2} = 0\]
Where in the last equality we use the fact that the variation vanishes at the endpoints. Hence adding the total derivative does not contribute to the variation. This $F$ is known as the generating function. In particular, we can set:
\[\sum_i \dot{q}_i p_i - \HH = \sum_i\dot{Q}_iP_i - K + \dod{F}{t}\]
And I know that these new variables will satisfy the same equations. We can use this $F$ to generate such tranformations. In full, we have $4n$ variables of $q, p, Q, P$ but only $2n$ are independent; hence $F$ should depend on $2n$ independent variables. Hence, there are $4$ possible ways we could construct a generating function. These would be:
\[F_1 = F_1(q, Q, t)\]
\[F_2 = F_2(q, P, t)\]
\[F_3 = F_3(p, Q, t)\]
\[F_4 = F_4(p, P, t)\]
For now, we will look at the first case, $F_1(q, Q, t)$. In this case,
\[\sum_i \dot{q}_i p_i - \HH = \sum_i \dot{Q}_i P_i - K + \dod{F_1}{t} = \sum_{i}\dot{Q}_iP_i - K \sum_i\dpd{F_1}{q_i}\dot{q}_i + \sum_i \dpd{F_1}{Q_i}\dot{Q}_i + \dpd{F_1}{t}\]
We now collect some terms (i.e. the terms that depend commonly on $\dot{q}_i$, $\dot{Q}_i$). Doing so we have:
\[\sum_i \dot{q}_i\left(p_i - \dpd{F_1}{q_i}\right) - \sum_i\dot{Q}_i\left(P_i + \dpd{F_1}{Q_i}\right) + K - \HH - \dpd{F_1}{t} = 0\]
From this equation, it is nice to read off what the transformed variables must look like. From the first term, $p_i = \dpd{F_1}{q_i}$, $P_i = -\dpd{F}{Q_i}$, and the new Hamiltonian is $K = \HH + \dpd{F_1}{t}$.

\noindent This is all quite abstract, so let us consider an example. Let $F_1 = F_1(q, Q, t) = \sum_i q_iQ_i$. We therefore have that $p_i = \pd{F_1}{q_i} = Q_i$, $P_i = \pd{F_1}{Q_i} = - q_i$, and $K = \HH$ as the Hamiltonian is not explicitly time dependent. This is just an interchange of coordinates. This shows that in the Hamiltonian description, $p$ and $q$ are compeltely symmetric and can be completely interchanged.

\noindent We can derive very very similar transformation laws for the other three general cases above.

\noindent Whas is all of this good for? Can we do something more with it? Indeed we can, but we will see it on Wednesday. The first thing we shall do is to introduce a criterion for when a transform is canonical, and in doing so we will introduce something known as a Poisson bracket. We will also show that a time evolution itself is a canonical transformation. We will also show conservation laws associated with canonical transformations, and this will get us into Liouville's theorem.
\end{document}


\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{tikz}
\setlength{\parindent}{0pt}

\newtheorem*{theorem}{Theorem}
\newtheorem*{definition}{Definition}
\newtheorem*{lemma}{Lemma}
\newtheorem*{corollary}{Corollary}
\newtheorem{example}{Example}
\newtheorem*{trick}{Trick}
\newtheorem*{question}{Question}

\title{Lecture 1: Dot Product}
\author{}
\date{}

\begin{document}

\maketitle

\section{Vectors}

Vectors: quantities that have both direction and magnitude/length.

Scalars: quantities that only have magnitude.

Identities of vectors: as long as the directions and magnitudes of two vectors
are the same, we say these two vectors are equal. The equality of vectors has
nothing to do with their start points and end points.

\bigskip

Notations for Vectors
\begin{itemize}
	\item $\vec{A}$: a vector with the name $A$.
	\item $\vec{AB}$: a vector from the point $A$ to the point $B$.
	\item $|\vec{A}|$: the magnitude/length of the vector $\vec{A}$.
	\item $dir(\vec{A})$: the direction of the vector $\vec{A}$.
\end{itemize}

\begin{definition}
	The direction of $\vec{A}$ is defined by
	\[ dir \vec{A} = \frac{\vec{A}}{|\vec{A}|}, \qquad (\vec{A} \neq 0); \]
	it is the unit vector lying along $\vec{A}$ and pointed the same direction as
	$\vec{A}$.
\end{definition}

\subsection{Vectors From A Geometric Perspective}

Geometrically, we typically express a vector as an arrow with a direction and
a length.

\smallskip

Basic vector operations
\begin{itemize}
	\item Addition of vectors: The result of $\vec{A} + \vec{B}$ is defined as
	the vector from the start of $\vec{A}$ to the end of $\vec{B}$ after
	moving the start of $\vec{B}$ to the end of $\vec{A}$ parallel.

	\item Negative vectors: The result of $-\vec{A}$ is defined as the vector
	with the same length and reverse direction of $\vec{A}$.

	\item Subtraction of vectors: The result of $\vec{A} - \vec{B}$ is equal to
	$\vec{A} + (-\vec{B})$, which is the vector from the end of $\vec{B}$ to
	the end of $\vec{A}$.

	\item Multiplication by scalars: The result of $c \times \vec{A}$ is
	defined as the vector with the same direction and $c$ times of the length
	of $\vec{A}$.
\end{itemize}

\subsection{Vectors From An Analytical Perspective}

To compute things with vectors, we need to put them into coordinate systems.
With the addition operation we defined for vectors, we can decompose a vector
to a unique set of component vectors along coordinate axes.

For the convenience of expression, we define a unit vector for each coordinate
axis, which has length $1$ and same direction as the corresponding axis. By
convention, the unit vector along the $x$ axis is $\vec{i}$, the unit vector
along the $y$ axis is $\vec{j}$, and the unit vector along the $z$ axis
$\vec{k}$. In this way, every vector in the three dimension space can be
expressed as

\[ \vec{A} = a_{1} * i + a_{2} * j + a_{3} * k \]

Or more generally

\[ \vec{A} = <a_{1}, a_{2}, a_{3}> \]

This kind of expression can be generalized into $N$ dimensional space as:

\[ \vec{A} = <a_{1}, a_{2}, a_{3}, ..., a_{n-1}, a_{n}> \]

\bigskip

Basic vector operations
\begin{itemize}
	\item Addition of vectors: Since the addition of vectors satisfies the
	commutative and associative laws, $\vec{A} + \vec{B}$ is equal to the sum
	of the addition result of their corresponding component vectors. Hence
	\[ \vec{A} + \vec{B} = <a_{1} + b_{1}, a_{2} + b_{2}, ..., a_{n} + b_{n}> \]

	\item Negative vectors: It is obvious that
	\[ -\vec{A} = <-a_{1}, -a_{2}, ..., -a_{n}> \]

	\item Subtraction of vectors: The result of $\vec{A} - \vec{B}$ is equal to
	$\vec{A} + (-\vec{B})$. Hence
	\[ \vec{A} - \vec{B} = <a_{1} - b_{1}, a_{2} - b_{2}, ..., a_{n} - b_{n}> \]

	\item Multiplication by scalars: It is obvious that
	\[ c \times \vec{A} = <c \times a_{1}, c \times a_{2}, ..., c \times a_{n} \]
\end{itemize}

\begin{example}
What is the length of the vector $\vec{A} = <3, 2, 1>$?

We can define an intermediate vector $\vec{A_{1}} = 3\vec{i} + 2\vec{j}$.
According to Pythagorean Theorem, $|\vec{A_{1}}| = \sqrt{3^2 + 2^2} = \sqrt{13}$.
Then $\vec{A} = \vec{A_{1}} + \vec{k}$, and $\vec{A_{1}}$ is perpendicular to
$\vec{k}$. Hence $|\vec{A}| = \sqrt{|\vec{A_{1}}|^2 + |\vec{k}|^2} =
\sqrt{3^2 + 2^2 + 1^2} = \sqrt{14}$.
\end{example}

In general,
\[ |\vec{A}| = \sqrt{a_{1}^{2} + a_{2}^{2} + ... + a_{n}^{2}} \]
This formula holds because of the orthogonality of the axes in coordinate
systems.

\section{Dot Product}

\begin{definition}
$\vec{A} \cdot \vec{B} = \sum a_{i}b_{i} = a_{1}b_{1} + a_{2}b_{2} + ... + a_{n}b_{n}$
\end{definition}

Geometric Interpretation: Suppose the angle between $\vec{A}$ and $\vec{B}$ is
$\theta$, then $\vec{A} \cdot \vec{B} = |\vec{A}| \cdot |\vec{B}| \cdot \cos\theta$.

Proofs:\\
Firstly let's consider the dot product of a vector and itself. According to the
definition of dot product:
\[ \vec{A} \cdot \vec{A} = \sum_{i=1}^{n}a_{i}^2 = |\vec{A}|^2 \]
Therefore the above statement holds in this case.

Then let's consider the dot product of two different vectors. One important
insight about the definition of dot product is that it satisfies the commutative
and distributive law. Let $\vec{C}$ denotes the result vector of
$\vec{A} - \vec{B}$. Then
\[ \vec{C} \cdot \vec{C} = (\vec{A} - \vec{B}) \cdot (\vec{A} - \vec{B}) \]

\[ |\vec{C}|^2 = \vec{A} \cdot \vec{A} + \vec{B} \cdot \vec{B} - 2 \vec{A} \cdot \vec{B} \]

\[ |\vec{C}|^2 = |\vec{A}|^2 + |\vec{B}|^2 - 2 \vec{A} \cdot \vec{B} \]

According to Law of Cosine, we have
\[ |\vec{C}|^2 = |\vec{A}|^2 + |\vec{B}|^2 - 2|\vec{A}||\vec{B}|\cos\theta \]

Therefore
\[ \vec{A} \cdot \vec{B} = |\vec{A}| \cdot |\vec{B}| \cdot \cos\theta \]

\bigskip

Property of the sign of dot product:
\begin{itemize}
	\item $\vec{A} \cdot \vec{B} > 0$ if and only if $\theta < 90^{\circ}$.
	\item $\vec{A} \cdot \vec{B} = 0$ if and only if $\theta = 90^{\circ}$.
	\item $\vec{A} \cdot \vec{B} < 0$ if and only if $\theta > 90^{\circ}$.
\end{itemize}

\bigskip
Application of Dot Product

1. Computing lengths and angles (especially angles).

\begin{example}
Find the angle between $PQ$ and $PR$.
% TODO(jinxinwang): add the diagram of this example.

Solution:
\[ \vec{PQ} = <-1, 1, 0> \]
\[ \vec{PR} = < -1, 0, 2> \]
Then
\[
  \begin{split}
	\cos(\angle QPR)  &= \frac{\vec{PQ} \cdot \vec{PR}}{|\vec{PQ}| \cdot |\vec{PR}|} \\
	                  &= \frac{-1 \cdot (-1) + 1 \cdot 0 + 0 \cdot 2}{\sqrt{(-1)^{2} + 1^{2} + 0^{2}} \cdot \sqrt{(-1)^{2} + 0^{2} + 2^{2}}} \\
	                  &= \frac{1}{\sqrt{10}}
  \end{split}
\]
\end{example}

2. Detect orthogonality.

\begin{example}
The set of points where $x + 2y + 3z = 0$ describes \\
A. The empty set \\
B. A single point \\
C. A line \\
D. A plane \\
E. A sphere \\
F. None of the above

Solution:\\
The set of points where $x + 2y + 3z = 0$ describes a plane. We can find three
points which satisfy the equation and are not on a same line together, in order
to exclude the option A, B, and C.
\[ P_1 = (0, 0, 0) \]
\[ P_2 = (1, 1, -1) \]
\[ P_3 = (5, -1, -1) \]
If a set of points describes a plane, then we can find a vector which is
perpendicular to any line formed by two points on the plane. That vector is
called normal. The normal to the surface described by this equation is
$<1, 2, 3>$. Suppose we have two random points on the surface described by the
above equation: $P_{1} = (x_{1}, y_{1}, z_{1})$ and $P_{2} = (x_{2}, y_{2},
z_{2})$. Then we have
\[ x_{1} + 2y_{1} + 3z_{1} = 0 \]
\[ x_{2} + 2y_{2} + 3z_{2} = 0 \]
Therefore
\[ (x_{1} - x_{2}) + 2(y_{1} - y_{2}) + 3(z_{1} - z_{2}) = 0 \]
which proves that the vector $<1, 2, 3>$ is perpendicular to the vector
$\vec{P_{1}P_{2}}$. Since $P_{1}$ and $P_{2}$ are random points, we prove that
the vector $<1, 2, 3>$ is perpendicular to any vectors formed by two points on
that surface. Therefore, that surface is a plane.
\end{example}

\end{document}


\documentclass[12pt]{amsart}
\usepackage{enumerate}
\usepackage[colorlinks=true, linkcolor=blue, urlcolor=blue, citecolor=blue, anchorcolor=blue, pdfborder={0 0 0}]{hyperref}
\usepackage{url}
\usepackage{graphicx,color}
\usepackage{cite}
\usepackage{amsthm, amsmath, amssymb}
\usepackage{mathtools}
\usepackage[top=45truemm, bottom=45truemm, left=30truemm, right=30truemm]{geometry}
\usepackage{nicefrac}
\usepackage{cancel}
\usepackage{float}
\usepackage{tabularx}
\usepackage{makecell}
\usepackage{array}
\usepackage{ragged2e}

\newcolumntype{P}[1]{>{\RaggedRight\hspace{0pt}}p{#1}}
\newcolumntype{L}{>{\begin{math}}l<{\end{math}}}%
\newcolumntype{C}{>{\begin{math}}c<{\end{math}}}%
\newcolumntype{R}{>{\begin{math}}r<{\end{math}}}%

\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{example}[theorem]{Example}
\theoremstyle{definition}
\newtheorem{remark}[theorem]{Remark}

\setlength{\headsep}{2em}
\setlength{\skip\footins}{1.4pc plus 5pt minus 2pt}

\title[Engel Expansions in Collatz Sequences]{The Role of Engel Expansions in Collatz Sequences}

\author[F.\ Last1]{\href{https://orcid.org/0000-0001-5257-2236}{\includegraphics[scale=0.06]{orcid.png}}\hspace{1mm}Eldar Sultanow}
\address{Eldar Sultanow\\
Capgemini Deutschland GmbH\\ Bahnhofstraße 30\\ 90402 Nuremberg\\ Germany}
\curraddr{}
\email{eldar.sultanow@capgemini.com}

\author[F.\ Last2]{First Last}
\address{First Lastname\\
Graduate School of Mathematics\\ XYZ University\\ City\\ Adresszusatz\\ ZIP\\ Germany}
\curraddr{}
\email{first.last@university.de}

\subjclass[2010]{11B99}
\keywords{Engel Expansions, Collatz Sequences}

\begin{document}

\begingroup
\let\MakeUppercase\relax
\maketitle
\endgroup

\begin{abstract}
The Collatz conjecture is a number theoretical problem, which has puzzled countless researchers using myriad approaches. Presently, there are scarcely investigations to treat the problem from the angle of the question "which are the corner cases the Collatz Sequences?". We pursue this question and to this end examine ascending continued fractions -- the so called Engel expansions. We demonstrate that Engel expansions form worst case sequences $v_1,v_2,\ldots,v_n,v_{n+1}$ that maximize $v_{n+1}$. We show that maximizing the product $(1+\nicefrac{1}{3v_1})(1+\nicefrac{1}{3v_2})\cdots(1+\nicefrac{1}{3v_n})(1+\nicefrac{1}{3v_{n+1}})$ requires us to minimize $v_1$ and to maximize $v_{n+1}$ as well as the number of division by two within the sequence.
\end{abstract}

\section{Introduction}
\label{introduction}
The Collatz conjecture is a well-known number theory problem and is the subject of numerous publications. An overview is provided by Lagarias \cite{Ref_Lagarias_2010}. Therefore, our description of the topic will be brief. The mathematician Lothar Collatz introduced a function $g:\mathbb{N}\rightarrow\mathbb{N}$ as follows:

\begin{equation}
\label{eq:func_collatz}
g(x)=
\begin{cases}
3x+1	&	2\nmid x\\
x/2		&	\text{otherwise}
\end{cases}
\end{equation}

\par\medskip
In the following, we only consider compressed Collatz sequences that solely contain the odd members, such as described by Bruckman \cite{Ref_Bruckman_2008}, who used the more convenient function that opts out all even integers:

\begin{equation}
\label{eq:func_collatz_odd}
f(x)=(3x+1)\cdot2^{-\alpha(x)},\text{where}\hspace{1em}2^{\alpha(x)}\mathrel\Vert(3x+1)
\end{equation}

\par\medskip
Note that $\alpha(x)$ is the largest possible exponent for which $2^{\alpha(x)}$ exactly divides $3x+1$. Especially for prime powers, one often says $p^\alpha$ \textit{divides} the integer $x$ \textit{exactly}, denoted as $p^\alpha\mathrel\Vert x$, if $p^\alpha$ is the greatest power of the prime $p$ that divides $x$.

\newpage
\begin{definition}
\label{def:halting_conditions}
A (compressed) Collatz sequence $v_1,v_2,\ldots,v_n,v_{n+1}$ ends when one of the following two conditions is reached:

\[
\begin{array}{ll}
\text{1.}&v_{n+1}=1\\[\medskipamount]
\text{2.}&v_{n+1}\in\{v_1,v_2,v_3,\ldots,v_n\}
\end{array}
\]

When the first condition applies, the Collatz conjecture is true for a specific sequence. If the second condition is fulfilled, the sequence has led to a cycle.
\end{definition}

\par\bigskip\noindent
Maximizing the product $(1+\nicefrac{1}{3v_1})(1+\nicefrac{1}{3v_2})\cdots(1+\nicefrac{1}{3v_n})(1+\nicefrac{1}{3v_{n+1}})$ means to search for a sequence of odd numbers $v_1,v_2,\ldots$ as small as possible. One could try to use the arithmetic\footnote{An arithmetic sequence is a sequence, "in which each term is a constant $q$ more than the previous term" \cite[p.~206]{Ref_Brualdi_2010}.} sequence of odd integers $v_i=2i-1$ (beginning at $v_1=1$), but will find that for this case the product will not converge against a limit value as shown in appendix~\ref{appx:pochhammer}. A Collatz sequence $v_1,v_2,\ldots,v_n,v_{n+1}$ allowed at most one division by $2$ between two successive members. Dividing only once between two successive members, maximizes $v_{n+1}$. Such a sequence forms the following ascending continued fraction (cf. also \cite[p.~11]{Ref_Laarhoven}):
\begin{equation}
\label{eq:engel_k3}
v_{n+1}=\cfrac{3\cfrac{3\cfrac{3\cfrac{3v_1+1}{2}+1}{2}+1}{2}+1}{2}\dotsb
=\frac{3^nv_1+\sum_{i=0}^{n-1}3^i2^{n-1-i}}{2^n}
=\frac{3^n(v_1+1)-2^n}{2^n}
\end{equation}

\medskip
\begin{example}
\label{ex:engel_31}
A concrete example for such a sequence is $v_1=31$, $v_2=47$, $v_3=71$, $v_4=107$, $v_5=161$. And, to follow that example, we can calculate $v_5$ in a straightforward way:
\[
v_5=v_{n+1}=\frac{3^4(31+1)-2^4}{2^4}=161
\]

\par\medskip
Besides, by choosing a starting number $v_1=2^{n+1}-1$, we are able to infinitely generate sequences each forming an ascending continued fraction. As per equation~\ref{eq:engel_k3} the last member in this sequence is the odd number $v_{n+1}=3^n\cdot2-1$.
\end{example}

\medskip
\begin{remark}
Ascending variants of a continued fraction, such as used in equation~\ref{eq:engel_k3}, shall not be confused with continued fractions as treated in \cite{Ref_Moore}, \cite{Ref_Hensley}, \cite{Ref_Borwe_etal}. Ascending continued fractions used in our case correspond to the so-called "Engel Expansions" \cite{Ref_Kraaikamp_Wu}.
\end{remark}

\par\noindent
As illustrated below, we can formulate the ascending continued fractions in a generalized fashion, whereas the analogy to \ref{eq:engel_k3} is given by $b_1=b_2=b_3=b_4=2$ and $a_1=3^0$, $a_2=3^1$, $a_3=3^2$ and $a_4=3^3+3^4v_1$:

\[
\cfrac{a_1+\cfrac{a_2+\cfrac{a_3+\cfrac{a_4}{b_4}}{b_3}}{b_2}}{b_1}\dotsb=\frac{a_1}{b_1}+\frac{a_2}{b_1b_2}+\frac{a_3}{b_1b_2b_3}+\frac{a_4}{b_1b_2b_3b_4}+\cdots
\]

\par\medskip
The generalized form of equation~\ref{eq:engel_k3} may be used to compute any of the above-named ascending continued fraction that has $a_i=k^{i-1}$, $b_i=b$ for $i\in\mathbb{N}$ and $a_n=k^{n-1}+k^nv_1$:

\begin{equation}
\label{eq:generalized_asc_continued_fraction}
v_{n+1}=\frac{k^n(kv_1-bv_1+1)-b^n}{b^n(k-b)}
\end{equation}

\par\medskip\noindent
Table~\ref{table:engel_expansions_k_1_3_5_7} provides for $k=1,3,5,7$ each formula that calculates $v_{n+1}$ of an Engel expansion along with some example sequences. We obtained these formulas by inserting $b=2$ and $k=1,3,5,7$ into equation~\ref{eq:generalized_asc_continued_fraction}.

{\renewcommand{\arraystretch}{1.8}
\begin{table}[H]
	\centering
	\begin{tabular}{|L|L|L|L|}
		\hline
		\thead{\boldsymbol{k}} &
		\thead{\textbf{equation for~}\boldsymbol{v_{n+1}}} &
		\thead{\textbf{example sequence}} &
		\thead{\textbf{resulting}~\boldsymbol{v_{n+1}}}\\
		\hline
		1
		& v_{n+1}=\frac{v_1-1+2^n}{2^n}
		& 513,257,129,65,33,17,9,5,3
		& v_9=\frac{513-1+2^8}{2^8}=3
		\\ \hline
		3
		& v_{n+1}=\frac{3^n(v_1+1)-2^n}{2^n}
		& 127,191,287,431,647,971,1457
		& v_7=\frac{3^6(127+1)-2^6}{2^6}=1457
		\\ \hline
		5
		& v_{n+1}=\frac{5^n(3v_1+1)-2^n}{3\cdot2^n}
		& 85,213,533,1333,3333,8333
		& v_6=\frac{5^5(3\cdot85+1)-2^5}{3\cdot2^5}=8333
		\\ \hline
		7
		& v_{n+1}=\frac{7^n(5v_1+1)-2^n}{5\cdot2^n}
		& 51,179,627,2195,7683
		& v_5=\frac{7^4(5\cdot51+1)-2^4}{5\cdot2^4}=7683
		\\ \hline
	\end{tabular}
	\caption{Some exemplary Engel expansions for $b=2$ and $k=1,3,5,7$}
	\label{table:engel_expansions_k_1_3_5_7}
\end{table}}

\section{Include more divisions by two into an Engel expansion}
\label{sec:include_divisions_engel_expansion}
For calculating the largest possible $v_{n+1}$, we considered so far Engel expansions which contain only $n$ division by two within a Collatz sequence of $n+1$ memebers. In the following we include $m$ additional divisions by two and thus a total of $m+n$ divisions.

\par\medskip
Our starting point again is a Collatz sequence $v_1,v_2,\ldots,v_{n+1}$ consisting of $n+1$ members. We have a total of $m+n$ divisions by two that are distributed over $n$ positions:

\begin{equation}
\label{eq:alpha_n_m}
\alpha=n+m=\alpha_1+\alpha_2+\cdots+\alpha_n
\end{equation}

The number of positive integer solutions of the diophantine equation above is given by the following binomial coefficient, which is commonly used to calculate combinations with repetition, see \cite[p.~54]{Ref_Brualdi_2010}:

\[
\binom{n+(\alpha-n)-1}{\alpha-n}=\binom{n+m-1}{m}
\]

\par\medskip
Each of these solutions describes a possible way to distribute the $m+n$ divisions by two across $n$ positions within a Collatz sequence containing $n+1$ members. But how do we distribute these divisions in such a way that $v_{n+1}$ becomes maximum? This is precisely the case if as many divisions as possible are performed right at the beginning, which is illustrated in appendix~\ref{appx:permuting_divisions}. The Engel expansion of this case (that maximizes the value of $v_{n+1}$) provides the following formula for calculating the last sequence member $v_{n+1}$:

\begin{equation}
\label{eq:engel_more_divisions}
v_{n+1}=\left(\frac{k}{2}\right)^{n-1}\left(\frac{kv_1+1}{2^{\alpha_1}}+\frac{1}{k-2}\right)-\frac{1}{k-2}=\left(\frac{k}{2}\right)^{n-1}\left(v_2+\frac{1}{k-2}\right)-\frac{1}{k-2}
\end{equation}

\medskip
\begin{example}
	\label{ex:engel_67}
	We choose the sequence for $k=5$ starting at $v_1=67$ continuing with $v_2=21$, $v_3=53$, $v_4=133$, $v_5=333$, $v_6=833$ and $v_7=2083$. The last sequence member can be calculated by equation~\ref{eq:engel_more_divisions} directly as follows:

	\[
	v_7=\left(\frac{5}{2}\right)^{6-1}\left(21+\frac{1}{5-2}\right)-\frac{1}{5-2}=2083
	\]
\end{example}

\par\medskip\noindent
Moreover theorem~\ref{theo:permutation} specifies the limitation of the effect, which the division permutations have on the last sequence member $v_{n+1}$. As demonstrated in appendix~\ref{appx:permuting_divisions}, the maximum impact on $v_{n+1}$ of permuting division by two in a given Collatz sequence can be calculated by the difference between the highest and lowest possible value of $v_{n+1}$.

\par\medskip
\begin{theorem}
	\label{theo:permutation}
	Let $v_1,v_2,\ldots,v_n,v_{n+1}$ be a sequence in which a total of $n+m$ divisions by two took place. No matter how these divisions are permuted, i.e. performed sooner or later, the last member $v_{n+1}$ can differ at most by the following product:

	\[
	\left(\frac{3^{n-1}}{2^{n-1}}-1\right)\left(1-\frac{1}{2^m}\right)
	\]
\end{theorem}

\newpage
\section{Sum of reciprocated Collatz members}
\label{sum_reciprocal_vertices}
A product $\prod(1+a_n)$ with positive terms $a_n$ is convergent if the series $\sum a_n$ converges, see Knopp \cite[p.~220]{Ref_Knopp}. A similar statement provides Murphy \cite{Ref_Murphy}, who write the factors in the form $c_n=1+a_n$ and explains that if $\prod c_n$ is convergent then $c_n\rightarrow1$ and therefore if $\prod (1+a_n)$ is convergent then $a_n\rightarrow0$.

\par\medskip
We write the sum of reciprocated Collatz members as $\nicefrac{1}{kv_1}+\nicefrac{1}{kv_2}+\ldots+\nicefrac{1}{kv_n}+\nicefrac{1}{kv_{n+1}}$. In order to formulate this sum independently from the successive members $v_2,v_3,\ldots$, we substitute these as follows:

\begin{flalign}
v_1&=v_1\notag\\
v_2&=\frac{kv_1+1}{2^{\alpha_1}}\notag\\
v_3&=\frac{k^2v_1+k+2^{\alpha_1}}{2^{\alpha_1+\alpha_2}}\notag\\
v_4&=\frac{k^3v_1+k^2+k\cdot2^{\alpha_1}+2^{\alpha_1+\alpha_2}}{2^{\alpha_1+\alpha_2+\alpha_3}}\label{eq:sum_v_4}\\
\vdots\notag\\
v_{n+1}&=\frac{k^nv_1+\sum_{j=1}^{n}k^{j-1}2^{\alpha_1+\ldots+\alpha_n-\sum_{l>n-j}\alpha_l}}{2^{\alpha_1+\ldots+\alpha_n}}\label{eq:sum_v_n_plus_1}
\end{flalign}

\par\medskip
The sum of the reciprocal Collatz sequence members can be expressed as a term that only depends from $v_1$ and from the number of dvisions by two $\alpha_1,\alpha_2,\alpha_3,\ldots$ between two successive members:
\begin{equation*}
\sum_{i=1}^{n+1}\frac{1}{kv_i}=\frac{1}{k}\left(\frac{1}{v_1}+\sum_{i=1}^{n}\frac{1}{v_{i+1}}\right)=\frac{1}{k}\left(\frac{1}{v_1}+\sum_{i=1}^{n}\frac{2^{\alpha_1+\ldots+\alpha_i}}{k^iv_1+\sum_{j=1}^{i}k^{j-1}2^{\alpha_1+\ldots+\alpha_n-\sum_{l>i-j}\alpha_l}}\right)
\end{equation*}

%\vspace{1em}
\section{The product of reciprocated Collatz members incremented by one}
\label{appx:product_formula_depending_v1}
In a similar way to deduce the sum of reciprocal vertices depending only on $v_1$ as performed in \ref{sum_reciprocal_vertices}, we evolve the formula for the product of reciprocated Collatz members (incremented by one):

\begin{flalign}
\prod_{i=1}^{n+1}\left(1+\frac{1}{kv_i}\right)&=1+\frac{2^{\alpha_1+\ldots+\alpha_n}+k\cdot2^{\alpha_1+\ldots+\alpha_{n-1}}+\ldots+k^{n-1}\cdot2^{\alpha_1}+k^n}{k^{n+1}v_1}\label{eq:prod_sum_v_n_plus_1}\\
&=1+\frac{2^{\alpha_1+\ldots+\alpha_n}+k\cdot\sum_{j=1}^{i}k^{j-1}2^{\alpha_1+\ldots+\alpha_n-\sum_{l>i-j}\alpha_l}}{k^{n+1}v_1}\label{eq:prod_sum_v_n_plus_1_inserted}\\
&=\frac{2^{\alpha_1+\ldots+\alpha_n}\left(1+kv_{n+1}\right)}{k^{n+1}v_1}\label{eq:prod_sum_v_n_plus_1_simplified}
\end{flalign}

We inserted the sum used in equation~\ref{eq:sum_v_n_plus_1} into the above-given equation~\ref{eq:prod_sum_v_n_plus_1} and then obtained equation~\ref{eq:prod_sum_v_n_plus_1_inserted}. Now let us divide this product by the last factor in order to retrieve the product which iterates to $n$ instead of $n+1$:

\begin{equation}
\label{eq:prod_sum_v_n_simplified}
\prod_{i=1}^{n}\left(1+\frac{1}{kv_i}\right)=\frac{\prod_{i=1}^{n+1}\left(1+\frac{1}{kv_i}\right)}{\frac{kv_{n+1}+1}{kv_{n+1}}}=\frac{2^{\alpha_1+\ldots+\alpha_n}v_{n+1}}{k^nv_1}
\end{equation}

\par\medskip
The above-shown equation~\ref{eq:prod_sum_v_n_simplified} becomes simplified, when we replaced the numerator by equation~\ref{eq:prod_sum_v_n_plus_1_simplified}. The question which sequence maximizes its last member $v_{n+1}$ ties into the question: Which sequence maximizes the product? The product formula~\ref{eq:prod_sum_v_n_simplified} does not depend from all vertices $v_1,v_2,\ldots,v_n$, it depends only from $2^\alpha=2^{\alpha_1+\ldots+\alpha_n}$, from the first sequence member $v_1$ and the final one $v_{n+1}$.

\section{Maximizing the product of reciprocated Collatz members}
Consider a Collatz sequence containing $n$ elements and starting at a given integer $v_1$. The corresponding product given by equation~\ref{eq:prod_sum_v_n_simplified} becomes largest if we
\begin{itemize}
\item maximize the last member $v_{n+1}$,
\item choose a smallest possible $v_1$ and
\item choose an $\alpha=n+m$ as large as possible, where $m$ is the crucial lever.
\end{itemize}

It is therefore a maximization problem over several variables. In the following we will reflect on how to approach a solution to the problem.

\par\medskip\noindent
{\bfseries\boldmath Minimizing $v_1$:} This is obvious and tricially achievable by iterating $v_1$ through small integers, starting at $v_1=1$.

\par\medskip\noindent
{\bfseries\boldmath Maximizing $\alpha$:} We must choose a Collatz sequence, in which as many divisions by two as possible occurred. Since $n$ and $m$ depend directly on $\alpha$, maximizing $\alpha$ is equivalent to maximizing $n$ or $m$. In general, adding more factors $(1+\nicefrac{1}{kv_i})$ can only increase the product. So, the larger $n$, the larger the product. Note that despite everything, $m$ is the key maximizer of the product -- these additional divisions by two reduce the sequence members $v_i$.

\par\medskip\noindent
{\bfseries\boldmath Maximizing $v_{n+1}$:} If we fix $v_1,\alpha,n$ then this maximum occurs when the sequence is an Engel expansion, id est when we run the most divisions by two at the beginning. Consequently, the exponent alpha (the total number of divisions by two) is the sum of a large $\alpha_1$ and the remaining alpha values which are all one:
\[
\alpha=n+m=\alpha_1+\alpha_2+\cdots+\alpha_n=\alpha_1+1+\cdots+1=\alpha_1+n-1
\]

The product of reciprocated Collatz members (incremented by one) for such an Engel expansion is given by the following equation:

\begin{flalign}
\label{eq:prod_engel_more_divisions}
\prod_{i=1}^{n}\left(1+\frac{1}{kv_i}\right)&=1+\frac{1}{kv_1}+\frac{2^{\alpha_1}}{k(k-2)v_1}\left(1-\left(\frac{2}{k}\right)^{n-1}\right)\\
\label{eq:prod_engel_more_divisions_v2}
&=1+\frac{1}{kv_1}+\frac{kv_1+1}{k(k-2)v_1v_2}\left(1-\left(\frac{2}{k}\right)^{n-1}\right)
\end{flalign}

\medskip
\begin{example}
	An example for $k=3$ provides the sequence $v_1=661$, $v_2=31$, $v_3=47$, and $v_4=71$. In this case $\alpha_1=6=m+1$ and $\alpha_2=\alpha_3=\alpha_4=1$. We now calcultae the product of reciprocated Collatz sequence members by inserting $v_1=661$ and $v_2=31$ together with $k=3$ and $n=4$ into equation~\ref{eq:prod_engel_more_divisions_v2}:

	\begin{flalign*}
	\prod_{i=1}^{4}\left(1+\frac{1}{3v_i}\right)&=
	\left(1+\frac{1}{3\cdot661}\right)\left(1+\frac{1}{3\cdot31}\right)\left(1+\frac{1}{3\cdot47}\right)\left(1+\frac{1}{3\cdot71}\right)\\
	&=1+\frac{1}{3\cdot 661}+\frac{3\cdot 661+1}{3\cdot(3-2)\cdot 661\cdot 31}\left(1-\left(\frac{2}{3}\right)^{4-1}\right)\\
	&=1.0232158532713247
	\end{flalign*}
\end{example}

\par\medskip
Maximizing the product of reciprocated Collatz sequence members $\prod_{i=1}^{n}(1+\nicefrac{1}{kv_i})$ requires us to maximize the equation~\ref{eq:prod_engel_more_divisions} or \ref{eq:prod_engel_more_divisions_v2}. This maximization is archieved by choosing $v_1$ as small as possible (which we already know). Additionally we need to select a largest possible $\alpha_1=m+1$ or a lowest possible $v_2$ (which is clear as well). Lastly, this maximization also requires the choice of a value $n$ as large as possible. To find the largest product, we iterate the variables $v_1$ and $n$ independently through integers $1,2,\ldots$ and calculate the product for each combination of the variable assignment using equation~\ref{eq:prod_engel_more_divisions_v2}. Alternatively, one can maximize equation~\ref{eq:prod_engel_more_divisions} or \ref{eq:prod_engel_more_divisions_v2} analytically for the different $k$.

\par\medskip
Table~\ref{table:product_equations_k_3_5_7} provides for $k=1,3,5,7$ the formula for calculating the Engel expansion's product. This table furthermore indicates the maximum cases along with the corresponding results for each product. These resulting product values have been determined empirically in \cite{Ref_Koch_etal}. Recall that we are not allowed to choose an arbitrarily large $n$ if we set $v_1=1$ because of the halting conditions given by definition~\ref{def:halting_conditions}. The case $v_1=3,v_2=5,n=\infty$ for $k=3$ disregards the halting condition, the value $n$ runs towards infinity and thus much further than allowed -- nevertheless, the product value converges towards $\nicefrac{4}{3}$. Note that for $n=1$ it does not matter what value $v_2$ takes -- it has no effect on the resulting product value.

{\renewcommand{\arraystretch}{1.8}
	\begin{table}[H]
		\centering
		\begin{tabular}{|L|L|L|L|}
			\hline
			\thead{\boldsymbol{k}} &
			\thead{\textbf{product formula}} &
			\thead{\textbf{maximum case}} &
			\thead{\textbf{resulting product}}\\
			\hline
			1 & 1+\frac{1}{v_1} + \frac{v_1+1}{-v_1v_2}\left(1-2^{n-1}\right) & v_1=1,n=1
			& 2
			\\ \hline
			3 & 1+\frac{1}{3v_1} + \frac{3v_1+1}{3v_1v_2}\left(1-\left(\frac{2}{3}\right)^{n-1}\right) & \makecell[l]{v_1=1,n=1\\v_1=3,v_2=5,n=\infty}
			& \frac{4}{3}
			\\ \hline
			5 & 1+\frac{1}{5v_1} + \frac{5v_1+1}{15v_1v_2}\left(1-\left(\frac{2}{5}\right)^{n-1}\right) & v_1=1,v_2=3,n=2
			& \frac{32}{25}
			\\ \hline
			7 & 1+\frac{1}{7v_1} + \frac{7v_1+1}{35v_1v_2}\left(1-\left(\frac{2}{7}\right)^{n-1}\right) & v_1=1,n=1
			& \frac{8}{7}
			\\ \hline
		\end{tabular}
		\caption{Formulas that calculate the Engel expansion's product for $k=1,3,5,7$}
		\label{table:product_equations_k_3_5_7}
\end{table}}

\section{Pitfalls and limitations}
We have maximized $v_1$ and $n$, but not the most important variable - namely the number $m$ of additional divisions by two. To our misfortune, there exist sequences that are not Engel expansions and still produce a larger product. Let us take for example the following five-element sequence for $k=3$ starting at $v_1=7$ and finishing with $v_{n}=5$:
\[
\begin{array}{l@{\hspace{1em}}l@{\hspace{1em}}l@{\hspace{1em}}l@{\hspace{1em}}l@{\hspace{2em}}l}
v_1=7&v_2=11&v_3=17&v_4=13&v_5=5&v_{n+1}=v_6=1\\
\alpha_1=1&\alpha_2=1&\alpha_3=2&\alpha_4=3&\alpha_5=4&
\end{array}
\]

The total number of divisions by two within this sequence is $\alpha=11=n+m=5+6$. The product $(1+\nicefrac{1}{3v_1})\cdots(1+\nicefrac{1}{3v_5})$ of this sequence is $1.20399764$. If we insert into the Engel expansion product formula~\ref{eq:prod_engel_more_divisions_v2} analogously $v_1=7$ and $n=5$, it yields a product value of only $1.12404468$. Do not forget that in this case the value $\alpha=4$ is much lower. Let us shift the $m=6$ divisions to the beginning:
\[
\alpha=11=7+1+1+1+1=\alpha_1+1+1+1+1
\]
In this case we would obtain a (hypothetical) product value of $5.93885949$, which is quite larger. One may verify this by inserting $k=3,v_1=7,\alpha_1=7,n=5$ into equation~\ref{eq:prod_engel_more_divisions}. However, such a sequence does not exist. We have shown that Engel expansions produce large product values, when $v_1$ is small enough. These product values are exactly those upper limits that were empirically determined in \cite{Ref_Koch_etal}. But we did not answer the question: Does there exist a sequence which is not an Engel expansion, but nevertheless has a greater product value by compensating a smaller $v_{n+1}$ through including more additional divisions by two (which means by compensating a smaller $v_{n+1}$ through having a larger $m$)?

\par\medskip
In the end, it is not sufficient to maximize only $v_{n+1}$, we need to optimize all parameters. Some sequences, such the one considered above $7,11,17,13,5$ produce a large product value $(1+\nicefrac{1}{3v_1})\cdots(1+\nicefrac{1}{3v_5})$ and there do not exist a corresponding Engel expansion (with analogous parameters) exceeding this product value.

%{\setlength{\jot}{1.2em}
%\begin{flalign}
%\label{eq:engel_k3_m}
%v_{n+1}&=\cfrac{3\cfrac{3\cfrac{3\cfrac{3v_1+1}{2\cdot2^m}+1}{2}+1}{2}+1}{2}\dotsb
%=\cfrac{3\cfrac{3\cfrac{3v_2+1}{2}+1}{2}+1}{2}\dotsb
%=\frac{3^{n-1}(v_2+1)-2^{n-1}}{2^{n-1}}\\
%\notag
%&=\frac{3^{n-1}(\frac{3v_1+1}{2\cdot2^{m}}+1)-2^{n-1}}{2^{n-1}}=\frac{3^nv_1+3^{n-1}+3^{n-1}2^{m+1}}{2^{m+n}}-1
%\end{flalign}}

\newpage
\section{Appendix}

\vspace{1em}
\subsection{The sequence of odd positive integers produces a divergent product}
\label{appx:pochhammer}
The arithmetic sequence of odd numbers $v_1=1,v_2=3,v_3=5,\ldots$ produces a divergent product $(1+\nicefrac{1}{3v_1})(1+\nicefrac{1}{3v_2})(1+\nicefrac{1}{3v_3})\cdots$. This sequence allows us to transform the product using the Pochhammer’s symbol (sometimes referred to as the \textit{rising factorial} or \textit{shifted factorial}), which is denoted by $(x)_n$ and defined as follows \cite{Ref_Zwillinger_Kokoska}, \cite[p.~679]{Ref_Brychkov} and \cite[p.~1005]{Ref_Trott}:
\[
(x)_n=x(x+1)(x+2)\cdots(x+n-1)=\prod_{i=0}^{n-1}(x+i)=\prod_{i=1}^{n}(x+i-1)=\frac{\Gamma(x+n)}{\Gamma(x)}
\]

Setting $v_i=2i-1$ into the product and setting $x=\nicefrac{k+1}{2k}$ into Pochhammer’s symbol $(x)_n$ interestingly makes it possible for us to perform the following transformation:

\begin{equation}
\label{eq:pochhammer}
\prod_{i=1}^{n}\left(1+\frac{1}{kv_i}\right)
=\frac{\prod_{i=1}^{n}(kv_i+1)}{\prod_{i=1}^{n}kv_i}
=\frac{\prod_{i=1}^{n}\left(k(2i-1)+1\right)}{k^n\prod_{i=1}^{n}(2i-1)}
=\frac{2^{2n}n!}{(2n)!}\cdot\frac{\Gamma\left(\frac{k+1+2kn}{2k}\right)}{\Gamma\left(\frac{k+1}{2k}\right)}
\end{equation}

\par\medskip
\begin{example}
	As an example that is easy to recalculate we choose $k=3$ and $n=4$:
	\[
	\left(1+\frac{1}{3*1}\right)\left(1+\frac{1}{3*3}\right)\left(1+\frac{1}{3*5}\right)\left(1+\frac{1}{3*7}\right)=1,6555=\frac{2^8*4!}{8!}\cdot\frac{\Gamma(\frac{14}{3})}{\Gamma(\frac{4}{6})}
	\]
\end{example}

\par\medskip
We transform the product in the numerator in equation~\ref{eq:pochhammer} into a form that allows us to use the Pochhammer’s symbol. It can be written as $2^nk^n(x)_n$, whwereby $x=\nicefrac{k+1}{2k}$:

\begin{flalign*}
\prod_{i=1}^{n}\left((2i-1)k+1\right)&=2^nk^n\prod_{i=1}^{n}\frac{(2i-1)k+1}{2k}=2^nk^n\prod_{i=1}^{n}\frac{k+1+2ki-2k}{2k}\\
&=2^nk^n\prod_{i=1}^{n}\left(\frac{k+1}{2k}+i-1\right)=2^nk^n\frac{\Gamma\left(\frac{k+1+2kn}{2k}\right)}{\Gamma\left(\frac{k+1}{2k}\right)}
\end{flalign*}

\par\medskip
We recall the basic fact that the product of even integers is given by $\prod_{i=1}^{n}2i=2^n\cdot n!$ and the product of odd integers is $\prod_{i=1}^{n}\left(2i-1\right)=\nicefrac{(2n)!}{2^n\cdot n!}$. For this reason we could transform the product in the denominator in equation~\ref{eq:pochhammer} as follows:

\[
\prod_{i=1}^{n}kv_i=k^n\prod_{i=1}^{n}v_i=k^n\prod_{i=1}^{n}(2i-1)=k^n\frac{(2n)!}{2^nn!}
\]

\vspace{1em}
\subsection{Permuting divisions by two}
\label{appx:permuting_divisions}
In order to illustrate how permuting divisions by two affect the last sequence member $v_{n+1}$, we take a look at two corner cases:
\begin{itemize}
	\item the one where we do the additional $m$ divisions by $2$ at the end and
	\item the one where we do these additional divisions at the very beginning.
\end{itemize}

\par\medskip\noindent
\textbf{The first case} is our starting point to examine how the swapping a division by two affects the sequence member $v_{n+1}$. For this, let us compare the Engel expansion where we devide by $2^m$ afterwards with one where we divide by $2$ in the penultimate step and by $2^{m-1}$ in last step. One can immediately recognize the following inequality with a mere look:
\[
\cfrac{1+\cfrac{3+\cfrac{3^2+\cfrac{3^3+3^4v_1}{2}}{2}}{2}}{2\cdot2^m}
<
\cfrac{1+\cfrac{3+\cfrac{3^2+\cfrac{3^3+3^4v_1}{2}}{2}}{2\cdot\textcolor{red}{\mathbf{2}}}}{2\cdot2^{m-1}}
\]

\par\bigskip
To put it simply, in the expansion on the right side of the above-shown inequality we perform one division by two a little bit earlier as we do it in the expansion on the left side of the expansion. Almost all summands of both expansions cancel out each other:

\[
\frac{1}{2\cdot2^m}+\cancel{\frac{3}{2^2\cdot2^m}+\frac{3^2}{2^3\cdot2^m}+\frac{3^3+3^4v_1}{2^4\cdot2^m}}
<
\frac{1}{2\cdot2^{m-1}}+\cancel{\frac{3}{2^2\cdot\textcolor{red}{\mathbf{2}}\cdot2^{m-1}}+\frac{3^2}{2^3\cdot\textcolor{red}{\mathbf{2}}\cdot2^{m-1}}\frac{3^3+3^4v_1}{2^4\cdot\textcolor{red}{\mathbf{2}}\cdot2^{m-1}}}
\]

\par\medskip\noindent
\textbf{The second case} deals with Engel expansions where we perform that additional $m$ divisions by two as early as possible. The resulting value $v_{n+1}$ decreases, when we make a division by two later:
\[
\cfrac{1+\cfrac{3+\cfrac{3^2+\cfrac{3^3+3^4v_1}{2\cdot2^{m-1}}}{2\cdot\textcolor{red}{\mathbf{2}}}}{2}}{2}
<
\cfrac{1+\cfrac{3+\cfrac{3^2+\cfrac{3^3+3^4v_1}{2\cdot2^m}}{2}}{2}}{2}
\]

\par\bigskip
Also here almost all summands of both Engel expansions, they cancel each other out:

\[
\cancel{\frac{1}{2}+\frac{3}{2^2}}+\frac{3^2}{2^3\cdot\textcolor{red}{\mathbf{2}}}+\cancel{\frac{3^3+3^4v_1}{2^4\cdot\textcolor{red}{\mathbf{2}}\cdot2^{m-1}}}
<
\cancel{\frac{1}{2}+\frac{3}{2^2}}+\frac{3^2}{2^3}+\cancel{\frac{3^3+3^4v_1}{2^4\cdot2^m}}
\]

\par\bigskip
While the first case minimizes the value of $v_{n+1}$, the second case maximizes it. The difference between the maximum and the minimum is given by the following equation:

\[
\frac{3^{n-1}\left(\frac{3v_1+1}{2\cdot2^m}+1\right)-2^{n-1}}{2^{n-1}}-\frac{3^n\left(v_1+1\right)-2^n}{2^{n+m}}=\left(\frac{3^{n-1}}{2^{n-1}}-1\right)\left(1-\frac{1}{2^m}\right)
\]
%\begin{flalign*}
%&\frac{3^{n-1}\left(\frac{3v_1+1}{2\cdot2^m}+1\right)-2^{n-1}}{2^{n-1}}-\frac{3^n\left(v_1+1\right)-2^n}{2^{n+m}}\\
%=&\frac{3^{n-1}\cdot\left(3v_1+1+2^{m+1}\right)-2^{n-1}\cdot2^{m+1}-3^n\left(v_1+1\right)+2^n}{2^{m+1}\cdot2^{n-1}}\\
%=&\frac{3^{n-1}+3^{n-1}\cdot2^{m+1}-2^{n+m}-3^n+2^n}{2^{n+m}}=\frac{3^{n-1}-3\cdot3^{n-1}+3^{n-1}\cdot2^{m+1}-2^{n+m}+2^n}{2^{n+m}}\\
%=&\frac{-2\cdot3^{n-1}+3^{n-1}\cdot2^{m+1}-2^{n+m}+2^n}{2^{n+m}}=\frac{\left(2\cdot3^{n-1}-2^n\right)\left(2^m-1\right)}{2^n\cdot2^m}\\
%=&\left(\frac{3^{n-1}}{2^{n-1}}-1\right)\left(1-\frac{1}{2^m}\right)
%\end{flalign*}

\par\bigskip
This has the consequence that for a given sequence consisting of $n+1$ members, between which a total of $n+m$ divisions have taken place, the permutations of these divisions have a limited effect on the last sequence member $v_{n+1}$ as described by theorem~\ref{theo:permutation}.

\vspace{1em}
\subsection{Condition for a limited growth of the Engel expansion}
\label{appx:condition_limited_growth}
Let us look now into the question of what condition must be met to prevent a greater growth than a decline in Collatz sequences. Specifically we consider an Engel expansion comprising $n+1$ sequence members that include $m$ additional divisions by two at the beginning. The last member $v_{n+1}$ in such a sequence can be calulated by formula~\ref{eq:engel_k3_m}. In order to restrict the growth of this sequence, we require that the last member has to be smaller than the first one. For this we define the condition $v_{n+1}<v_1$:

\[
\frac{3^nv_1+3^{n-1}+3^{n-1}2^{m+1}}{2^{m+n}}-1<v_1
\]

\par\medskip\noindent
Reshaping this inequality leads to the following condition:

\begin{equation}
\label{eq:condition_limited_growth}
\frac{3^{n-1}\left(2^{m+1}-2\right)}{2^{m+n}-3^n}-1<v_1
\end{equation}

\vspace{1em}
\subsection{Visualizing the product as a function of \boldmath{$v_1,n$}}
\label{appx:permuting_divisions}

When we display the product for $k=3$ as a discrete function of $v_1,n$ then it becomes visually clear that the maximum is $\nicefrac{4}{3}$ at $v_1=1,n=1$. Figure~\ref{fig:1} provides a chart illustrating the product values for Engel expansions depending on the variables $v_1$ and $n$.

\par\medskip
In Figure~\ref{fig:2} we see the product values for actual Collatz sequences as a function of both variables $v_1$ and $n$. There we observe that product values of several Collatz sequences are larger than ones of the corresponding Engel expansions displayed by figure~\ref{fig:1}.

\newpage
\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.68\textwidth]{prod_engel.png}
		\caption{Engel expansion's product value ($k=3$) as a function of $v_1,n$}
		\label{fig:1}
	\end{center}
\end{figure}

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=0.68\textwidth]{prod.png}
		\caption{Product value ($k=3$) as a function of $v_1,n$}
		\label{fig:2}
	\end{center}
\end{figure}

%\newpage
\vspace{1em}
\bibliographystyle{unsrt}
\bibliography{references}

\end{document}


\section{Classical Algebraic Geometry}

\begin{frame}{Foray Into Algebraic Geometry}
    \begin{block}{Projective Space}
    Playing field is $n$\emph{-dimensional projective space}, $\PP^{n}$:
        $$ \PP^{n} := \{ (z_{0}, \ldots, z_{n}) \in \CC^{n} \} / (\vb{x} \sim \lambda \cdot \vb{y}), \quad \lambda \neq 0, $$
    that is, its elements consists of \emph{lines through the origin} in $\CC^{n}$.
    \end{block}

    \begin{center}
        \includegraphics[height=0.35\textwidth, angle=0]{resources/projective-space}
    \end{center}

\end{frame}

\begin{frame}{Varieties}

    \emph{Varieties} are the objects studied in algebraic geometry, determined by the \emph{vanishing set}\footnote{from `\emph{Verschwindungsmenge}'} $V(-)$, for a system of polynomials.

\begin{figure}
        \centering
        \begin{subfigure}[b]{0.475\textwidth}
            \centering
            \includegraphics[width=0.35\textwidth]{resources/two-hyperboloid}
            \caption[]%
            {{\small $V(x^{2} + y^{2} - z^{2} + 1)$}}
        \end{subfigure}
        \hfill
        \begin{subfigure}[b]{0.475\textwidth}
            \centering
            \includegraphics[width=0.35\textwidth]{resources/one-hyperboloid}
            \caption[]%
            {{\small $V(x^{2} + y^{2} - z^{2} - 1)$}}
        \end{subfigure}
        \hfill
        \begin{subfigure}[b]{0.475\textwidth}
            \centering
            \includegraphics[width=0.35\textwidth]{resources/sphere}
            \caption[]%
            {{\small $V(x^{2} + y^{2} + z^{2} - 1)$}}
        \end{subfigure}
        \hfill
        \begin{subfigure}[b]{0.475\textwidth}
            \centering
            \includegraphics[width=0.35\textwidth]{resources/cone}
            \caption[]%
            {{\small $V(x^{2} + y^{2} - z^{2})$}}
        \end{subfigure}
    \end{figure}

\end{frame}

\begin{frame}{Segre Varieties}
        \emph{Segre varieties} come from $\sigma: \PP^{n} \times \PP^{m} \ra \PP^{(n+1)(m+1) - 1}$, that sends $([X],[Y])$ to the pairwise products of their components:
            $$ \sigma : ([X_{1}, \ldots, X_{n+1}], [Y_{1}, \ldots, Y_{m+1}]) \mapsto [\ldots, X_{i}Y_{j}, \ldots ]. $$

        \begin{block}{Example (Segre quadric surface)}
        \vspace{-24pt}
        $$\sigma : \PP^{1} \times \PP^{1} \ra \PP^{3},\ ([X_{1}, X_{2}], [Y_{1}, Y_{2}]) \mapsto [ X_{1}Y_{1}, X_{1}Y_{2}, X_{2}Y_{1}, X_{2}Y_{2} ]. $$

        Set $[ X_{1}Y_{1}, X_{1}Y_{2}, X_{2}Y_{1}, X_{2}Y_{2} ] =: [p_{11}, p_{12}, p_{21}, p_{22}]$, then:
        $$ \rightsquigarrow \det \begin{pmatrix} p_{11} & p_{12} \\ p_{21} & p_{22} \end{pmatrix} = 0 \iff \rank \begin{pmatrix} p_{11} & p_{12} \\ p_{21} & p_{22} \end{pmatrix} \leq 1. $$
        \end{block}
\end{frame}

\begin{frame}
    \begin{block}{Rulings}
    The Segre quadric surface has two families of lines in it, called \emph{rulings}. These are the images of $\sigma(\PP^{1} \times \{ \text{pt} \} )$ and $\sigma( \{ \text{pt} \} \times \PP^{1})$ in $\PP^{3}$.
    \end{block}

    \begin{figure}[!htb]
    \centering
    \begin{minipage}{0.3\textwidth}
        \centering
        \includegraphics[height=0.5\textheight]{resources/shukhov-1.jpg}
        \caption{\emph{Shukhov Tower}, Nizhny Novgorod}
    \end{minipage}%
    \begin{minipage}{0.3\textwidth}
        \centering
        \includegraphics[height=0.5\textheight]{resources/shukhov-2.jpg}
        \caption{\emph{Shukhov Tower}, Moscow}
    \end{minipage}%
    \begin{minipage}{.3\textwidth}
        \centering
        \includegraphics[height=0.5\textheight]{resources/tractricious.jpg}
        \caption{\emph{Tractricious}, Fermilab}
    \end{minipage}
    \end{figure}

\end{frame}

\begin{frame}{Manifold of Independence}

    \begin{itemize}
        \item Let $\Delta_{3} \subset \RR^{4}$, with vertices $A_{i} = e_{i}$, and let $p = (p_{ij}) \in \Delta_{3}$ be
        \vspace{-6pt}
        \begin{center}
        \begin{table}[]
        $p_{ij} = (p_{11}, p_{12}, p_{21}, p_{22}) =$
        \begin{tabular}{|l|l|}
        \hline
        $p_{11}$ & $p_{12}$ \\ \hline
        $p_{21}$ & $p_{22}$ \\ \hline
        \end{tabular}
        \end{table}
        \end{center}

    \item Has been shown that the two rulings are given by \cite{SFJG1970}:

    \begin{center}
    \begin{table}[]
    $p_{ij}(s,t) =$
    \begin{tabular}{|c|c|}
    \hline
    $st$ & $s(1-t)$ \\ \hline
    $t(1-s)$ & $(1-s)(1-t)$ \\ \hline
    \end{tabular}
    $\quad (0 \leq s,t \leq 1).$
    \end{table}
    \end{center}

    \end{itemize}

    \begin{figure}[!htb]
    \centering
    \begin{minipage}{.5\textwidth}
        \centering
        \includegraphics[height=0.35\textheight]{resources/tetrahedron.pdf}
    \end{minipage}%
    \begin{minipage}{0.5\textwidth}
        \centering
        \includegraphics[height=0.40\textheight]{resources/independence-surface.pdf}
    \end{minipage}
    \end{figure}

\end{frame}