\documentclass[fleqn]{article}
\usepackage[a4paper, left=25.4mm, top=25.4mm, right=25.4mm, bottom=25.4mm]{geometry}
\usepackage[shortlabels]{enumitem}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{authoraftertitle}
\usepackage{blindtext}
\usepackage{bm}
\usepackage{color}
\usepackage{graphicx}
\usepackage{newpxtext}
%\usepackage{newpxmath}
\usepackage{textcomp}
\newcommand\tab[1][1cm]{\hspace*{#1}}

\author{Victor Zhao\\xz398@cam.ac.uk}

\begin{document}
\centering
\section*{NST Part IA Mathematics}
\MyAuthor

\begin{enumerate}
    \item Parallel and perpendicular components of a vector:\\
        $\mathbf{a}_\parallel=(\mathbf{a}\cdot\hat{\mathbf{n}})\hat{\mathbf{n}}$\\
        $\mathbf{a}_\perp=\mathbf{a}-(\mathbf{a}\cdot\hat{\mathbf{n}})\hat{\mathbf{n}}$
    \item Vector triple product:\\
        $[\mathbf{a},\mathbf{b},\mathbf{c}]=\mathbf{a}\cdot(\mathbf{b}\times\mathbf{c})$\\
        $[\mathbf{a},\mathbf{b},\mathbf{c}]=[\mathbf{b},\mathbf{c},\mathbf{a}]=[\mathbf{c},\mathbf{a},\mathbf{b}]$\\
        $[\mathbf{a},\mathbf{b},\mathbf{c}]=-[\mathbf{a},\mathbf{c},\mathbf{b}]$
    \item $\mathbf{a}\times(\mathbf{b}\times\mathbf{c})=(\mathbf{a}\cdot\mathbf{c})\mathbf{b}-(\mathbf{a}\cdot\mathbf{b})\mathbf{c}$
    \item Plane equation:\\
        $\mathbf{r}\cdot\hat{\mathbf{n}}=\mathbf{a}\cdot\hat{\mathbf{n}}=d$\\
        $|$$d$$|$ is perpendicular distance of plane from origin for unit normal $\hat{\mathbf{n}}$
    \item Polar coordinates:\\
        $\hat{\mathbf{r}}=\cos\phi\mathbf{i}+\sin\phi\mathbf{j}$\\
        $\hat{\bm{\phi}}=-\sin\phi\mathbf{i}+\cos\phi\mathbf{j}$\\
        $dS=rdrd\phi$
    \item Cylindrical coordinates:\\
        $x=r\cos\phi$\\
        $y=r\sin\phi$\\
        $z=z$\\
        $dV=rdrd\phi dz$
    \item Spherical coordinates:\\
        $x=r\sin\theta\cos\phi$\\
        $y=r\sin\theta\sin\phi$\\
        $z=r\cos\theta$\smallbreak
        $\hat{\mathbf{r}}=\sin\theta\cos\phi\mathbf{i}+\sin\theta\sin\phi\mathbf{j}+\cos\theta\mathbf{k}$\\
        $\hat{\bm{\theta}}=\cos\theta\cos\phi\mathbf{i}+\cos\theta\sin\phi\mathbf{j}-\sin\theta\mathbf{k}$\\
        $\hat{\bm{\phi}}=-\sin\phi\mathbf{i}+\cos\phi\mathbf{j}$\smallbreak
        $dV=r^2\sin\theta dr d\theta d\phi$\\
        $dS=r^2\sin\theta d\theta d\phi$
    \item Leibnitz's formula:\smallbreak
        $\dfrac{d^n(fg)}{dx^n}=\displaystyle\sum_{i=0}^{n}\binom{n}{i}f^{(n-i)}g^{(i)}$
    \item Limits: \smallbreak
        $\displaystyle\lim_{x\to a}f(x)=K$ means that
        $\forall\epsilon>0.\exists\delta>0.\;(0<$ $|$$x-a$$|$ $<\delta)\implies($ $|$$f(x)-K$$|$ $<\epsilon)$\smallbreak
        $\displaystyle\lim_{x\to a+}f(x)=K$ means that
        $\forall\epsilon>0.\exists\delta>0.\;(0<x-a<\delta)\implies($ $|$$f(x)-K$$|$ $<\epsilon)$\smallbreak
        $\displaystyle\lim_{x\to a-}f(x)=K$ means that
        $\forall\epsilon>0.\exists\delta>0.\;(0<a-x<\delta)\implies($ $|$$f(x)-K$$|$ $<\epsilon)$\smallbreak
        $\displaystyle\lim_{x\to\infty}f(x)=K$ means that
        $\forall\epsilon>0.\exists X>0.\;(x>X)\implies($ $|$$f(x)-K$$|$ $<\epsilon)$
    \item Continuity: $f(x)$ is continuous at $a$ if:
        \begin{itemize}
            \item $f(a)$ exists;
            \item $\displaystyle\lim_{x\to a}f(x)$ exists and equals $f(a)$.
        \end{itemize}
    \newpage
    \item Taylor's series:\smallbreak
        $e^x=1+x+\dfrac{x^2}{2!}+\cdots+\dfrac{x^n}{n!}+\cdots$\smallbreak
        $\ln(1+x)=x-\dfrac{x^2}{2}+\dfrac{x^3}{3}-\cdots+(-1)^{n+1}\dfrac{x^n}{n}+\cdots$\smallbreak
        $\sin x=x-\dfrac{x^3}{3!}+\dfrac{x^5}{5!}-\cdots+(-1)^n\dfrac{x^{2n+1}}{(2n+1)!}+\cdots$\smallbreak
        $\cos x=1-\dfrac{x^2}{2!}+\dfrac{x^4}{4!}-\cdots+(-1)^n\dfrac{x^{2n}}{(2n)!}+\cdots$\smallbreak
        $\tan^{-1}x=x-\dfrac{x^3}{3}+\dfrac{x^5}{5}-\cdots+(-1)^n\dfrac{x^{2n+1}}{2n+1}+\cdots$\smallbreak
        $\sinh x=x+\dfrac{x^3}{3!}+\dfrac{x^5}{5!}+\cdots+\dfrac{x^{2n+1}}{(2n+1)!}+\cdots$\smallbreak
        $\cosh x=1+\dfrac{x^2}{2!}+\dfrac{x^4}{4!}+\cdots+\dfrac{x^{2n}}{(2n)!}+\cdots$\smallbreak
        $\tanh^{-1}x=x+\dfrac{x^3}{3}+\dfrac{x^5}{5}+\cdots+\dfrac{x^{2n+1}}{2n+1}+\cdots$
    \item Hyperbolic functions:\smallbreak
        $\cosh^2 x-\sinh^2 x=1$\smallbreak
        $\cosh2x=\cosh^2 x+\sinh^2 x$\smallbreak
        $\cosh^{-1}x=\ln(x+\sqrt{x^2-1})$\smallbreak
        $\sinh^{-1}x=\ln(x+\sqrt{x^2+1})$\smallbreak
        $\tanh^{-1}x=\dfrac{1}{2}\ln\left(\dfrac{1+x}{1-x}\right)$
    \item Differentiation of integrals wrt parameters:\smallbreak
        $\dfrac{d}{dt}\displaystyle\int_{a(t)}^{b(t)}f(x,t)dx=\displaystyle\int_{a(t)}^{b(t)}\dfrac{\partial f}{\partial t}dx+\dfrac{db}{dt}f(b,t)-\dfrac{da}{dt}f(a,t)$
    \item Schwarz's inequality:\smallbreak
        $\left(\displaystyle\int_a^b f(x)g(x)dx\right)^2\leq\left(\displaystyle\int_a^b f^2(x)dx\right)\left(\displaystyle\int_a^b g^2(x)dx\right)$
    \item Gaussian integral:\smallbreak
        $\displaystyle\int_{-\infty}^{+\infty}e^{-x^2}dx=\sqrt{\pi}$
    \item Bayes' theorem:\\
        $P(A|B)=\dfrac{P(B|A)P(A)}{P(B)}$
    \item Poisson distribution:\\
        $P(X=r)=e^{-\lambda}\dfrac{\lambda^r}{r!}$\\
        mean = variance = $\lambda$
    \item Lifetime distribution:\\
        $f(t)=\lambda e^{-\lambda t}$\\
        mean = $\frac{1}{\lambda}$, variance = $\frac{1}{\lambda^2}$\\
    \item Gaussian (normal) distribution:\\
        $f(x)=\dfrac{1}{\sqrt{2\pi\sigma^2}}e^{-\frac{(x-\mu)^2}{2\sigma^2}}$\\
        mean = $\mu$, variance = $\sigma^2$
    \item Linear 1st-order ODE:\smallbreak
        $\dfrac{dy}{dx}+p(x)y=f(x)$:\smallbreak
        $y=\dfrac{1}{\mu(x)}\displaystyle\int\mu(x)f(x)dx$, where $\mu(x)=e^{\int p(x)dx}$
    \item Linear 2nd-order ODE (constant coefficients):\smallbreak
        $\dfrac{d^2y}{dx^2}+a\dfrac{dy}{dx}+by=f(x)$:\smallbreak
        Complementary function: consider the auxiliary equation $\lambda^2+a\lambda+b=0$:
        \begin{itemize}[noitemsep, topsep=0pt]
            \item Case of real, distinct roots $\lambda_1$, $\lambda_2$: $y_c=Ae^{\lambda_1x}+Be^{\lambda_2x}$
            \item Case of equal roots $\alpha$: $y_c=(A+Bx)e^{\alpha x}$
            \item Case of complex roots $\alpha\pm\beta i$: $y_c=e^{\alpha x}(A\sin\beta x+B\cos\beta x)$
        \end{itemize}
        Particular integral:
        \begin{itemize}[noitemsep, topsep=0pt]
            \item Case $f(x)$ is polynomial: try polynomial with same degree (or higher if needed)
            \item Case $f(x)=Ce^{kx}$: try $y_p=De^{kx}$ (or $Dxe^{kx}$, or $Dx^2e^{kx}$)
            \item Case $f(x)=C_1\sin{kx}+C_2\cos{kx}$: try $y_p=D_1\sin{kx}+D_2\cos{kx}$ (or $D_1x\sin{kx}+D_2x\cos{kx}$)
        \end{itemize}
    \item Partial differentiation:
        \begin{itemize}[topsep=0pt]
            \item Differential relations:\smallbreak
                $df=\left(\dfrac{\partial f}{\partial x}\right)_ydx+\left(\dfrac{\partial f}{\partial y}\right)_xdy$
            \item Chain rule:\smallbreak
                $\left(\dfrac{\partial f}{\partial u}\right)_v=\left(\dfrac{\partial f}{\partial x}\right)_y\left(\dfrac{\partial x}{\partial u}\right)_v+\left(\dfrac{\partial f}{\partial y}\right)_x\left(\dfrac{\partial y}{\partial u}\right)_v$\smallbreak
                $\left(\dfrac{\partial f}{\partial v}\right)_u=\left(\dfrac{\partial f}{\partial x}\right)_y\left(\dfrac{\partial x}{\partial v}\right)_u+\left(\dfrac{\partial f}{\partial y}\right)_x\left(\dfrac{\partial y}{\partial v}\right)_u$
            \item Reciprocity:\smallbreak
                $\left(\dfrac{\partial x}{\partial y}\right)_z\left(\dfrac{\partial y}{\partial x}\right)_z=1$
            \item Cyclic relations:\smallbreak
                $\left(\dfrac{\partial x}{\partial z}\right)_y\left(\dfrac{\partial y}{\partial x}\right)_z\left(\dfrac{\partial z}{\partial y}\right)_x=-1$
            \item Exact differential:\\
                $P(x,y)dx+Q(x,y)dy$ is an exact differential iff $\dfrac{\partial P}{\partial y}=\dfrac{\partial Q}{\partial x}$.
            \item Taylor series:\smallbreak
                $\begin{aligned}
                    f(x,y) &= f(x_0,y_0)\\
                           &+ f_x(x_0,y_0)(x-x_0)+f_y(x_0,y_0)(y-y_0)\\
                           &+ \dfrac{1}{2!}\big(f_{xx}(x_0,y_0)(x-x_0)^2+2f_{xy}(x_0,y_0)(x-x_0)(y-y_0)+f_{yy}(x_0,y_0)(y-y_0)^2\big)+\cdots
                \end{aligned}$
        \end{itemize}
    \item Stationary points of multi-variable functions: $f$ has a stationary point if $f_x=f_y=0$
        \begin{itemize}[noitemsep, topsep=0pt]
            \item Local minimum: $f_{xx}f_{yy}>f_{xy}^2$ with $f_{xx}>0$ and $f_{yy}>0$
            \item Local maximum: $f_{xx}f_{yy}>f_{xy}^2$ with $f_{xx}<0$ and $f_{yy}<0$
            \item Saddle point: $f_{xx}f_{yy}<f_{xy}^2$
        \end{itemize}
    \item Lagrange multipliers and Lagrangian function:\\
        To find the stationary points of $f(x,y)$ subject to the constraint $g(x,y)=0$:\\
        define the Lagrangian function
            \[L(x,y,\lambda)=f(x,y)-\lambda g(x,y)\]
        and solve $L_x=L_y=L_\lambda=0$.
    \item Gradient of a scalar field:\\
        $\bm{\nabla}\Phi=(\Phi_x,\Phi_y,\Phi_z)$\\
        $d\Phi=(\bm{\nabla}\Phi)\cdot d\mathbf{x}$
    \item Divergence of a vector field:\smallbreak
        div $\mathbf{F}=\bm{\nabla}\cdot\mathbf{F}=\left(\dfrac{\partial}{\partial x},\dfrac{\partial}{\partial y},\dfrac{\partial}{\partial z}\right)\cdot(F_x,F_y,F_z)=\dfrac{\partial F_x}{\partial x}+\dfrac{\partial F_y}{\partial y}+\dfrac{\partial F_z}{\partial z}$\smallbreak
        $\bm{\nabla}\cdot(\bm{\nabla}\Phi)=\nabla^2\Phi=\dfrac{\partial^2\Phi}{\partial x^2}+\dfrac{\partial^2\Phi}{\partial y^2}+\dfrac{\partial^2\Phi}{\partial z^2}$
    \item Curl of a vector field:\smallbreak
        curl $\mathbf{F}=\bm{\nabla}\times\mathbf{F}=\left(\dfrac{\partial}{\partial x},\dfrac{\partial}{\partial y},\dfrac{\partial}{\partial z}\right)\times(F_x,F_y,F_z)=\left(\dfrac{\partial F_z}{\partial y}-\dfrac{\partial F_y}{\partial z},\dfrac{\partial F_x}{\partial z}-\dfrac{\partial F_z}{\partial x},\dfrac{\partial F_y}{\partial x}-\dfrac{\partial F_x}{\partial y}\right)$\\
        $\bm{\nabla}\times(\bm{\nabla}\Phi)=\mathbf{0}$
    \item Normal to a surface:\smallbreak
        $\mathbf{n}=\dfrac{\bm{\nabla}\Phi}{|\bm{\nabla}\Phi|}$
    \item Line integral of a scalar field:\smallbreak
        $\displaystyle\int_\Gamma\Phi ds=\displaystyle\int_{s_1}^{s_2}\Phi(\mathbf{x}(s))ds=\displaystyle\int_{t_1}^{t_2}\Phi(\mathbf{x}(t))\left|\dfrac{d\mathbf{x}}{dt}\right|dt$
    \item Line integral of a vector field:\smallbreak
        $\displaystyle\int_\Gamma\mathbf{F}(\mathbf{x})\cdot d\mathbf{x}=\displaystyle\int_{t_1}^{t_2}\mathbf{F}(\mathbf{x}(t))\cdot\dfrac{d\mathbf{x}}{dt}dt$
    \item Conservative vector fields: $\mathbf{F}=\bm{\nabla}\Phi$\smallbreak
        $\displaystyle\int_\Gamma\mathbf{F}\cdot d\mathbf{x}=\displaystyle\int_\Gamma(\bm{\nabla}\Phi)\cdot d\mathbf{x}=\Phi(\mathbf{x}_1)-\Phi(\mathbf{x}_2)$\smallbreak
        $\displaystyle\oint_\Gamma\mathbf{F}\cdot d\mathbf{x}=\displaystyle\oint_\Gamma(\bm{\nabla}\Phi)\cdot d\mathbf{x}=0$
    \item Surface integral (flux):\smallbreak
        $\displaystyle\int_S\mathbf{F}\cdot d\mathbf{S}=\displaystyle\int_S\mathbf{F}\cdot\mathbf{n}dS$
    \item Gauss's theorem (divergence theorem):\smallbreak
        $\displaystyle\int_V(\bm{\nabla}\cdot\mathbf{F})dV=\displaystyle\int_S\mathbf{F}\cdot d\mathbf{S}$, where $S$ is the bounding surface of $V$
    \item Stoke's theorem (curl theorem):\smallbreak
        $\displaystyle\int_S(\bm{\nabla}\times\mathbf{F})\cdot d\mathbf{S}=\displaystyle\int_C\mathbf{F}\cdot d\mathbf{x}$, where $C$ is the boundary of $S$ (also called $\partial S$)
    \newpage
    \item Decomposing matrix $\mathbf{M}$ as sum of a symmetric matrix $\mathbf{S}$ and an anti-symmetric matrix $\mathbf{A}$: \\
        $\mathbf{S}=\frac{1}{2}(\mathbf{M}+\mathbf{M}^\top)$, $\mathbf{A}=\frac{1}{2}(\mathbf{M}-\mathbf{M}^\top)$\\
        For an anti-symmetric matrix $\mathbf{A}$, $\mathbf{x}^\top\mathbf{Ax}=0$ for any column vector $\mathbf{x}$.
    \item Hermitian conjugation:\\
        If $\mathbf{A}=(a_{ij})$, then the Hermitian conjugate is $\mathbf{A}^\dagger=(\mathbf{A}^\top)^*=(\mathbf{A}^*)^\top=(a^*_{ji})$\\
        Hermitian matrix: $\mathbf{A}^\dagger=\mathbf{A}$
    \item Trace:
        For an $n\times n$ matrix $\mathbf{A}$, trace($\mathbf{A}$)=$\displaystyle\sum_{i=1}^n a_{ii}$\\
        The trace of the product of a symmetric and an antisymmetric matrix is 0.\\
        trace($\mathbf{AB}$)=trace($\mathbf{BA}$).\\
        The results can be generalised and holds for any cyclic permutation of the order of multiplication.
    \item Minors and cofactors:\\
        For an $n\times n$ matrix $\mathbf{A}=(a_{ij})$, let $\mathbf{M}_{ij}$ be an $(n-1)\times(n-1)$ sumathbfatrix:
        \begin{itemize}[noitemsep, topsep=0pt]
            \item Minor of the element $a_{ij}$ of $\mathbf{A}$: $|\mathbf{M}_{ij}|$
            \item Cofactor of $a_{ij}$: $A_{ij}=(-1)^{i+j}|\mathbf{M}_{ij}|$
                \[\begin{pmatrix}
                    + & - & + & \dots \\
                    - & + & - & \dots \\
                    + & - & + & \dots \\
                    \vdots & \vdots & \vdots & \ddots
                \end{pmatrix}\]
            \item Classical adjoint: (adj$\mathbf{A}$)$_{ij}=A_{ji}$
                \[\begin{pmatrix}
                    A_{11} & A_{21} & \dots  & A_{j1} & \dots  & A_{n1}\\
                    A_{12} & A_{22} & \dots  & A_{j2} & \dots  & A_{n2}\\
                    \vdots & \vdots & \ddots & \vdots & \ddots & \vdots\\
                    A_{1i} & A_{2i} & \dots  & A_{ji} & \dots  & A_{ni}\\
                    \vdots & \vdots & \ddots & \vdots & \ddots & \vdots\\
                    A_{1n} & A_{2n} & \dots  & A_{jn} & \dots  & A_{nn}\\
                \end{pmatrix}\]
        \end{itemize}
    \item Determinants:\smallbreak
        $|\mathbf{A}|=\displaystyle\sum_{j=1}^n a_{ij}A_{ij}$ for any fixed $i$; or\\
        $|\mathbf{A}|=\displaystyle\sum_{i=1}^n a_{ij}A_{ij}$ for any fixed $j$; or\smallbreak
        product of the elements on the diagonal if the matrix is triangular.
        \begin{itemize}[topsep=0pt]
            \item $\mathbf{A}(\text{adj}\mathbf{A})=(\text{det}\mathbf{A})\mathbf{I}$
            \item Interchanging any two rows or columns of $\mathbf{A}$ changes the sign of $\text{det}\mathbf{A}$
            \item $\text{det}\mathbf{A}=0$ if any two rows or columns are the same
            \item Multiplying all the elements of any one row or column of $\mathbf{A}$ by $\lambda$ multiplies $\text{det}\mathbf{A}$ by $\lambda$
            \item Adding a multiple of row (column) on another row (column) leaves $\text{det}\mathbf{A}$ unchanged
            \item $\text{det}\mathbf{AB}=(\text{det}\mathbf{A})(\text{det}\mathbf{B})$
            \item $\text{det}\mathbf{A}=\text{det}\mathbf{A}^\top$
        \end{itemize}
    \item Eigenvalues:
        \begin{itemize}[topsep=0pt]
            \item $\text{det}\mathbf{A}=\displaystyle\prod_{i=1}^n \lambda_i$
            \item trace$(\mathbf{A})=\displaystyle\sum_{i=1}^n \lambda_i$
        \end{itemize}
    \item Diagonalisation of real symmetric matrices: if $\mathbf{A}$ is real symmetric, then:
        \begin{itemize}[topsep=0pt]
            \item $\mathbf{A}$ has $n$ distinct eigenvalues $\lambda_1$, $\lambda_2$, ..., $\lambda_n$;
            \item $\mathbf{A}$ has $n$ linearly independent eigenvectors $\mathbf{e}_1$, $\mathbf{e}_2$, ..., $\mathbf{e}_n$ that form an orthonormal basis;
            \item $\mathbf{A}$ can be diagonalised by setting $\mathbf{X}=\begin{pmatrix}
                    \mathbf{e}_1 & \mathbf{e}_2 & \dots & \mathbf{e}_n
                \end{pmatrix}$, then \smallbreak
                $\mathbf{A}'=\mathbf{X}^\top\mathbf{AX}=
                \begin{pmatrix}
                    \lambda_1 & 0 & \dots & 0\\
                    0 & \lambda_2 & \dots & 0\\
                    \vdots & \vdots & \ddots & \vdots\\
                    0 & 0 & \dots & \lambda_n
                \end{pmatrix}$
        \end{itemize}
\end{enumerate}
\end{document}


\chapter{Lattice Systems}

\section{Free Fermion Systems}
In this section, we consider the system whose Hamiltonian composed of quadratic fermionic operators, i.e.,
\begin{equation}
	\hat H_{\mathrm{free}} = \sum_{i,j=1}^N A_{ij} c_i^\dagger c_j + \frac{1}{2}\sum_{i,j=1}^N B_{ij} c_i c_j + \frac{1}{2}\sum_{i,j=1}^N B_{ij}^* c_j^\dagger c_i^\dagger, \label{eq:lattice-free-fermion-hamiltonian}
\end{equation}
where $t_{ij}$ is a Hermitian matrix, and $\Delta_{ij}$ is anti-symmetric.
In the Nambu basis
\begin{equation}
	\Psi = (c_1,\dots,c_N,c_1^\dagger,\dots,c_N^\dagger)^T,
\end{equation}
the Hamiltonian has the form\footnote{Without loss of generality, in the following we always assume that the sum of chemical potential is zero, i.e., $\mathrm{Tr} A=0$.}
\begin{equation}
	\hat H_{\mathrm{free}} = \frac{1}{2} \sum_{i,j=1}^{2N} \Psi^\dagger_i H_{ij}^{\Psi} \Psi_j + \frac{1}{2}\mathrm{Tr}A,
\end{equation}
where the single-body matrix $H^{\Psi}$ is a $2N\times 2N$ Hermitian matrix
\begin{equation}
	H^{\Psi} = \left[\begin{array}{cc}
		A & B \\
		-B^* & -A^*
	\end{array}\right].
\end{equation}

\subsection{Majorana Representation}

The Majorana operators are defined as:
\begin{equation}
	\left[\begin{array}{c} \omega_{i} \\ \omega_{i+N} \end{array}\right]
	= \left[\begin{array}{cc}
		1 & 1 \\
		i & -i
	\end{array}\right] \left[\begin{array}{c}
		c_i \\ c_i^\dagger
	\end{array}\right], \quad
	\left[\begin{array}{c} c_i \\ c_i^\dagger \end{array}\right]
	= \frac{1}{2} \left[\begin{array}{cc}
		1 & -i \\
		1 & i
	\end{array}\right] \left[\begin{array}{c}
		\omega_{i} \\ \omega_{i+N}
	\end{array}\right].
\end{equation}
The fermionic bilinear in the Majorana basis has the form
\begin{equation}
	\hat H = -\frac{i}{4} \sum_{i,j=1}^{2N} H_{ij} \omega_i \omega_j
\end{equation}
where the single-body matrix $H$ is a $2N \times 2N$ real anti-symmetric matrix:
\begin{equation}
	H = \left[\begin{array}{cc}
		-A^I - B^I & A^R - B^R \\
    	-A^R - B^R &  -A^I + B^I
	\end{array}\right].
\end{equation}
where we have define $A^{R/I} = \mathrm{Re} A / \mathrm{Im} A$ and $B^{R/I} = \mathrm{Re} B / \mathrm{Im} B$.
Conversely, if we have a Majorana bilinear
\begin{equation}
	\frac{i}{2} \sum_{i,j=1}^{2N} M_{ij}\omega_i \omega_j, \quad
	M = \left[\begin{array}{cc}
		M^{11} & M^{12} \\ M^{21} & M^{22}
	\end{array} \right],
\end{equation}
it can be transformed back to ordinary fermionic bilinear (\ref{eq:lattice-free-fermion-hamiltonian}) where
\begin{equation}
\begin{aligned}
	A &= M^{21} - M^{12} + i M^{11} + i M^{22}, \\
	B &= M^{21} + M^{12} + i M^{11} - i M^{22}.
	\label{eq:lattice-majorana-bilinear-to-fermion}
\end{aligned}
\end{equation}
A real anti-symmetric matrix can be transformed to standard form by an orthogonal transformation $O$:
\begin{equation}
\begin{aligned}
	H &= O \cdot \Sigma(\bm \lambda) \cdot O^T, \\
	\Sigma(\bm \lambda) &= i\sigma_y \otimes \mathrm{diag}(\lambda_1,\cdots,\lambda_n).
\end{aligned}
\end{equation}
Make the basis transformation
\begin{equation}
	\gamma_n = \sum_{j=1}^{2N} O_{jn} \omega_j,
\end{equation}
the Hamiltonian becomes the standard form:
\begin{equation}
\begin{aligned}
	H &= -\frac{i}{4} \sum_{i=1}^N \lambda_i (\gamma_i \gamma_{i+N}-\gamma_{i+N} \gamma_i) \\
	&= -\frac{i}{2} \sum_{i=1}^N \lambda_i \gamma_i \gamma_{i+N}.
\end{aligned}
\end{equation}
Each $\gamma_i \gamma_{i+N}$ pair can then transforms to independent fermion mode:
\begin{equation}
\begin{aligned}
	-\frac{i}{2}\gamma_i \gamma_{i+N}
	&= -\frac{i}{2}(d_i + d_i^\dagger)(id_i-id_i^\dagger) \\
	&= d_i^\dagger d_i-\frac{1}{2}.
\end{aligned}
\end{equation}

\subsection{Gaussian States}
The Fermionic Gaussian states are those states with Gaussian form density operator:
\begin{equation}
	\hat \rho \propto \exp \left(\frac{i}{2}\sum_{i,j=1}^{2N}M_{ij}\omega_i \omega_j \right),
\end{equation}
where the matrix $M$ is real and anti-symmetric.\footnote{In particular, any thermal state has this form, with $M = \beta H/2$. The ground state of the free fermion system, though being pure state, can be regarded as the Gaussian state in the limit $M = \lim_{\beta \rightarrow \infty} \beta H$.}
If we expand the Gaussian form, the density operator becomes a Majorana polynomial:\footnote{Note that the coefficient $\Gamma$ in each order is not the direct expansion of the matrix $M$, since the direct expansion contains identical Majorana operators. That is, the $n$-th order expansion of the Majorana Gaussian form may contribute to the ($n-2m$)-th order term in the Majorana polynomial.}
\begin{equation}
	\hat{\rho} = \frac{\mathbb{I}}{2^N} + \sum_{n=1}^{N}\frac{i^n}{2^N}\sum_{1\le i_{1}<\cdots<i_{2n} \le 2N}\Gamma_{i_{1}\cdots i_{2n}} \omega_{i_1}\cdots\omega_{i_{2n}},
\end{equation}
where the coefficient $\Gamma_{i_1 \cdots i_{2n}}$ is the $2n$-point correlation function:
\begin{equation}
	\Gamma_{i_1 \cdots i_{2n}} = i^n \langle \omega_{i_1} \cdots \omega_{i_{2n}}\rangle, \quad i_m \ne i_n.
\end{equation}
In particular, the 2-point function
\begin{equation}
	\Gamma_{ij} = i\langle \omega_i \omega_j\rangle - i\delta_{ij} = \frac{i}{2}\langle [\omega_i, \omega_j]\rangle
\end{equation}
is also called the \textit{covariance matrix}.
For Gaussian state all $2n$-point correlation is determined by the covariance matrix by the Wick theorem.
\begin{framedrmk}[Two-point Correlation Function]
We are usually more familiar with the ordinary fermionic two-point correlation function $\langle c^\dagger_i c_j\rangle$ or $\langle c_i c_j\rangle$, which is related to the Majorana covariance matrix by:
\begin{equation}
\begin{aligned}
	\langle c_i^\dagger c_j\rangle &= \frac{1}{4}(
		\Gamma^{21}_{ij} - \Gamma^{12}_{ij} +
		i \Gamma^{11}_{ij} + i \Gamma^{22}_{ij})
		+\frac{1}{2}\mathbb \delta_{ij}, \\
	\langle c_i c_j\rangle &= \frac{1}{4}(
		\Gamma^{21}_{ij} + \Gamma^{12}_{ij} +
		i \Gamma^{11}_{ij} - i \Gamma^{22}_{ij}), \\
	\langle c_i^\dagger c_j^\dagger\rangle &= \frac{1}{4}(
		-\Gamma^{21}_{ij} - \Gamma^{12}_{ij} +
		i \Gamma^{11}_{ij} - i \Gamma^{22}_{ij}).
\end{aligned}
\end{equation}
\end{framedrmk}

The relation of the correlation in each order can be neatly captured by the Grassmannian Gaussian form:
\begin{equation}
\begin{aligned}
	\omega(\hat \rho, \theta)
	&= \frac{1}{2^N} \exp \left(\frac{i}{2} \sum_{i,j=1}^{2N}\Gamma_{ij}\theta_i \theta_j \right) \\
	&=\frac{1}{2^N} + \sum_{n=1}^{N}\frac{i^n}{2^N}\sum_{1\le i_{1}<\cdots<i_{2n} \le 2N}\Gamma_{i_{1}\cdots i_{2n}} \theta_{i_1} \cdots \theta_{i_{2n}}.
\end{aligned}
\end{equation}
When the covariance matrix is obtained, we can use the same routine to canonicalize the skew-symmetric matrix $\Gamma$:
\begin{equation*}
	\Gamma = O \cdot \Sigma(\bm \lambda) \cdot O^T, \quad
	\tilde\theta_n = \sum_i O_{in} \theta_i,
\end{equation*}
and the density matrix in the Grassmann representation is
\begin{equation}
	\omega(\hat \rho, \theta)
	= \prod_{n=1}^N \left(\frac{1}{2} e^{i \lambda_n \tilde\theta_n \tilde\theta_{n+N}} \right)
	= \prod_{n=1}^N \left(\frac{1+i\lambda_n \tilde\theta_n\tilde\theta_{n+N}}{2}  \right).
\end{equation}
This state correspond to a product state $\rho = \otimes_n \rho_n$ where
\begin{equation}
	\rho_n = \frac{1}{2} \left[\begin{array}{cc}
		1 + \lambda_n & 0 \\
		0 & 1 - \lambda_n
	\end{array} \right].
\end{equation}
The entanglement entropy is then
\begin{equation}
	S=\sum_n S_n = -\sum_n \left[
	\left(\frac{1+\lambda_n}{2}\right)\ln\left(\frac{1+\lambda_n}{2}\right)
	+ \left(\frac{1-\lambda_n}{2}\right)\ln\left(\frac{1-\lambda_n}{2}\right)\right].
\end{equation}

\subsection{Lindblad Master Equation}
For Lindblad equation
\begin{equation}
	\frac{d}{dt} \hat\rho = -i[\hat H, \hat \rho] + \sum_{\mu=1}^{m} \hat L_\mu \hat\rho \hat L_\mu^\dagger -\frac{1}{2} \sum_{\mu=1}^{m} \{\hat L_\mu^\dagger \hat L_\mu, \hat \rho\}
\end{equation}
When the \textit{jump operator} $\hat L_\mu$ contains only the linear Majorana operator, the Lindblad equation preserve Gaussianity.
For \textit{jump operator} contains up to quadratic Majorana terms, the evolution will break the Gaussian form, however, the $2n$-point correlation is still solvable for free fermion system.

\subsubsection*{Dynamics of Covariance Matrix}

We assume that the jump operator has up to quadratic Majorana terms.
In particular, we denote the linear terms and the Hermitian quadratic terms as
\begin{equation}
	\hat L_r = \sum_{j=1}^{2N} L^r_{j} \omega_j, \quad
	\hat L_s = \sum_{j,k=1}^{2N} M^s_{jk} \omega_j \omega_k.
\end{equation}
Now consider the dynamics of the expectation value $\langle\hat O\rangle$:
\begin{equation}
\begin{aligned}
	\frac{d}{dt}\langle \hat O\rangle
	&= -i \mathrm{Tr} [\hat O (\hat H \hat\rho-\hat\rho \hat H)]
		+ \sum_\mu \mathrm{Tr}[\hat O \hat L_\mu \hat\rho \hat L_\mu^\dagger]
		- \frac{1}{2}\sum_\mu \mathrm{Tr}[\hat O \hat L_\mu^\dagger \hat L_\mu \hat\rho
		+ \hat O \hat\rho \hat L_\mu^\dagger \hat L_\mu] \\
	&= \left\langle
		i[\hat H, \hat O] + \sum_\mu \hat L_\mu^\dagger \hat O\hat L_\mu - \frac{1}{2} \sum_\mu\{\hat L_\mu^\dagger \hat L_\mu, \hat O \}
		\right\rangle.
\end{aligned}
\end{equation}
We can express the dynamics of operator as in the Heisenberg picture:
\begin{equation}
	\frac{d\hat O}{dt} = i[\hat H, \hat O] + \mathcal D_r[\hat O] + \mathcal D_s[\hat O],
\end{equation}
where
\begin{equation}
\begin{aligned}
	\mathcal D_r[\hat O]
	&= \sum_r \hat L_r^\dagger \hat O\hat L_r - \frac{1}{2} \sum_r\{\hat L_r^\dagger \hat L_r, \hat O \}
	= \frac{1}{2}\sum_r [\hat L_r^\dagger L_r, \hat O] - \sum_r \hat L_r^\dagger[\hat L_r,\hat O],  \\
	\mathcal D_s[\hat O]
	&= \sum_s \hat L_s \hat O\hat L_s - \frac{1}{2} \sum_r\{\hat L_s^2, \hat O \}
	= -\frac{1}{2} \sum_s [\hat L_s,[\hat L_s,\hat O]].
\end{aligned}
\end{equation}
The equation of motion can be further simplified to:
\begin{equation}
	\frac{d\hat O}{dt}
	= i[\hat H_{\mathrm{eff}}, \hat O] - \sum_r \hat L_r^\dagger[\hat L_r,\hat O] -\frac{1}{2} \sum_s [\hat L_s,[\hat L_s,\hat O]],
\end{equation}
where the effective Hamiltonian is
\begin{equation}
	\hat H_{\mathrm{eff}} = \sum_{ij} \left(-\frac{i}{4}H_{ij}-\frac{1}{2} B^I_{ij}\right)\omega_i\omega_j,
\end{equation}
where we have defined $B_{ij} = \sum_r L^r_i L^{r*}_j$.
Using the commutation relation $\{\omega_i, \omega_j\} = 2\delta_{ij}$, we have the following relation
\begin{equation}
\begin{aligned}[]
	[\omega_k,\omega_i \omega_j] &= 2(\delta_{ki}\omega_j-\delta_{kj}\omega_i), \\
	[\omega_k \omega_l, \omega_i \omega_j]
	&= 2(\delta_{ki}\omega_j \omega_l-\delta_{kj} \omega_i \omega_l + \delta_{li}\omega_k \omega_j - \delta_{lj}\omega_k\omega_i),
\end{aligned}
\end{equation}
and let $\hat O_{ij} = \omega_i\omega_j - \delta_{ij}\mathbb I$.
The first term of EOM is:
\begin{equation*}
\begin{aligned}[]
	i\langle[\hat H_{\mathrm{eff}}, \hat O_{ij}]\rangle_t
	&= \sum_{kl}\left(\frac{1}{4}H-\frac{i}{2}B^I \right)_{kl} \langle[\omega_k \omega_l, \omega_i \omega_j]\rangle_t \\
	&= \sum_{kl} \left(\frac{1}{2}H-i B^I\right)_{kl} \langle
		\delta_{ki}\omega_j \omega_l-\delta_{kj} \omega_i \omega_l +
		\delta_{li}\omega_k \omega_j - \delta_{lj}\omega_k\omega_i
	\rangle_t \\
	&= \left[
		(H-2iB^I)^T \cdot \langle\hat O\rangle_t +
		\langle\hat O\rangle_t \cdot (H-2iB^I)
	\right]_{ij}.
\end{aligned}
\end{equation*}
The second term is
\begin{equation*}
\begin{aligned}
	-\sum_r \langle L_r^\dagger[L_r, \hat O_{ij}] \rangle_t
	&= -\sum_{kl} B_{kl}^* \langle \omega_k [\omega_l, \omega_i \omega_j] \rangle_t \\
	&= -2\sum_{kl} B_{kl}^* \langle
		\delta_{li} \omega_k \omega_j -
		\delta_{lj} \omega_k \omega_i
	\rangle_t \\
	&= -\left[2B\cdot \langle\hat O\rangle_t + 2\langle\hat O\rangle_t\cdot B^* + 4i B^I \right]_{ij}.
\end{aligned}
\end{equation*}
And the third term is
\begin{equation*}
\begin{aligned}
	-\frac{1}{2}\sum_s \langle[\hat L_s,[\hat L_s, \hat O_{ij}]]\rangle_t
	&= -\frac{1}{2} \sum_s \sum_{kl} M^s_{kl}\langle[\hat L_s,[\omega_k \omega_l, \omega_i \omega_j]]\rangle_t \\
	&= 2\sum_s \sum_{k} \left\langle M^s_{ik}[\hat L_s,\omega_k \omega_j]-[\hat L_s,\omega_i \omega_k]M^s_{kj} \right\rangle_t \\
	&= 8\sum_{s,kl} \left\langle M^s_{ik}[-M^s_{kl}\omega_l\omega_j+\omega_k\omega_l M^s_{lj}]+[M^s_{il}\omega_l\omega_k-\omega_i\omega_l M^s_{lk}]M^s_{kj} \right\rangle_t \\
	&= 8\sum_s \left[2 M^s \cdot \langle\hat O\rangle_t\cdot M^s-(M^s)^2 \cdot \langle\hat O\rangle_t - \langle\hat O\rangle_t\cdot(M^s)^2 \right]_{ij}.
\end{aligned}
\end{equation*}
In together, we get the EOM of variance matrix $\Gamma_{ij}(t)=i\langle\hat O_{ij}\rangle_t$, the result is:
\begin{equation}
	\partial_t \Gamma = X^T\cdot\Gamma + \Gamma \cdot X + \sum_s (Z^s)^T \cdot \Gamma\cdot Z^s + Y,
\end{equation}
where
\begin{equation}
	X = H - 2B^R + 8 \sum_s (\mathrm{Im} M^s)^2, \quad
	Y = 4B^I, \quad
	Z = 4 \mathrm{Im} M^s.
\end{equation}


\documentclass[a4paper,11pt]{article}
\usepackage{a4wide}
\usepackage{amsmath}
\usepackage{amssymb}
\begin{document}
\begin{center}
  {\LARGE\bf Supplemental note for Week 4 Part 1}
  \end{center}
\begin{flushright}
  {\large\bf ver. 20170416-01}\\
 \ \\
{\large\bf Ryoichi Yamamoto}\\
\end{flushright}

\section{Average and variance of the cumulative impulse $\Delta\mathbf{W}_i$}

Let us start with the Langevin equation
\begin{equation}
m\frac{d\mathbf{V}(t)}{dt}={-\zeta\mathbf{V}(t)}+{\mathbf{F}(t)},
\tag{F2}
\end{equation}
where the random force $\mathbf{F}(t)$ satisfies the following conditions
\begin{equation}
\langle \mathbf{F}(t)\rangle=\mathbf{0}
\tag{F3}
\end{equation}
\begin{equation}
\langle \mathbf{F}(t)\mathbf{F}(0)\rangle = {2k_B T\zeta}\mathbf{I}\delta(t),\tag{F4}
\end{equation}
with
$\mathbf{0}\equiv(0,0,0)$ and $\mathbf{I}\equiv\begin{bmatrix}1&0&0\\0&1&0\\0&0&1\end{bmatrix}$.\\
We now discretize the time $t$ using an increment $\Delta t$, such that
$t_i\equiv i\Delta t$, and define the cumulative impulse during the
interval $t_i\le t\le t_{i+1} = t_i + \Delta t$, as
\begin{equation}
\Delta\mathbf{W}_i
\equiv\int_{t_i}^{t_{i+1}} dt\mathbf{F}(t).
\tag{F8}
\end{equation}
From Eq.(F3), it is straightforward to show
\begin{equation}
\langle\Delta\mathbf{W}_i\rangle
=\int_{t_i}^{t_{i+1}} dt\langle\mathbf{F}(t)\rangle=\mathbf{0}.
\tag{F10}
\end{equation}
Also from Eq.(F4), for $j\ne i$
\begin{eqnarray}
\langle\Delta\mathbf{W}_i\Delta\mathbf{W}_{j\ne i}\rangle
&=&\int_{t_i}^{t_{i+1}} dt\int_{t_j}^{t_{j+1}} dt'\langle\mathbf{F}(t)\mathbf{F}(t')\rangle\\
&=&2k_B T\zeta\mathbf{I} \int_{t_i}^{t_{i+1}} dt\int_{t_j}^{t_{j+1}} dt'
\delta(t-t')\\
&=&\mathbf{O},
\end{eqnarray}
where $\mathbf{O}\equiv\begin{bmatrix}0&0&0\\0&0&0\\0&0&0\end{bmatrix}$.\\
For $j=i$
\begin{eqnarray}
\langle\Delta\mathbf{W}_i\Delta\mathbf{W}_i\rangle
&=&\int_{t_i}^{t_{i+1}} dt\int_{t_i}^{t_{i+1}} dt'\langle\mathbf{F}(t)\mathbf{F}(t')\rangle\\
&=&2k_B T\zeta\mathbf{I} \int_{t_i}^{t_{i+1}} dt\int_{t_i}^{t_{i+1}} dt'
\delta(t-t')\\
&=&2k_B T\zeta\Delta t\mathbf{I}.
\end{eqnarray}
Combining Eqs.(3) and (6), we obtain
\begin{equation}
\langle \Delta \mathbf{W}_i\Delta \mathbf{W}_j\rangle = {2k_B T\zeta}\Delta t\mathbf{I}\delta_{ij} .
\tag{F11}
\end{equation}

%\newpage
\section{Distribution of $\Delta\mathbf{W}_i$}

Here we further divide $\Delta t$ into $n$ segments ($n\gg1$) of a
very small time span $\epsilon$, {\it i.e.}, $\Delta t \equiv n\epsilon$, and
define a new cumulative impulse over $\epsilon$
\begin{equation}
\mathbf{W}^m_i
\equiv\int_{t_i+(m-1)\epsilon}^{t_{i}+m\epsilon} dt\mathbf{F}(t),
\end{equation}
where $1\le m\le n$.\\
Repeating the same procedure performed in the previous section, the following conditions are derived.
\begin{eqnarray}
\langle\mathbf{W}^m_i\rangle&=&\mathbf{0}\\
\langle \mathbf{W}^m_i\mathbf{W}^l_j\rangle &=& {2k_B T\zeta}\epsilon\mathbf{I}\delta_{ij}\delta_{ml}
\end{eqnarray}
Eqs.(8) and (9) show that the mean and variance of the random numbers $W^m_{\alpha,i}$ $(\alpha\in x,y,z)$ are zero and $2k_B T\zeta\epsilon$, respectively. \\
From Eq.(F8) and (7), we should notice that
\begin{equation}
\Delta\mathbf{W}_i
=\mathbf{W}^1_i+\mathbf{W}^2_i+\cdots+\mathbf{W}^n_i.
\end{equation}
Therefore, from the central limit theorem Eqs.(D7)-(D9) introduced in
Part 3 of Week 2, one realizes that the $\Delta W_{\alpha,i}$ should be
drawn from a \textit{Gaussian} distribution, with average and variance
equal to zero and $2k_B T\zeta\Delta t$, respectively, regardless of the
distribution of the $W^m_{\alpha,i}$.
\end{document}


\section{Risk Importance Measures}
Associated test: \texttt{tests/framework/PostProcessors/InterfacedPostProcessor/\\test-riskMeasuresDiscreteMultipleIE.xml}
Risk Importance Measures (RIMs) are originally defined for each basic event in a Event-Tree/Fault-Tree analysis.
In a simulation based environment similar calculations can employed for boolean models.

For each component $i$ and for each IE the following quantities are calculated:
\begin{itemize}
  \item $R^0$ = probability of system failure
  \item $R^i_+$ = probability of system failure given component $i$ has failed
  \item $R^i_-$ = probability of system failure given component $i$ is prefectly reliable
\end{itemize}

For each component $i$, four RIMs indexes can be computed:
\begin{itemize}
  \item $RAW^i = R^i_-/R^0$
  \item $RAW^i = R^0/R^i_+$
  \item $B^i = R^i_- R^i_+$
  \item $FV^i = (R^0 -  R^i_-)/R^0$
\end{itemize}

In the asscoiated test, a system composed by four components (i.e., A, B, C and D) is analyzed for 2 Initiating Events (IEs), IE1 and IE2.
Data associated for each IE is as follows:
\begin{itemize}
  \item IE1 (probability $p1=0.01$); 1 single MCS, $MCS1 = A+BC$
  \item IE2 (probability $p1=0.02$); 1 single MCS, $MCS2 = BCD$
\end{itemize}

In the associated test, the following probabilities are provided:
\begin{itemize}
  \item $p_A = 0.01$
  \item $p_B = 0.05$
  \item $p_C = 0.1 $
  \item $p_D = 0.02$
\end{itemize}

For each IE, the symbolic expressions and the numerical expressions of $R^0$, $R^i_+$ and $R^i_-$ are calculated
(see Tables~\ref{tab:RIM_IE1_symb}, \ref{tab:RIM_IE1_num}, \ref{tab:RIM_IE2_symb} and \ref{tab:RIM_IE2_num}).

\begin{table}[h!]
  \centering
  \caption{IE1: symbolic expressions of $R^0$, $R^i_+$ and $R^i_-$}
  \label{tab:RIM_IE1_symb}
  \begin{tabular}{c|ccc}
    \toprule
    & $R0$ & $R^i_+$ & $R^i_-$ \\
    \midrule
    A & A+BC & []   & BC   \\
    B & A+BC & A+C  & A    \\
    C & A+BC & A+B  & A    \\
    D & A+BC & A+BC & A+BC \\
    \bottomrule
  \end{tabular}
\end{table}

\begin{table}[h!]
  \centering
  \caption{IE1: numerical value of $R^0$, $R^i_+$ and $R^i_-$}
  \label{tab:RIM_IE1_num}
  \begin{tabular}{c|ccc}
    \toprule
    & $R0$ & $R^i_+$ & $R^i_-$ \\
    \midrule
    A & 0.01495 & 1.0     & 0.005   \\
    B & 0.01495 & 0.109   & 0.01    \\
    C & 0.01495 & 0.0595  & 0.01    \\
    D & 0.01495 & 0.01495 & 0.01495 \\
    \bottomrule
  \end{tabular}
\end{table}

\begin{table}[h!]
  \centering
  \caption{IE2: symbolic expressions of $R^0$, $R^i_+$ and $R^i_-$}
  \label{tab:RIM_IE2_symb}
  \begin{tabular}{c|ccc}
    \toprule
    & $R0$ & $R^i_+$ & $R^i_-$ \\
    \midrule
    A & BCD & BCD & BCD  \\
    B & BCD & CD  & -    \\
    C & BCD & BD  & -    \\
    D & BCD & BC  & BCD  \\
    \bottomrule
  \end{tabular}
\end{table}

\begin{table}[h!]
  \centering
  \caption{IE2: numerical value of $R^0$, $R^i_+$ and $R^i_-$}
  \label{tab:RIM_IE2_num}
  \begin{tabular}{c|ccc}
    \toprule
    & $R0$ & $R^i_+$ & $R^i_-$ \\
    \midrule
    A & 0.0001 & 0.0001 & 0.0001 \\
    B & 0.0001 & 0.002  & 0.0    \\
    C & 0.0001 & 0.001  & 0.0    \\
    D & 0.0001 & 0.005  & 0.0    \\
    \bottomrule
  \end{tabular}
\end{table}

Given the values provided above it is possible to linearly weight them with the probability associated to each IE (see Table~\ref{tab:RIM_IE12}).

\begin{table}[h!]
  \centering
  \caption{IE1+IE2: numerical value for $R^0$, $R^i_+$ and $R^i_-$}
  \label{tab:RIM_IE12}
  \begin{tabular}{c|ccc}
    \toprule
    & $R0$ & $R^i_+$ & $R^i_-$ \\
    \midrule
    A & 0.0001515 & 0.010002  & 0.000052  \\
    B & 0.0001515 & 0.00113   & 0.0001    \\
    C & 0.0001515 & 0.000615  & 0.0001    \\
    D & 0.0001515 & 0.0002495 & 0.0001495 \\
    \bottomrule
  \end{tabular}
\end{table}

Then, it is possible to obtain the values of each of the 4 RIMs for eah component:

\begin{table}[h!]
  \centering
  \caption{IE1+IE2: numerical value for $R^0$, $R^i_+$ and $R^i_-$}
  \label{tab:table1}
  \begin{tabular}{c|cccc}
    \toprule
    & RAW & RRW & FV & B \\
    \midrule
    A & 66.01980198 & 2.913461538 & 0.656765677 & 0.00995  \\
    B & 7.458745875 & 1.515       & 0.339933993 & 0.00103  \\
    C & 4.059405941 & 1.515       & 0.339933993 & 0.000515 \\
    D & 1.646864686 & 1.013377926 & 0.01320132  & 0.0001   \\
    \bottomrule
  \end{tabular}
\end{table}


% !TeX root = ../main.tex
% Add the above to each chapter to make compiling the PDF easier in some editors.

\chapter{Theory}\label{chapter:theory}

In this chapter, we introduce the theoretical foundations for our subsequent work. We begin by formally introducing the metrics we use to assess the performance of the discussed algorithms. We then introduce the problem of smoothed convex optimization and related variants that the examined algorithms address.

\section{Performance Metrics}\label{section:theory:performance_metrics}

We say that an algorithm is \emph{optimal}\index{optimal algorithm} with respect to some performance metric if no algorithm can achieve a better score in the given metric given the same information. Crucially, optimality depends on the information given to the algorithm. We thus say that an offline algorithm of a minimization problem is optimal if its result always incurs the smallest possible cost while satisfying the given constraints. In contrast, an optimal online algorithm must not necessarily return the optimal offline solution. In fact, in many cases, online algorithms must necessarily perform worse than optimal offline algorithms due to the lack of provided information (in our case, the convex cost functions arrive over time). Naturally, these performance metrics also inform parts of our experimental analysis performed in \cref{chapter:case_studies}.

\subsection{Approximations}

We begin by considering the offline case. In most cases, we seek to find optimal solutions to the offline problem. However, for some problems where the computational complexity of optimal solutions is high for large instances, it is beneficial to consider efficient algorithms that achieve close to optimal performance, motivating the definition of approximation algorithms. Note that we limit our definitions of performance metrics to minimization problems.

\begin{definition}\index{approximation ratio}
\cite{Williamson2011} An $\alpha$-approximation algorithm for a minimization problem $c$ is a polynomial-time algorithm $ALG$ that for all instances of the problem produces a solution whose value is within a factor of $\alpha$ of the value of an optimal solution $OPT$, i.e., $c(ALG) \leq \alpha \cdot c(OPT)$.
\end{definition}

In other words, an $\alpha$-approximation guarantees that its results are at most a factor of $\alpha$ worse than the optimal solution. The integral smoothed convex optimization problem is an example where \citeauthor{Kappelmann2017}~\cite{Kappelmann2017} and \citeauthor{Albers2021_2}~\cite{Albers2021_2} recently made substantial progress on approximation algorithms.

\subsection{Competitiveness}

For online algorithms, it is natural to consider an adaptation of the idea of approximation algorithms. Here, we compare the result of an online algorithm with the optimal offline solution.

\begin{definition}\index{competitive ratio}
An $\alpha$-competitive online algorithm for a minimization problem $c$ is an algorithm $ALG$ that for all instances of the problem produces a solution whose value is within a factor of $\alpha$ of the value of an optimal offline solution $OPT$, i.e. $c(ALG) \leq \alpha \cdot c(OPT)$.
\end{definition}

We observe that this definition is analogous to our earlier definition of approximation algorithms in the offline case. However, in contrast to approximation algorithms, where the limiting factor was the algorithm's complexity, the competitiveness of online algorithms is fundamentally restricted by the information available to an online algorithm compared to its offline variants. In smoothed convex optimization, considerable work has focused on finding online algorithms with a constant competitive ratio in the number of dimensions $d$.

Crucially, the competitiveness of an online algorithm depends on the assumed adversary model. Commonly, three adversary models are used in the literature, which are described by \citeauthor{Borodin1990}~\cite{Borodin1990}. First, the \emph{oblivious adversary}\index{oblivious adversary} is the weakest adversary and only knows the algorithm's code but needs to construct the request sequence before any moves are made. Second, the \emph{adaptive online adversary}\index{adaptive online adversary} makes the next request based on the algorithm's previous answers but serves it immediately. Third, the \emph{adaptive offline adversary}\index{adaptive offline adversary} is the strongest adversary that serves the requests based on the algorithm's previous answers but, in the end, can choose the optimal request sequence among all possible request sequences. Note that as all adversaries know the algorithm's code, they are equivalent in the case of a deterministic algorithm. Also, note that randomization is not helpful when playing against an adaptive offline adversary. In the case of many smoothed online convex optimization problems, including right-sizing data centers, it is reasonable to assume an oblivious adversary as typically incoming requests arrive independently from previous server configurations in a data center.

\subsection{Regret}

Regret is another approach to measuring the performance of online algorithms.

\begin{definition}\index{regret (static)}
The (static) regret of an online algorithm $ALG$ for a minimization problem $c$ is $\rho(T)$ if for all instances of the problem the difference between the result of the algorithm and the static optimal offline solution $OPT_s$ does not exceed $\rho(T)$, i.e. $c(ALG) - c(OPT_s) \leq \rho(T)$.
\end{definition}

Commonly, the literature considers this definition of regret where the online algorithm is compared against a static offline solution, i.e., a solution where the agent is not allowed to move in the decision space. We say that an algorithm achieves \emph{no-regret}\index{no-regret} if $\rho$ is sublinear in the time horizon $T$. Observe that ideally, an algorithm achieves negative regret, in which case it performs better than the static optimum.

Ideally, online algorithms perform well with respect to the competitive ratio and regret. In other words, our online algorithms should both perform well compared against an agent that is moving in the decision space with perfect knowledge of the future (competitive ratio) and perform well against an agent that picks one optimal location in the decision space. In practice, for the example of dynamically right-sizing a data center, our algorithms are required to outperform a static number of servers to be viable alternatives. In contrast, to minimize energy waste and revenue loss, the strategies proposed by our algorithms must be as close as possible to the optimal dynamic strategies.

However, \citeauthor{Andrew2015}~\cite{Andrew2015} proved that no online algorithm for smoothed convex optimization can simultaneously achieve a constant competitive ratio and no-regret even when $d = 1$ and cost functions are linear. The competitive ratio can be arbitrarily poor for no-regret algorithms by oscillating the dynamic optimal solution between two points in the decision space. The no-regret algorithm will approach a static optimum, which can be arbitrarily worse than the dynamic optimum. In contrast, a constant-competitive algorithm generally sticks to a point in the decision space until it knows that the cost of movement is outweighed by the reduced cost of some other point that it then moves to. Hence, for constant-competitive algorithms, the regret can be arbitrarily large as the algorithm oscillates between the two points in the decision space, in each step having an arbitrary distance to the static optimum. An illustrative example with one dimension and a periodic sequence of two linear cost functions is depicted in \cref{fig:incompatibility_of_competitive_ratio_and_regret}.

\begin{figure}
    \centering
    \input{thesis/figures/incompatibility_of_competitive_ratio_and_regret}
    \caption{Incompatibility of competitive ratio and regret in one dimension. Consider an adversary playing two linear cost functions $f_1$ and $f_2$ with different minimizers. Then, the dynamic optimum oscillates between the two minimizers while the static optimum is given by the intersection of the two cost functions. Therefore, a no-regret algorithm may be arbitrarily far away from the dynamic offline optimum. In contrast, a competitive algorithm which sticks to either end of the decision space may exceed the static offline optimum by a delta that is not in $\mathcal{O}(T)$ \cite{Wierman2019}.}
    \label{fig:incompatibility_of_competitive_ratio_and_regret}
\end{figure}

There thus exist many variants of regret and the competitive ratio used to bridge between the two metrics. One approach considers an additive variant of the competitive ratio, which is called the \emph{competitive difference}.

\begin{definition}\index{competitive difference}
\cite{Chen2015} The competitive difference of an online algorithm $ALG$ for a minimization problem $c$ is $\rho(T)$ if for all instances of the problem, the difference between the result of the algorithm and the dynamic optimal offline solution $OPT$ does not exceed $\rho(T)$, i.e., $c(ALG) - c(OPT) \leq \rho(T)$.
\end{definition}

This definition is also known as \emph{dynamic regret}\index{dynamic regret}~\cite{Chen2018}. We next define a variant of regret that bridges between static and dynamic regret.

\begin{definition}\index{constrained dynamic regret}
\cite{Chen2018} The $L$-constrained dynamic regret of an online algorithm $ALG$ for a minimization problem $c$ is $\rho(T)$ if for all instances of the problem the difference between the result of the algorithm and the $L$-constrained optimal offline solution $OPT_L$ does not exceed $\rho(T)$, i.e. $c(ALG) - c(OPT_L) \leq \rho(T)$.

The $L$-constrained optimal offline solution minimizes $c$ subject to the additional constraint \begin{align*}
    \sum_{t=1}^T \norm{X_t - X_{t-1}} \leq L
\end{align*} for $X_t, X_{t-1} \in \mathcal{X}$.
\end{definition}

We now observe that given the optimal offline solution $OPT$ with schedule $\hat{X}_t$, the $L$-constrained dynamic regret is equivalent to dynamic regret for $L = \sum_{t=1}^T \norm{\hat{X}_t - \hat{X}_{t-1}}$. In contrast, given the static optimal offline solution $OPT_s$, the $L$-constrained dynamic regret is equivalent to static regret for $L = \norm{OPT_s - \mathbf{0}}$ which is the initial (and only) step of $OPT_s$~\cite{Chen2018}.

Another metric used to bridge the gap between the competitive ratio and regret is the \emph{$\alpha$-unfair competitive ratio} which penalizes movement in the decision space by an additional factor $\alpha$~\cite{Andrew2015}.

\begin{definition}\index{unfair competitive ratio}
\cite{Andrew2015} The $\alpha$-unfair competitive ratio of an online algorithm $ALG$ for a minimization problem $c$ is $\beta$ if for all instances of the problem the ratio of the result of the algorithm and the dynamic $\alpha$-unfair offline solution $OPT_{\alpha}$ does not exceed $\beta$, i.e. $c(ALG) \leq \beta \cdot c(OPT_{\alpha})$.

Here, the $\alpha$-unfair optimal offline solution $OPT_{\alpha}$ is defined as the minimizer of \begin{align*}
    \sum_{t=1}^T f_t(X_t) + \alpha \norm{X_t - X_{t-1}}.
\end{align*}
\end{definition}

Note that for $\alpha = 1$, the $\alpha$-unfair competitive ratio is equivalent to the competitive ratio. For large $\alpha$, the $\alpha$-unfair optimal offline solution $OPT_{\alpha}$ is similar to the $L$-constrained optimal offline solution $OPT_L$ in that the movement in the decision space is restricted.

\section{Problems}

Now that we have an overview of the commonly used performance metrics, we introduce the problems we consider in this work. We initially state the problems as offline problems, but as all problems follow the same structure, their corresponding online variant is obtained by deferring the convex cost functions. All other problem variables --- except for the time horizon $T$ --- such as the movement cost that penalizes movement in the decision space are known from the beginning.

\subsection{Smoothed Convex Optimization}

We begin by formally introducing the most general problem we consider and which we already motivated in \cref{chapter:introduction}.

\begin{problem}[Smoothed Convex Optimization (SCO)]\index{smoothed convex optimization}\label{problem:smoothed_convex_optimization}
Given a time horizon $T \in \mathbb{N}$, a convex decision space $\mathcal{X} \subset \mathbb{R}^d$, a norm $\norm{\cdot}$ on $\mathbb{R}^d$, and a sequence $F$ of non-negative convex functions $f_t$ for $t \in [T]$ with $f_t(x) = \infty$ for all $x \not\in \mathcal{X}$, find $X \in \mathcal{X}^T$ minimizing \begin{align*}
    c_{\text{SCO}}(X) = \sum_{t=1}^T f_t(X_t) + \norm{X_t - X_{t-1}}
\end{align*}
where $X_0 = \mathbf{0}$.
\end{problem}

In many practical applications of smoothed convex optimization, we seek to find integral solutions minimizing hitting and movement costs. This is especially true within the context of resource allocation, for example, for right-sizing data centers, where our resources are discrete. This observation motivates the definition of the following variant of SCO.

\begin{problem}[Integral Smoothed Convex Optimization (Int-SCO)]
We define integral smoothed convex optimization analogously to SCO with the added restriction that the points $x$ in $d$-dimensional space must be discrete, that is $\mathcal{X} \subset \mathbb{Z}^d$.
\end{problem}

In this work, we often refer to the convex cost functions of fractional problems as hitting costs, whereas we generally refer to them as operating costs in the context of integral problems.

In \cref{chapter:introduction}, we have seen that metrical task systems subsume Int-SCO. However, it was shown that, in general, the competitiveness of deterministic and randomized algorithms for metrical task systems must be proportional to the size of the decision space~\cite{Blum1992, Borodin1992}. Further, \citeauthor{Chen2018}~\cite{Chen2018} have shown that the competitiveness of any online algorithm for SCO is lower bounded by $\Omega(\sqrt{d})$. Therefore, many of the online algorithms for SCO that we examine in \cref{chapter:online_algorithms} further restrict hitting and movement costs.

Another similar problem is the ski rental problem. In the \emph{ski rental problem}\index{ski rental problem}, skis can be bought for a cost of $b$ units or rented for a cost of one unit per day. Each day of the ski season, the agent has to decide whether to rent the skis or end the sequence of decisions by buying the skis without knowing how long the ski season will last~\cite{Shah2021}. Consider the uni-dimensional decision space $\{0,b\}$, the $\ell_2$ norm as movement cost, and the sequence of hitting costs $f_t(0) = 1$ and $f_t(b) = 0$. The solution to this instance of SCO is a solution to the corresponding ski rental problem, yielding that the ski rental problem is a special case of SCO. \citeauthor{Karlin1990}~\cite{Karlin1990} showed that the best competitive ratio attainable by a randomized algorithm is $e/(e-1) \approx 1.58$, giving a lower bound for the competitive ratio of online algorithms for SCO.

\citeauthor{Goel2019}~\cite{Goel2019} proved that for $\alpha$-strongly convex hitting costs with respect to the $\ell_2$ norm and $\ell_2$-squared movement costs, the optimal competitiveness of any online algorithm is $\mathcal{O}(1/\sqrt{\alpha})$ as $\alpha \downarrow 0$. We discuss hitting costs and movement costs of this shape in greater detail in \cref{section:theory:beyond_convexity}. \citeauthor{Bansal2015}~\cite{Bansal2015} have shown that in the uni-dimensional setting, the optimal competitive ratio that a deterministic memoryless algorithm for SCO can attain is three.

\subsubsection{Complexity of the Offline Problem}

We now want to examine the complexity of Int-SCO in the offline case. That is, we know all arriving convex cost functions $f_t$ in advance. We prove Int-SCO NP-hard for varying $d$ by giving a polynomial-time reduction from the Knapsack problem. In \cref{section:theory:simplified_smoothed_convex_optimization}, we extend this proof of NP-hardness to the integral simplified smoothed convex optimization problem, further restricting the decision space and movement cost.

Given a set of items with an associated value and weight and an upper bound to the total weight, Knapsack is the problem of determining the number of copies of each item that maximizes the total value and conforms to the given upper bound on total weight. Formally we define Knapsack as follows.

\begin{problem}[Knapsack (KP)]\index{knapsack problem}
Given a number of items $n \in \mathbb{N}$, a value of each item $v \in \mathbb{N}^n$, a weight of each item $w \in \mathbb{N}^n$, and an upper bound to the total weight $W \in \mathbb{N}$, find $x \in \{0,1\}^n$ satisfying $\sum_{i = 1}^n w_i x_i \leq W$ and maximizing $\sum_{i=1}^n v_i x_i$.
\end{problem}

This variant of Knapsack is commonly called \emph{0-1 Knapsack} and restricts the number of copies of each item to zero or one. It is, however, easy to see that our proof can be generalized to a setting where we allow $x_i \in [m_i]_0$ for $m \in \mathbb{N}^n$. \citeauthor{Williamson2014}~\cite{Williamson2014} gives a proof for the NP-completeness of the Knapsack decision problem. It immediately follows that the Knapsack optimization problem is NP-hard.

Before reducing to Int-SCO, we reduce Knapsack to a related problem called Minimum Knapsack.

\begin{problem}[Minimum Knapsack (Min-KP)]\index{minimum knapsack problem}
Given a number of items $n \in \mathbb{N}$, a cost of each item $c \in \mathbb{N}^n$, a utility of each item $u \in \mathbb{N}^n$, and a lower bound to the total utility $U \in \mathbb{N}$, find $x \in \{0,1\}^n$ satisfying $\sum_{i = 1}^n u_i x_i \geq U$ and minimizing $\sum_{i=1}^n c_i x_i$.
\end{problem}

\begin{lemma}
Min-KP is NP-hard.
\end{lemma}
\begin{proof}
We prove the lemma by giving a reduction from KP.

Let $\mathcal{I}_{\text{KP}} = (n, v, w, W)$ be an instance of KP. Let $\mathcal{I}_{\text{Min-KP}}(U) = (n, c, u, U)$ be an instance of Min-KP with $c = w$, and $u = v$. Hence, $\mathcal{I}_{\text{Min-KP}}(U)$ minimizes the total weight $\sum_{i=1}^n w_i x_i$ such that $\sum_{i=1}^n v_i x_i \geq U$.

By finding solutions to $\mathcal{I}_{\text{Min-KP}}(U)$ repeatedly for varying $U$, we determine the maximal $U$ such that $\sum_{i=1}^n w_i x_i \leq W$. We observe that $U$ is upper bounded by $n \cdot v_{\text{max}}$. If $U$ were greater than $n \cdot v_{\text{max}}$ we would have $\sum_{i=1}^n v_{\text{max}} x_i \geq \sum_{i=1}^n v_i x_i > n \cdot v_{\text{max}}$ which contradicts $x \in \{0,1\}^n$. Hence, we can use binary search to find $U$ in $\mathcal{O}(\log n + \log v_{\text{max}})$ iterations. The other direction works analogously.

We have seen a total, polynomial-time reduction from KP to Min-KP. Hence, Min-KP is NP-hard.
\end{proof}

Next, we prove our central reduction from Min-KP to Int-SCO. To motivate this reduction, we first prove that the following (convex) integer optimization is, in fact, equivalent to Min-KP.

\begin{lemma}
\label{lemma:integer_minimization}
Let $\mathcal{I}_{\text{Min-KP}} = (n, c, u, U)$ be an instance of Min-KP. $x$ is the solution to $\mathcal{I}_{\text{Min-KP}}$ if and only if $x$ minimizes \begin{align*}
    c_{\text{SCO}}'(x) = \sum_{i=1}^n c_i x_i + M\left(U - \sum_{i=1}^n u_i x_i\right)^+
\end{align*} subject to $x \in \{0,1\}^n$ for some $M > \frac{n c_{\text{max}}}{u_{\text{min}}}$.
\end{lemma}
\begin{proof}
Suppose $x$ minimizes $c_{SCO}'(x)$. Now suppose $(U - \sum_{i=1}^n u_i x_i)^+ > 0$. Then $\sum_{i=1}^n u_i < U$ follows immediately. It is easy to see that if $x \equiv 1$, $\mathcal{I}$ has no solution because the lower bound on the utility $U$ is not met. Henceforth, we assume $x$ can be further increased. Then, $(U - \sum_{i=1}^n u_i x_i)^+ \geq u_{\text{min}}$. Therefore, $c_{SCO}'(x) > \sum_{i=1}^n c_i x_i + c_{\text{max}}$. We observe that $x$ is not optimal as $c_{SCO}'(x)$ could be minimized further by increasing $x$ such that $(U - \sum_{i=1}^n u_i x_i)^+ = 0$ since $\sum_{i=1}^n c_i x_i \leq n c_{\text{max}}$ holds for all $x$.

By leading our previous assumption to a contradiction, we conclude $(U - \sum_{i=1}^n u_i x_i)^+ = 0$ and therefore $U \leq \sum_{i=1}^n u_i x_i$. Further, $c_{SCO}'(x)$ minimizes $\sum_{i=1}^n c_i x_i$ for all remaining candidates for $x$. Hence, $x$ is the solution of $\mathcal{I}_{\text{Min-KP}}$.

On the other hand, suppose that $x$ is the solution to $\mathcal{I}_{\text{Min-KP}}$. Then $(U - \sum_{i=1}^n u_i x_i)^+ = 0$ and $\sum_{i=1}^n c_i x_i$ is minimized. Hence, $x$ minimizes $c_{SCO}'(x)$.
\end{proof}

For our construction we need that $c_{SCO}'$ is convex.

\begin{lemma}
\label{lemma:integer_minimization_convexity}
$c_{SCO}'$ is convex on $\{0,1\}^n$.
\end{lemma}
\begin{proof}
It is easy to see that $c_{SCO}'$ is continuous. Therefore, to show the convexity of $c_{SCO}'$ it suffices to prove midpoint-convexity, i.e. $c_{SCO}'\left(\frac{x+y}{2}\right) \leq \frac{c_{SCO}'(x)+c_{SCO}'(y)}{2}$ for all $x, y \in \mathbb{R}^n$.

To simplify the notation let $C(x) = \sum_{i=1}^n c_i x_i$ and let $U(x) = \sum_{i=1}^n u_i x_i$. To further simplify the notation we define $\frac{x+y}{2}$ to be applied component-wise to elements $i \in [n]$ of $x$ and $y$. We then obtain \small{
\begin{align*}
         &c_{SCO}'\left(\frac{x+y}{2}\right) \leq \frac{c_{SCO}'(x)+c_{SCO}'(y)}{2} \\
    \iff &C\left(\frac{x+y}{2}\right) + M\left(U - U\left(\frac{x+y}{2}\right)\right)^+ \leq \frac{C(x) + M(U - U(x))^+ + C(y) + M(U - U(y))^+}{2} \\
    \iff &C(x) + C(y) + 2M\left(U - U\left(\frac{x+y}{2}\right)\right)^+ \leq C(x) + M(U - U(x))^+ + C(y) + M(U - U(y))^+ \\
    \iff &2\left(U - U\left(\frac{x+y}{2}\right)\right)^+ \leq (U - U(x))^+ + (U - U(y))^+.
\end{align*}
}\normalsize

We immediately get the convexity of $U(\cdot)$ by the following equivalence. \begin{align*}
    U\left(\frac{x+y}{2}\right) &= \sum_{i=1}^n u_i \frac{x_i + y_i}{2} \\
                                &= \frac{\sum_{i=1}^n u_i x_i + \sum_{i=1}^n u_i y_i}{2} \\
                                &= \frac{U(x) + U(y)}{2}.
\end{align*}

Now, we consider three cases separately.

\begin{enumerate}
    \item If $U(x) > U$ and $U(y) > U$, then $U\left(\frac{x+y}{2}\right) > U$. Hence \begin{align*}
        2\left(U - U\left(\frac{x+y}{2}\right)\right)^+ = 0 = (U - U(x))^+ + (U - U(y))^+.
    \end{align*}
    \item If $U(x) \leq U$ and $U(y) \leq U$, then $U\left(\frac{x+y}{2}\right) \leq U$. Hence \begin{align*}
        2\left(U - U\left(\frac{x+y}{2}\right)\right)^+ &= 2U - 2U\left(\frac{x+y}{2}\right) \\
                                                        &= 2U - U(x) - U(y) \\
                                                        &= (U - U(x))^+ + (U - U(y))^+.
    \end{align*}
    \item For the only remaining case we assume w.l.o.g. that $U(x) \leq U$ and $U(y) > U$. If $U - U(x) < U(y) - U$, then $U\left(\frac{x+y}{2}\right) > U$ and we follow the first case. If, on the other hand, $U - U(x) \geq U(y) - U$, then $U\left(\frac{x+y}{2}\right) \leq U$ and we follow the second case.\qedhere
\end{enumerate}
\end{proof}

We now have everything in place to prove our main result of this section.

\begin{theorem}
Int-SCO is NP-hard.
\end{theorem}
\begin{proof}
We now give our reduction from Min-KP to Int-SCO.

Let $\mathcal{I}_{\text{Min-KP}} = (n, c, u, U)$ be an instance of Min-KP and set $d = n$. We define $\mathcal{I}_{\text{Int-SCO}} = (T, \mathcal{X}, \norm{\cdot}, f)$ as an instance of Int-SCO with $T = 1$, $\mathcal{X} = \{0,1\}^n$, $\norm{\cdot} = 0$, and $f_1(x) = c_{\text{SCO}}'(x)$. It is easy to see that $f_1$ is non-negative. By \cref{lemma:integer_minimization_convexity}, $\mathcal{I}_{\text{Int-SCO}}$ is a valid instance of Int-SCO.

The correctness of our construction follows from \cref{lemma:integer_minimization}. \begin{align*}
         &X \text{ is a solution to } \mathcal{I}_{\text{Int-SCO}} \\
    \iff &X \text{ minimizes } \sum_{t=1}^T f_t(X_t) + \norm{X_t - X_{t-1}} \text{ such that } X_t \in \mathcal{X}. \\
    \iff &X \text{ minimizes } c_{\text{SCO}}'(X_1) \text{ such that } X_1 \in \{0,1\}^n. \\
    \iff &X_1 \text{ is a solution to } \mathcal{I}_{\text{Min-KP}}.
\end{align*}

Our construction is total and polynomial in the size of $\mathcal{I}_{\text{Min-KP}}$. Hence, Int-SCO is NP-hard.
\end{proof}

We observe that the above reduction can be extended to Knapsack with arbitrary bounds $m_i$ by setting $\mathcal{X}$ of $\mathcal{I}_{\text{Int-SCO}}$ to $[m_1]_0 \times \dots \times [m_n]_0$.

\subsection{Simplified Smoothed Convex Optimization}\label{section:theory:simplified_smoothed_convex_optimization}

In many applications, for example, for right-sizing data centers where we are interested in determining the optimal number of servers to run at a particular time, it suffices to restrict $\mathcal{X}$ to $[m_0]_0 \times \dots \times [m_d]_0$ for some upper bound in each dimension $m \in \mathbb{N}^d$ and the switching cost $\norm{\cdot}$ to a Manhattan norm which is scaled in each dimension independently from time. To that end, we first define a restricted variant of (fractional) SCO, which we term \emph{simplified smoothed convex optimization}.

\begin{problem}[Simplified Smoothed Convex Optimization (SSCO)]\index{simplified smoothed convex optimization}\label{problem:simplified_smoothed_convex_optimization}
Given a time horizon $T \in \mathbb{N}$, upper bounds $m \in \mathbb{N}^d$, switching costs $\beta \in \mathbb{R}_{>0}^d$, and a sequence $F$ of non-negative convex functions $f_t$ for $t \in [T]$, find $X \in (\mathbb{R}_{\geq 0, \leq m_0} \times \dots \times \mathbb{R}_{\geq 0, \leq m_d})^T$ minimizing \begin{align}\label{eq:simplified_smoothed_convex_optimization}
    c_{\text{SSCO}}(X) = \sum_{t=1}^T f_t(X_t) + \sum_{k=1}^d \beta_k (X_{t,k} - X_{t-1,k})^+
\end{align}
where $X_0 = \mathbf{0}$.
\end{problem}

We observe that $c_{\text{SSCO}}$ pays the switching cost whenever $x$ increases. Decreasing $x$ does not increase the paid switching cost. This observation motivates the following lemma that shows that we could equivalently pay the switching cost for decreasing $x$.

\begin{lemma}
\label{lemma:inverse_switching_cost}
For all $T \in \mathbb{N}$ and $ X_t \in \mathbb{R}$ where $X_0 = X_{T+1} = \mathbf{0}$, the following equivalence holds:
\begin{align*}
    \sum_{t=1}^T (X_t - X_{t-1})^+ = \sum_{t=1}^T (X_t - X_{t+1})^+.
\end{align*}
\end{lemma}
\begin{proof}
The left side of the equation sums all increases in $x$ from $t \in \{0, \dots, T\}$ starting from $X_0 = \mathbf{0}$. The right side of the equation sums all decreases in $x$ from $t \in \{1, \dots, T+1\}$ ending with $X_{T+1} = \mathbf{0}$. As the schedule $X$ begins and ends with the configuration $\mathbf{0}$, the two sums are equivalent.
\end{proof}

To complete the proof that any instance of SSCO is an instance of SCO, we have to show that our switching cost is indeed a valid norm. Given an instance $\mathcal{I}_{\text{SSCO}} = (T, m, \beta, F)$ with $F = (f_1, \dots, f_T)$ we define the corresponding instance of SCO as $\mathcal{I}_{\text{SCO}} = (T, \mathcal{X}, \norm{\cdot}, \widetilde{F})$ where $\mathcal{X} = \mathbb{R}_{\geq 0, \leq m_0} \times \dots \times \mathbb{R}_{\geq 0, \leq m_d}$, $\widetilde{F}$ is slightly modified version of $F$ which is formally defined in the following, and $\norm{x} = \sum_{k=1}^d \frac{\beta_k}{2} |x_k|$ as the dimension-dependently scaled Manhattan norm of $x$. It is easy to see that $\norm{\cdot}$ is indeed a valid norm. The next lemma proves that $X \in \mathcal{X}^T$ is a solution to $\mathcal{I}_{\text{SCO}}$ if and only if it is a solution to $\mathcal{I}_{\text{SSCO}}$.

\begin{lemma}\label{lemma:switching_cost_l1_norm_vs_pos_movement}
For any $T \in \mathbb{N}, \beta \in \mathbb{R}_{>0}^d$, and $X_t \in \mathbb{R}^d$ with $X_0 = X_{T+1} = \mathbf{0}$, the following equivalence holds:
\begin{align}\label{eq:switching_cost_l1_norm_vs_pos_movement}
    \sum_{t=1}^{T+1} \norm{X_t - X_{t-1}} = \sum_{t=1}^T \sum_{k=1}^d \beta_k (X_{t,k} - X_{t-1,k})^+.
\end{align}
\end{lemma}
\begin{proof}
By \cref{lemma:inverse_switching_cost}, the above equivalence holds iff \begin{align*}
    \sum_{t=1}^{T+1} \sum_{k=1}^d \beta_k |X_{t,k} - X_{t-1,k}| = \sum_{t=1}^T \sum_{k=1}^d \beta_k ((X_{t,k} - X_{t-1,k})^+ + (X_{t,k} - X_{t+1,k})^+).
\end{align*}
It is easy to see that this always holds as $(X_{t,k} - X_{t-1,k})^+$ (increasing value) and $(X_{t,k} - X_{t+1,k})^+$ (decreasing value) are the two components of $|X_{t,k} - X_{t-1,k}|$.
\end{proof}

Note that the last summand of the left side of \cref{eq:switching_cost_l1_norm_vs_pos_movement} is $\norm{X_{T+1} - X_T} = \norm{X_T}$ which is not considered in the cost function of SCO. To correct for this under-approximation of the switching cost and to ensure that the cost of a schedule $X$ is equivalent between $\mathcal{I}_{\text{SSCO}}$ and $\mathcal{I}_{\text{SCO}}$ we slightly modify the hitting cost $f_T$ at time $T$ to \begin{align*}
    \widetilde{f}_T(x) := f_T(x) + \norm{x} = f_T(x) + \sum_{k=1}^d \frac{\beta_k}{2} |x|.
\end{align*} The remaining hitting costs remain the same, i.e. $\widetilde{f_t} := f_t$ for all $t \in [T-1]$. We set $\widetilde{F} = (\widetilde{f}_1, \dots \widetilde{f}_T)$. We also observe that the $\norm{\cdot}$ is convex, increasing, and non-negative, implying that this slight modification maintains the invariant that the hitting costs likewise are convex, increasing, and non-negative. This slight modification of the final hitting cost is only relevant in the offline setting where the time horizon is known.

With the same motivation we used for the restriction of SCO to Int-SCO, we now restrict SSCO to an integral variant.

\begin{problem}[Integral Simplified Smoothed Convex Optimization (Int-SSCO)]
We define integral simplified smoothed convex optimization analogously to SSCO with the added restriction that the points $x$ in $d$-dimensional space must be discrete, that is $x \in [m_0]_0 \times \dots \times [m_d]_0$.
\end{problem}

\citeauthor{Albers2018}~\cite{Albers2018} have shown for Int-SSCO in the uni-dimensional setting that the optimal competitive ratio is 3 for deterministic algorithms and 2 for randomized algorithms. As Int-SSCO is subsumed by Int-SCO, these bounds also hold for Int-SCO.

\subsubsection{Complexity of the Offline Problem}

We next extend our proof of NP-hardness of Int-SCO for varying $d$ to Int-SSCO. We cannot reuse our original proof as the switching cost of SSCO is required to be positive.

\begin{theorem}
\label{theorem:int_ssco_np_hardness}
Int-SSCO is NP-hard.
\end{theorem}
\begin{proof}
Again, we use a reduction from Min-KP.

Let $\mathcal{I}_{\text{Min-KP}} = (n, c, u, U)$ be an instance of Min-KP and set $d = n$. We define $\mathcal{I}_{\text{Int-SSCO}} = (T, m, \beta, f)$ as an instance of Int-SSCO with $T = 1$, $m \equiv 1$, $\beta \equiv 1$, and $f_1(x) = c_{\text{SCO}}'(x) + n - \sum_{i=1}^n x_i$.

It is easy to see that $f_1$ is non-negative. In \cref{lemma:ssco_reduction_convexity}, we prove that $f_1$ is convex. Assuming the convexity of $f_1$, $\mathcal{I}_{\text{Int-SSCO}}$ is a valid instance of Int-SSCO.

We now prove the correctness of our construction. Again, we use \cref{lemma:integer_minimization}. \begin{align*}
         &X \text{ is a solution to } \mathcal{I}_{\text{Int-SSCO}} \\
    \iff &X \text{ minimizes } \sum_{t=1}^T f_t(X_t) + \sum_{k=1}^d \beta_k (X_{t,k} - X_{t-1,k})^+ \text{ such that } X_t \in [m_0]_0 \times \dots \times [m_d]_0. \\
    \iff &X \text{ minimizes } f_1(X_1) + \sum_{i=1}^n X_{1,i} \text{ such that } X_1 \in \{0,1\}^n. \\
    \iff &X \text{ minimizes } c_{\text{SCO}}'(X_1) + n + \sum_{i=1}^n X_{1,i} - X_{1,i} \text{ such that } X_1 \in \{0,1\}^n. \\
    \iff &X \text{ minimizes } c_{\text{SCO}}'(X_1) \text{ such that } X_1 \in \{0,1\}^n. \\
    \iff &X_1 \text{ is a solution to } \mathcal{I}_{\text{Min-KP}}.
\end{align*}

Our construction is still total and polynomial in the size of $\mathcal{I}_{\text{Min-KP}}$. Hence, Int-SSCO is NP-hard.
\end{proof}

\begin{lemma}
\label{lemma:ssco_reduction_convexity}
$f_1$ from \cref{theorem:int_ssco_np_hardness} is convex on $\{0,1\}^n$.
\end{lemma}
\begin{proof}
To show convexity of $f_1$, it suffices to show that $h(x) = n - \sum_{i=1}^n x_i$ is convex as the convexity of $c_{SCO}'$ was already established in \cref{lemma:integer_minimization_convexity} and $f_1(x) = c_{SCO}'(x) + h(x)$. Further, it is enough to prove $h$ midpoint-convex as $h$ is continuous. We observe that \begin{align*}
         &&h\left(\frac{x + y}{2}\right) &\leq \frac{h(x) + h(y)}{2} \\
    \iff &&n - \sum_{i=1}^n \frac{x_i + y_i}{2} &\leq n - \frac{\sum_{i=1}^n x_i + \sum_{i=1}^n y_i}{2}
\end{align*} holds for any $x, y \in \{0,1\}^n$, proving the lemma.
\end{proof}

\subsection{Smoothed Balanced Load Optimization}

We now turn to a variant of Int-SSCO introduced by \citeauthor{Albers2021_2}~\cite{Albers2021_2} that further restricts the structure of the convex cost functions. This restriction is motivated by the usual cost model of heterogeneous data centers with homogeneous loads we examined in detail in \cref{section:application:dispatching:optimal_load_balancing} where the incoming load (or set of jobs) is distributed equally among all active servers.

Given a sequence of convex increasing non-negative costs $g_{t,k}(l)$ of each instance in dimension $k$ given its load $l$ during time slot $t$, the overall cost for dimension $k$ during time slot $t$ is given as \begin{align*}
    h_{t,k}(x,z) := \begin{cases}
        x g_{t,k}\left(\frac{l_{t,k}}{x}\right) & x > 0 \\
        \infty                                  & x = 0 \land l_{t,k} > 0 \\
        0                                       & x = 0 \land l_{t,k} = 0
    \end{cases}
\end{align*} where $l_{t,k} = \lambda_t z$ for some sequence of load profiles $\lambda_t \in \mathbb{N}_0$. Here, $x$ is the position in the decision space in dimension $k$, and $z \in [0,1]$ is the fraction of the load $\lambda_t$ that is assigned to dimension $k$~\cite{Albers2021_2}. Given the set of all possible assignments to $d$ dimensions $\mathcal{Z} := \{z \in [0,1]^d \mid \sum_{k=1}^d z_k = 1\}$, the overall hitting cost is defined as the convex optimization \begin{align}
\label{eq:sblo_hitting_cost}
    f_t(x) := \min_{z \in \mathcal{Z}} \sum_{k=1}^d h_{t,k}(x_k,z_k).
\end{align} Intuitively, the load profiles $\lambda_t$ are balanced across all dimensions so as to minimize cost. We also observe that the formulation of $f_t$ from \cref{eq:sblo_hitting_cost} is equivalent to our formulation from \cref{eq:heterogeneous_load_balancing}.

\begin{problem}[Smoothed Balanced Load Optimization (SBLO)]\index{smoothed balanced load optimization}\label{problem:sblo}
Given a time horizon $T \in \mathbb{N}$, upper bounds $m \in \mathbb{N}^d$, switching costs $\beta \in \mathbb{R}_{>0}^d$, a sequence $\Lambda$ of load profiles $\lambda_t \in \mathbb{N}_0$, and a sequence $G$ of convex increasing non-negative functions $g_{t,k}$ for $t \in [T], k \in [d]$, find $X \in ([m_0]_0 \times \dots \times [m_d]_0)^T$ minimizing \begin{align*}
    c_{\text{SBLO}}(X) = \sum_{t=1}^T f_t(X_t) + \sum_{k=1}^d \beta_k (X_{t,k} - X_{t-1,k})^+
\end{align*}
where $X_0 = \mathbf{0}$ and $f_t$ is given by \cref{eq:sblo_hitting_cost}.
\end{problem}

In the online variant of SBLO (and in its variants), load profiles and convex cost functions arrive over time. It is easy to see that any instance of SBLO is in fact an instance of Int-SSCO.

\subsection{Smoothed Load Optimization}

Lastly, we consider an even simpler problem proposed by \citeauthor{Albers2021}~\cite{Albers2021} where we assume that each instance can only handle a single job during each time slot. Instead of using convex functions to model cost, we assume that cost increases linearly and independently from time with the number of active servers. In addition, we impose the constraint that the number of servers must still be enough to handle the incoming load. Without this restriction, the optimal strategy would always be not to run any servers at all.

\begin{problem}[Smoothed Load Optimization (SLO)]\index{smoothed load optimization}\label{problem:slo}
Given a time horizon $T \in \mathbb{N}$, upper bounds $m \in \mathbb{N}^d$, switching costs $\beta \in \mathbb{R}_{>0}^d$, a sequence $\Lambda$ of load profiles $\lambda_t \in \mathbb{N}_0$, and the non-negative operating costs $c \in \mathbb{R}_{\geq 0}^d$, find $X \in ([m_0]_0 \times \dots \times [m_d]_0)^T$ minimizing \begin{align*}
    c_{\text{SLO}}(X) = \sum_{t=1}^T \sum_{k=1}^d c_k X_{t,k} + \beta_k (X_{t,k} - X_{t-1,k})^+
\end{align*}
where $X_0 = \mathbf{0}$ such that for all $t \in [T]$ \begin{align*}
    \sum_{k=1}^d X_{t,k} \geq \lambda_t.
\end{align*}
\end{problem}

In contrast to our definition of SBLO, SLO balances the load implicitly among all active servers, which is possible because we assume that each active server can only handle a single job during one time slot. Again, it is easy to see that SLO is an instance of SBLO by setting $g_{t,k}(l) := c_k$ for $l \leq 1$ and $g_{t,k}(l) := \infty$ otherwise.

\citeauthor{Albers2021}~\cite{Albers2021} show that an online algorithm for SLO cannot attain a competitive ratio smaller than $2d$.

\section{Beyond Convexity}\label{section:theory:beyond_convexity}

We have seen that the optimal competitiveness of online algorithms for smoothed convex optimization is fundamentally limited to be dimension-dependent as long as arbitrary convex hitting costs and arbitrary norms as movement costs are allowed. In the literature, many promising approaches are based on restricting the class of hitting costs (and movement costs) to achieve a dimension-independent competitive ratio. This section focuses mainly on hitting costs, introducing these restrictions, and investigating how they relate to our data center model.

\subsection{Continuity and Differentiability}\label{section:theory:beyond_convexity:continuity_and_differentiability}

A very first natural restriction is to assume that hitting costs are continuous. In fact, theorem 10.1 of~\cite{Rockafellar1970} proves that given a convex function $f : \mathcal{X} \to \mathbb{R}$, $f$ is continuous on the interior of its domain, $\mathcal{X}^{\circ}$. Throughout this work, we will thus assume the hitting costs to be continuous on the interior of the decision space $\mathcal{X}$ without an explicit mention.

As continuity does not represent a limitation, we investigate the continuous differentiability of the hitting costs. We call a function \emph{smooth}\index{smooth function} if it is infinitely-many times continuously differentiable. However, to obtain a smooth hitting cost in the application of right-sizing data centers, one would have to drastically reduce the complexity of the model we discussed in \cref{chapter:application}. For example, \citeauthor{Bansal2015}~\cite{Bansal2015} focus entirely on the energy cost, which is a good approximation in practice as energy represents the largest fraction of the overall cost. Still, in general, the assumption of smoothness is too strong.

\subsection{Stronger Assumptions}

Some of the algorithms, which we discuss, require a more restricted class of convex cost functions. We thus introduce some terminology that is commonly used in convex optimization to describe properties of well-behaved functions.

\paragraph{Lipschitz Continuity} We begin with the fundamental notion of Lipschitz continuity.

\begin{definition}\index{Lipschitz continuity}
\cite{Gupta2020} A function $f : K \to \mathbb{R}$ is called $L$-Lipschitz over a convex set $K \subseteq \mathbb{R}^d$ with respect to the norm $\norm{\cdot}$ if \begin{align*}
    \norm{f(x) - f(y)} \leq L \norm{x - y}
\end{align*} holds for all $x, y \in K$.
\end{definition}

Intuitively, the absolute slope of an $L$-Lipschitz function cannot be greater than $L$. Alternatively, in other words, the function values cannot change arbitrarily fast.

\paragraph{Lipschitz Smoothness} In the context of convex optimization, there is a notion of smoothness that is distinct from the smoothness that we discussed in \cref{section:theory:beyond_convexity:continuity_and_differentiability}. For descent methods, it is beneficial if the difference in gradients of two points shrinks with the distance between the points. Formally, we define smoothness as follows.

\begin{definition}\index{Lipschitz smoothness}
A function $f : K \to \mathbb{R}$ is called $\beta$-Lipschitz smooth over a convex set $K \subseteq \mathbb{R}^d$ with respect to the norm $\norm{\cdot}$ if its gradient $\nabla f$ is $\beta$-Lipschitz over $K$. Thus, $f$ is $\beta$-Lipschitz smooth if \begin{align*}
    \norm{\nabla f(x) - \nabla f(y)} \leq \beta \norm{x - y}
\end{align*} holds for all $x, y \in K$. This is equivalent to saying that \begin{align*}
    f(y) \leq f(x) + \langle\nabla f(x), y-x\rangle + \frac{\beta}{2}\norm{x-y}^2
\end{align*} holds for all $x, y \in K$~\cite{Gupta2020}.
\end{definition}

Intuitively, this ensures that at any point $x \in K$, a quadratic can be fit above the curve of $f$. This ensures that a descent method does not ``overshoot" when approaching the minimum because the gradient decreases as the minimum is approached.

\paragraph{Strong Convexity} In contrast, descent methods converge faster if gradients are large, very far away from the optimal solution. The notion of strong convexity describes this property.

\begin{definition}\index{strong convexity}
\cite{Gupta2020} A function $f : K \to \mathbb{R}$ is called $\alpha$-strongly convex over a convex set $K \subseteq \mathbb{R}^d$ with respect to the norm $\norm{\cdot}$ if $g(x) = f(x) - \frac{\alpha}{2}\norm{x-y}^2$ is convex over $K$. Equivalently, $f$ is $\alpha$-strongly convex if \begin{align*}
    f(y) \geq f(x) + \langle\nabla f(x), y-x\rangle + \frac{\alpha}{2}\norm{x-y}^2
\end{align*} holds for all $x, y \in K$.
\end{definition}

Intuitively, at any point $x \in K$, a quadratic can be fit under the curve of $f$. In other words, $f$ grows at least quadratically as one moves away from the minimizer. This contrasts our definition of $\beta$-Lipschitz smoothness. When a function is $\alpha$-strongly convex and $\beta$-Lipschitz smooth, descent methods converge quickly as the gradient is large when far away and small when close to the optimal solution.

Note that constant and even linear functions are not strongly convex. Recall that the energy consumption models we discussed in \cref{eq:energy_model:1} and \cref{eq:energy_model:2} were linear in the utilization, implying that the overall operating cost of a server is not strongly convex. Even the non-linear energy consumption model from \cref{eq:energy_model:3} is not strongly convex as its first-order derivative is zero for $s = 0$.

\paragraph{Local Polyhedrality} Still, strong convexity represents a significant restriction. A similar but not quite as strong is the property of local polyhedrality.

\begin{definition}\index{local polyhedrality}
\cite{Goel2018} A function $f : K \to \mathbb{R}$ with minimizer $\hat{x}$ is called $\alpha$-locally polyhedral over a convex set $K \subseteq \mathbb{R}^d$ with respect to the norm $\norm{\cdot}$ if there exists some $\epsilon > 0$ such that \begin{align*}
    f(x) - f(\hat{x}) \geq \alpha \norm{x - \hat{x}}
\end{align*} holds for all $x \in K$ with $\norm{x - \hat{x}} \leq \epsilon$.
\end{definition}

Local polyhedrality indicates that at any point $x \in K$, a linear function with slope $\alpha$ can be fit below the curve of $f$~\cite{Goel2018}. In other words, $f$ grows at least linearly as one moves away from the minimizer. Similar to strong convexity, constant functions are not locally polyhedral. Nevertheless, local polyhedrality encompasses many functions, among others the cost functions we described in \cref{chapter:application} modeling the cost of a data center~\cite{Goel2018}.


% ******************************* Thesis Appendix D ********************************

\chapter{Details of reliability analyses}
\label{ap:reli_details}

\section{First order reliability method, FORM}

The improved Hasofer-Lind-Rackwitz-Fiessler algortihm \citep{Rackwitz1979, Zhang1995a} is used to solve the constrained optimization problem. For correlated random variables unless otherwise stated the Nataf transformation \citep{Liu1986} with Cholesky decomposition is used to obtain independent, normally distributed random variables.

\section{Second order reliability method, SORM}

The asymptotic formula of \citet{Breitung1984} is used as a correction term in SORM:

\begin{equation}
	{P_f} \approx \Phi ( - \beta )\left( {\prod\limits_{j = 1}^{n - 1} {\frac{1}{{\sqrt {1 + \beta  \cdot {\kappa _j}} }}} } \right).
\end{equation}

\section{Importance sampling Monte Carlo, isMC}

\begin{equation}
\label{eq:isMC_integral}
	{P_\mathrm{f}} = \int\limits_{({\mathbf{X}})} {{h_{\mathbf{X}}}({\mathbf{x}}) \cdot \frac{{{f_{\mathbf{X}}}({\mathbf{x}})}}{{{h_{\mathbf{X}}}({\mathbf{x}})}} \cdot I({\mathbf{x}})}  \cdot \mathrm{d}{\mathbf{x}}
\end{equation}
Where:

\begin{tabular}{ll}
	$I(\mathbf{x})$ & indicator function of the violation of the limit state; \\
	$f_{\mathbf{X}}({\mathbf{x}})$ & joint PDF of random variables, $\mathbf{X}$; \\
	$h_{\mathbf{X}}({\mathbf{x}})$ & sampling PDF.
\end{tabular}

\noindent
The integral in Eq.\ref{eq:isMC_integral} is replaced with summation for simulation based evaluation:

\begin{equation}
\label{eq:isMC_sum}
	{P_\mathrm{f}} = \mathop {\lim }\limits_{n \to \infty } \frac{1}{n} \cdot \sum\limits_{i = 1}^n {\frac{{{f_{\bf{X}}}({{\bf{x}}_i})}}{{{h_{\bf{X}}}({{\bf{x}}_i})}} \cdot I({{\bf{x}}_i})}.
\end{equation}

%\nomenclature[a-RV]{$RV$}{Return value}
%\nomenclature[a-RP]{$RP$}{Return period}


\documentclass[12pt,oneside,a4paper]{article}

\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{geometry}
\usepackage{layout}
\usepackage{fancyhdr}

\usepackage{hyperref}
%\hypersetup{pdfcolorlinks=true,allcolors=blue}

%\pagestyle{fancy}
%\headheight = 14.5 pt
%\markright{Notes on \textsl{volatilitytrade.pdf} \hfill Peter Zsohar}

\voffset = -10 pt
\textheight = 650 pt
\parindent = 0 pt

\begin{document}

\section{Solve for Z, w and trade costs} % (fold)
\label{sec:solve_for_z_w_and_trade_cost}

\begin{align}
P_{nt} &= \prod_{j = 1}^J {\alpha^j}^{- \alpha^j} {P_{nt}^j}^{\alpha^j} \tag{15p}\\
%
P_{nt}^j &= \xi^j {\Phi_{nt}^j}^{-\frac{1}{\theta}} \tag{16p}\\
%
d^j_{nmt} &= \frac{{B^{j}}^{-\theta} \left(\psi^j_{mt}\right)^{\theta\beta^j} Z_{mt}^j \left(\kappa^j_{nmt}\right)^{\theta} \left(y^j_{mt}\right)^{-\theta\beta^j}}{{P_{mt}}^\theta {\Phi_{nt}^j}} \tag{27p}
\end{align}

\begin{enumerate}
	\item Solve for $P_{nt}(P^j_{nt})$ from (15p).
	\item Solve for $\Phi^j_{nt}(P^j_{nt})$ from (16p).
	\item Rearrange (27p) to get
	\begin{equation}
	d^j_{nmt} {P_{mt}}^{\theta(1 - \beta^j)} {\Phi_{nt}^j} {B^{j}}^{\theta}  = Z_{mt}^j \left(\kappa^j_{nmt}\right)^{\theta} {w^j_{mt}}^{-\theta\beta^j} {\underbrace{L_{mt}}_{1}}^{-\theta\beta^j}
	\end{equation}
	\item Divide by $d^j_{mmt} {P_{mt}}^{\theta(1 - \beta^j)} {\Phi_{mt}^j}$ to get  $\kappa$ as
	\begin{equation}
		\left(\frac{d^j_{nmt} {\Phi_{nt}^j}}{d^j_{mmt} {\Phi_{mt}^j}}\right)^{\frac{1}{\theta}} =
	  \frac{\kappa^j_{nmt}}{\kappa^j_{mmt}} = \kappa^j_{nmt}
	\end{equation}
	\item Denote the LHS of (1) as $G_{nmt}^j$ and express $w_{nt}^j$ from (1) as
	\begin{equation}
		w_{nt}^j = {Z_{nt}^j}^{\frac{1}{\theta\beta^j}} {G_{nnt}^j}^{-\frac{1}{\theta\beta^j}}
	\end{equation}
	\item Divide $wL_{nt}^j$ (this is data) by $w_{nt}^j$ to express $L_{nt}^j$ as
	\begin{equation}
		L_{nt}^j = {Z_{nt}^j}^{-\frac{1}{\theta\beta^j}} {G_{nnt}^j}^{\frac{1}{\theta\beta^j}}
	\end{equation}
	\item Calculate $L_{nt}^j$ from (21p) by approximating the expectation and using $wL_{nt}^j$
	\item With $L_{nt}^j$ at hand calculate $Z_{nt}^j$ as
	\begin{equation}
		Z_{nt}^j = {L_{nt}^j}^{-\theta\beta^j} G_{nnt}^j = {L_{nt}^j}^{-\theta\beta^j} d^j_{nnt} {P_{nt}}^{\theta(1 - \beta^j)} {\Phi_{nt}^j} {B^{j}}^{\theta}
	\end{equation}
	\item Now it is possible to get $w_{nt}^j$ as well.
\end{enumerate}

% section solve_for_z_w_and_trade_cost (end)

\end{document}


\documentclass{homework}
\course{Math 5522H}
\author{Alex Li}
\input{preamble}

\begin{document}
\maketitle

\begin{inspiration}
What kind of metabolism do they have? What's their \textbf{growth rate?}
\byline{the fictional Dr. Alan Grant in \textit{Jurassic Park}, a well-known movie about complex dynamics}
\end{inspiration}

\textbf{This is a short week with an instructional break, so this
  problem set is shorter.}

  \section{Terminology}

  \begin{problem}
    What does it mean to say that an entire function is of
      \textbf{finite order}?
      \end{problem}
      \begin{solution}
      A function $f:\C\to\C$ is said to have order of growth at most $\rho\in\R$ if there exist $A\in\R, B\in\R$ so that $\forall z\, \in \C$,
      \[
      f(z) \leq Ae^{B\rho^{|z|}}
      \]
      The order is finite if such $\rho$ exists.
      \end{solution}
      \begin{problem}
        What are \textbf{canonical factors}?
        \end{problem}
        \begin{solution}
        For $k\geq0,$ the $k$th canonical factor is a function of $z$ given by the equation
        \[
        \left(1-z\right)e^{z + \frac{z^2}{2} + \dots + \frac{z^k}{k}}
        \]
        Note that when $k=0$, the exponential term is $e^0$.
        \end{solution}
        \section{Numericals}

        \begin{problem}
          Compute $\displaystyle\prod_{n=0}^\infty \left( 1 + z^{(2^n)} \right)$.
          \end{problem}
          \begin{solution}
          First we note that if $|z| < 1$, then $\sum_{n=0}^\oo |z^{(2^n)}| < \infty$ by comparison to the geometric series $z^n$, so the product converges to something nonzero, and if $|z| > 1$, then each term grows unboundedly so the product diverges. If $|z|=1$ then the product diverges (to 0) since no matter how big $n$ is, there will a $\delta$ so that there are terms of product farther than $\delta$ from $1$.

          Next let's consider this as a formal product and expand. We note that
          for any term $z^k$, there is eactly one way to multiple terms to get it, corresponding to the binary expansion of $k$:
          \[
          \prod_{n=0}^\infty \left( 1 + z^{(2^n)} \right) = \sum_{n=0}^\infty z^n
          \]
          The rearrangement of the terms of the product are justified by the fact that the sum $\sum_{n=0}^\infty z^n$ converges absolutely for $|z|< 1$. % Not really

          This implies that the sum is equal to
          \[
          1 + \log(\frac{1}{1-z})
          \]
          \end{solution}
          \begin{problem}
            Compute $\displaystyle\prod_{n=1}^\infty \left( 1 - \frac{1}{(2n)^2} \right)$.
            \end{problem}
            \begin{solution}
            Recall that in an earlier assignment, we proved that
            \[
            \sin \left( \pi z \right) = \pi z \prod_{n=1}^\infty \left( 1 - \frac{z^2}{n^2} \right)
            \]
            Then take $z=\frac{1}{2}$ to see that
            \[
            \frac{2}{\pi} = \frac{2\sin \left( \pi/2 \right)}{\pi} = \prod_{n=1}^\infty \left( 1 - \frac{1}{(2n)^2} \right)
            \]
            \end{solution}
            \begin{problem}
              What is the order of growth of $f(z) = \sin z$?
              \end{problem}
              \begin{solution}
              \begin{align*}
              \abs{\sin z} = \abs{\frac{e^{iz} - e^{-iz}}{2}}
              \end{align*}
              For a radius $r$, both terms in the numerator are bounded above by $e^{\abs{z}}$, so
              \begin{align*}
              \abs{\sin z} \leq e^{\abs{z}}
              \end{align*}
              Thus the order of growth of $f$ is at most $1$.

              Then considering the point $z=ir$ for $r>1$,
              \[
              e^{iz} - e^{-iz} = e^{r} - e^{-r} \geq \frac{1}{2}e^{r}
              \]
              so the order of growth of $f$ is at least $1$. Hence the order of growth is exactly 1.
              \end{solution}
              \begin{problem}
                What is the order of growth of a polynomial?
                \end{problem}
                \begin{solution}
                For fixed $B, C, \rho>0$, the function $Ae^{B\rho^{|z|}}$ grows at an expoential rate in $|z|$, faster than any polynomial. Since $\rho\leq0$ will not satisfy any function, the inf of the $\rho$ satisfying the conditions is 0, so the order of growth of any polynomial is 0.
                \end{solution}
                \section{Exploration}

                \begin{problem}
                  Suppose $f : \C \to \C \setminus \{0, 1\}$ is a holomorphic function
                    of finite order.  What does Hadamard say about $f$ in this case?
                    \end{problem}
                    \begin{solution}
                    $f$ has no zeros, just like the function $g(z) = 1$. Hence by Hadamard's theorem, $f(z) = e^{p(z)}g(z)$. Since $f$ has finite order, $p(z)$ is a polynomial. If $p(z)$ is constant, than $f(z)$ is a constant. Otherwise, it has a root at $z_0$ by the funamental theorem of algebra. But $f(z_0) = e^p(z_0)g(z_0) = 1$, contradicting the range of $f$. Thus $f$ must be constant.
                    \end{solution}
                    \begin{problem}
                      Consider the function
                        \[
                            G(z) = z \prod_{n=1}^\infty \left( 1 + \frac{z}{n} \right) e^{-z/n}
                              \]
                                which has zeros at nonpositive integers, just like the function
                                  $z \mapsto 1/\Gamma(z)$ we saw last week.

                                    Is it the case that $1/\Gamma(z) = G(z)$?
                                    \end{problem}
                                    \begin{solution}
                                    Suppose that $G(z)\Gamma(z) = 1$. Then $\frac{G(2)}{G(1)} = \frac{\Gamma(2)}{\Gamma(1)} = 2$. But
                                    \begin{align*}
                                    \frac{G(2)}{G(1)} &= 2\prod_{n=1}^\infty\frac{1+\frac{2}{n}}{1 + \frac{1}{n}}e^{\frac{-1}{n}}\\
                                    &= 2\prod_{n=1}^\infty \frac{n + 2}{n + 1}e^{-\frac{1}{n}}\\
                                    \end{align*}
                                    This product telescopes, so
                                    \begin{align*}
                                    \frac{g(2)}{g(1)} &= \lim_{N\to\infty} N\exp({-\sum_{n=1}^N \frac{1}{n}})\\
                                    &= \lim_{N\to\infty} N\exp({-\sum_{n=1}^N \frac{1}{n}})e^{\log(N^{-1}) + \log(N))}\quad\color{purple} \text{ multiply by 1}\\
                                    &= \lim_{N\to\infty} Ne^{\log(N^{-1})}\exp({-\sum_{n=1}^N \frac{1}{n} + \log(N)})\\
                                    &= e^{-\gamma} \quad\color{purple} \gamma \text{ the euler mascheroni constant} \neq 2
                                    \end{align*}
                                    Thus $\frac{1}{\Gamma(z)\neq G(z)}$. One can also note that, since $\Gamma$ has order 1 and shares the same zeroes as $G$, $\Gamma(z) e^{a+bz} = G(z)$. We showed $b=-\gamma$.
                                    \end{solution}

                                    \section{Prove or Disprove and Salvage if Possible}

                                    \begin{problem}
                                      A meromorphic function on the complex plane is the quotient of two
                                        entire functions.
                                        \end{problem}
                                        \begin{proof}
                                        The claim is true. Let $f$ be meromorphic. If $f=0$, then $f(z)=g(z)/h(z)$ with $g(z)=0$, $h(z)=1$. Otherwise, $f$ has a list of poles with repetition $z_1, z_2, \dots$. Then there is an entire function $h$ with zeros at exactly the poles of $f$, given by a Wierstrauss infinite product. The function $h\cdot f = g$ then has removable singularities at $z_1, z_2, \dots$, and we can regard it as entire. Dividing by $h$, we see that $f = \frac{g}{h}$, so $f$ is holomorphic.
                                        \end{proof}
                                        \begin{problem}
                                          If $f : \C \to \C$ is a odd function of order 1 with $f(n) = 0$ for
                                            $n \in \Z$, then $f(z) = \sin (\pi z)$.
                                            \end{problem}
                                            \begin{solution}
                                            False. $f(z) = z^2\sin (\pi z)$ also works.

                                            If we assume that $f$ has a zero of degree 1 at 0, we can get the result up to a constant:

                                            By Hadamard's factorization theorem, if $f$ is of order 1, then we can write it as a product of $\sin(\pi z)$ with a function exponent raised to the power of a linear polynomial.
                                            \[
                                            f(z) = e^{a+bz}\sin(\pi z)
                                            \]
                                            If $b\neq 0$, then the function will no longer be odd (e.g. consider $a=0, z=\pm i$). Hence
                                            \[
                                            f(z) = e^{a}\sin(\pi z)
                                            \]
                                            so $f(z)$ can by any nonzero constant multiple of $\sin(\pi z)$.
                                            \end{solution}
                                            \end{document}