text:
\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[margin=1in]{geometry}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{setspace}

\title{Chapter 3\\Numerical Sequences and Series}
\author{solutions by Hikari}
\date{November 2021}

\begin{document}

\newcommand{\V}{\mathbf}

\maketitle

\paragraph{1.}
Let $\{s_n\}$ converges to $s$, so for every $\varepsilon>0$, there is an integer $N$ such that $n\geq N$ implies $|s_n-s|<\varepsilon$. By Problem 1.13, $\big||s_n|-|s| \big|<|s_n-s|<\varepsilon$, so for every $\varepsilon>0$, there is an integer $N$ such that $n\geq N$ implies $\big||s_n|-|s| \big|<\varepsilon$, which means $\{|s_n|\}$ converges to $|s|$.

The converse is not true. Let $s_n=(-1)^n$, then $\{|s_n|\}$ converges to $1$, but $\{s_n\}$ diverges.

\paragraph{2.}
\[
\lim_{n\to\infty}(\sqrt{n^2+n}-n)=\lim_{n\to\infty}\frac{n}{\sqrt{n^2+n}+n}=\lim_{n\to\infty}\frac{1}{\sqrt{1+\frac{1}{n}}+1}=\frac{1}{2}
\]

\paragraph{3.}
$s_1<2$. If $s_k<2$, then $s_{k+1}=\sqrt{2+\sqrt{s_k}}<\sqrt{2+\sqrt{2}}<2$, so $s_n<2$ for every $n$ by induction. $s_2>s_1$. If $s_k>s_{k-1}$, then $\sqrt{2+\sqrt{s_k}}>\sqrt{2+\sqrt{s_{k-1}}}$, which means $s_{k+1}>s_k$. s o $\{s_n\}$ is monotonically increasing by induction. By Theorem 3.14, $\{s_n\}$ being monotonic and bounded implies convergence.

\paragraph{4.}
$s_{2m+1}=1-\frac{1}{2^m}$ holds for $m=0$. If it holds for $m=k$, so $s_{2k+1}=1-\frac{1}{2^k}$, then $s_{2(k+1)+1}=\frac{1}{2}+s_{2k+2}=\frac{1}{2}+\frac{s_{2k+1}}{2}=1-\frac{1}{2^{k+1}}$, which means it also holds for $m=k+1$. So $s_{2m+1}=1-\frac{1}{2^m}$ holds for every $m$ by induction.

$s_{2m}=\frac{1}{2}-\frac{1}{2^m}$ holds for $m=1$. If it holds for $m=k$, so $s_{2k}=\frac{1}{2}-\frac{1}{2^k}$, then $s_{2(k+1)}=\frac{s_{2k+1}}{2}=\frac{1}{4}+\frac{s_{2k}}{2}=\frac{1}{2}-\frac{1}{2^{k+1}}$, which means it also holds for $m=k+1$. So $s_{2m}=\frac{1}{2}-\frac{1}{2^m}$ holds for every $m$ by induction.

$\{s_{2m+1}\}=\{1-\frac{1}{2^m}\}$ converges to $1$, so $1$ is a subsequential limit of $\{s_n\}$. If $x>1$, then for every $n$ we have $s_n<1<x$. By Theorem 3.17, $1$ is the upper limit of $\{s_n\}$.

$\{s_{2m}\}=\{\frac{1}{2}-\frac{1}{2^m}\}$ converges to $\frac{1}{2}$, so $\frac{1}{2}$ is a subsequential limit of $\{s_n\}$. If $x<\frac{1}{2}$, let $x=\frac{1}{2}-\varepsilon$ where $\varepsilon>0$, and let $N$ be an integer such that $N>-\log_2\varepsilon$, then $s_n\geq\frac{1}{2}-\frac{1}{2^n}>\frac{1}{2}-\varepsilon=x$ for all $n\geq N$. By Theorem 3.17, $\frac{1}{2}$ is the lower limit of $\{s_n\}$.

\paragraph{5.}
If at least one of  $\limsup_{n\to\infty}a_n$ and $\limsup_{n\to\infty}b_n$ equals to $+\infty$, and the other does not equal to $-\infty$, then
\[
\limsup_{n\to\infty}(a_n+b_n)=\infty=\limsup_{n\to\infty}a_n+\limsup_{n\to\infty}b_n
\]
the inequality holds.

For the rest of the case, we have $\limsup_{n\to\infty}a_n<+\infty$ and $\limsup_{n\to\infty}<+\infty$. By Theorem 3.17, $\limsup_{n\to\infty}(a_n+b_n)$ is also a subsequential limit of $\{a_n+b_n\}$, so there is a subsequence $\{a_{n_k}+b_{n_k}\}$ such that
\begin{equation}
    \limsup_{n\to\infty}(a_n+b_n)=\lim_{k\to\infty}(a_{n_k}+b_{n_k})
\end{equation}
$\limsup_{k\to\infty}a_{n_k}$, the upper limit of $\{a_{n_k}\}$, is also a subsequential limit of $\{a_{n_k}\}$, so there is a subsequence $\{a_{n_{k_j}}\}$ such that
\[
\lim_{j\to\infty}a_{n_{k_{j}}}=\limsup_{k\to\infty}a_{n_k}
\]
$\{a_{n_k}+b_{n_k}\}$ converges, so every subsequential limit equals to $\lim_{k\to\infty}(a_{n_k}+b_{n_k})$, which means
\begin{equation}
    \lim_{k\to\infty}(a_{n_k}+b_{n_k})=\lim_{j\to\infty}(a_{n_{k_j}}+b_{n_{k_j}})
\end{equation}
Both $\{a_{n_{k_j}}+b_{n_{k_j}}\}$ and $\{a_{n_{k_j}}\}$ converge, so $\{b_{n_{k_j}}\}$ also converges, and we have
\begin{equation}
    \lim_{j\to\infty}(a_{n_{k_j}}+b_{n_{k_j}})=\lim_{j\to\infty}a_{n_{k_j}}+\lim_{j\to\infty}b_{n_{k_j}}
\end{equation}
$\lim_{j\to\infty}b_{n_{k_j}}$ is a subsequential limit of $\{b_{n_k}\}$, so we have
\[
\lim_{j\to\infty}b_{n_{k_j}}\leq\limsup_{k\to\infty}b_{n_k}
\]
Therefore, we have
\begin{equation}
    \lim_{j\to\infty}a_{n_{k_j}}+\lim_{j\to\infty}b_{n_{k_j}}\leq\limsup_{k\to\infty}a_{n_k}+\limsup_{k\to\infty}b_{n_k}
\end{equation}
It is obvious that
\[
\limsup_{k\to\infty}a_{n_k}\leq \limsup_{n\to\infty}a_n
\]
and also
\[
\limsup_{k\to\infty}b_{n_k}\leq \limsup_{n\to\infty}b_n
\]
so we have
\begin{equation}
    \limsup_{k\to\infty}a_{n_k}+\limsup_{k\to\infty}b_{n_k}\leq\limsup_{n\to\infty}a_n+\limsup_{n\to\infty}b_n
\end{equation}
Combining equation (1) to (5), we have
\[
\limsup_{n\to\infty}(a_n+b_n)\leq\limsup_{n\to\infty}a_n+\limsup_{n\to\infty}b_n
\]

\paragraph{6.}
(a)
\[
a_n=\sqrt{n+1}-\sqrt{n}=\frac{1}{\sqrt{n+1}+\sqrt{n}}>\frac{1}{2\sqrt{n+1}}
\]
$\sum\frac{1}{2(n+1)^{1/2}}$ diverges by Theorem 3.28, so $\sum a_n$ diverges by comparison test.
\medskip

(b)
\[
a_n=\frac{\sqrt{n+1}-\sqrt{n}}{n}=\frac{1}{n(\sqrt{n+1}+\sqrt{n})}<\frac{1}{n\cdot2\sqrt{n}}
\]
$\sum\frac{1}{2n^{3/2}}$ converges by Theorem $3.28$, so $\sum a_n$ converges by comparison test.
\medskip

(c)
\[
\limsup_{n\to\infty}\sqrt[n]{|a_n|}=\lim_{n\to\infty}(\sqrt[n]{n}-1)=0
\]
so $\sum a_n$ converges by root test.
\medskip

(d)
For $|z|\leq1$,
\[
\lim_{n\to\infty}|a_n|=\lim_{n\to\infty}\frac{1}{|1+z^n|}\geq\lim_{n\to\infty}\frac{1}{1+|z|^n}=
\begin{cases}
1,\quad & |z|<1\\
\frac{1}{2},\quad & |z|=1
\end{cases}
\]
which is not zero, so $\sum a_n$ diverges by Theorem 3.23.

For $|z|>1$,
\[
\limsup_{n\to\infty}\left|\frac{a_{n+1}}{a_n} \right|=\limsup_{n\to\infty}\frac{|1+z^n|}{|1+z^{n+1}|}\leq\limsup_{n\to\infty}\frac{|z|^n+1}{|z|^{n+1}-1}=\frac{1}{|z|}<1
\]
so $\sum a_n$ converges by ratio test

\paragraph{7.}
\[
(\sqrt{a_n}-\frac{1}{n})^2=a_n+\frac{1}{n^2}-\frac{2\sqrt{a_n}}{n}\geq0
\]
\[
\frac{\sqrt{a_n}}{n}\leq\frac{a_n}{2}+\frac{1}{2n^2}
\]
$\sum\frac{a_n}{2}$ and $\sum\frac{1}{2n^2}$ converges, so $\sum\frac{\sqrt{a_n}}{2}$ converges by comparison test.

\paragraph{8.}
Being monotonic and bounded implies convergence, so let $\lim_{n\to\infty}b_n=b$. If $\{b_n\}$ is increasing, let $d_n=b-b_n$, then $d_0\geq d_1\geq d_2\geq\cdots$, and $\lim_{n\to\infty}d_n=0$.
\[
\sum a_nb_n=\sum a_nb-\sum a_nd_n
\]
$\sum a_nb$ converges because $\sum a_n$ converges. $\sum a_nd_n$ converges by Theorem $3.42$ because $\sum a_n$ is bounded and $d_n$ satisfy the conditions. Therefore, $\sum a_nb_n$ converges.

If $\{b_n\}$ is decreasing, let $d_n=b_n-b$, then the convergence can be proved similarly.

\paragraph{9.}
(a)
The series converges when
\[
\limsup_{n\to\infty}\left|\frac{(n+1)^3z^{n+1}}{n^3z^n} \right|=|z|\limsup_{n\to\infty}\left|\frac{(n+1)^3}{n^3} \right|=|z|<1
\]
so the radius of convergence $R=1$.
\medskip

(b)
The series converges when
\[
\limsup_{n\to\infty}\left|\frac{\frac{2^{n+1}}{(n+1)!}z^{n+1}}{\frac{2^n}{n!}z^n} \right|=|z|\limsup_{n\to\infty}\left|\frac{2}{n+1} \right|=0<1
\]
so the radius of convergence $R=\infty$.
\medskip

(c)
The series converges when
\[
\limsup_{n\to\infty}\left|\frac{\frac{2^{n+1}}{(n+1)^2}z^{n+1}}{\frac{2^n}{n^2}z^n} \right|=|z|\limsup_{n\to\infty}\left|\frac{2n^2}{(n+1)^2} \right|=2|z|<1
\]
so the radius of convergence $R=\frac{1}{2}$.
\medskip

(d)
The series converges when
\[
\limsup_{n\to\infty}\left|\frac{\frac{(n+1)^3}{3^{n+1}}z^{n+1}}{\frac{n^3}{3^n}z^n} \right|=|z|\limsup_{n\to\infty}\left|\frac{(n+1)^3}{3n^3} \right|=\frac{|z|}{3}<1
\]
so the radius of convergence $R=3$.

\paragraph{10.}
For every positive integer $N$, there is an integer $n$ such that $a_n\neq0$. Because $|a_n|\geq1$, we have $\sqrt[n]{|a_n|}\geq1$. Therefore,
\[
\alpha=\limsup_{n\to\infty}\sqrt[n]{|a_n|}\geq1
\]
\[
R=\frac{1}{\alpha}\leq1
\]

\paragraph{11.}
(a) If $\{a_n\}$ is not bounded, then $\lim_{n\to\infty}a_n=\infty\;or\,-\infty$, so
\[
\lim_{n\to\infty}\frac{a_n}{1+a_n}=1\neq0
\]
which means $\sum\frac{a_n}{1+a_n}$ diverges by Theorem 3.23.

If $\{a_n\}$ is bounded, so there is a $M$ such that $|a_n|<M$ for every $n$, then
\[
\frac{a_n}{1+a_n}\geq\frac{a_n}{1+M}
\]
$\sum\frac{a_n}{1+M}$ diverges because $\sum a_n$ diverges, so $\sum\frac{a_n}{1+a_n}$ diverges by comparison test.
\medskip

(b)
$a_n>0$, so $s_n$ is monotonically increasing, and $s_{N+1},s_{N+2},\cdots\leq s_{N+k}$. Therefore,
\[
\frac{a_{N+1}}{s_{N+1}}+\cdots+\frac{a_{N+k}}{s_{N+k}}\geq\frac{a_{N+1}}{s_{N+k}}+\cdots+\frac{a_{N+k}}{s_{N+k}}=1-\frac{s_N}{s_{N+k}}
\]

$s_n$ is monotonically increasing but diverges, which implies that it is not bounded, so $\lim_{n\to\infty}s_n=\infty\,or-\infty$. For every integer $N$,
\[
\lim_{k\to\infty}\left|\sum_{n=N+1}^{N+k}\frac{a_n}{s_n} \right|\geq\lim_{k\to\infty}\left|1-\frac{s_N}{s_{N+k}} \right|=1
\]
so for $\varepsilon<1$, the Cauchy criterion (Theorem 3.11) is not satisfied, which means $\sum\frac{a_n}{s_n}$ diverges.
\medskip

(c)
\[
\frac{a_n}{s_n^2}=\frac{s_{n}-s_{n-1}}{s_n^2}\leq\frac{s_n-s_{n-1}}{s_n\cdot s_{n-1}}=\frac{1}{s_{n-1}}-\frac{1}{s_n}
\]
Because $\lim_{n\to\infty}s_n=\infty\,or-\infty$, so
\[
\sum_{n=2}^\infty\left(\frac{1}{s_{n-1}}-\frac{1}{s_n} \right)=\frac{1}{s_1}-\lim_{n\to\infty}\frac{1}{s_n}=\frac{1}{s_1}
\]
which is convergent, so $\frac{a_n}{s_n^2}$ converges by comparison test.
\medskip

(d)
$\sum\frac{a_n}{1+a_n}$ may be convergent or divergent. For example, let $a_n=1$ for every $n$, then
\[
\sum\frac{a_n}{1+na_n}=\sum\frac{1}{n+1}
\]
which is divergent. On the other hand, let
\[
a_n=
\begin{cases}
1,\quad & n=m^2,\quad m\in\mathbb{N}\\
\frac{1}{n^2},\quad & otherwise
\end{cases}
\]
Then
\[
\sum_{n=1}^N\frac{a_n}{1+na_n}=\sum_{m=1}^\infty\frac{1}{1+m^2}+\sum_{\substack{n=1\\n\neq m^2}}^\infty\frac{\frac{1}{n^2}}{1+n\cdot\frac{1}{n^2}}
\]
The first series converges because
\[
\frac{1}{1+m^2}<\frac{1}{m^2}
\]
and $\sum\frac{1}{m^2}$ converges. The second series converges because
\[
\frac{\frac{1}{n^2}}{1+n\cdot\frac{1}{n^2}}=\frac{1}{n(n+1)}<\frac{1}{n^2}
\]
and $\sum\frac{1}{n^2}$ converges. Therefore, $\sum\frac{a_n}{1+na_n}$ converges.

\paragraph{12.}
(a)
$a_n>0$, so $s_n=\sum_{m=1}^n a_m$ is monotonically increasing, and $r_n=\sum_{m=n}^\infty a_m$ is monotonically decreasing, which means $r_m>r_{m+1},\cdots,r_{n}$. Therefore,
\[
\frac{a_m}{r_m}+\cdots+\frac{a_n}{r_n}>\frac{a_m}{r_m}+\cdots+\frac{a_n}{r_m}=1-\frac{r_{n+1}}{r_m}>1-\frac{r_n}{r_m}
\]
By Cauchy criterion, $\lim_{n\to\infty}r_n=0$. For every positive integer $N$,
\[
\lim_{k\to\infty}\left|\sum_{n=N}^k\frac{a_n}{r_n} \right|>\lim_{k\to\infty}\left|1-\frac{r_k}{r_N} \right|=1
\]
so the Cauchy criterion (Theorem 3.22) cannot be satisfied, which means $\sum\frac{a_n}{r_n}$ diverges.
\medskip

(b)
$r_n\neq r_{n+1}$, so
\[
(\sqrt{r_n}-\sqrt{r_{n+1}})^2>0
\]
\[
r_n-2\sqrt{r_n}\sqrt{r_{n+1}}+r_{n+1}>0
\]
\[
2r_n-2\sqrt{r_n}\sqrt{r_{n+1}}>r_n-r_{n+1}
\]
\[
2(\sqrt{r_n}-\sqrt{r_{n+1}})>\frac{r_n-r_{n+1}}{\sqrt{r_n}}=\frac{a_n}{\sqrt{r_n}}
\]
We have
\[
\sum_{n=1}^\infty2(\sqrt{r_n}-\sqrt{r_{n+1}})=2\sqrt{r_1}-\lim_{n\to\infty}2\sqrt{r_{n}}=2\sqrt{r_1}
\]
which is convergent, so $\sum\frac{a_n}{\sqrt{r_n}}$ converges by comparison test.

\paragraph{13.}
Let $\sum a_n$ and $\sum  b_n$ be two absolutely convergent series, and let $c_n=\sum_{k=0}^n a_kb_{n-k}$. Let $d_n$ be the Cauchy product of $\sum|a_n|$ and $\sum|b_n|$, which is
\[
d_n=\sum_{k=0}^n|a_k||b_{n-k}|=\sum_{k=0}^n|a_k b_{n-k}|
\]
Both $\sum|a_n|$ and $\sum|b_n|$ converges absolutely, so $\sum d_n$ converges by Theorem 3.50.
\[
|c_n|=\left|\sum_{k=0}^n a_kb_{n-k} \right|\leq\sum_{k=0}^n|a_k b_{n-k}|=d_n
\]
$\sum d_n$ converges, so $\sum|c_n|$ converges by comparison test, which means $\sum c_n$ converges absolutely.

\paragraph{14.}

(a)
For every $\varepsilon>0$, let $N$ be a positive integer such that $|s_n-s|<\frac{\varepsilon}{2}$ for $n>N$. Let $M$ be a positive integer such that $\frac{(s_0-s)+\cdots+(s_N-s)}{M}<\frac{\varepsilon}{2}$. Then for $n>\max(N,M)$, we have
\[
\sigma_n-s=\frac{(s_0-s)+\cdots+(s_n-s)}{n+1}<\frac{(s_0-s)+\cdots+(s_N-s)}{M}+\frac{(s_{N+1}-s)+\cdots+(s_n-s)}{n-N}<\frac{\varepsilon}{2}+\frac{\varepsilon}{2}=\varepsilon
\]
which means $\lim\sigma_n=s$.
\medskip

(b)
Let $s_n=(-1)^n$, then $\{s_n\}$ diverges, but $\lim\sigma_n=0$ because $(s_0+\cdots+s_n)\leq1$ and $\lim\frac{1}{n+1}=0$.
\medskip

(c)
Let $s_n$ be
\[
s_n=\begin{cases}
m,\quad & n=m^3,\;m\in\mathbb{N}\\
\frac{1}{2^n},\quad & otherwise
\end{cases}
\]
then $\limsup s_n=\infty$ because it is not bounded.
\[
\sigma_n\leq\frac{\frac{1}{2^0}+\cdots+\frac{1}{2^n}}{n+1}+\frac{1+\cdots+M}{n+1}\leq\frac{2}{n+1}+\frac{M^2}{n+1}\leq\frac{2}{n+1}+n^{-\frac{1}{3}}
\]
where $M$ is the largest positive integer such that $M^3\leq n$. We have $\lim\frac{2}{n+1}=\lim n^{-\frac{1}{3}}=0$, and $\sigma_n\geq0$, so $\lim\sigma_n=0$.
\medskip

(d)
\[
s_n-\sigma_n=\frac{ns_n-\sum_{k=0}^{n-1}s_k}{n+1}=\frac{\sum_{k=1}^n ks_k-\sum_{k=0}^{n-1}(k+1)s_k}{n+1}=\frac{\sum_{k=1}^n(ks_k-ks_{k-1})}{n+1}=\frac{\sum_{k=1}^n ka_k}{n+1}
\]
Note that $\frac{\sum_{k=0}^n ka_k}{n+1}$ is the arithmetic means of the sequence $\{na_n\}$, so by (a), $\lim(na_n)=0$ implies $\lim(s_n-\sigma_n)=0$, which is $\lim s_n=\lim\sigma_n$.
\medskip

(e)
For $m<n$,
\begin{equation*}
    \begin{split}
        & \quad\;\frac{m+1}{n-m}(\sigma_n-\sigma_m)+\frac{\sum_{i=m+1}^n(s_n-s_i)}{n-m}\\
        & =\frac{m+1}{n-m}\sigma_n-\frac{\sum_{i=0}^m s_i}{n-m}+\frac{(n-m)s_n}{n-m}-\frac{\sum_{i=m+1}^n s_i}{n-m}\\
        & =\frac{(n-m)s_n}{n-m}+\frac{m+1}{n-m}\sigma_n-\frac{\sum_{i=0}^n s_i}{n-m}\\
        & =s_n+\frac{m+1}{n-m}\sigma_n-\frac{n+1}{n-m}\sigma_n\\
        & =s_n-\sigma_n
    \end{split}
\end{equation*}
For $i\geq m+1$,
\[
|s_n-s_i|=\left|\sum_{k=i+1}^n(s_k-s_{k-1}) \right|\leq\sum_{k=i+1}^n|s_k-s_{k-1}|=\sum_{k=i+1}^n|a_k|\]
\[
\sum_{k=i+1}^n|a_k|\leq\sum_{k=i+1}^n\frac{M}{k}\leq\sum_{k=i+1}^n\frac{M}{i+1}=\frac{(n-i)M}{i+1}\leq\frac{(n-m-1)M}{m+2}
\]
For $\varepsilon>0$, let $m$ be the integer such that
\[
m\leq\frac{n-\varepsilon}{1+\varepsilon}<m+1
\]
form which we have
\[
\frac{m+1}{n-m}\leq\frac{1}{\varepsilon}\qquad\frac{n-m-1}{m+2}<\varepsilon
\]
We have $\lim_{n\to\infty}\frac{m+1}{n-m}(\sigma_n-\sigma_m)=0$, and
\[
\frac{1}{n-m}\sum_{i=m+1}^n(s_n-s_i)\leq\frac{(n-m-1)M}{m+2}<M\varepsilon
\]
Therefore,
\[
\limsup_{n\to\infty}|s_n-\sigma|<M\varepsilon
\]
Since $\varepsilon$ is arbitrary, $\lim s_n=\sigma$.

\paragraph{15.}
\begin{itemize}
\item\textit{Theorem 3.22}
From Theorem 3.11, in $R^k$, a sequence converges if and only if it is a Cauchy sequence. Therefore, $s_n=\sum a_n$ converges if and only if for every $\varepsilon>0$, there is an integer $N=N'+1$ such that
\[
|s_m-s_{n-1}|=\left|\sum_{k=n}^m a_k \right|\leq \varepsilon
\]
if $m\geq n\geq N'+1=N$.

\item\textit{Theorem 3.23}
By taking $m=n$, we have
\[
|a_n|\leq\varepsilon\qquad(n\geq N)
\]
which means $\lim|a_n|=\lim a_n=0$.

\item\textit{Theorem 3.25}
The proof is identical with that in the text because $\left|\sum_{k=n}^m a_k \right|\leq\sum_{k=m}^n|a_k|$ holds in every $R^k$.

\item\textit{Theorem 3.33}
The proof is identical with that in the text because the comparison text (Theorem 3.25) and Theorem 3.23 holds in every $R^k$.

\item\textit{Theorem 3.34}
The proof is identical with that in the text as Theorem 3.33.

\item\textit{Theorem 3.42}
The proof is identical with that in the text because the Cauchy criterion (Theorem 3.22) holds in every $R^k$.

\item\textit{Theorem 3.45}
The proof is identical with that in the text because the equality and Cauchy criterion hold in every $R^k$.

\item\textit{Theorem 3.47}
The proof is identical with that in the text because the proof of the limit rules (Theorem 3.3) holds in every $R^k$.

\item\textit{Theorem 3.55}
The proof is identical with that in the text because the Cauchy criterion holds in every $R^k$.
\end{itemize}

\paragraph{16.}
(a)
$x_1>\sqrt{\alpha}$. If $x_n>\sqrt{\alpha}$, then $x_{n+1}>\sqrt{\alpha}$ because
\[
(x_n-\sqrt{\alpha})^2>0
\]
\[
\frac{x_n^2+\alpha}{2x_n}>\frac{2x_n\sqrt{\alpha}}{2x_n}
\]
\[
x_{n+1}>\sqrt{\alpha}
\]
So by induction, $x_n>\sqrt{\alpha}$ for every $n$. From $x_n^2>\alpha$, we have
\[
x_{n+1}=\frac{1}{2}\left(x_n+\frac{\alpha}{x_n}\right)<\frac{1}{2}\left(x_n+x_n\right)=x_n
\]
So $\{x_n\}$ decreases monotonically. Along with the fact that $\{x_n\}$ is bounded below, $\{x_n\}$ converges. Let $\lim x_n=x$, then
\[
\lim_{n\to\infty} x_{n+1}=\lim_{n\to\infty}\frac{1}{2}\left(x_n+\frac{\alpha}{x_n}\right)=\frac{x}{2}+\frac{\alpha}{2x}=\lim_{n\to\infty} x_n=x
\]
Solving for $x$, we have
\[
\lim_{n\to\infty }x_n=\sqrt{\alpha}
\]

(b)
\[
\varepsilon_{n+1}=\frac{1}{2}\left(x_n+\frac{\alpha}{x_n} \right)-\sqrt{\alpha}=\frac{x_n^2-2x_n\sqrt{\alpha}+\alpha}{2x_n}=\frac{(x_n-\sqrt{\alpha})^2}{2x_n}=\frac{\varepsilon_n^2}{2x_n}<\frac{\varepsilon_n^2}{2\sqrt{\alpha}}
\]
Setting $\beta=2\sqrt{\alpha}$, then $\varepsilon_{n+1}<\frac{\varepsilon_n^2}{\beta}$ for every $n$. Consider the inequality
\[\varepsilon_{n+1}<\beta\left(\frac{\varepsilon_1}{\beta} \right)^{2^n}
\]
It holds for $n=1$:
\[
\varepsilon_2<\frac{\varepsilon_1^2}{\beta}=\beta\left(\frac{\varepsilon_1}{\beta} \right)^2
\]
If it holds for $n=k$:
\[
\varepsilon_{k+1}<\beta\left(\frac{\varepsilon_1}{\beta} \right)^{2^k}
\]
then it also holds for $n=k+1$:
\[
\varepsilon_{k+2}<\frac{\varepsilon_{k+1}^2}{\beta}<\frac{1}{\beta}\left[\beta\left(\frac{\varepsilon_1}{\beta} \right)^{2^k} \right]^2=\beta\left(\frac{\varepsilon_1}{\beta} \right)^{2^{k+1}}
\]
So the inequality holds for every $n$ by induction.
\medskip

(c)
From $25<27,\;5<3\sqrt{3},\;20<12\sqrt{3},\;10(2-\sqrt{3})<2\sqrt{3}$, we have
\[
\frac{\varepsilon_1}{\beta}=\frac{
2-\sqrt{3}}{2\sqrt{3}}<\frac{1}{10}
\]
From $2\sqrt{3}=\sqrt{12}<\sqrt{16}=4$, we have
\[
\beta=2\sqrt{3}<4
\]
Therefore, from the inequality in (b), we have
\[
\varepsilon_5<4\left(\frac{1}{10} \right)^{2^4}=4\cdot10^{-16}
\]
\[
\varepsilon_6<4\left(\frac{1}{10} \right)^{2^5}=4\cdot10^{-32}
\]

\paragraph{17.}
(a)(b)
\[
x_{n+1}-\sqrt{\alpha}=\frac{\alpha+x_n}{1+x_n}-\sqrt{\alpha}=-\frac{(\sqrt{\alpha}-1)(x_n-\sqrt{\alpha})}{1+x_n}
\]
So if $x_{n}-\sqrt{\alpha}<0$,\; $x_{n+1}-\sqrt{\alpha}>0$, and if $x_n-\sqrt{\alpha}>0$,\; $x_{n+1}-\sqrt{\alpha}<0$. Because $x_1>\sqrt{\alpha}$, we have $x_1,x_3,x_5,\cdots>\sqrt{\alpha}$, and $x_2,x_4,x_6,\cdots<\sqrt{\alpha}$.
\[
x_{n+2}=\frac{\alpha+x_{n+1}}{1+x_{n+1}}=\frac{\alpha+\frac{\alpha+x_n}{1+x_n}}{1+\frac{\alpha+x_n}{1+x_n}}=\frac{(\alpha+1)x_n+2\alpha}{2x_n+\alpha+1}=x_n+\frac{-2(x_n^2-\alpha)}{2x_n+\alpha+1}
\]

For the odd terms, $x_n^2-\alpha>0$, so $x_{n+2}<x_n$, which is $x_1>x_3>x_5>\cdots$.

For the even terms, $x_n^2-\alpha<0$, so $x_{n+2}>x_n$, which is $x_2<x_4<x_6<\cdots$.
\medskip

(c)
The sequence of odd terms is monotonically decreasing and bounded below by $\sqrt{\alpha}$, so it converges. Let the limit be $x$:
\[
\lim_{n\to\infty}x_{n+2}=\frac{(\alpha+1)x+2\alpha}{2x+\alpha+1}=\lim_{n\to\infty}x_n=x
\]
Solving for $x$, we have $x=\sqrt{\alpha}$. Similarly, the sequence of even terms being monotonically increasing and bounded above by $\sqrt{\alpha}$ implies convergence, and the limit is also $\sqrt{\alpha}$. Therefore, both the sequences of odd and even terms converging to $\sqrt{\alpha}$ implies that
\[
\lim_{n\to\infty}x_n=\sqrt{\alpha}
\]

(d)
Let $\delta_n=|x_n-\sqrt{\alpha}|$, then
\[
\delta_{n+1}=\frac{(\sqrt{\alpha}-1)\delta_n}{1+x_n}>\frac{(\sqrt{\alpha}-1)\delta_n}{1+x_1}=\gamma\delta_n
\]
where $\gamma<1$. By induction we have
\[
\delta_{n+1}>\gamma^n\delta_1
\]
Compared with the sequence in Exercise 16:
\[
\varepsilon_{n+1}<\beta\left(\frac{\varepsilon_1}{\beta} \right)^{2^n}
\]
The sequence $a^{2^n}$ for $a<1$ converges faster than $b^n$ for $b<1$, so for $n>N$ where $N$ is large enough, we have
\[
\varepsilon_{n+1}<\beta\left(\frac{\varepsilon_1}{\beta} \right)^{2^n}<\gamma^n\delta_1<\delta_{n+1}
\]
which means the sequence in Exercise 16 converges faster than that in Exercise 17.

\paragraph{18.}
For $0<a<1$, we have
\[
1-a^p=(1-a)(1+a+\cdots+a^{p-1})<(1-a)(1+1+\cdots+1)=p(1-a)
\]
$x_1>\sqrt[p]{\alpha}$. If $x_n>\sqrt[p]{\alpha}$, so $0<\frac{\sqrt[p]{\alpha}}{x_n}<1$, then
\[
1-\left(\frac{\sqrt[p]{\alpha}}{x_n} \right)^p<p\left(1-\frac{\sqrt[p]{\alpha}}{x_n} \right)
\]
\[
\frac{x_n}{p}-\frac{\alpha}{p}x_n^{-p+1}<x_n-\sqrt[p]{\alpha}
\]
\[
x_{n+1}=\frac{p-1}{p}x_n+\frac{\alpha}{p}x_{n}^{-p+1}>\sqrt[p]{\alpha}
\]
So by induction, $x_n>\sqrt[p]{\alpha}$ for every $n$. From $x_n^p>\alpha$, or $x_n>\alpha x_n^{-p+1}$, we have
\[
x_{n+1}=\frac{p-1}{p}x_n+\frac{\alpha}{p}x_n^{-p+1}<\frac{p-1}{p}x_n+\frac{1}{p}x_n=x_n
\]
So $\{x_n\}$ decreases monotonically. Along with the fact that $\{x_n\}$ is bounded below, $\{x_n\}$ converges. Let $\lim x_n=x$, then
\[
\lim_{n\to\infty}x_{n+1}=\lim_{n\to\infty}\left(\frac{p-1}{p}x_n+\frac{\alpha}{p}x_n^{-p+1} \right)=\frac{p-1}{p}x+\frac{\alpha}{p}x^{-p+1}=\lim_{n\to\infty}x_n=x
\]
solving for $x$, we have
\[
\lim_{n\to\infty}x_n=\sqrt[p]{\alpha}
\]

\paragraph{19.}
Let the Cantor set be denoted as $P$.

If $x\in P$, then $0\leq x\leq1$, and $3x$ satisfies either the two inequalities:
\[
0\leq 3x\leq 1
\]
\[
2\leq 3x\leq 3
\]
Let $\alpha_1$ be $0$ or $2$, respectively, and let $\beta_1=3x-\alpha_1$. Then $0\leq\beta_1\leq1$, and $3\beta_1$ satisfies either the two inequalities:
\[
0\leq3\beta_1\leq1
\]
\[
2\leq3\beta_1\leq3
\]
Let $\alpha_2$ be $0$ or $2$, respectively, and let $\beta_2=3\beta_1-\alpha_2$. Continue the process to obtain the sequences $\{\alpha_n\}$ and $\{\beta_n\}$, where $\alpha_n$ is $0$ or $2$, and $0\leq\beta_n\leq1$ for every $n$. Then we have
\[
x=\sum_{n=1}^N\frac{\alpha_n}{3}+\frac{\beta_N}{3}
\]
Since $\frac{\beta_N}{3^N}$ can be arbitrarily small for large enough $N$, we have
\[
x=\lim_{N\to\infty}\sum_{n=1}^N\frac{\alpha_n}{3^n}=\sum_{n=1}^\infty\frac{\alpha_n}{3^n}
\]
which means that $x\in X(a)$. Therefore, $P\subset X(a)$.
\medskip

If $x\not\in P$, then for some $N$ we have $1<3\beta_n<2$, so
\[
x=\sum_{n=1}^N\frac{\alpha_n}{3^n}+\frac{\beta_N}{3^N}
\]
\[
\sum_{n=1}^N\frac{\alpha_n}{3^n}+\frac{1}{3^{N+1}}<x<\sum_{n=1}^N\frac{\alpha_n}{3^n}+\frac{2}{3^{N+1}}
\]
so if $x=\sum_{n=1}^\infty\frac{\alpha_n}{3^n}$, then $\alpha_{N+1}$ cannot be $0$ or $2$, which means $x\not\in X(a)$. Therefore, $X(a)\subset P$.
\medskip

From $P\subset X(a)$ and $X(a)\subset P$, we have $X(a)=P$.

\paragraph{20.}
For every $\varepsilon>0$, let $N_1$ be the positive integer such that for $n,m\geq N_1$,
\[
d(p_n,p_m)<\frac{\varepsilon}{2}
\]
Let $N_2$ be the positive integer such that for $n_i\geq N_2$,
\[
d(p_{n_i},p)<\frac{\varepsilon}{2}
\]
Let $N=\max(N_1,N_2)$. Then for $n\geq N$, choose $n_i\geq N$, and we have
\[
d(p_n,p)\leq d(p_n,p_{n_i})+d(p_{n_i},p)<\frac{\varepsilon}{2}+\frac{\varepsilon}{2}=\varepsilon
\]
which implies $\{p_n\}$ converges to $p$.

\paragraph{21.}
Construct a sequence $\{x_n\}$ such that $x_n\in E_n$ for each $n$. Because $E_n\supset E_{n+1}$,\;\;$E_n$ contains the points $x_n,x_{n+1},x_{n+2},\cdots$, and therefore $\lim\mathrm{diam}\,E_n=0$ implies that $\{x_n\}$ is a Cauchy sequence. Since the metric space is complete, $\{x_n\}$ converges to a point $x$. Since $x$ is a limit point of the set of $\{x_n\}$, it is a limit point of every $E_n$, and since $E_n$ is closed, $x\in E_n$ for every $n$. Therefore,
\[
x\in\bigcap_{n=1}^\infty E_n
\]
If $E=\bigcap_1^\infty E_n$ consists of more that one point, then $\mathrm{diam}\,E>0$. But for each $n$,\; $\mathrm{diam}\,E_n\geq\mathrm{diam}\,E$. This contradicts the assumption that $\mathrm{diam}\,E_n\to0$. Therefore, $\bigcap_1^\infty E_n$ consists of exactly one point.

\paragraph{22.}
Find a neighborhood $E_1$ with diameter less than $1$ such that $\overline{E_1}\subset G_1$ (it exists because $G_1$ is open). Since $G_2$ is dense, every neighborhood centered at any point contains a point of $G_2$, so $E_1\cap G_2$ is nonempty, and because both $E_1$ and $G_2$ are open, $E_1\cap G_2$ is open. Find a neighborhood $E_2$ with diameter less than $\frac{1}{2}$ such that $\overline{E_2}\subset E_1\cap G_2$. Continue the process to construct a sequence of sets $\{\overline{E_n}\}$, where $\overline{E_n}\supset\overline{E_{n+1}}$, and $\overline{E_n}\subset G_n$. Every $\overline{E_n}$ is closed, and because $0\leq\mathrm{diam}\,\overline{E_n}\leq\frac{1}{n}$,
\[
\lim_{n\to\infty}\mathrm{diam}\,\overline{E_n}=0
\]
so by Exercise 21, there is a point $x$ contained in every $\overline{E_n}$, so $x$ is contained in every $G_n$, which means $\bigcap_1^\infty G_n$ is not empty.

\paragraph{23.}
$\{p_n\}$ and $\{q_n\}$ are Cauchy sequences, so for every $\varepsilon>0$, there is a positive integer $N_1$ such that $d(p_n,p_m)<\frac{\varepsilon}{2}$ for $n,m\geq N_1$, and a positive integer $N_2$ such that $d(q_n,q_m)<\frac{\varepsilon}{2}$ for $n,m\geq N_2$. Let $N=\max(N_1,N_2)$. For $n,m\geq N$, we have
\[
\left|d(p_n,q_n)-d(p_m,q_m) \right|\leq d(p_n,p_m)+d(q_n,q_m)<\frac{\varepsilon}{2}+\frac{\varepsilon}{2}=\varepsilon
\]
which implies $\{d(p_n,q_n)\}$ is a Cauchy sequence. Since every Cauchy sequence in $R$ converges, $\{d(p_n,q_n)\}$ converges.

\paragraph{24.}
(a)
\begin{itemize}
\item \textit{reflexive:}
\[
\lim_{n\to\infty}d(p_n,p_n)=0
\]
so $\{p_n\}\sim\{p_n\}$.
\item \textit{symmetric:} If $\{p_n\}\sim\{q_n\}$, so $\lim d(p_n,q_n)=0$, then
\[
\lim_{n\to\infty}d(q_n,p_n)=\lim_{n\to\infty}d(p_n,q_n)=0
\]
so $\{q_n\}\sim\{p_n\}$.
\item \textit{transitive} If $\{p_n\}\sim\{q_n\}$ and $\{q_n\}\sim\{r_n\}$, so $\lim d(p_n,q_n)=\lim d(q_n,r_n)=0$, then
\[
d(p_n,r_n)\leq d(p_n,q_n)+d(q_n,r_n)
\]
\[
\lim_{n\to\infty}d(p_n,r_n)=0
\]
so $\{p_n\}\sim\{r_n\}$.
\end{itemize}
\medskip

(b)
If $\{p_n\},\{p_n'\}\in P$, and $\{q_n\},\{q_n'\}\in Q$
, then
\[
d(p_n',q_n')\leq d(p_n',p_n)+d(p_n,q_n)+d(q_n,q_n')
\]
\[
|d(p_n',q_n')-d(p_n,q_n) |\leq d(p_n',p_n)+d(q_n,q_n')
\]
Since $\lim d(p_n',p_n)=\lim d(q_n,q_n')=0$, we have
\[
\lim_{n\to\infty}d(p_n',q_n')=\lim_{n\to\infty}d(p_n,q_n)
\]
So $\Delta(P,Q)$ is unchanged if $\{p_n\}$ and $\{q_n\}$ are replaced by equivalent sequences.

Verify the three definition of distance function:
\begin{itemize}
    \item \textit{Definition (a)}
    \[
    \Delta(P,Q)=\lim_{n\to\infty}d(p_n,q_n)\begin{cases}
    >0\quad \textit{if $P\neq Q$}\\
    =0\quad \textit{if $P=Q$}
    \end{cases}
    \]
    \item \textit{Definition (b)}
    \[
    \Delta(P,Q)=\lim_{n\to\infty}d(p_n,q_n)=\lim_{n\to\infty}d(q_n,p_n)=\Delta(Q,P)
    \]
    \item \textit{Definition (c)}
    \[
    \Delta(P,Q)=\lim_{n\to\infty}d(p_n,q_n)\leq\lim_{n\to\infty}d(p_n,r_n)+\lim_{n\to\infty}d(r_n,q_n)=\Delta(P,R)+\Delta(R,Q)
    \]
\end{itemize}
So $\Delta$ is a distance function in $X^*$.
\medskip

(c)
Let $\{P_n\}$ be a Cauchy sequence in $X^*$, so every $P_n$ is an equivalence class. Let $p_n=\{p_{n,m}\}$ be an element of $P_n$. so $p_n$ is a Cauchy sequence in $X$. By the definition of Cauchy sequence, there is a positive integer $N_n$ such that for $s,t\geq N_n$,
\[
d(p_{n,s},p_{n,t})<\frac{1}{2^n}
\]
Let $q$ be a sequence in $X$ such that $q=\{q_n\}=\{p_{n,N_n}\}$.
\medskip

For $\varepsilon>0$, there is a positive integer $M_1$ such that for $m,n\geq M_1$,
\[
\Delta(P_m,P_n)<\frac{\varepsilon}{6}
\]
There is a positive integer $M_2$ such that
\[
\frac{1}{2^{M_2}}<\frac{\varepsilon}{3}
\]
Let $M=\max(M_1,M_2)$. For $m,n\geq M$, since
\[
\Delta(P_m,P_n)=\lim_{k\to\infty}d(p_{m,k},p_{n,k})
\]
there is a positive integer $N_0$ such that for $k\geq N_0$,
\[
\left|d(p_{m,k},p_{n,k})-\Delta(P_m,P_n) \right|<\frac{\varepsilon}{6}
\]
\[
d(p_{m,k},p_{n,k})<\frac{\varepsilon}{6}+\Delta(P_m,P_n)<\frac{\varepsilon}{3}
\]
Let $N=\max(N_0,N_m,N_n)$. Let $k$ be a positive integer such that $k\geq N$. Then
\begin{equation*}
    \begin{split}
        d(q_m,q_n) & =d(p_{m,N_m},p_{n,N_n})\\
        & \leq d(p_{m,N_m},p_{m,k})+d(p_{m,k},p_{n,k})+d(p_{n,k},p_{n,N_n})\\
        & < \frac{1}{2^m}+\frac{\varepsilon}{3}+\frac{1}{2^n}\\
        & <\frac{\varepsilon}{3}+\frac{\varepsilon}{3}+\frac{\varepsilon}{3}=\varepsilon
    \end{split}
\end{equation*}
Therefore, for $\varepsilon>0$, there is a positive integer $M$ such that for $m,n\geq M$, \;$d(q_m,q_n)<\varepsilon$, which means that $q=\{q_n\}$ is a Cauchy sequence. Let $Q\in X^*$ be the equivalence class containing $q$.

\[
\lim_{n\to\infty}\Delta(P_n,Q)=\lim_{n\to\infty}\lim_{m\to\infty}d(p_{n,m},q_n)
\]
For $m\geq N_n$, \;$d(p_{n,m},q_n)<\frac{1}{2^n}$, so
\[
\Delta(P_n,Q)=\lim_{m\to\infty}d(p_{n,m},q_n)<\frac{1}{2^n}
\]
Because $\lim_{n\to\infty}\frac{1}{2^n}=0$,
\[
\lim_{n\to\infty}\Delta(P_n,Q)=0
\]
which means that $\{P_n\}$ converges to $Q$. So every Cauchy sequence in $X^*$ converges, which means that $X^*$ is complete.
\medskip

(d)
\[
\Delta(P_p,P_q)=\lim_{n\to\infty}d(p,q)=d(p,q)
\]
\medskip

(e)
Let $P$ be an element of $X^*$, which contains a Cauchy sequence $p=\{p_n\}$. For $\varepsilon>0$, there is a positive integer $N$ such that for $n,m\geq N$,
\[
d(p_n,p_m)<\varepsilon
\]
Consider $p_N\in X$, and $\varphi(p_N)\in\varphi(X)$.
\[
\Delta(P,\varphi(p_N))=\lim_{n\to\infty}d(p_n,p_N)<\varepsilon
\]
which means $\varphi(p_N)$ is contained in the neighborhood of $P$ with radius $\varepsilon$. Therefore, every neighborhood centered at any point of $X^*$ contains an element of $\varphi(X)$, which means $\varphi(X)$ is dense in $X^*$.

If $X$ is complete, then $\{p_n\}$ converges. Let $\lim_{n\to\infty}p_n=a$, then
\[
\Delta(P,\varphi(a))=\lim_{n\to\infty}d(p_n,a)=0
\]
so $P=\varphi(a)\in\varphi(X)$. Therefore, $X^*\subset\varphi(X)$, and obviously $\varphi(X)\subset X^*$, so $\varphi(X)=X^*$.

\paragraph{25.}
The completion of $X$ must be a complete metric space, and contains a dense subset isometric with $X$. If $X$ is the rational numbers with the metric $d(x,y)=|x-y|$, then the real numbers with the same metric satisfies the conditions. So the completion of $Q$ is $R$.

\end{document}

max_stars_repo_path: Principles of Mathematical Analysis/Chapter 03/main.tex


text:
\documentstyle[11pt]{article}

\pagestyle{empty}
\setlength{\textheight}{9in}
\setlength{\footheight}{0.0in}
\setlength{\topmargin}{0in}

%Defaults from art10.sty:
%\textwidth 345pt \columnsep 10pt \columnseprule 0pt
%\oddsidemargin 63pt

\advance\textwidth by 0.5in
\advance\oddsidemargin by -0.25in

\begin{document}

\vspace*{-0.3in}

\begin{center}
{\large\bf Scheme 48} \\
\vspace{1ex}
Richard Kelsey ({\tt kelsey@corwin.ccs.northeastern.edu}) \\
Jonathan Rees ({\tt jar@cs.cornell.edu}) \\
June 1992
\end{center}

\vspace{1ex}

Scheme 48 is an implementation of the Scheme programming language based
on a virtual machine architecture.  The following is an overview of
the project.

\paragraph{Goals}

\begin{itemize}
\setlength{\itemsep}{0pt}
\item Straightforward, minimal implementation.
\item Flexible experimental apparatus for research in programming
      language design and implementation.
\item Easy to make changes to internal data representations, memory
      management, and compilation strategy.
\item High reliability.
\item Fast and complete enough to be a good
      development environment for Scheme programs.
\end{itemize}

\paragraph{Virtual machine}

The virtual machine executes a simple byte-code instruction set
similar to the target of the Scheme 311 compiler [Clinger, LFP 1984].
The interpreter for the virtual instruction set is itself written in
PreScheme, a systems programming dialect of Scheme.  A PreScheme
compiler applies intensive source-to-source rewrites to the
interpreter source code and emits low-level C code.  When the output
is then compiled by an optimizing C compiler such as gcc, the result
is a very efficient and portable emulator.

\paragraph{Run-time system}

The virtual machine is initialized from a specified memory image
containing byte-compiled Scheme code and data.  Images (including
small stand-alone applications) are built either by a linker or by
writing out the state of an executing program.  A standard memory
image contains a Scheme run-time library ({\tt append}, {\tt read},
{\tt write}, etc.), a compiler from Scheme to the virtual instruction
set, and a command processor and debugger.  In this way Scheme 48 can
be configured to look like a conventional Lisp interpreter.

In addition to the Scheme run-time library and development
environment, library software includes support for multitasking,
modules (packages), hygienic macros (as described in the Revised$^4$
Scheme report), records, and exception handling.

\paragraph{Applications}

The Scheme 48 system is being used at several sites for research in
memory management, embedded systems, multiprocessing, and computer
system verification.  Scheme 48 was chosen as the platform for these
projects because of its internal tractability and flexibility.

\end{document}

ext: tex

max_stars_repo_name: takusuman/scsh

max_issues_repo_name: takusuman/scsh

max_forks_repo_name: takusuman/scsh


text:
\section{Physics Backends}
This section deals with the different physics backends shipping with the PixelLight \ac{SDK}.

\paragraph{Null}
\begin{itemize}
\item The null physics backend does nothing - can be useful if you e.g. are in debug mode and don't want have any physics.
\item PixelLight component name: PLPhysicsNull
\item Used \ac{DLL}s: \emph{PLPhysicsNull.dll}
\end{itemize}

\paragraph{Newton Game Dynamics}
\begin{itemize}
\item This is the preferred physics plugin of the PixelLight team because Newton Game Dynamics\footnote{Newton Game Dynamics can be downloaded from \url{http://newtondynamics.com/}} is really easy to use, offers a lot of geometry and joint types by default, has a nice interface (in fact just one header) and some usefull tool functions. Also the community is very active.
\item PixelLight component name: PLPhysicsNewton
\item Used \ac{DLL}s: \emph{PLPhysicsNewton.dll} and \emph{newton.dll}
\end{itemize}

\paragraph{\ac{ODE}}
\begin{itemize}
\item Currently not within the official PixelLight \ac{SDK}
\item \ac{ODE}\footnote{\ac{ODE} can be downloaded from \url{http://www.ode.org/}} is a well-known open source physics engine.
\item PixelLight component name: PLPhysicsODE
\item Used \ac{DLL}s: \emph{PLPhysicsODE.dll} and \emph{ode.dll}
\end{itemize}

\paragraph{PhysX}
\begin{itemize}
\item Currently not within the official PixelLight \ac{SDK}
\item PhysX\footnote{PhysX can be downloaded from \url{http://developer.nvidia.com/object/physx.html}} is a commercial multithreaded physics \ac{API} with support for the physics \ac{GPU}. Please keep in mind that the \emph{PhysX \ac{SDK} System Software} must be installed to be able to use PhysX - this may not be acceptable for each project.
\item PixelLight component name: PLPhysicsPhysX
\item Used \ac{DLL}s: \emph{PLPhysicsPhysX.dll} and \emph{PhysXLoader.dll}
\end{itemize}

max_stars_repo_name: ktotheoz/pixellight

max_issues_repo_name: PixelLightFoundation/pixellight

max_forks_repo_name: naetherm/PixelLight


text:
    \foldertitle{namedmat}{Matrices with Named Rows and Columns}{namedmat/Contents}

	Matrices with named rows and columns are returned as output arguments
from several IRIS functions, such as \url{model/acf}, \url{model/xsf},
or \url{model/fmse}, to facilitate easy selection of submatrices by
referrring to variable names in rows and columns.

Namedmat methods:

\paragraph{Constructor}\label{constructor}

\begin{itemize}
\itemsep1pt\parskip0pt\parsep0pt
\item
  \href{namedmat/namedmat}{\texttt{namedmat}} - Create a new matrix with
  named rows and columns.
\end{itemize}

\paragraph{Manipulating named
matrices}\label{manipulating-named-matrices}

\begin{itemize}
\itemsep1pt\parskip0pt\parsep0pt
\item
  \href{namedmat/select}{\texttt{select}} - Select submatrix by
  referring to row names and column names.
\item
  \href{namedmat/transpose}{\texttt{transpose}} - Transpose each page of
  matrix with names rows and columns.
\end{itemize}

\paragraph{Getting row and column
names}\label{getting-row-and-column-names}

\begin{itemize}
\itemsep1pt\parskip0pt\parsep0pt
\item
  \href{namedmat/rownames}{\texttt{rownames}} - Names of rows in
  namedmat object.
\item
  \href{namedmat/colnames}{\texttt{colnames}} - Names of columns in
  namedmat object.
\end{itemize}

\paragraph{Sample characteristics}\label{sample-characteristics}

\begin{itemize}
\itemsep1pt\parskip0pt\parsep0pt
\item
  {[}\texttt{cutoff}{]}(namedmat/cutoff{]} -
\end{itemize}

All operators and functions available for standard Matlab matrices and
arrays (i.e.~double objects) are also available for namedmat objects.

max_stars_repo_name: OGResearch/IRIS-Toolbox-For-Octave

max_issues_repo_name: OGResearch/IRIS-Toolbox-For-Octave

max_forks_repo_name: OGResearch/IRIS-Toolbox-For-Octave


text:
%-------------------------
% Resume in Latex
% Author : Sourabh Bajaj
% License : MIT
%------------------------

\documentclass[letterpaper,11pt]{article}

\usepackage{latexsym}
\usepackage[empty]{fullpage}
\usepackage{titlesec}
\usepackage{marvosym}
\usepackage[usenames,dvipsnames]{color}
\usepackage{verbatim}
\usepackage{enumitem}
\usepackage[hidelinks]{hyperref}
\usepackage{fancyhdr}
\usepackage[english]{babel}

\pagestyle{fancy}
\fancyhf{} % clear all header and footer fields
\fancyfoot{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}

% Adjust margins
\addtolength{\oddsidemargin}{-0.5in}
\addtolength{\evensidemargin}{-0.5in}
\addtolength{\textwidth}{1in}
\addtolength{\topmargin}{-.5in}
\addtolength{\textheight}{1.0in}

\urlstyle{same}

\raggedbottom
\raggedright
\setlength{\tabcolsep}{0in}

% Sections formatting
\titleformat{\section}{
  \vspace{-4pt}\scshape\raggedright\large
}{}{0em}{}[\color{black}\titlerule \vspace{-5pt}]

%-------------------------
% Custom commands
\newcommand{\resumeItem}[2]{
  \item\small{
    \textbf{#1}{: #2 \vspace{-1pt}}
  }
}

\newcommand{\resumeItemNoBold}[2]{
  \item\small{
    \textbf{#1}{#2 \vspace{-2pt}}
  }
}

\newcommand{\resumeSubheading}[4]{
  \vspace{-4pt}\item
    \begin{tabular*}{0.97\textwidth}[t]{l@{\extracolsep{\fill}}r}
      \textbf{#1} & #2 \\
      \textit{\small#3} & \textit{\small #4} \\
    \end{tabular*}\vspace{-8pt}
}

\newcommand{\resumeSubItem}[2]{\resumeItem{#1}{#2}\vspace{-4pt}}
\newcommand{\resumeSubItemNoBold}[2]{\resumeItemNoBold{#1}{#2}\vspace{-4pt}}

\renewcommand{\labelitemii}{$\circ$}

\newcommand{\resumeSubHeadingListStart}{\begin{itemize}[leftmargin=*]}
\newcommand{\resumeSubHeadingListEnd}{\end{itemize}}
\newcommand{\resumeItemListStart}{\begin{itemize}[leftmargin=*]}
\newcommand{\resumeItemListEnd}{\end{itemize}\vspace{-5pt}}

%-------------------------------------------
%%%%%%  CV STARTS HERE  %%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}

%----------HEADING-----------------
\begin{tabular*}{\textwidth}{l@{\extracolsep{\fill}}r}
  \textbf{\href{https://linkedin.com/in/alexlundberg/}{\Large Alex Lundberg}} & Email : \href{mailto:alex.lundberg@gmail.com}{alex.lundberg@gmail.com}\\
  \href{https://linkedin.com/in/alexlundberg}{https://linkedin.com/in/alexlundberg} & Mobile : 920-933-9805 \\
  \href{https://medium.com/@lundbird}{https://medium.com/@lundbird} & Madison, WI.
\end{tabular*}

%-----------EXPERIENCE-----------------
\section{Experience}
  \resumeSubHeadingListStart

  \resumeSubheading
  {CommonBond}{New York City, NY}
  {DevOps Engineer}{July 2019 - Current }
  \resumeItemListStart
      \resumeItem{GitlabCI}
        {Created CI for go projects which added parellelized build/test, code quality/security, regression tests, environment provisioning, and Kubernetes/ArgoCD deployments. Migrated majority of existing projects to new CI}
      \resumeItem{Terraform}
        {Managed all infrastructure with Terraform. Standardized all new terraform into two monorepos to manage resources and modules. Added Terragrunt tests, linting, and auto-docs. Used Atlantis for approvals.}
      \resumeItem{Kubernetes}
        {Maintained three Kubernetes clusters. Managed cluster autoscaling and upgrades using Kops. Installed third-party apps using Helm. Controlled routing with Traefik. Managed all application manifests in a monorepo.}
      \resumeItem{Monitoring}
        {Maintained Prometheus as monitoring and alerting solution. Created Prometheus rules and grafana dashboards. Researched and deployed multi-tenant long-term storage solution for Prometheus with Victoria-Metrics.}
      \resumeItem{Service Mesh}
        {Demo'd service mesh solutions Istio, Linkerd, and Maesh. Championed Linkerd service mesh within company. Deployed Linkerd with custom dashboard which dramatically improved monitoring with route level metrics}
      \resumeItem{On-Call}
        {Participated in on-call rotation with other DevOps engineers. Resolved errors in Gitlabci, Jenkins jobs, lambdas, firewalls, DNS, schema changes, Looker reporting, ETL failures, and Kubernetes deployments.}
      \resumeItem{Data Engineering}
        {Architected new data lake ETL framework with AWS-Glue. Created Terraform modules to deploy infrastructure and pyspark libraries to perform transformations. Setup connection to Snowflake.}
      \resumeItem{GitOps}
        {Created templated Kubernetes manifests which use Kustomize to management environment configuration and ArgoCD to synchronize git changes. Updated all active projects to use new templates.}
      \resumeItem{Security \& Compliance}
        {Was designated owner for over half of organization SOC2 controls. Enforced, tracked, and reported control status when working directly with auditor. }
      \resumeItem{Management}
        {Managed two engineers for four months. Migrated project management from Jira to Gitlab. Standardized support requests with templates. Ran all agile ceremonies}
      \resumeItemListEnd

    \resumeSubheading
      {S\&C Electric}{Chicago, IL}
      {DevOps Engineer Intern}{May 2018 - Aug 2018}
      \resumeItemListStart
        \resumeItem{CI}
          {Configured new testing machines into Jenkins pipelines. Troubleshooted build errors and network configuration.}

      \resumeItemListEnd

      \resumeSubheading
      {S\&C Electric}{Chicago, IL}
      {Software Engineer Intern}{Sep 2017 - Dec 2017}
      \resumeItemListStart
        \resumeItem{ML}
          {Created ML models with pandas and sklearn to predict failure causing events on injection molding machines}
      \resumeItemListEnd

    \resumeSubheading
      {Domtar}{Nekoosa, WI}
      {Software Engineer Intern}{Jan 2017 - Aug 2017}
      \resumeItemListStart
        \resumeItem{.NET}
          {Developed C\# apps that pull metrics, set limits, and display alarms/logs to operators and management.}
      \resumeItemListEnd

  \resumeSubHeadingListEnd

%-----------PROJECTS-----------------
\section{Selected Projects and Contributions}
  \resumeSubHeadingListStart
    \resumeSubItem{Gitlab-Python API}
        {Adds Kubernetes cluster management feature to Gitlab api.}
    \resumeSubItem{Linkerd Route Dashboard}
        {Provides a grafana dashboard showing route-level metrics for the Linkerd service mesh}
    \resumeSubItem{Redis Helm}
        {Provided fix to bug preventing high-availability of redis-clusters running on Kubernetes.}
    \resumeSubItem{AutoGui}
      {Personal open-source Python/C\# library for Windows GUI automation/testing using element properties}
  \resumeSubHeadingListEnd

\section{Programming Skills}
  \resumeSubHeadingListStart
    \item{
      \textbf{Technologies:}{ Gitlab, Kubernetes, Airflow, AWS, Terraform, Prometheus, Snowflake, Looker, NATS, Docker} \\
      \textbf{Languages:}{ Golang, Python, Java, C, SQL, C\#, NodeJS}
      \hfill
    }
  \resumeSubHeadingListEnd

  %-----------EDUCATION-----------------
\section{Education}
\resumeSubHeadingListStart
  \resumeSubheading
    {University of Wisconsin Madison}{Madison, WI}
    {B.S. Computer Science;  GPA: 3.75/4.00}{May 2019}
\resumeSubHeadingListEnd
\section{Active Certifications}
  \resumeSubHeadingListStart
    \resumeSubItemNoBold{}
    {AWS Solution Architect Associate, AWS Developer Associate, AWS SysOps Administrator Associate, Certified Kubernetes Administrator(CKA), Certified Kubernetes Application Developer(CKAD)}
  \resumeSubHeadingListEnd

%-------------------------------------------
\end{document}

max_stars_repo_name: lundbird/resume

max_issues_repo_name: lundbird/resume

max_forks_repo_name: lundbird/resume


text:
\section{Conclusions}
\label{sec:conclusions}

In this assignment, we created a generative model to do concept tagging.
The best model was the one described in \cref{sec:improvements}, using 4-gram and Kneser-Ney smoothing for the underlying language model.
The inclusion of words in the \texttt{O} tags brought a significant performance improvement:
the model reached $82.44\%$ precision, $83.04\%$ recall and a F1 score of $82.74\%$ on the test set.


text:
\documentclass[letterpaper, 11pt]{article}

\usepackage{multirow}
\usepackage{latexsym}
\usepackage[empty]{fullpage}
\usepackage{titlesec}
\usepackage{marvosym}
\usepackage[usenames,dvipsnames]{color}
\usepackage{verbatim}
\usepackage{enumitem}
\usepackage[hidelinks]{hyperref}
\usepackage{fancyhdr}
\usepackage[english]{babel}

\pagestyle{fancy}
\fancyhf{} % clear all header and footer fields
\fancyfoot{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}

% Adjust margins
\addtolength{\oddsidemargin}{-0.5in}
\addtolength{\evensidemargin}{-0.5in}
\addtolength{\textwidth}{1in}
\addtolength{\topmargin}{-.5in}
\addtolength{\textheight}{1.0in}

\urlstyle{same}

\raggedbottom
\raggedright
\setlength{\tabcolsep}{0in}

% Sections formatting
\titleformat{\section}{
  \vspace{-4pt}\scshape\raggedright\large
}{}{0em}{}[\color{black}\titlerule \vspace{-5pt}]

%-------------------------
% Custom commands
\newcommand{\resumeItem}[2]{
  \item\small{
    \textbf{#1}{#2 \vspace{-2pt}}
  }
}

\newcommand{\resumeSubheadTwo}[2]{
  \vspace{-1pt}\item
    \begin{tabular*}{0.97\textwidth}{l@{\extracolsep{\fill}}r}
      \textbf{#1} & #2
    \end{tabular*}\vspace{-5pt}
}

\newcommand{\resumeSmallSubheading}[1]{
  \item
    \textbf{#1}\vspace{-5pt}
}

\newcommand{\resumeSubheading}[4]{
  \item
    \begin{tabular*}{0.97\textwidth}[t]{l@{\extracolsep{\fill}}r}
      \textbf{#1} & \textbf{#2} \\
      \textit{\small#3} & \textit{\small#4} \\
    \end{tabular*}\vspace{-5pt}
}

\newcommand{\resumePoint}[2]{
  \item
    \begin{tabular*}{0.97\textwidth}[t]{l@{\extracolsep{\fill}}r}
      #1 & \textbf{\small #2}
    \end{tabular*}
}

\newcommand{\resumeSubItem}[2]{\resumeItem{#1}{#2}\vspace{-4pt}}

\renewcommand{\labelitemii}{$\circ$}

\newcommand{\resumeSubHeadingListStart}{\begin{itemize}[leftmargin=*]}
\newcommand{\resumeSubHeadingListEnd}{\end{itemize}}
\newcommand{\resumeItemListStart}{\begin{itemize}}
\newcommand{\resumeItemListEnd}{\end{itemize}\vspace{-5pt}}

%-------------------------------------------
%%%%%%  CV STARTS HERE  %%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}

%----------HEADING-----------------
\begin{tabular*}{\textwidth}{l@{\extracolsep{\fill}}r}
  \multirow{3}{*}{\textbf{\Huge{Ho Duc Hieu}}} & {\small Email: \texttt{\underline{\href{mailto:hoduchieu01@gmail.com}{hoduchieu01@gmail.com}}}}\\
   & {\small Github: \texttt{\underline{\href{https://github.com/hoduchieu01}{hoduchieu01}}}} \\
   & {\small Website: \texttt{\underline{\href{https://www.hoduchieu.tech/}{hoduchieu.tech}}}} \\
   & {\small Mobile: +84 9 42 96 00 25} \\
\end{tabular*}

%-----------EDUCATION-----------------
\section{Education}
  \resumeSubHeadingListStart
    \resumeSubheading
      {HUS High School for Gifted Students}{Hanoi, Vietnam}
      {Gifted class in Informatics}{Sep. 2016 – Jun. 2019}
  \resumeSubHeadingListEnd

%-----------EXPERIENCE-----------------
\section{Experience}
  \resumeSubHeadingListStart

    \resumeSubheading
      {Open Source Education Bot, Facebook}{Remote Work}
      {Core Maintainer}{Jun. 2020 – present}
      \resumeItemListStart
        \resumeItem{}
          {Build out a Messenger open source training bot for Developer Circles under guidance and mentorship
          from Facebook}
        \resumeItem{}
          {Collaborate with Facebook engineers to maintain the project, review pull requests, and manage issues}
        \resumeItem{}
          {Support and participate in Open Source Immersion initiative run by Facebook}
      \resumeItemListEnd

    \resumeSubheading
      {Institute of Mathematics, Vietnam Academy of Science and Technology}{Hanoi, Vietnam}
      {Student Researcher}{Jun. 2020 – present}
      \resumeItemListStart
      \resumeItem{}
        {Research Project: \textit{Aircraft Type Recognition Based on Orthogonal Convex Hull and Machine Learning Models}}
        \resumeItem{}
        {Received a research grant to work as a student researcher under the supervision of Associate Professor
        Phan ~ Thanh ~ An and conduct research on computational geometry and machine learning}
        \resumeItem{}
        {Hosted 4 scientific seminars on computational geometry and participated in graduate classes on convex optimization}
        \resumeItem{}
        {Scholar of International Graduate Summer School 2020, accumulated knowledge on analysis, linear programming, algebra, optimization and practical for modelling}

        \resumeItemListEnd

    \resumeSubheading
      {2020 MOST GASE Global Talent Internship Program Artificial Intelligence}{Taipei, Taiwan}
      {Virtual Internship}{Jun. 2020 – present}
      \resumeItemListStart
      \resumeItem{}
        {Got selected by Ministry of Science and Technology, Taiwan to take a research internship under the
        supervision of Distinguished Professor Jacky Baltes from National Taiwan Normal University}
      \resumeItem{}
        {Participated in all online activities including Orientation, Featured Speech: Artificial Intelligence and
        Green Tech, Mandarin \& Culture Course A, Cultural Experience and complete 6 weekly work logs}
      \resumeItemListEnd

      \resumeSubheading
      {Cinnamon AI Labs }{Hanoi, Vietnam}
      {Internship}{Jan. 2018 – Aug. 2018}
      \resumeItemListStart
      \resumeItem{}
        {Awarded Intelligence Fellows Program scholarship to join and complete an intensive AI training
        program focusing on natural language processing and image processing by Cinnamon AI engineers and
        2 AI expert lecturers}
        \resumeItem{}
        {Accumulated knowledge on computer vision, semantic segmentation, object recognition, lexical
        analysis, information retrieval, name entity recognition, deep learning for text processing}
      \resumeItemListEnd

      \resumeSubheading
      {Viettel Cyber Security, Viettel Group}{Hanoi, Vietnam}
      {Internship}{Aug. 2017 – Dec. 2017}
      \resumeItemListStart
      \resumeItem{}
        {Researched on machine learning to build an application in detecting wide-area botnet based on domain
        name resolution data of network operator for early detecting DDoS attacks}
        \resumeItem{}
        {Deployed system for detecting malicious domain names using Python with 98\% accuracy on 2,000,000
        domain names by using machine learning and deep learning}
      \resumeItemListEnd

  \resumeSubHeadingListEnd

\end{document}


text:
\subsection{Object-Oriented Programming (OOP)}

all variable types are objects. inc integers, floats, lists etc

max_stars_repo_name: adamdboult/nodeHomePage

max_issues_repo_name: adamdboult/nodeHomePage

max_forks_repo_name: adamdboult/nodeHomePage


text:
\hypertarget{haskell}{%
\section{Haskell - Higher-Order Functions}\label{haskell}}

Haskell functions can take functions as parameters and return functions as return values. A function that does either of those is called a higher order function.

\hypertarget{curried-functions}{%
\subsection{Curried Functions}\label{curried-functions}}

Functions with multiple arguments are also possible by returning
functions as results. Functions that take their arguments one at a time
are called \textbf{curried functions}.

\begin{lstlisting}[language=Haskell]
ghci> max 4 5
5
max :: (Ord a) => a -> a -> a
-- Can also be written like: max :: (Ord a) => a -> (a -> a)

multThree :: (Num a) => a -> a -> a -> a
multThree x y z = x * y * z
\end{lstlisting}

Curried functions are more flexible than functions on tuples, because
useful functions can often be made by partially applying a curried
function.

\hypertarget{currying-conventions}{%
\subsubsection{Currying Conventions}\label{currying-conventions}}

\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\tightlist
\item
  The arrow -\textgreater{} associates to the right.
\item
  As a consequence, it is then natural for function application to
  associate to the left
\end{enumerate}

\begin{tcolorbox}[colback=red!5!white,colframe=red!75!black]
Unless tupling is explicitly required, all functions in Haskell are normally defined in curried form.
\end{tcolorbox}

\subsubsection{Currying infix functions}

Infix functions can also be partially applied by using sections. To section an infix function, simply surround it with parentheses and only supply a parameter on one side. That creates a function that takes one parameter and then applies it to the side that's missing an operand.

\begin{lstlisting}[language=Haskell]
ghci> max 4 5
5
max :: (Ord a) => a -> a -> a
-- Can also be written like: max :: (Ord a) => a -> (a -> a)

multThree :: (Num a) => a -> a -> a -> a
multThree x y z = x * y * z
\end{lstlisting}

\clearpage
\subsection{Higher-Order function declaration}

\begin{lstlisting}[language=Haskell]
applyTwice :: (a -> a) -> a -> a
applyTwice f x = f (f x)
\end{lstlisting}

Before, we didn't need parentheses because -> is naturally right-associative. However, here, they're mandatory. They indicate that the first parameter is a function that takes something and returns that same thing. The second parameter is something of that type also and the return value is also of the same type. We could read this type declaration in the curried way, but to save ourselves a headache, we'll just say that this function takes two parameters and returns one thing. The first parameter is a function (of type a -> a) and the second is that same a.

\begin{lstlisting}[language=Haskell]
zipWith' :: (a -> b -> c) -> [a] -> [b] -> [c]
zipWith' _ [] _ = []
zipWith' _ _ [] = []
zipWith' f (x:xs) (y:ys) = f x y : zipWith' f xs ys

ghci> zipWith' (+) [4,2,5,6] [2,6,2,3]
[6,8,7,9]
\end{lstlisting}

The function zipWith' takes a function and two lists as parameters and then joins the two lists by applying the function between corresponding elements.

\hypertarget{map-function}{%
\subsection{Map Function}\label{map-function}}

The higher-order library function called map applies a function to every
element of a list.

\begin{lstlisting}[language=Haskell]
map :: (a -> b) -> [a] -> [b]

> map (+1) [1,3,5,7]
[2,4,6,8]
\end{lstlisting}

\hypertarget{filter-function}{%
\subsection{Filter Function}\label{filter-function}}

The higher-order library function filter selects every element from a
list that satisfies a predicate.

\begin{lstlisting}[language=Haskell]
filter :: (a -> Bool) -> [a] -> [a]

> filter even [1..10]
[2,4,6,8,10]
\end{lstlisting}

\clearpage
\hypertarget{foldr-function-folg-right}{%
\subsection{Foldr Function (Folg
right)}\label{foldr-function-folg-right}}

\begin{lstlisting}[language=Haskell]
f [] = v  //Neutral Element
f (x:xs) = x $\oplus$ f xs
\end{lstlisting}

f maps the empty list to some value v (Default value), and any non-empty
list to some function $\oplus$  applied to its head and f of its tail.

\begin{lstlisting}[language=Haskell]
//Example
sum = foldr (+) 0
\end{lstlisting}

\begin{figure}[H]
\centering
\includegraphics[width=0.5\textwidth]{figures/fold_examples.png}
\caption{Foldr examples}
\end{figure}

\begin{figure}[H]
\centering
\includegraphics[width=0.7\textwidth]{figures/foldr.png}
\caption{Foldr}
\end{figure}

\hypertarget{other-library-functions}{%
\subsection{Other Library Functions}\label{other-library-functions}}

The library function (.) returns the composition of two functions as a
single function.

\begin{lstlisting}[language=Haskell]
(.) :: (b -> c) -> (a -> b) -> (a -> c)
f . g = $\lambda$x -> f (g x)

example:
odd :: Int -> Bool
odd = not . even
\end{lstlisting}

\hypertarget{all}{%
\subsubsection{all}\label{all}}

The library function all decides if every element of a list satisfies a
given predicate.

\begin{lstlisting}[language=Haskell]
> all even [2,4,6,8,10]
True
\end{lstlisting}

\hypertarget{any}{%
\subsubsection{any}\label{any}}

Dually, the library function any decides if at least one element of a
list satisfies a predicate.

\begin{lstlisting}[language=Haskell]
> any (== ' ') "abc def"
True
\end{lstlisting}

\hypertarget{takewhile}{%
\subsubsection{takeWhile}\label{takewhile}}

The library function takeWhile selects elements from a list while a
predicate holds of all the elements.

\begin{lstlisting}[language=Haskell]
> takeWhile (/= ' ') "abc def"
"abc"
\end{lstlisting}

\clearpage

max_stars_repo_name: nortismo/mse-documentations

max_issues_repo_name: nortismo/mse-documentations

max_forks_repo_name: nortismo/mse-documentations


text:
\documentclass[11pt]{article}
\usepackage{times}
\usepackage{verbatim}
\sloppy
\makeindex

\begin{document}

\title{%
    Logol usage}
\author{%
    Olivier Sallou
    olivier.sallou@irisa.fr}

\maketitle

\begin{abstract}
 Logol is a pattern search and matching tool on genomic sequences.
\end{abstract}

\tableofcontents

\section{Introduction}

\label{sec:logol}
Logol is a logol grammar interpreter and a pattern search tool. It takes as input a biological sequence (DNA, RNA or protein), and a grammar file. The grammar is a logol grammar that describes a pattern to be found in the input sequence. Logol analyses the grammar and executes a program to match the pattern on the sequence. It returns a result file containing the matches with all required details.\\
Logol grammar is a highly descriptive language dedicated to biological sequence analysis. It defines sequence information with allowed mutations and morphism. Models and variables can be used to express a specific pattern and can be used to find repetition of a pattern along the sequence.\\
Logol is open source, and free of use.

\subsection{History}

\begin{itemize}
    \item 2011/09/29 Creation
\end{itemize}

\subsection{License}

    License CeCILL

\section{Definitions}

The term “should” will be used when an operation is not mandatory but highly recommended to perform the operation in the best conditions.\\
The term “must” will be used when a condition is mandatory to meet the program requirements.\\
The term “can” will be used to describe a program option (command-line or configuration or installation related) and is not limited to this option.\\
The term “may” will be used to define a condition that is not dependent upon the current program (cpu speed for example, cluster queue management...).

\section{Installation}

\subsection{Prerequisites}

\begin{itemize}
  \item JRE 1.6+
  \item Ruby
  \item Vmatch or Cassiopee software is required to run Logol. It is advised to install one first.
  \item SWI-Prolog if using package or SWI-prolog compilation.
  \item Sicstus 4+ if using Sicstus prolog compilation (not needed at runtime)
\end{itemize}
Cassiopee is a search with dna ambiguity and error support. Vmatch has better performances over large sequences (genomes) but does not support ambiguity.\\
Default is to use Cassiopee, which is open source. This gem must be installed manually:
\begin{verbatim}
gem install cassiopee
\end{verbatim}
Vmatch can be obtained from S. Kurtz at http://www.vmatch.de/.

\subsection{From a package}

To install the Logol package, copy the install package file to the final system (Linux) and execute  it (dpkg,rpm).
Configuration is located in /etc/logol and results are available in /var/lib/logol/results. Default is to use Cassiopee Ruby gem.

\subsection{From source}

Compilation additionally requires: ant 1.7+, jdk 1.6+, SWI-prolog 5.10+ or Sicstus 4+\\
Extract the code from SVN:\\
\fbox{svn checkout https://scm.gforge.inria.fr/svn/logolexec/vX.Y/LogolExec Logol}\\
Go in the directory and execute compilation:\\
\fbox{ant test\_sicstus}\\
or \\
\fbox{ant create-jar}\\\fbox{ant test\_swi}\\
This will create executables and run some unit tests. All tests should pass before configuring the application.

\section{Configuration}

 The file logol.properties contains the default configuration.\\
 Two directories are required to run Logol. The first one is the place where result files will be written. If running on a cluster, this directory must be accessible from all the nodes of the cluster. The second one is a temporary directory to hold temporary files (deleted after work).\\
 Many parameters are defined in this file, a description is available for each.\\
{\small
\begin{verbatim}
 ##
 # Configuration file for LogolMatch. Some properties may be override by
 # command-line parameters.
 ##
 # Minimum size to use to split a file to parallelize treatments
 minSplitSize=2000000
 # Maximum size to display a solution, 0 is no limit. Above the limit,
 # the variable is replaced by "-" character
 maxResultSize=0
 # Maximum size of a solution (used to optimize the search)
 #maxMatchSize=30000
 maxMatchSize=0
 # Temporary directory used for the analysis. Should be local to the node
 workingDir=/tmp/Logol
 # Directory where to place the results. In case of cluster usage,
 # result must be a shared directory between nodes
 dir.result=/tmp/Logol
 # Maximum length of a spacer when looking forward for a match
 #maxSpacerLength=10000
 maxSpacerLength=0
 # Maximum length of a variable in a match
 #maxLength=1000
 maxLength=0
 # Minimum length of a variable in a match
 minLength=2
 # Default strategy to use, 1 must be keep by default
 parentStrategy=1
 # Number of processor on computer running the analysis,
 # or number of available processors on DRM  nodes.
 # Can speed up the search process when sequence file can be splitted.
 nbProcessor=1
 # Max Number of jobs to run for a single sequence when used in DRM config.
 nbJobs=1
 # Default number to limit number of results (must be above 0)
 maxSolutions=100
 # Minimum size of tree index. In case of use of small sequences,
 # should be set to 2, else use 4. (see vmatch manual). This applies for all sequences.
 minTreeIndex=2
 # Host where is smtp server (if email required)
 smtp.host=localhost
 # Mail user for smtp host
 mail.user=
 # DRM queue command if a specific queue is to be used
 # Example for SGE: drm.queue= -q long
 drm.queue=
 # Suffix tool   0: Cassiopee (default), 1: Vmatch
suffix.tool = 0
suffix.path=
\end{verbatim}
}
Default configuration (except directories) should apply to most of usages, but parameters should be carefully studied to improve the performances of the software.\\
The configuration file described here is the default configuration file. However, a per-request configuration file can be specified in command-line, this allows to adapt the parameters to specific queries/sequences.

\section{Usage}

\subsection{Sequences}

Input sequences must be in a single  file in NCBI Fasta format. All headers must be like:\\
\small{
\begin{verbatim}
>gi|51511735|ref|nc_000018.8|nc_000018 test sequence for logol validation
acgcgcggta
 \end{verbatim}
}

References are not checked and can be any value.

\subsection{Web interface - Genouest web site only}

For the web interface, connect to the web container (http://webapps.genouest.org/LogolDesigner) at the application URL.\\
For LogolDesigner, an index page provides links to the online help and software as well as some screencasts.\\
For the Logolanalyser, an online help is available under URL at org.irisa.genouest.logol.LogolAnalyser/help/LogolAnalyser.html

\subsection{Command-line}

 Options specified in command-line superseeds default configuration options.\\
 Use programname.sh -h to get a list of available options.

\subsubsection{LogolMultiExec.sh}

LogolMultiExec.sh is an intermediate program only. It takes as input one or more sequences, and dispatch them to LogolExec.\\
If configuration allows it, it can also split a sequence in smaller part, in such a case, it is also in charge of merging the results fr the sequence. On DRM systems, it creates a new job for each (sub-)sequence. On non-DRM system, all (sub-)sequences are executed sequentially.\\
 A man page is available for options.

\subsubsection{LogolExec.sh}

Called by LogolMultiExec.sh, it can be run directly when using a single sequence. A man page is available for options.

\subsubsection{Grammar checks}

To check a Logol grammar file, one simply execute LogolExec.sh -check -g mygrammarfile.

\section{Results}

Results are zipped in a single file. There is one result file per input sequence, in XML format.\\
The model is the id of the model defined in the grammar. Variables are the detailled value of the match according to the grammar. The Id of the match is unique for the sequence result file. Reverse complement search, when selected, will have a begin position higher than end position.\\
Here is the DTD of the XML document:\\
{\small
\begin{verbatim}
 <!ELEMENT sequences ( fastaHeader, grammar, model, match+ ) >
 <!ELEMENT fastaHeader ( #PCDATA ) >
 <!ELEMENT grammar ( #PCDATA ) >
 <!ELEMENT match ( model, id, begin, end, errors, distance, variable+ ) >
 <!ELEMENT model ( #PCDATA ) >
 <!ELEMENT id ( #PCDATA ) >
 <!ELEMENT begin ( #PCDATA ) >
 <!ELEMENT content ( #PCDATA ) >
 <!ELEMENT end ( #PCDATA ) >
 <!ELEMENT errors ( #PCDATA ) >
 <!ELEMENT distance ( #PCDATA ) >
 <!ELEMENT variable ( begin, end, size, errors, content, text ) >
 <!ELEMENT size ( #PCDATA ) >
 <!ELEMENT text ( #PCDATA ) >
 <!ATTLIST variable name CDATA  #REQUIRED >
\end{verbatim}
}

\section{FAQ}
\begin{itemize}
  \item Out of memory issue when running LogolMatch programs:

 Depending on sequence size, it may be required to increase the JVM max memory. To do so, in case of problem, edit the .sh files and increase the -Xmx parameter value (should be at least 2 times the sequence size).
  \item How to add a cost specific function:

 Create a program in LogolMatch/tools directory. Script should return the number of errors found to stdout and have execution rights for the LogolMatch? user.
  \item I have some grammar errors when running a search

 Look at the error message, it usually specify the kind of error.
  \item I have no results or result file is empty

 Look the stdout information messages, there could be grammar issues, or suffix tree file creation issue.   In case of use via a DRM system, edit the generated xxx.ojobid and xxx.ejobid to get job stream information. If this is not enough, it is possible to increase the level of information in the file LogolMatch/log4j.properties. Modify the level of log4j.logger.org.irisa.genouest.logol and lo4j.logger.org.irisa.genouest.logol.StreamGobbler from ERROR to INFO or DEBUG.
\end{itemize}

\end{document}

max_stars_repo_name: genouest/logol

max_stars_repo_licenses: DOC Ruby

max_issues_repo_name: genouest/logol

max_issues_repo_licenses: DOC Ruby

max_forks_repo_name: genouest/logol

max_forks_repo_licenses: DOC Ruby


text:
\chapter{WAMIT: Output Files}
\label{chap:WamitOutput}

\input{chaps/tables/Chap.WamitOutput.Notation.tex}

WAMIT can use several methods to calculate the normalized second order wave force.  Each of those methods produces a different type of output file.  The calculation methods available to the WAMIT2 module are limited by the WAMIT output files that are available.  \Cref{tab:Wamit2MethodsByFileType} shows what second order force calculation methods are available depending on the WAMIT files available\cite{WAMIT}.
\Cref{tab:WamitOutputUnits} lists the variables used in this document to refer to the various WAMIT outputs.  Note that the notation here differs with the notation used in the WAMIT manual and in Tiago's writings\cite{duarte:2014,WAMIT}.

\section{WAMIT Output}
\Cref{tab:WamitOutputFormat} lists the format for each of the WAMIT output files.
Within these files, the angles and frequencies do not need to be evenly spaced.  Also, it should also be noted that the discretization between $\omega_1$ and $\omega_2$ are not necessarily the same.  This also applies to the angles $\beta_1$ and $\beta_2$.

A value for the period $\tau = 0$ in the WAMIT output file means that the frequency $\omega = \infty$.  A period of $\tau < 0$ is used in the WAMIT output file to indicate $\omega = 0$.

The QTF in the WAMIT output files does not need to be complete since the following relationships are true:
\begin{equation}
   \bar{F}^\text{-}_{mn} = \bar{F}^{\text{-}~*}_{nm}   \qquad \text{and} \qquad   \bar{F}^{+}_{mn} = \bar{F}^{+}_{nm},
\label{eq:WAMIT:QTF_sym}
\end{equation}
where $*$ indicates the complex conjugate.  Note that this implies that the diagonal terms in the second order difference QTF, $\bar{F}^\text{-} (\omega_m,\omega_m) =\bar{F}^{\text{-}~*} (\omega_m,\omega_m)$, are real valued.

The normalized second order wave force in the WAMIT output files is non-dimensional (see Ref~\cite{WAMIT} section 11.6 for details).  These are written as
\begin{equation}
   \bar{F}_k^\text{-}   = \frac{\tilde{F}_k^\text{-}}{\rho g L^a A_m A^*_n}
         \qquad\text{and}\qquad
   \bar{F}_k^{+}        = \frac{\tilde{F}_k^{+}}{\rho g L^a A_m A_n},
\label{eq:QTF:nondimensional}
\end{equation}
where $a=1$ for forces ($k = 1, 2, 3$) and $a=2$ for moments ($k=4, 5, 6$), $\bar{F}_k$ and $\tilde{F}_k$ are respectively the non-dimensioned and dimensioned QTFs for the $k^\text{th}$ force component,
and $A_m$ and $A^*_n$ are the complex wave and complex conjugates of the amplitudes. Other variables are listed in \Cref{tab:2ndOrdNotation}.
In order to simplify using the dimensioned wave force in calculations, \Cref{eq:QTF:nondimensional} can be rewritten as
\begin{equation}
    \tilde{F}_k^\text{-}   = A_m A^*_n \left(\bar{F}_k^\text{-}   \rho g L^a\right)    = A_m A^*_n  {F}_k^\text{-}
         \qquad\text{and}\qquad
     \tilde{F}_k^+         = A_m A_n   \left(\bar{F}_k^+          \rho g L^a\right)    = A_m A_n    {F}_k^+,
\label{eq:QTF:dimensional}
\end{equation}
where ${F}_k^\pm$ is partially dimensioned by $\rho g L^a$, but does not include the wave amplitudes.

\input{chaps/tables/Chap.WamitOutput.Format.tex}

\section{Reading WAMIT Data Files}
\label{sec:WamitOuput:Read}
\todo[inline]{Make pretty version of \Cref{fig:2ndOrdRead}}

\subsection{First order WAMIT output files (.3)}
The algorithm used in reading in the first order WAMIT data files involves scanning through the data file multiple times.  This is roughly summarized as:
\begin{enumerate}
   \item{Get wave period information}
   \begin{enumerate}
      \item{Read through file to find the number of wave periods}
      \item{Allocate array to hold the wave periods in the order they appear in the file (\varname{WAMITPer} and \varname{WAMITFreq})}
      \item{Allocate array \varname{SortFreqInd} to hold the ordered indices of the sorted frequencies}
      \item{Allocate array \varname{HdroFreq} to hold the sorted frequencies}
      \item{Read through file to populate the \varname{WAMITPer}, \varname{WAMITFreq} and \varname{SortFreqInd} arrays}
      \item{Read through file and store the sorted frequencies in \varname{HdroFreq}}
   \end{enumerate}
   \item{Get wave directions}
   \begin{enumerate}
      \item{Read through first wave period to get the directions}
      \item{Allocate array to hold the wave directions in the order they appear in the file (\varname{WAMITDir})}
      \item{Allocate array \varname{SortWvDirInd} to hold the ordered indices of the sorted directions}
      \item{Allocate array to hold the ordered indices of the sorted directions (\varname{HdroWvDir})}
      \item{Read through file to populate \varname{WAMITDir} and assemble}
      \item{Read through file and store the sorted directions in \varname{HdroWvDir}}
   \end{enumerate}
   \item{Populate the complex wave information \varname{HdroExctn}}
   \begin{enumerate}
      \item{Read through the file again to populate \varname{HdroExctn}(\varname{SortFreqInd}(K),\varname{SortWvDirInd}(J),I)}
   \end{enumerate}
\end{enumerate}

There are two subtle assumptions about the organization of the WAMIT output file that are made here.  First, the file is always organized such that the wave direction is looped through for each value of the wave period.  The second assumption is that all the force components are grouped for a given wave direction and wave period.  In the case of the second order WAMIT data, this may not be true.

\subsection{Second order WAMIT output files}

The calculations for the second order WAMIT output are very time consuming.  In order to help alleviate this problem, WAMIT allows the user to specify exactly which combinations of wave heading and wave periods to calculate in a .PT2 input file.  As a result, the output file may be very sparse, and may not be ordered in any meaningful way.  Therefore, a different approach that does not make assumptions about the ordering of the file should be used.

\begin{figure}[H]
   \centering
   \includegraphics[height=8in]{chaps/figures/WAMIT2--read_Algorithm.jpg}
   \caption{Overview of scheme for reading in 2nd order WAMIT files with two periods (.10, .11, .12).  The algorithm for reading in 2nd order WAMIT files with only one period (.7, .8, .9) should be a simplified version of this algorithm.
      \label{fig:2ndOrdRead}}
\end{figure}

The overall idea of this approach is to read the entire data file a temporary array in memory, and then figure out how many unique values of $\omega_1, \omega_2, \beta_1,$ and $\beta_2$ there are.  Once this has been determined, the arrays storing the sorted frequencies and directions can be allocated along with the array for storing $F^\pm$.  In addition to the array holding the data, a mask array (boolean?) of equal size must be created to store information regarding which values are populated.  This will be necessary for knowing how sparse the array is and for interpolation algorithms that can handle limited sparseness.

Due to the number of times the file would need to be read for this algorithm, it will likely be faster to read everything into memory and then process rather than rewind the file many times (disk IO is slow).  This does impose some memory usage that could be avoided, but given how long it takes WAMIT to perform these calculations, the files are likely to be small (at least in comparison to the wind files).

\clearpage

\section{WAMIT Data Integrity Checks}
\label{sec:WamitOutput:Checks}
A few checks can be enforced to ensure that the calculations within the \modname{WAMIT2} module can be performed using the provided data.  If the limits of frequency or wave direction are set outside what is provided within the WAMIT output data, an error should be issued and the program aborted.  This could be checked during the calculations by checking if either $\omega < \min{(\tilde{\omega})}$ or $\omega > \max{(\tilde{\omega})}$ is true, where $\tilde{\omega}$ is the array of frequencies given in the WAMIT output files.  Alternatively, this could be checked immediately after reading the WAMIT output file by checking against the limits in the \HD input file as follows:
\begin{eqnarray}
   \varname{WvLowCOffD} > \min{(\tilde{\omega}_D)}\\
   \varname{WvHiCOffD}  < \max{(\tilde{\omega}_D)}
\label{eq:WAMIT:DataLimitTest:Diff}
\end{eqnarray}
for difference QTF files, and
\begin{eqnarray}
   \varname{WvLowCOffS} > \min{(\tilde{\omega}_S)}\\
   \varname{WvHiCOffS}  < \max{(\tilde{\omega}_S)}
\label{eq:WAMIT:DataLimitTest:Sum}
\end{eqnarray}
for sum QTF files where $\tilde{\omega}_D$ and $\tilde{\omega}_S$ are the arrays of frequencies found in the difference and sum WAMIT files, respectively.

In addition to checking the frequency range of the WAMIT output files, the wave direction range should also be checked.  The values can be checked agains the \varname{WaveDirMin} and \varname{WaveDirMax} variables (derived from \varname{WaveDir} and \varname{WaveDirRange} in the \HD input file -- see \Cref{chap:MultiDir}).  Care needs to be taken to account for a possible boundary between positive and negative direction headings ($\pi$ and $-\pi$ directions).
%\todo{Expand this to include eqs/pseudocode for checking of WAMIT data files}

%note on the header lines

\endinput
\section{Additional Data Requirements for the WAMIT2 Module}
\label{sec:WamitOutput:Req}

We will add some additional requirements for second order WAMIT files as they become evident (\emph{i.e.} frequency limits).

\begin{table}
\end{table}

max_stars_repo_name: NWTC/HydroDyn

max_issues_repo_name: NWTC/HydroDyn

max_forks_repo_name: NWTC/HydroDyn


text:
This chapter includes the specifications for all of the Role/System pair interfaces depicted in figure~\ref{fig:UCDTopLevel} on page~\pageref{fig:UCDTopLevel}.
Each interface section first outlines the purpose the interface serves.
Core functionality for each interface is exposed through the attribute functions (see section \ref{sec:Attributes}).
Each interface section includes a table of the supported attributes for that interface.
The table contains the \textit{suggested} attributes that the implementation should support for each interface.
The implementation can choose to implement additional, some subset, or none of the attributes listed for that interface.
As previously mentioned, the implementation must implement all attribute functions whether individual attributes are supported or not.
If a particular attribute is not supported for that interface the implementation should return \texttt{PWR_RET_NOT_IMPLEMENTED}.

In addition to the attribute functions, other Core (Common) functions are included in this specification.
Each individual interface section will enumerate the Core (Common) functions that the specification suggests are applicable for that interface (see chapter \ref{chap:Common} for details regarding Core (Common) functions).
Again, the implementation must implement these functions but may choose not to support them for a particular interface.

Each section also includes the High-Level (Common) functions that are applicable to that section (see chapter \ref{chap:HighLevel} for details regarding High-Level (Common) functions).
These functions are functions that are applicable to more than one Role/System pair interface.

Finally, individual interface sections may also contain interface specific functions.
These are functions that, at the time of their addition to the specification, are specific to one Role/System pair.
This does not indicate that the function cannot be supported by an implementation for other Role/System pairs, only that the authors did not recognize a use for other interfaces at the time of addition to the specification.

\section{Operating System, Hardware Interface}\label{sec:OSHW}
\input{OSHW}

\newpage
\section{Monitor and Control, Hardware Interface}\label{sec:MCHW}
\input{MCHW}

\newpage
\section{Application, Operating System Interface}\label{sec:AppOS}
\input{AppOS}

\newpage
\section{User, Resource Manager Interface}\label{sec:UserRM}
\input{UserRM}

\newpage
\section{Resource Manager, Operating System Interface}\label{sec:RMOS}
\input{RMOS}

\newpage
\section{Resource Manager, Monitor and Control Interface}\label{sec:RMMC}
\input{RMMC}

\newpage
\section{Administrator, Monitor and Control Interface}\label{sec:AdminMC}
\input{AdminMC}

\newpage
\section{HPCS Manager, Resource Manager Interface}\label{sec:MgrRM}
\input{MgrRM}

\newpage
\section{Accounting, Monitor and Control Interface}\label{sec:AccMC}
\input{AccMC}

\newpage
\section{User, Monitor and Control Interface}\label{sec:UserMC}
\input{UserMC}