\chapter{CPU, Scheduling, and OS Services}

\section{Measurement overhead}
In this part, we measure the overhead of reading time(read processor cycle counter) and the overhead of using a loop to measure many iterations of an operation. We will use these data to make other experiments more accurate by removing the overhead.

\paragraph{Methodology}
According to the hint, we googled rdtsc instruction and find useful helper functions rdtsc()\cite{rdtsc}, written in inline assembly form that return processor cycle count.

In order to record the overhead of reading time, we call rdtsc() twice and subtract them. To measure the overhead of using a loop, we apply this method
\lstinputlisting[language=C]{hello.c}
We run it many times, and get the overhead by (end - start) / loops.

\paragraph{Predictions}
As for reading time, I guess the overhead of software is 8 cycles which I get from the inline assembly code. For the hardware layer, I guess it is 9 cycles to perform read, binary operation, write. So total 17 cycles for reading time;

As for iterations of an operation, I guess software takes 3 cycles to do branch and increment and hardware takes 1 or 2 cycles as overhead, so it is about 5 cycles for iterations.

\paragraph{Results}
We present our measure results.

\begin{center}
\begin{tabular}{| p{2cm} | p{3cm} | p{3cm} | p{2cm} | p{3cm} | p{1cm} }
Operation  & Base Hardware Performance  & Estimated Software Overhead  & Predicted Time  & Measured Time  & Std  \\
\hline
Reading time & 9 cycles& 8 cycles& 17 cycles& 19.51327 cycles  & 1.9087  \\
Using a loop  & 2 cycles& 3 cycles& 5 cycles& 5.726476 cycles & 0.1728 \\
\end{tabular}
\end{center}

\paragraph{Discussion}
My prediction is pretty successful, very close to the measure value. Because we adopted low-overhead mechanism to measure operations and these operations are visible to use, we could follow and predict all the instructions they perform. So our prediction and methodology could get this result.

\section{Procedure call overhead}
In this part, we measure the overhead of Procedure call.

\paragraph{Methodology}
In order to get accurate result, we have to tell compiler not to inline the procedure call. So We use this attribute ((noinline)) to tell gcc not to inline procedure call and I turn off OPTIMIZE.

We did not process the arguments in procedure call. We iterate about 100000 times, I record the counter before the loop and record it again after the loop, then remove the iteration overhead.

\paragraph{Predictions}
We predicte when adding more arguments to procedure call, the cycle count should increase linearly. Because we should push each argument to the stack. Besides, procedure call will maintain stack pointers, and instruction like call and ret. When there are no arguments, the cycle should be about 6 cycles, 4 cycles for call, ret and maintain stack pointers and 2 cycles for hardware. When adding one more arguments, we assume hardware and software both add 1 cycles.

\paragraph{Results}
We present our measure results(unit : cycle).

\begin{center}
\begin{tabular}{l*{6}{c}r}
Args              & Hardware  & Software  & Overall  & Measured  & Remove overhead & Std\\
\hline
0 args & 2 & 4 & 6 & 7.1 & 2.1 & 0.16788\\
1 args & 3 & 5 & 8 & 7.3  & 2.3 & 0.19758 \\
2 args & 4 & 6 & 10 & 7.7 & 2.7 & 0.17281 \\
3 args & 5 & 7 & 12 & 8.6 & 3.6 & 0. 21230  \\
4 args & 6 & 8 & 14 & 9.3 & 4.3 & 0. 26652 \\
5 args & 7 & 9 & 16 & 10.0 & 5.0 & 0.17272 \\
6 args & 8 & 10 & 18 & 10.9 & 5.9 & 0.20281 \\
7 args & 9 & 11 & 20 & 13.1 & 8.1 & 0.22101 \\
\end{tabular}
\end{center}

\begin{figure}[htbp] %  figure placement: here, top, bottom, or page
   \centering
   \includegraphics[width=5in]{./pics/pcall.jpg}
   \caption{procedure call overhead}
   \label{fig:procedure call overhead}
\end{figure}

\paragraph{Discussion}
The measurement statistics is a little strange. Like we have predicted, the overhead for a procedure call scales about linearly with the number of arguments passed in; However, the cycles procedure calls take are less than we have predicted.

So I tried another methodology. In a loop, first I record the counter, then do procedure call and record again. When calculating, I remove the overhead of counter reading time. But I still get similar results.

I have guessed that compiler may use registers to store parameter in the loop so as to reduce many memory operations. So I look at assembly code but it is pretty regular stack operation.

With the increasing of iteration time, the average cycles decrease a lot. There may be some mechanism like cache in the hardware.

\paragraph{Question} What is the increment overhead of an argument? The increment overhead is about 1 cycle per  argument, pushing parameters to stack.

\section{System call overhead}
In this part, we measure the overhead of System call. There are more than 100 systems in Mac OS and Linux like exit, fork, open and getpid. And the overhead varies a lot. For example, System call like fork will use more cycles than getpid. Because fork will creates a new process by duplicating the calling process which will use much more resources than getpid. So we aim to choose the one that use fewer CPU cycles. The minimal cost can be emulated by measuring the cost of getpid() or getppid().

\paragraph{Methodology}
Because in my operating system getpid() will cache the result. So we use a trick here. In each iteration, we fork a child process, and call getpid() in child process and then reap this child process. So every iteration we actually call getpid() in a bread-new  process, as a result we will never call getpid() on a cached one. So we solved this problem.

As before, we iterate about 100000 times, record the time before getpid() and after getpid(), then calculate the average cycles.

\paragraph{Predictions}
As for hardware, it may take 200 cycles to deal with registers. As for software, it is hard to estimate.  I know the operations including save current state to memory, trap into kernel, then kernel provide service and finally restore previous state. I measure it about 10000 cycles.

\paragraph{Results}
We present our measure results.

\begin{center}
\begin{tabular}{| p{2cm} | p{3cm} | p{3cm} | p{2.5cm} | p{2.5cm} | p{2cm}}
System call  & Base Hardware Performance  & Estimated Software Overhead  & Predicted Time  & Measured Time  & Std \\
\hline
getpid() & 200 cycles& 10000 cycles& 10200 cycles& 43020 cycles & 1702\\
\end{tabular}
\end{center}

\paragraph{Discussion}
Our estimates were lower than the measured result. That is to say, the overhead of user and kernel mode switch is more than we have imagined. So, caching some system call results may be a good idea. Because some stupid system call benchmark will repeatedly call getpid ().

\paragraph{Question} How does it compare to the cost of a procedure call? The cost of a system call is much larger than that of a procedure call. Because a system call involves switch between user mode and kernel mode. Furthermore, kernel will provide service to the caller and sometimes will have I/O operations.

\section{Task creation time}
In this part, we measure task creation time, measure the time to create and run both a process and a kernel thread.

\paragraph{Methodology}
For process, we use fork() to create a new process.  Each iteration we record time before fork(). Then there is a problem : Who executes first after fork(), parent or the child? In general, nothing can be said about the relative order of their execution. So we can not record time immediately after fork(). Here is our trick : in child process, we simply exit(); But in parent process, we use wait(NULL) and then record time. So after fork(), first parent process will give CPU to child process, then child process exit and kernel give CPU to parent process again. So there are two context switches. Then we subtract the two context switch overheads and get the final results. We run there procedure many times and get the average.

Things are quiet similar for kernel thread. We use pthread to create a task. Whenever we create a new thread, in the thread function we use pthread\_exit() to kill thread immediately, which will make measurement accurate.

\paragraph{Predictions}
It is difficult to predict accurately. What I am quiet sure is that creating a thread kernel is much more cheaper than creating a process. Because threads share many resources like file descriptors.

THOMAS E. ANDERSON in 1991 report it takes 11300 microseconds to fork process and 948 microseconds to create thread. \cite{task} In 1991， the CPU frequency of Intel 80486SX is 20MHz. Based on CPU frequency at that time, which are about 200000 cycles to fork process and 20000 cycles to create thread. So I do the following predictions.

For process, I guess the hardware overhead are 10000 cycles, and the software overhead is 190000 cycles.
For thread, I guess the hardware overhead are 1000 cycles, and the software overhead is 19000 cycles.

\paragraph{Results}
We present our measure results.

\begin{center}
\begin{tabular}{| p{2cm} | p{3cm} | p{3cm} | p{2.5cm} | p{2.5cm} | p{2cm} }
Task creation  & Base Hardware Performance  & Estimated Software Overhead  & Predicted Time  & Measured Time  & Std \\
\hline
process & 10000 cycles& 190000 cycles& 200000 cycles& 311751  cycles & 11321 \\
kernel thread    & 1000 cycles& 19000 cycles& 20000 cycles& 16509 cycles & 827\\
\end{tabular}
\end{center}

\paragraph{Discussion}
First, the cost of creating a process is much more expensive than a thread as the data indicated. Because thread is a light process that share many resources so it use fewer CPU cycles.

\paragraph{Question} How do they compare?
The cost of creating a new process is expensive. Each process has its own address space. Even with COW, there are still many memory copy operation and other overheads. Compared with process, kernel thread can share process resources and can be used in many situations. For example, in a web server, there are many clients and it is impossible to respond to so many clients using process creation model.

\section{Context switch time}
In this part, we measure the time to context switch from one process to another, and from one kernel thread to another.

\paragraph{Methodology}
As the hint indicated, blocking pipe will force context switch and we tried, it did do context switch so we use blocked pipe to perform context switch.

For process, we first record the time before read pipe, because read will block so it will switch to child process. Then we record the end time and write end time to pipe. So when parent process resume, parent process can collect the end time and do the calculation; Besides, we use wait() to reap resources.

For thread, we perform similar operations. After pthread\_create(), we record start time and use read to block pipe. At thread function we record the end time and write this value to pipe. So main thread could collect data and print the statistics.

At the end of each iteration, we all reap the resource in order to get accurate results. When there are many resources that are not reaped, our machine may run slower than usual.

\paragraph{Predictions}
What I am sure is that process context switch is much more expensive than thread context switch.

For process context switch, I think hardware cycles are 20000 cycles and software are 5000 cycles.

For thread context switch, I think hard cycles are 2000 cycles and software are 500 cycles.

\paragraph{Results}
We present our measure results.

\begin{center}
\begin{tabular}{| p{2cm} | p{3cm} | p{3cm} | p{2.5cm} | p{2.5cm} | p{2cm} }
Context switch              & Base Hardware Performance  & Estimated Software Overhead  & Predicted Time  & Measured Time & Std  \\
\hline
process & 20000 cycles& 5000 cycles& 25000cycles & 133221 cycles & 3428 \\
kernel thread    & 2000 cycles& 500 cycles& 2500 cycles& 9752 cycles & 439 \\
\end{tabular}
\end{center}

\paragraph{Discussion}
We predict well on the scale of process context switch and thread context switch. A process contains much more information than a kernel thread, so it is expensive of course just like previous experiments on creation time overhead.

The cost of process context switch is as expensive as fork a new process and so as a kernel thread. So context switch is very important to go deep into. How to reduce the overhead of context switch is of great significance.

\paragraph{Question} How do they compare?
In my experiment, kernel threads are approximately 14 times faster in performing a context switch than processes. So in some applications like web server, threads are much more cheaper than processes and recommended.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% LaTeX Template: Project Titlepage Modified (v 0.1) by rcx
%
% Original Source: http://www.howtotex.com
% Date: November 2017
%
% This is a title page template which be used for articles & reports.
%
% This is the modified version of the original Latex template from
% aforementioned website.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\documentclass[12pt]{report}
\usepackage[a4paper]{geometry}
\usepackage[myheadings]{fullpage}
\usepackage{fancyhdr}
\usepackage{lastpage}
\usepackage{graphicx, wrapfig, subcaption, setspace, booktabs}
\usepackage[T1]{fontenc}
\usepackage[font=small, labelfont=bf]{caption}
\usepackage{fourier}
\usepackage[protrusion=true, expansion=true]{microtype}
\usepackage[english]{babel}
\usepackage{sectsty}
\usepackage{url, lipsum}

\newcommand{\HRule}[1]{\rule{\linewidth}{#1}}
\onehalfspacing{}
\setcounter{tocdepth}{5}
\setcounter{secnumdepth}{5}

%-------------------------------------------------------------------------------
% HEADER & FOOTER
%-------------------------------------------------------------------------------
\pagestyle{fancy}
\fancyhf{}
\setlength\headheight{15pt}
\fancyhead[L]{Student ID\@: 101006753}
\fancyhead[R]{Carleton University}
\fancyfoot[R]{Page \thepage\ of~\pageref{LastPage}}
%-------------------------------------------------------------------------------
% TITLE PAGE
%-------------------------------------------------------------------------------

\begin{document}

\title{ \HRule{0.5pt} \\
		\LARGE \textbf{\uppercase{Proof on the Uniqueness of the Sicherman dice}}
		\HRule{2pt} \\ [0.5cm]
		\normalsize \today \vspace*{5\baselineskip}}

\date{}

\author{
		Name: Robert Lech \\
        Student ID\@: 101006753 \\
		Carleton University \\
		Department of Mathematics }

\maketitle

%-------------------------------------------------------------------------------
% Section title formatting
\sectionfont{\scshape}
%-------------------------------------------------------------------------------

%-------------------------------------------------------------------------------
% BODY
%-------------------------------------------------------------------------------

\section*{Introduction}
Often times, the jump from the abstract to the real-life application is what makes a proof so interesting. We
commonly use number theory and group theory to prove properties of encryption methods. We use the
representation theory of finite groups to infer structural information about molecules in chemistry. Lastly,
we note that problems in discrete probability rely heavily on techniques developed in combinatorics.
Generally, it's the ability to connect the real-world problems to questions in mathematics is what really
allows us to properly tackle them in systematic, and sometimes simple, ways. For the purposes of our paper, we
attempt to do exactly this to a well-known question in probability.

In this paper, we pose the problem, ``Suppose we have a pair of 1 to 6 dice. What other pair\@(s) of dice are
there that provide the same probability distribution?'' Suppose we had a die labelled, $1,2,2,3,3,4$ and
another labelled $1,3,4,5,6,8$. It's clear from Figure~\ref{fig:wikipedia_table} that there is 1 way for a
pair of dice to be rolled and produce a sum of 2, 2 ways to produce a sum of 3, and so on. Now, suppose we
have a different pair of dice. Therefore, we can conclude that both pairs of dice have the same probability
distribution when rolled. However, what's not as immediately clear is that this odd pair of dice (now called
the \textit{Sicherman dice}) is the only other pair of 6-sided dice, with positive labels, with this exact
probability distribution.

\begin{figure}[h]
  \includegraphics[width=\linewidth]{images/wikipedia_table.png}
  \caption{A table showing that the probability distribution of both dice are the same.}
  \label{fig:wikipedia_table}
\end{figure}

We'll prove this by employing the Unique Factorization Theorem. After this, we'll then apply this to three
other scenarios: a scenario with two tetrahedral dice, a scenario with three cubic dice, and a scenario with
two octahedral dice. We then conclude by restating just how powerful and general this technique is.

%-------------------------------------------------------------------------------
% Background Information
%-------------------------------------------------------------------------------

\section*{Background Information}
In this section, we state all the algebraic definitions necessary. We start from the very beginning and work
our way forward. We let $G$ be a set together with a binary operation which assigns an ordered pair $(a,b)$ of
elements in $G$ to an element denoted $ab$. We say $G$ is a group under this operation if the following three
properties are satisfied: associativity, the existence of an identity element, and for each element, the
existence of an inverse of that element. Moreover, a group is \textit{Abelian} if the elements commute. We now
build upon this notion of a group by introducing our definition of a \textit{ring}. A \textit{ring} is a set
with two binary operations, addition (denoted by $(a+b)$) and multiplication (denoted $ab$) such that a ring
forms an Abelian group under addition and having an associative multiplication that is left and right
distributive over addition. When a ring contains an identity element under multiplication, we call it the
\textit{unity}. We take a step forward and define an \textit{integral domain} is a commutative ring with unity
and no \textit{zero-divisors}; that is, no non-zero elements $a,b$ such that $ab=0$. Lastly, we say that if a
non-zero element of a ring has a multiplicative inverse, we say that it is a \textit{unit}.

We now introduce our rings of interest. Let $R$ be a commutative ring. Then
$R[x]=\{ a_{n}x + \cdots + a_{0} | a_{i}\in R\}$ is called the \textit{ring of polynomials over $R$ in the
indeterminate $x$}. We're interested in $Z[x]$ under ordinary addition and multiplication, which is known to
be an integral domain since $Z$ is an integral domain. From this definition, we can define a particular type
of polynomial. Let $D$ be an integral domain. Let $f(x)\in D[x]$ be a non-zero or non-unit over $D[x]$. If for
every $f(x)=g(x)h(x)$, either $g(x)$ or $h(x)$ is unit, then $f(x)$ is \textit{irreducible}. Otherwise, it's
\textit{reducible}. With all these definitions in place, we introduce the final ingredient we'll need to prove
the uniqueness of the Sicherman dice. This is the \textit{Unique Factorization Theorem} which claims that
every polynomial in $Z[x]$ can be factored into the form
$b_{1}b_{2}\ldots b_{s}p_{1}(x)p_{2}(x)\ldots p_{m}(x)$ where $b_{i}$'s are irreducible polynomials of degree
$0$ and $p_{i}(x)$'s are irreducible polynomials of positive degree. Moreover, this factorization is unique
(which the only differences being that another factoring my have different signs in front of each polynomial).
With this all in place, we're ready to tackle our problem.

%-------------------------------------------------------------------------------
% THE PROBLEM
%-------------------------------------------------------------------------------
\section*{The Problem}
To begin the proof, we find a correspondence between summing dice and polynomials. We note that two dice
having a sum of 6 would imply the dice being rolled had values (5,1), (4,2), (3,3), (2,4), or (1,5). Now
suppose we look at $R(x)R(x)=(x^{6}+x^{5}+x^{4}+x^{3}+x^{2}+x^{1})(x^{6}+x^{5}+x^{4}+x^{3}+x^{2}+x^{1})$. We
observe that to pick the term $x^{6}$ in this product, we have to choose them in the following ways:
$x^{5}x^{1}$, $x^{4}x^{2}$, $x^{3}x^{3}$, $x^{2}x^{4}$, or $x^{1}x^{5}$. So there is a clear correspondence
here between the labels of dice whose sum is 6, and the pairs of terms whose products are six. This
correspondence is one to one (that is, any two dice with the same same should have the same correspondence).
Moreover, it's valid for all sums and dice -- including the Sicherman dice and any other potential dice (of
course, we'll show there aren't any others). We'll do this using a constructive argument, of sorts.

Suppose we have two sequences: $A=$ $a_{1}$, $a_{2}$, $a_{3}$, $a_{4}$, $a_{5}$, $a_{6}$ and $B=$ $b_{1}$,
$b_{2}$, $b_{3}$, $b_{4}$, $b_{5}$, $b_{6}$. Let these be the two sequences of positive integer labels for the
faces of pairs of cubes with the property that the probability of rolling any particular sum with these dice
(we'll call them \textit{weird dice}) is the same probability of rolling that sum with ordinary dice labelled
1 through 6. Therefore, as an example, we should also be able to choose 5 tuples $(a_{i_{1}}, b_{j_{1}})$,
$(a_{i_{2}}, b_{j_{2}})$, $(a_{i_{3}}, b_{j_{3}})$, $(a_{i_{4}}, b_{j_{4}})$, $(a_{i_{5}}, b_{j_{5}})$, such
that $a_{i_{s}} \in A$ and $b_{j_{t}} \in B$. Moreover, we should have that the product of two polynomials
$P(x)Q(x)=(x^{a_{6}}+x^{a_{5}}+x^{a_{4}}+x^{a_{3}}+x^{a_{2}}+x^{a_{1}})
(x^{b_{6}}+x^{b_{5}}+x^{b_{4}}+x^{b_{3}}+x^{b_{2}}+x^{b_{1}})$
should give us 5 pairs of terms who whose products is also $x^{6}$. Therefore, we can assume
$(R(x))^{2}=P(x)Q(x)$.

Therefore, now that we're done setting up the equation, we can focus on solving for the possible $a$'s and
$b$'s. We note from the Unique Factorization Theorem that our polynomial factors uniquely like so:
$x^{6}+x^{5}+x^{4}+x^{3}+x^{2}+x^{1} = (x)(x+1)(x^{2}+x+1)(x^{2}-x+1)$ and so
$(x^{6}+x^{5}+x^{4}+x^{3}+x^{2}+x^{1})^2 = (x)^{2}(x+1)^{2}(x^{2}+x+1)^{2}(x^{2}-x+1)^{2}$. However, this
implies $P(x)=(x)^{q}(x+1)^{r}(x^{2}+x+1)^{t}(x^{2}-x+1)^{u}$ where $0\leq q,r,t,u \leq 2$. The bounds are
there because the exponents can't possibly be negative, and $P(x)$ can't possibly introduce more of the same
irreducible polynomials then $(R(x))^2$ introduced.

We now restrict the possibilities for these four parameters by evaluating $P(0)$ and $P(1)$ in two ways.
Firstly, note $P(1)=1^{a_{6}}+1^{a_{5}}+1^{a_{4}}+1^{a_{3}}+1^{a_{2}}+1^{a_{1}}=6$. Moreover,
$P(1)=1^{q}2^{r}3^{t}1^{u}=2^{r}3^{t} \stackrel{!}{=} 6$. Therefore, $r=t=1$. So we have that
$P(x)=(x)^{q}(x+1)(x^{2}+x+1)(x^{2}-x+1)^{u}$. Now, we similarly note that
$P(0)=0^{a_{6}}+0^{a_{5}}+0^{a_{4}}+0^{a_{3}}+0^{a_{2}}+0^{a_{1}}=0$. Moreover,
$P(0)=0^{q}*1*1*1^{u} \stackrel{!}{=} 0$. This implies $q \neq 0$. Now, we'd like to show that $q$ cannot be
2. Suppose, for a contradiction, $q=2$ and $u=0$. Then
$P(x)=(x)^{2}(x+1)(x^{2}+x+1)=x^{5}+2x^{4}+2x^{3}+x^{2}$. That is, the first die should be labelled
$5,4,4,3,3,2$. This implies $Q(x)=(x+1)(x^{2}+x+1)(x^{2}-x+1)^{2}=x^{7}+x^{5}+x^{4}+x^{3}+x^{2}+x^{0}$ and so
the second die should be labelled $7,5,4,3,2,0$. However, we disallow labels of $0$ so this is not allowed.
This occurs similarly for when $u\in \{1,2\}$. Therefore, $q$ cannot be $2$, and so $q=1$. Therefore, we have
that $q=r=t=1$ and $u\in \{0,1,2\}$. So let's not consider the possibilities:

\begin{enumerate}
\item Suppose $u=0$. Then $P(x)=(x)(x+1)(x^{2}+x+1)=x^{4}+2x^{3}+2x^{2}+x^{1}$ and so the die labels are $4,3,3,2,2,1$ -- a Sicherman die.
\item Suppose $u=1$. Then $P(x)=(x)(x+1)(x^{2}+x+1)(x^{2}-x+1)=x^{6}+x^{5}+x^{4}+x^{3}+x^{2}+x^{1}$ and so the die labels are $6,5,4,3,2,1$ -- an ordinary die.
\item Suppose $u=2$. Then $P(x)=(x)(x+1)(x^{2}+x+1)(x^{2}-x+1)^{2}=x^{8}+x^{6}+x^{5}+x^{4}+x^{3}+x^{1}$ and so the die labels are $8,6,5,4,3,1$ -- the other Sicherman die.
\end{enumerate}

Therefore, choose $P(x)$ such that $q=r=t=1$ and $u=0$ and $Q(x)$ such that $q=r=t=1$ and $u=2$. Then these
represent dice with the same probability distribution of an ordinary pair of dice. Moreover, this shows that
the Sicherman dice are the \textit{only} other pair of dice that have this property.

%-------------------------------------------------------------------------------
% ADDITIONAL APPLICATIONS
%-------------------------------------------------------------------------------
\section*{Additional Applications}
We can use this same approach to see what other `weird dice' we can create. We'll tackle this in three
different scenarios: a scenario with two tetrahedral dice, a scenario with three cubic dice, and a scenario
with two octahedral dice.

\subsection*{Weird Tetrahedral Dice}
We start with a pair of tetrahedrons labelled $1,2,3,4$. We'll use the same approach by denoting
$P(x)Q(x)=(x^{a_{4}}+x^{a_{3}}+x^{a_{2}}+x^{a_{1}})
(x^{b_{4}}+x^{b_{3}}+x^{b_{2}}+x^{b_{1}})=(x^{4}+x^{3}+x^{2}+x^{1})^{2}=(x)^{2}(x+1)^{2}(x^{2}+1)^{2}$.
Therefore, we need to solve for $P(x)=(x)^{q}(x+1)^{r}(x^{2}+1)^{s}$ for $q,r,s \in \{0,1,2\}$. We note that
$P(0)=0^{a_{4}}+0^{a_{3}}+0^{a_{2}}+0^{a_{1}}=0$ and $P(0)=(0)^{q}(1)^{r}(1)^{s} \stackrel{!}{=} 0$ which
implies $q \neq 0$. As with the case before, $q=2$ implies we must have a 0 label on the other die, which we
disallow. There, $q=1$. For the second case, we have $P(1)=1^{a_{4}}+1^{a_{3}}+1^{a_{2}}+1^{a_{1}}=4$ and
$P(1)=(1)^{1}(2)^{r}(2)^{s} \stackrel{!}{=} 4 \Rightarrow 2^{r+s}=2^{2} \Rightarrow r+s=2$. Therefore, have
that $s=2-r$ gives us 3 valid dice.

\begin{enumerate}
\item Suppose $r=0$. Then $P(x)=(x)(x+1)(x^{2}+1)=x^{3}+2x^{2}+x^{1}$ and so the die labels are $3,2,2,1$ -- one weird die.
\item Suppose $r=1$. Then $P(x)=(x)(x+1)(x^{2}+1)=x^{4}+x^{3}+x^{2}+x^{1}$ and so the die labels are $4,3,2,1$ -- an ordinary tetrahedral die.
\item Suppose $r=2$. Then $P(x)=(x)(x+1)(x^{2}+1)=x^{5}+2x^{3}+x^{1}$ and so the die labels are $5,3,3,1$ -- another weird die.
\end{enumerate}

Therefore, choose $P(x)$ such that $q=1$, $r=0$, and $s=2$ and $Q(x)$ such that $q=1$, $r=2$, and $s=0$. Then
these represent dice with labels $3,2,2,1$ and $5,3,3,1$ such that they have the same probability distribution
as that of an ordinary pair of tetrahedral dice. Moreover, this shows that the `weird dice' are the
\textit{only} other pair of tetrahedral dice that have this property.

\subsection*{Weird Triples of Cubic Dice}
We now tackle the question: are there combinations of 3 dice that have the same probability distribution as 3
cubes numbered $1,2,3,4,5,6$? The answer is yes and the approach is almost identical to what we did in the
previous section. We let
$\prod_{i=1}^{3} P_{i}=\prod_{i=1}^{3}(x^{a_{i,6}}+x^{a_{i,5}}+x^{a_{i,4}}+x^{a_{i,3}}+x^{a_{i,2}}+x^{a_{i,1}})=(x^{6}+x^{5}+x^{4}+x^{3}+x^{2}+x^{1})^{3}=((x)(x+1)(x^{2}+x+1)(x^{2}-x+1))^{3}$.
Therefore, we're aiming to solve $P(x)=(x)^{q}(x+1)^{r}(x^{2}+x+1)^{t}(x^{2}-x+1)^{u}$ where
$0\leq q,r,t,u\leq 3$. However, for the exact same reasons as before, evaluating $P(1)$ tells us the $r,t=1$
and evaluating $P(0)$ tells us the $q \neq 0$. We note that setting $q=2,3$ demands at least one of our two
remaining dice have a 0 label, which we disallow. Therefore, $q=1$. What remains is our choice for $u$?

\begin{enumerate}
\item Suppose $u=0$. Then $P(x)=(x)(x+1)(x^{2}+x+1)=x^{4}+2x^{3}+2x^{2}+x^{1}$ and so the die labels are $4,3,3,2,2,1$ -- a Sicherman die.
\item Suppose $u=1$. Then $P(x)=(x)(x+1)(x^{2}+x+1)(x^{2}-x+1)=x^{6}+x^{5}+x^{4}+x^{3}+x^{2}+x^{1}$ and so the die labels are $6,5,4,3,2,1$ -- an ordinary die.
\item Suppose $u=2$. Then $P(x)=(x)(x+1)(x^{2}+x+1)(x^{2}-x+1)^{2}=x^{8}+x^{6}+x^{5}+x^{4}+x^{3}+x^{1}$ and so the die labels are $8,6,5,4,3,1$ -- the other Sicherman die.
\item Suppose $u=3$. Then $P(x)=(x)(x+1)(x^{2}+x+1)(x^{2}-x+1)^{3}=x^{10}-x^{9}+2x^{8}+x^{6}+x^{5}+2x^{3}-x^{2}+x^{1}$. However, this is not of the form $x^{a_{1,6}}+x^{a_{1,5}}+x^{a_{1,4}}+x^{a_{1,3}}+x^{a_{1,2}}+x^{a_{1,1}}$ where $x^{a_{i,j}} \in \{1,2,\ldots\}$. Therefore, this case is impossible.
\end{enumerate}

Therefore, choose, this allows us to choose two triples of dice: either (a) a pair of Sicherman dice and 1 regular die, or (b) 3 regular dice.

\subsection*{Weird Octahedral Dice}
Lastly, we tackle the question: are there pairs of octahedral dice that have the same probability distribution
as octahedral dice numbered $1,2,3,4,5,6,7,8$? The answer is yes and the approach is almost identical to what
we did in the previous section -- with slightly more work. If we jump ahead, we have our
$R(x)=\sum_{i=1}^{8} x^{i}=(x)(x+1)(x^{2}+1)(x^{4}+1)$. Therefore, our $P(x)$ should be of the form
$(x)^{q}(x+1)^{r}(x^{2}+1)^{t}(x^{4}+1)^{u}$ such that $q,r,t,u \in \{0,1,2\}$. Our usual tricks tell us
$q=1$. However, evaluating $P(1)$ gives us $r+t+u=3$. Therefore, we have 7 choices for $r$, $t$, and $u$.

\begin{enumerate}
\item Suppose $r=0$, $t=1$, and $u=2$. Then $(x)^{1}(x+1)^{0}(x^{2}+1)^{1}(x^{4}+1)^{2}=x^{11}+x^{9}+2x^{7}+2x^{5}+x^{3}+x^{1}$ and so the die labels are $11,9,7,7,5,5,3,1$ -- a weird die
\item Suppose $r=0$, $t=2$, and $u=1$. Then $(x)^{1}(x+1)^{0}(x^{2}+1)^{2}(x^{4}+1)^{1}=x^{9}+2x^{7}+2x^{5}+2x^{3}+x^{1}$ and so the die labels are $9,7,7,5,5,3,3,1$ -- a weird die
\item Suppose $r=1$, $t=0$, and $u=2$. Then $(x)^{1}(x+1)^{1}(x^{2}+1)^{0}(x^{4}+1)^{2}=x^{10}+x^{9}+2x^{6}+2x^{5}+x^{2}+x^{1}$ and so the die labels are $10,9,6,6,5,5,2,1$ -- a weird die
\item Suppose $r=1$, $t=1$, and $u=1$. Then $(x)^{1}(x+1)^{1}(x^{2}+1)^{1}(x^{4}+1)^{1}=x^{8}+x^{7}+x^{6}+x^{5}+x^{4}+x^{3}+x^{2}+x^{1}$ and so the die labels are $8,7,6,5,4,3,2,1$ -- a regular die
\item Suppose $r=1$, $t=2$, and $u=0$. Then $(x)^{1}(x+1)^{1}(x^{2}+1)^{2}(x^{4}+1)^{0}=x^{6}+x^{5}+2x^{4}+2x^{3}+x^{2}+x^{1}$ and so the die labels are $6,5,4,4,3,3,2,1$ -- a weird die corresponding to the die mentioned in item 3
\item Suppose $r=2$, $t=0$, and $u=1$. Then $(x)^{1}(x+1)^{2}(x^{2}+1)^{0}(x^{4}+1)^{1}=x^{7}+2x^{6}+x^{5}+x^{3}+2x^{2}+x^{1}$ and so the die labels are $7,6,6,5,3,2,2,1$ -- a weird die corresponding to the die mentioned in item 2
\item Suppose $r=2$, $t=1$, and $u=0$. Then $(x)^{1}(x+1)^{2}(x^{2}+1)^{1}(x^{4}+1)^{0}=x^{5}+2x^{4}+2x^{3}+2x^{2}+x^{1}$ and so the die labels are $5,4,4,3,3,2,2,1$ -- a weird die corresponding to the die mentioned in item 1
\end{enumerate}

So our 4 pairs of octahedral dice are:
\begin{enumerate}
\item $(8,7,6,5,4,3,2,1)$ and $(8,7,6,5,4,3,2,1)$
\item $(9,7,7,5,5,3,3,1)$ and $(7,6,6,5,3,2,2,1)$
\item $(10,9,6,6,5,5,2,1)$ and $(6,5,4,4,3,3,2,1)$
\item $(11,9,7,7,5,5,3,1)$ and $(5,4,4,3,3,2,2,1)$
\end{enumerate}

%-------------------------------------------------------------------------------
% CONCLUSION
%-------------------------------------------------------------------------------
\section*{Conclusion}
We finish this project by recalling that the primary tool we used to successfully find, and prove the
uniqueness of, these dice was the Unique Factorization Theorem. That is, what makes this method/proof so
incredible is we used a completely abstract concept from ring theory, that inherently doesn't seem too
applicable to the real world, and applied it directly a real world question. Moreover, this method simply,
efficiently, and reliably solves the problem that would otherwise use an exponentially-growing, brute force
approach to prove. It's very general in that can be applied to dice with large number of size and dice with
varying numbers of faces. These are the reasons for why the method is so powerful. However, these aren't the
only reasons that make a method ``beautiful''.

Another more important facet, from a personal standpoint, that method needs for being beautiful is that it can
make math fun. This is a technique that can be introduced to high-schoolers to learn the importance of
higher-level math in the real world. I know I personally enjoyed applying it to other geometric shapes for
dice that I can create for myself some day, just for fun. This is why I think this proof is so beautiful.

%-------------------------------------------------------------------------------
% REFERENCES
%-------------------------------------------------------------------------------
\section*{References}
\addcontentsline{toc}{section}{References}
Gallian, J. A. (2010). 17. In \textit{Contemporary Abstract Algebra} (7th ed., pp. 314-319). Australia: Brooks/Cole.
\end{document}

Proof on the Uniqueness of the Sicherman Dice/paper.tex


\section*{NP--Completeness - Peter Christensen}

\begin{enumerate}
	\item Define P vs NP problem i.e polynomial solvable vs polynomial verifiable
	\item Talk about reducibility
	\item Define NP--Complete
	\item Assume SAT is NPC. Prove Theorm 34.10. that is 3--CNF is NPC.
\end{enumerate}


\section{\texorpdfstring{Relative computations by Oracle TM}{Relative computations by Oracle TM}}
\vspace{5mm}
\large

%2nd lecture

\begin{definition}[Oracle TM]
	\textbf{Oracle} TM is a DTM with an Oracle A (where A is a language) differs from an ordinary DTM by the following:
	\begin{itemize}
		\item Oracle tape (with same alphabet as TM)
		\item 3 special states: QUERY, YES, NO
		\item In QUERY state TM moves to YES state if word on the oracle tape $\in A$ (moves to NO o/w).
			After the answer oracle tape is erased (to reuse space in Space complexity).
		\item Language of the accepted word by an oracle TM M is $L(M, A)$.
	\end{itemize}
\end{definition}

\begin{note}
	For NTM definition works the same.
\end{note}

\begin{note}
	Ordinary DTM is the same as oracle DTM with $A = \emptyset$.
\end{note}

Consider now a comparison of the oracle DTM, when oracle language A is \emph{not fixed in advance}.
Computation forms a tree, that branches at every QUERY.

\begin{observation}
	Consider NTM vs Oracle DTM.

	"$\Rightarrow$". If NTM M has language $L(M)$, set oracle language $A = L(M)$.
	"$\Leftarrow$". If oracle language is not recognizable (e.g. HALT), we cannot simulate such NTM.
\end{observation}

\begin{definition}[Turing reducibility]
	\emph{Turing reducibility} - let A,B languages.
	We say that A is (deterministically) Turing reducible to B in polynomial time if there $\exists$ an oracle DTM M working in polynomial time such that
	\[ A = L(M, B), A \leq^T B \]
\end{definition}

\begin{example}
	$A \in P \Rightarrow A \leq^T \emptyset$. Since we have polynomial time algorithm without any oracle.
\end{example}

\begin{definition}[$\TP(A)$]
	Let $A$ be a language, then
	\[ \TP(A) = \{ B | B \leq^T A \} \]
\end{definition}
\begin{definition}[$\TP(\C)$]
	Let $\C$ be a set of languages then
	\[ \TP(\C) = \{ B |\, \exists A \in \C: B \leq^T A \} \]
\end{definition}

\begin{theorem}[$\TP(\TP) = \TP$]\label{p_eq_pp}
	\[ \TP(\TP) = \TP \]
\end{theorem}
\begin{proof}
	$ \TP \subseteq \TP(\TP)$. Let $A \in \TP$, use $A$ as an oracle with 1 QUERY or use empty oracle.

	$\TP(\TP) \subseteq \TP$. Let $B \in \TP(\TP) \iff \exists A \in \TP \exists ODTM\ M: B = L(M, A)$.

	To prove the inclusion, we have to construct ordinary DTM that recognizes $B$.
	Such TM $M_B$ simulates $M$ and whenever $M$ enters QUERY state, simulate $M_A$ to check if word $w$ on oracle tape
	\[ w \in L(M_A) = A \]

	Now we have to check time complexity.

	$M$ makes $p(|x|)$ queries (for $p$ polynomial), as the total number of steps is polynomial.
	Each query word length is at most $p_w(|x|) = t$.
	Every query has at most $p_q(|t|)$ steps.
	In total, query is $p_q(p_w(|x|))$.
	And the total time complexity of the TM is $p(p_q(p_w(|x|)))$.
	Which is also polynomial.
\end{proof}

\begin{definition}[Turing reducibility (N)]
	\emph{Turing reducibility (non-deterministic)} - let A,B languages.
	We say that $A$ is non-deterministically Turing reducible to $B$ in polynomial time if there $\exists$ an oracle NTM $M$ working in polynomial time such that
	\[ A = L(M, B), A \leq^{NP} B \]
\end{definition}

\begin{definition}[$\TNP(A)$]
	Let $A$ be a language, then
	\[ \TNP(A) = \{ B | B \leq^{NP} A \} \]
\end{definition}
\begin{definition}[$\TNP(\C)$]
	Let $\C$ be a set of languages then
	\[ \TNP(\C) = \{ B |\, \exists A \in \C: B \leq^{NP} A \} \]
\end{definition}

\begin{note}
	Relativized definition also works for other classes, e.g. EXPTIME.
\end{note}

\begin{definition}[PS]
	\[ PS = \bigcup_{i = 0}^{\infty} DS(n^i) = NPS = \bigcup_{i = 0}^{\infty} NS(n^i) \]
	Where the 2nd equality holds because of Savic theorem \cref{savic}.
\end{definition}

\begin{definition}[PS(A)]
	$PS(A) = \{ B | \, B$ accepted by an oracle DTM working in polynomial space, st $B = L(M, A)\}$.

	Also for class of languages $\C$.
\end{definition}

\begin{note}
	\[ \TP \subseteq \TNP \subseteq PS \]

	Where last inclusion hold because of $NT(f(n)) \subseteq DS(f(n))$.

	Same proof but as for ordinary TM, but with oracle TM that shares same oracle language A.
\end{note}

\begin{observation}[Open question]
	What about $\TNP(\TNP)$? Still an open question, depends on $\TP = \TNP$.

	We cannot simply plug NTM back to the original TM with oracle, as NTM serving as an oracle could have multiple accepting or rejecting leaves.
\end{observation}


\chapter{Nuclear solutions}
\begin{abox}
	Practice set 1 solutions
	\end{abox}
\begin{enumerate}
	\item The radius of a ${ }_{29}^{64} \mathrm{Cu}$ nucleus is measured to be $4.8 \times 10^{-13} \mathrm{~cm}$.
	{\exyear{NET JUNE 2011}}\\
(A) The radius of a ${ }_{12}^{27} \mathrm{Mg}$ nucleus can be estimated to be
\begin{tasks}(2)
	\task[\textbf{A.}] $2.86 \times 10^{-13} \mathrm{~cm}$
	\task[\textbf{B.}]$5.2 \times 10^{-13} \mathrm{~cm}$
	\task[\textbf{C.}] $3.6 \times 10^{-13} \mathrm{~cm}$
	\task[\textbf{D.}]$8.6 \times 10^{-13} \mathrm{~cm}$
\end{tasks}
\begin{answer}
\begin{align*}
R&=R_{0}(A)^{1 / 3} \Rightarrow \frac{R_{M g}}{R_{C u}}=\left(\frac{A_{M g}}{A_{C u}}\right)^{1 / 3}=\left(\frac{27}{64}\right)^{1 / 3}\\
\Rightarrow \frac{R_{M g}}{R_{C u}}&=\frac{3}{4} \Rightarrow R_{M g}=\frac{3}{4} \times 4.8 \times 10^{-13}=3.6 \times 10^{-13} \mathrm{~cm}
\end{align*}
The correct option is \textbf{(c)}
\end{answer}
(B) The root-mean-square (r.m.s) energy of a nucleon in a nucleus of atomic number $A$ in its ground state varies as:
\begin{tasks}(2)
	\task[\textbf{A.}] $A^{4 / 3}$
	\task[\textbf{B.}]$A^{1 / 3}$
	\task[\textbf{C.}] $A^{-1 / 3}$
	\task[\textbf{D.}] $A^{-2 / 3}$
\end{tasks}
\begin{answer}
	The correct option is \textbf{(c)}
\end{answer}
	\item According to the shell model the spin and parity of the two nuclei ${ }_{51}^{125} S b$ and ${ }_{38}^{89} \mathrm{Sr}$ are, respectively,
	{\exyear{NET DEC 2011}}\\
\begin{tasks}(2)
	\task[\textbf{A.}] $\left(\frac{5}{2}\right)^{+}$and $\left(\frac{5}{2}\right)^{+}$
	\task[\textbf{B.}]$\left(\frac{5}{2}\right)^{+}$and $\left(\frac{7}{2}\right)^{+}$
	\task[\textbf{C.}]$\left(\frac{7}{2}\right)^{+}$and $\left(\frac{5}{2}\right)^{+}$
	\task[\textbf{D.}]$\left(\frac{7}{2}\right)^{+}$and $\left(\frac{7}{2}\right)^{+}$
\end{tasks}
\begin{answer}
	${ }_{51}^{125} \mathrm{Sb} ; Z=51$ and $N=74$
	$$
	Z=51
	$$
	$$
	\left(s_{1 / 2}\right)^{2}\left(p_{3 / 2}\right)^{4}\left(p_{1 / 2}\right)^{2}\left(d_{5 / 2}\right)^{6}\left(s_{1 / 2}\right)^{2}\left(d_{3 / 2}\right)^{4}\left(f_{7 / 2}\right)^{8}\left(p_{3 / 2}\right)^{4}\left(f_{5 / 2}\right)^{6}\left(p_{1 / 2}\right)^{2}\left(g_{9 / 2}\right)^{10}\left(g_{7 / 2}\right)^{1}
	$$
	$\Rightarrow j=\frac{7}{2}$ and $l=4$. Thus spin and parity $=\left(\frac{7}{2}\right)^{+}$\\
	\begin{align*}
		&{ }_{38}^{89} S r ; Z=38 \text { and } N=51 \\
		&N=51: \\
		&\left(s_{1 / 2}\right)^{2}\left(p_{3 / 2}\right)^{4}\left(p_{1 / 2}\right)^{2}\left(d_{5 / 2}\right)^{6}\left(s_{1 / 2}\right)^{2}\left(d_{3 / 2}\right)^{4}\left(f_{7 / 2}\right)^{8}\left(p_{3 / 2}\right)^{4}\left(f_{5 / 2}\right)^{6}\left(p_{1 / 2}\right)^{2}\left(g_{9 / 2}\right)^{10}\left(g_{7 / 2}\right)^{1} \\
		&\Rightarrow j=\frac{7}{2} \text { and } l=4 \text {. Thus spin and parity }=\left(\frac{7}{2}\right)^{+}
	\end{align*}
	The correct option is \textbf{(d)}
\end{answer}
	\item The difference in the Coulomb energy between the mirror nuclei ${ }_{24}^{49} \mathrm{Cr}$ and ${ }_{25}^{49} \mathrm{Mn}$ is 6.0 MeV. Assuming that the nuclei have a spherically symmetric charge distribution and that $e^{2}$ is approximately $1.0 \mathrm{MeV}-\mathrm{fm}$, the radius of the ${ }_{25}^{49} \mathrm{Mn}$ nucleus is
{\exyear{NET DEC 2011}}\\
\begin{tasks}(2)
	\task[\textbf{A.}] $4.9 \times 10^{-13} \mathrm{~m}$
	\task[\textbf{B.}]$4.9 \times 10^{-15} \mathrm{~m}$
	\task[\textbf{C.}]$5.1 \times 10^{-13} \mathrm{~m}$
	\task[\textbf{D.}]$5.1 \times 10^{-15} \mathrm{~m}$
\end{tasks}
\begin{answer}
	$$
	R=\frac{3 e^{2}}{5 \cdot \Delta W}\left(Z_{1}^{2}-Z_{2}^{2}\right)=\frac{3 \times 1 \times 10^{-15}}{5 \times 6}\left(25^{2}-24^{2}\right)=4.9 \times 10^{-15} \mathrm{~m}
	$$
	The correct option is \textbf{(b)}
\end{answer}
	\item The ground state of ${ }_{12}^{207} \mathrm{~Pb}$ nucleus has spin-parity $J^{p}=\frac{1^{-}}{2}$, while the first excited state has $J^{p}=\frac{5^{-}}{2}$.The electromagnetic radiation emitted when the nucleus makes a transition from the first excited state to ground state are
{\exyear{NET JUNE 2012}}\\
\begin{tasks}(2)
	\task[\textbf{A.}] E2 and E3
	\task[\textbf{B.}] M2 or E3
	\task[\textbf{C.}] E2 or M3
	\task[\textbf{D.}] M2 or M3
\end{tasks}
\begin{answer}
 No parity change; $\Delta J=2,3$\\
For $E_{l}$ type, $\Delta \pi=(-1)^{l}$, (for no parity change $l=2$ )\\
For $M_{l}$ type, $\Delta \pi=(-1)^{l+1}$, (for no parity change $l=3$ )\\
$\Delta J=2$, No parity change $\rightarrow E 2 ; \Delta J=3$, No parity change $\rightarrow M 3$\\
The correct option is \textbf{(c)}
\end{answer}
\item The binding energy of a light nucleus $(Z, A)$ in $\mathrm{MeV}$ is given by the approximate formula
$$
B(A, Z) \approx 16 A-20 A^{2 / 3}-\frac{3}{4} Z^{2} A^{-1 / 3}+30 \frac{(N-Z)^{2}}{A}
$$
where $N=A-Z$ is the neutron number. The value of $Z$ of the most stable isobar for a given $A$ is
{\exyear{NET JUNE 2013}}
\begin{tasks}(2)
	\task[\textbf{A.}] $\frac{A}{2}\left(1-\frac{A^{2 / 3}}{160}\right)^{-1} \quad$
	\task[\textbf{B.}]$\frac{A}{2}$
	\task[\textbf{C.}]$\frac{A}{2}\left(1-\frac{A^{2 / 3}}{120}\right)^{-1}$
	\task[\textbf{D.}]$\frac{A}{2}\left(1+\frac{A^{4 / 3}}{64}\right)^{-1}$
\end{tasks}
\begin{answer}
	$$\left.\frac{\partial B}{\partial Z}\right|_{Z=Z^{\prime}}=0 \Rightarrow Z^{\prime}=\frac{A}{2}\left(1-\frac{A^{2 / 3}}{160}\right)^{-1}$$
	The correct option is \textbf{(a)}
\end{answer}
\item The intrinsic electric dipole moment of a nucleus ${ }_{Z}^{A} X$
{\exyear{NET DEC 2013}}
\begin{tasks}(2)
	\task[\textbf{A.}] increases with $Z$, but independent of $A$
	\task[\textbf{B.}]decreases with $Z$, but independent of $A$
	\task[\textbf{C.}]is always zero
	\task[\textbf{D.}]increases with $Z$ and $A$
\end{tasks}
\begin{answer}
	The correct option is \textbf{(d)}
\end{answer}
\item According to the shell model, the total angular momentum (in units of $\hbar$ ) and the parity of the ground state of the ${ }_{3}^{7} L i$ nucleus is
{\exyear{NET DEC 2013}}
\begin{tasks}(2)
	\task[\textbf{A.}] $\frac{3}{2}$ with negative parity
	\task[\textbf{B.}] $\frac{3}{2}$ with positive parity
	\task[\textbf{C.}]$\frac{1}{2}$ with positive parity
	\task[\textbf{D.}]$\frac{7}{2}$ with negative parity
\end{tasks}
\begin{answer}
 $Z=3, N=4$\\
	For odd $Z=3 ;\left(s_{1 / 2}^{2}\right)\left(p_{3 / 2}^{1}\right) \Rightarrow j=3 / 2, l=1$ and parity $=(-1)^{1}=-1$.
\end{answer}
\item If the binding energy $B$ of a nucleus (mass number $A$ and charge $Z$ ) is given by
$$
B=a_{V} A-a_{S} A^{2 / 3}-a_{s y m} \frac{(2 Z-A)^{2}}{A}+\frac{a_{C} Z^{2}}{A^{1 / 3}}
$$
where $a_{V}=16 \mathrm{MeV}, a_{S}=16 \mathrm{MeV}, a_{s y m}=24 \mathrm{MeV}$ and $a_{C}=0.75 \mathrm{MeV}$, then for the most stable isobar for a nucleus with $A=216$ is
{\exyear{NET DEC 2014}}
\begin{tasks}(2)
	\task[\textbf{A.}] 68
	\task[\textbf{B.}]72
	\task[\textbf{C.}]84
	\task[\textbf{D.}]92
\end{tasks}
\begin{answer}
	\begin{align*}
	&\text { For the most stable isobar for a nucleus }\\
	\frac{d B}{d Z}&=0 \Rightarrow-a_{s y m} \frac{2(2 Z-A) \times 2}{A}+\frac{2 a_{C} Z}{A^{1 / 3}}=0\\
	&\Rightarrow 24 \frac{2(2 Z-216) \times 2}{216}+0.75 \frac{2 Z}{(216)^{1 / 3}}=0 \Rightarrow \frac{4(2 Z-216)}{9}+\frac{3}{4} \frac{2 Z}{6}=0\\
	&\Rightarrow \frac{4(2 Z-216)}{9}+\frac{Z}{4}=0 \Rightarrow 16(2 Z-216)+9 Z=0 \Rightarrow 41 Z=216 \times 16 \Rightarrow Z=82.3
	\end{align*}
	The correct option is \textbf{(c)}
\end{answer}
\item Let us approximate the nuclear potential in the shell model by a three dimensional isotropic harmonic oscillator. Since the lowest two energy levels have angular momenta $l=0$ and $l=1$ respectively, which of the following two nuclei have magic numbers of protons and neutrons?
{\exyear{NET JUNE 2015}}
\begin{tasks}(2)
	\task[\textbf{A.}] ${ }_{2}^{4} \mathrm{He}$ and ${ }_{8}^{16} \mathrm{O}$
	\task[\textbf{B.}]${ }_{1}^{2} D$ and ${ }_{4}^{8} B e$
	\task[\textbf{C.}]${ }_{2}^{4} \mathrm{He}$ and ${ }_{4}^{8} \mathrm{Be}$
	\task[\textbf{D.}]${ }_{2}^{4} \mathrm{He}$ and ${ }_{6}^{12} \mathrm{C}$
\end{tasks}
\begin{answer}
	${ }_{2} H e^{4}$ has $Z=2, N=2$\\
	${ }_{8} O^{16}$ has $Z=8, N=8$ magic numbers $(2,8,20,28,50,82,126)$\\
	The correct option is \textbf{(a)}
\end{answer}
\item Of the nuclei of mass number $A=125$, the binding energy calculated from the liquid drop model (given that the coefficients for the Coulomb and the asymmetry energy are $a_{c}=0.7 \mathrm{MeV}$ and $a_{s y m}=22.5 \mathrm{MeV}$ respectively) is a maximum for
{\exyear{NET DEC 2015}}
\begin{tasks}(2)
	\task[\textbf{A.}] ${ }_{54}^{125} \mathrm{Xe}$
	\task[\textbf{B.}] ${ }_{53}^{124} I$
	\task[\textbf{C.}]${ }_{52}^{125} \mathrm{Te}$
	\task[\textbf{D.}]${ }_{51}^{125} \mathrm{Sb}$
\end{tasks}
\begin{answer}
	\begin{align*}
	Z_{0}&=\frac{4 a_{a}+a_{c} A^{-1 / 3}}{2 a_{c} A^{-1 / 3}+8 a_{a} A^{-1}}=\frac{4 a_{a} A+a_{c} A^{2 / 3}}{8 a_{a}+2 a_{c} A^{2 / 3}}\\
	Z_{0}&=\frac{4 \times 22.5 \times 125+0.7\left(5^{3}\right)^{2 / 3}}{8 \times 22.5+2 \times 0.7\left(5^{3}\right)^{2 / 3}}\\
	&=\frac{11250+17.5}{180+35}=\frac{11267.5}{215}=52.4 \Rightarrow Z_{0} \approx 52
	\end{align*}
	The correct option is \textbf{(c)}
\end{answer}
\item A radioactive element $X$ decays to $Y$, which in turn decays to a stable element $Z$. The decay constant from $X$ to $Y$ is $\lambda_{1}$, and that from $Y$ to $Z$ is $\lambda_{2}$. If, to begin with, there are only $N_{0}$ atoms of $X$, at short times $\left(t \ll \frac{1}{\lambda_{1}}\right.$ as well as $\left.\frac{1}{\lambda_{2}}\right)$ the number of atoms of $Z$ will be
{\exyear{NET JUNE 2016}}
\begin{tasks}(2)
	\task[\textbf{A.}] $\frac{1}{2} \lambda_{1} \lambda_{2} N_{0} t^{2}$
	\task[\textbf{B.}]$\frac{\lambda_{1} \lambda_{2}}{2\left(\lambda_{1}+\lambda_{2}\right)} N_{0} t$
	\task[\textbf{C.}]$\left(\lambda_{1}+\lambda_{2}\right)^{2} N_{0} t^{2}$
	\task[\textbf{D.}] $\left(\lambda_{1}+\lambda_{2}\right) N_{0} t$
\end{tasks}
\begin{answer}
	\begin{align*}
	X \stackrel{\lambda_{1}}{\longrightarrow} Y \stackrel{\lambda_{2}}{\longrightarrow} Z\\
	\begin{array}{cccc}
	t=0 & N_{0} & 0 & 0 \\
	t & N_{1} & N_{2} & N_{3}
	\end{array}
	\end{align*}
	\begin{align*}
	&\text { Rate equations }\\
	N_{1}&=N_{0} e^{-\lambda_{1} t}, \frac{d N_{2}}{d t}=\lambda_{1} N_{1}-\lambda_{2} N_{2}, \frac{d N_{3}}{d t}=\lambda_{2} N_{2}\\
	N_{3}&=N_{0}\left[1+\frac{\lambda_{1} e^{-\lambda_{2} t}}{\left(\lambda_{2}-\lambda_{1}\right)}-\frac{\lambda_{2} e^{-\lambda_{1} t}}{\left(\lambda_{2}-\lambda_{1}\right)}\right]\\
	&=N_{0}\left[1+\frac{\lambda_{1}}{\left(\lambda_{2}-\lambda_{1}\right)}\left(1-\lambda_{2} t+\frac{\lambda_{2}^{2} t^{2}}{2}\right)-\frac{\lambda_{2}}{\left(\lambda_{2}-\lambda_{1}\right)}\left(1-\lambda_{1} t+\frac{\lambda_{1}^{2} t^{2}}{2}\right)\right]\\
	&=N_{0}\left[1+\frac{\lambda_{1}}{\left(\lambda_{2}-\lambda_{1}\right)}-\frac{\lambda_{1} \lambda_{2} t}{\left(\lambda_{2}-\lambda_{1}\right)}+\frac{\lambda_{1}}{\left(\lambda_{2}-\lambda_{1}\right)} \frac{\lambda_{2}^{2} t^{2}}{2}\right.\\
	&\left.-\frac{\lambda_{2}}{\left(\lambda_{2}-\lambda_{1}\right)}+\frac{\lambda_{2} \lambda_{1} t}{\left(\lambda_{2}-\lambda_{1}\right)}-\frac{\lambda_{2}}{\left(\lambda_{2}-\lambda_{1}\right)} \frac{\lambda_{1}^{2} t^{2}}{2}\right]\\
	&=N_{0}\left[\frac{\lambda_{1}}{\left(\lambda_{2}-\lambda_{1}\right)} \times \frac{\lambda_{2}^{2} t^{2}}{2}-\frac{\lambda_{2}}{\left(\lambda_{2}-\lambda_{1}\right)} \times \frac{\lambda_{1}^{2} t^{2}}{2}\right]\\
	&=\frac{\lambda_{1} \lambda_{2} t^{2}}{2} N_{0}\left[\frac{\lambda_{2}}{\lambda_{2}-\lambda_{1}}-\frac{\lambda_{1}}{\lambda_{2}-\lambda_{1}}\right]=\frac{1}{2} \lambda_{1} \lambda_{2} N_{0} t^{2}
	\end{align*}
	The correct option is \textbf{(a)}
\end{answer}
\item Let $E_{S}$ denotes the contribution of the surface energy per nucleon in the liquid drop model. The ratio $E_{S}\left({ }_{13}^{27} \mathrm{Al}\right): E_{S}\left({ }_{30}^{64} \mathrm{Zn}\right)$ is
{\exyear{NET JUNE 2016}}
\begin{tasks}(2)
	\task[\textbf{A.}](a) $2: 3$
	\task[\textbf{B.}] $4: 3$
	\task[\textbf{C.}] $5: 3$
	\task[\textbf{D.}] $3: 2$
\end{tasks}
\begin{answer}
	$$E_{S}=\frac{B}{A}=\frac{A^{\frac{2}{3}}}{A} \propto A^{-\frac{1}{3}} \Rightarrow \frac{E_{S}(A l)}{E_{S}\left(Z_{n}\right)}=\frac{(27)^{-\frac{1}{3}}}{(64)^{-\frac{1}{3}}}=\frac{(64)^{\frac{1}{3}}}{(27)^{\frac{1}{3}}}=\frac{4}{3}$$
	The correct option is \textbf{(b)}
\end{answer}
\item According to the shell model, the nuclear magnetic moment of the ${ }_{13}^{27} \mathrm{Al}$ nucleus is (Given that for a proton $g_{l}=1, g_{s}=5.586$, and for a neutron $g_{l}=0, g_{s}=-3.826$ )
{\exyear{NET JUNE 2016}}
\begin{tasks}(2)
	\task[\textbf{A.}] $-1.913 \mu_{N}$
	\task[\textbf{B.}]$14.414 \mu_{N}$
	\task[\textbf{C.}]$4.793 \mu_{N}$
	\task[\textbf{D.}]0
\end{tasks}
\begin{answer}
$${ }_{13} A l^{27}: Z=13, N=14 \text { for } Z=13, S_{1 / 2}^{2}, P_{3 / 2}^{4}, P_{1 / 2}^{2}, d_{5 / 2}^{5} \Rightarrow j=\frac{5}{2}, l=2$$
$$
\text { Magnetic moment, } \mu=\frac{1}{2}\left[2 j-1+g_{S}\right] \mu_{N}=\frac{1}{2}\left[2 \times \frac{5}{2}-1+5.586\right] \mu_{N} \Rightarrow \mu=4.793 \mu_{N}
$$
The correct option is \textbf{(c)}
\end{answer}
\item The spin-parity assignments for the ground and first excited states of the isotope ${ }_{28}^{57} N i$, in the single particle shell model, are
{\exyear{NET DEC 2017}}
\begin{tasks}(2)
	\task[\textbf{A.}] $\left(\frac{1}{2}\right)^{-}$and $\left(\frac{3}{2}\right)^{-}$
	\task[\textbf{B.}]$\left(\frac{5}{2}\right)^{+}$and $\left(\frac{7}{2}\right)^{+}$
	\task[\textbf{C.}]$\left(\frac{3}{2}\right)^{+}$and $\left(\frac{5}{2}\right)^{+}$
	\task[\textbf{D.}]$\left(\frac{3}{2}\right)^{-}$and $\left(\frac{5}{2}\right)^{-}$
\end{tasks}
\begin{answer}
	For ${ }_{28} N i^{57}: \quad P=28, N=29 \rightarrow$ will decide the $j^{P}$\\
	So, for $N=29$, ground state configuration,\\\\
	$1 s_{1 / 2}^{2} 1 p_{3 / 2}^{4} 1 p_{1 / 2}^{2} 1 d_{5 / 2}^{6} 2 s_{1 / 2}^{2} 1 d_{3 / 2}^{4} 1 f_{7 / 2}^{8} 2 p_{3 / 2}^{1}$\\\\
	So, $j=\frac{3}{2}, l=1$\\
	Spin parity for ground state of ${ }_{28} N i^{57} \rightarrow\left(\frac{3}{2}\right)^{-}$\\
	For first excited state,\\
	\begin{align*}
		&1 s_{1 / 2}^{2} 1 p_{3 / 2}^{4} 1 p_{1 / 2}^{2} 1 d_{5 / 2}^{6} 2 s_{1 / 2}^{2} 1 d_{3 / 2}^{4} 1 f_{7 / 2}^{8} 2 p_{3 / 2}^{1} \rightarrow 1 f_{5 / 2} \\
		&P=\frac{5}{2}, l=3 \Rightarrow \text { spin parity } \rightarrow\left(\frac{5}{2}\right)^{-}
	\end{align*}
The correct option is \textbf{(d)}
\end{answer}
\end{enumerate}
\newpage
\begin{abox}
	Practice set 2 solutions
	\end{abox}
\begin{enumerate}
\item In the nuclear shell model the spin parity of ${ }_{7}^{15} N$ is given by
{\exyear{GATE 2010}}
\begin{tasks}(2)
	\task[\textbf{A.}] $\frac{1^{-}}{2}$
	\task[\textbf{B.}]$\frac{1^{+}}{2}$
	\task[\textbf{C.}]$\frac{3^{-}}{2}$
	\task[\textbf{D.}]$\frac{3^{+}}{2}$
\end{tasks}
\begin{answer}
	$$
	Z=7 ;\left(s_{1 / 2}\right)^{2}\left(p_{3 / 2}\right)^{4}\left(p_{1 / 2}\right)^{1} \text { and } N=8
	$$
	$$
	l=1, J=\frac{1}{2} \Rightarrow \text { parity }=(-1)^{1}=-1, \quad \text { spin }-\text { parity }=\left(\frac{1}{2}\right)^{-}
	$$
	The correct option is \textbf{(a)}
\end{answer}
\item The semi-empirical mass formula for the binding energy of nucleus contains a surface correction term. This term depends on the mass number $A$ of the nucleus as
{\exyear{GATE 2011}}
\begin{tasks}(2)
	\task[\textbf{A.}] $A^{-1 / 3}$
	\task[\textbf{B.}]$A^{1 / 3}$
	\task[\textbf{C.}]$A^{2 / 3}$
	\task[\textbf{D.}]$A$
\end{tasks}
\begin{answer}
	The correct option is \textbf{(c)}
\end{answer}
\item According to the single particles nuclear shell model, the spin-parity of the ground state of ${ }_{8}^{17} O$ is
{\exyear{GATE 2011}}
\begin{tasks}(2)
	\task[\textbf{A.}] $\frac{1}{2}$
	\task[\textbf{B.}]$\frac{3}{2}$
	\task[\textbf{C.}]$\frac{3}{2}^{+}$
	\task[\textbf{D.}] $\frac{5^{+}}{2}$
\end{tasks}
\begin{answer}
	$$Z=8 \text { and } N=9 ;\left(s_{1 / 2}\right)^{2}\left(p_{3 / 2}\right)^{4}\left(p_{1 / 2}\right)^{2}\left(d_{5 / 2}\right)^{1}$$
	$$
	l=2, J=\frac{5}{2} \Rightarrow \text { parity }=(-1)^{2}=+1, \quad \text { spin - parity }=\left(\frac{5}{2}\right)^{+}
	$$
	The correct option is \textbf{(d)}
\end{answer}
\item In the nuclear shell model, the potential is modeled as $V(r)=\frac{1}{2} m \omega^{2} r^{2}-\lambda \vec{L} \cdot \vec{S}, \lambda>0$ The correct spin-parity and isospin assignments for the ground state of ${ }_{6}^{13} \mathrm{C}$ is
{\exyear{GATE 2015}}
\begin{tasks}(2)
	\task[\textbf{A.}] $\frac{1^{-}}{2} ; \frac{-1}{2}$
	\task[\textbf{B.}]$\frac{1^{+}}{2} ; \frac{-1}{2}$
	\task[\textbf{C.}] $\frac{3^{+}}{2} ; \frac{1}{2}$
	\task[\textbf{D.}]$\frac{3^{-}}{2} ; \frac{-1}{2}$
\end{tasks}
\begin{answer}
	$$
	{ }^{13} C_{6}, \quad N=7, Z=6, \text { for } N=7 ; \quad\left(1 S_{\frac{1}{2}}\right)^{2}\left(1 P_{\frac{3}{2}}\right)^{4}\left(P_{\frac{1}{2}}\right)^{1} \Rightarrow j=\frac{1}{2} \text { and } l=1
	$$
	$$
	\text { Thus spin- parity is }\left(\frac{1}{2}\right)^{-} \text {. }
	$$
\end{answer}
\item According to the nuclear shell model, the respective ground state spin-parity values of ${ }_{8}^{15} O$ and ${ }_{8}^{17} O$ nuclei are
{\exyear{GATE 2016}}
\begin{tasks}(2)
	\task[\textbf{A.}] $\frac{1^{+}}{2}, \frac{1^{-}}{2}$
	\task[\textbf{B.}]$\frac{1}{2}^{-}, \frac{5^{+}}{2}$
	\task[\textbf{C.}]$\frac{3^{-}}{2}, \frac{5^{+}}{2}$
	\task[\textbf{D.}]$\frac{3^{-}}{2}, \frac{1^{-}}{2}$
\end{tasks}
\begin{answer}
	${ }_{8}^{15} O ; Z=8$ and $N=7 ; \quad N=7:\left(s_{1 / 2}\right)^{2}\left(p_{3 / 2}\right)^{4}\left(p_{1 / 2}\right)^{1}$\\
	$\Rightarrow j=\frac{1}{2}$ and $l=1$. Thus spin and parity $=\left(\frac{1}{2}\right)^{-}$\\
	${ }_{8}^{17} O ; Z=8$ and $N=9 ; \quad N=9:\left(s_{1 / 2}\right)^{2}\left(p_{3 / 2}\right)^{4}\left(p_{1 / 2}\right)^{2}\left(d_{5 / 2}\right)^{1}$\\
	 $\Rightarrow j=\frac{5}{2}$ and $l=2$. Thus spin and parity $=\left(\frac{5}{2}\right)^{+}$
\end{answer}
\item An $\alpha$ particle is emitted by ${ }_{90}^{230} T h$ nucleus. Assuming the potential to be purely Coulombic beyond the point of separation, the height of the Coulomb barrier is $\mathrm{MeV}$ (up to two decimal places).
$$
\left(\frac{e^{2}}{4 \pi \epsilon_{0}}=1.44 \mathrm{MeV}-\mathrm{fm}, r_{0}=1.30 \mathrm{fm}\right)
$$
{\exyear{GATE 2018}}
\begin{answer}
The height of coulomb barrier for $\alpha$ particle from \\
${ }_{90} T h^{230} \rightarrow_{88} X^{226}+2 \mathrm{He}^{4}(\alpha$ - particle $)$
$$
V_{C}=\frac{1}{4 \pi \epsilon_{0}}\left(\frac{2 z e^{2}}{R}\right)
$$
Here, $R_{0}=1.3 \mathrm{fm}, \frac{e^{2}}{4 \pi \in_{0}}=1.44 \mathrm{MeV} \mathrm{fm}$
And $R=R_{0} A^{1 / 3}$\\
Here, we consider pure Coulombic interection
\begin{align*}
	&A_{T h}^{1 / 3}=A_{X}^{1 / 3}+A_{\alpha}^{1 / 3}=(226)^{1 / 3}+(4)^{1 / 3}=(6.09+1.58)=7.67 \\
	&R=R_{0} A_{T h}^{1 / 3}=1.3(7.67)
\end{align*}
Hence, $V_{C}=\left(\frac{e^{2}}{4 \pi \in_{0}}\right) \frac{2 \times 90}{1.3(7.67)}=\frac{180 \times 1.44}{1.3 \times 7.67} \frac{\mathrm{MeV}}{f \mathrm{fm}}$
$$
V_{C}=25.995 \mathrm{MeV}
$$
\end{answer}
\item The nuclear spin and parity of ${ }_{20}^{40} \mathrm{Ca}$ in its ground state is
{\exyear{GATE 2019}}
\begin{tasks}(2)
	\task[\textbf{A.}] $0^{+}$
	\task[\textbf{B.}] $0^{-}$
	\task[\textbf{C.}] $1^{+}$
	\task[\textbf{D.}] $1^{-}$
\end{tasks}
\begin{answer}
	${ }_{20}^{40} \mathrm{Ca}$ is an even-even nuclei, therefore $I=0, P=+v e$\\
	Spin-parity $=0^{+}$\\
	The correct option is \textbf{(a)}
\end{answer}
\item A radioactive element $X$ has a half-life of 30 hours. It decays via alpha, beta and gamma emissions with the branching ratio for beta decay being $0.75$. The partial half-life for beta decay in unit of hours is
{\exyear{GATE 2019}}
\begin{answer}
 Branching ratio is the fraction of particles (here $\beta$ ) which decays by an individual decay mode with respect to the total number of particles which decays
 $$B R=\frac{\left(\frac{d N}{d t}\right)_{x}}{\left(\frac{d t}{d t}\right)_{\beta}}=\frac{\left(T_{1 / 2}\right)_{x}}{\left(T_{1 / 2}\right)_{\beta}} \Rightarrow\left(T_{1 / 2}\right)_{\beta}=\frac{\left(T_{1 / 2}\right)_{x}}{B R}=\frac{30}{0.75}=40 \text { hours }$$
\end{answer}
\end{enumerate}

Nuclear and particle properties/chapter/nuclear solutions.tex


% Modified based on Xiaoming Sun's template
\documentclass{article}
\usepackage{amsmath,amsfonts,amsthm,amssymb}
\usepackage{setspace}
\usepackage{fancyhdr}
\usepackage{lastpage}
\usepackage{extramarks}
\usepackage{chngpage}
\usepackage{soul,color}
\usepackage{graphicx,float,wrapfig}

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

\newcommand{\Class}{Mathematics for Computer Science}

% Homework Specific Information. Change it to your own
\newcommand{\Title}{Homework 2}

% In case you need to adjust margins:
\topmargin=-0.45in      %
\evensidemargin=0in     %
\oddsidemargin=0in      %
\textwidth=6.5in        %
\textheight=9.0in       %
\headsep=0.25in         %

% Setup the header and footer
\pagestyle{fancy}                                                       %
\chead{\Title}  %
\rhead{\firstxmark}                                                     %
\lfoot{\lastxmark}                                                      %
\cfoot{}                                                                %
\rfoot{Page\ \thepage\ of\ \protect\pageref{LastPage}}                          %
\renewcommand\headrulewidth{0.4pt}                                      %
\renewcommand\footrulewidth{0.4pt}                                      %

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Some tools
\newcommand{\enterProblemHeader}[1]{\nobreak\extramarks{#1}{#1 continued on next page\ldots}\nobreak%
                                    \nobreak\extramarks{#1 (continued)}{#1 continued on next page\ldots}\nobreak}%
\newcommand{\exitProblemHeader}[1]{\nobreak\extramarks{#1 (continued)}{#1 continued on next page\ldots}\nobreak%
                                   \nobreak\extramarks{#1}{}\nobreak}%

\newcommand{\homeworkProblemName}{}%
\newcounter{homeworkProblemCounter}%
\newenvironment{homeworkProblem}[1][Problem \arabic{homeworkProblemCounter}]%
  {\stepcounter{homeworkProblemCounter}%
   \renewcommand{\homeworkProblemName}{#1}%
   \section*{\homeworkProblemName}%
   \enterProblemHeader{\homeworkProblemName}}%
  {\exitProblemHeader{\homeworkProblemName}}%

\newcommand{\homeworkSectionName}{}%
\newlength{\homeworkSectionLabelLength}{}%
\newenvironment{homeworkSection}[1]%
  {% We put this space here to make sure we're not connected to the above.

   \renewcommand{\homeworkSectionName}{#1}%
   \settowidth{\homeworkSectionLabelLength}{\homeworkSectionName}%
   \addtolength{\homeworkSectionLabelLength}{0.25in}%
   \changetext{}{-\homeworkSectionLabelLength}{}{}{}%
   \subsection*{\homeworkSectionName}%
   \enterProblemHeader{\homeworkProblemName\ [\homeworkSectionName]}}%
  {\enterProblemHeader{\homeworkProblemName}%

   % We put the blank space above in order to make sure this margin
   % change doesn't happen too soon.
   \changetext{}{+\homeworkSectionLabelLength}{}{}{}}%

\newcommand{\Answer}{\ \\\textbf{Answer:} }
\newcommand{\Acknowledgement}[1]{\ \\{\bf Acknowledgement:} #1}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Make title
\title{\textmd{\bf \Class: \Title}}
\date{March 8, 2019}
\author{Xingyu Su 2015010697}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}
\begin{spacing}{1.1}
\maketitle \thispagestyle{empty}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Begin edit from here

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% HOMEWORK-2-LPV 3.8.8
\begin{homeworkProblem}[LPV 3.8.8]
Prove the following identities:
\begin{align*}
  \sum_{k=0}^{m}{(-1)^k\binom{n}{k}} = (-1)^m\binom{n-1}{m};\\
  \sum_{k=0}^n\binom{n}{k}\binom{k}{m}=\binom{n}{m}2^{n-m}.
\end{align*}

\Answer

From Pascal Triangle, we have
\begin{equation*}
  \binom{n}{k}=\binom{n-1}{k-1}+\binom{n-1}{k}
\end{equation*}
\hspace{1em}
So we have:
\begin{align*}
  \sum_{k=0}^{m}{(-1)^k\binom{n}{k}}
    &=\binom{n}{0}-\binom{n}{1}+\binom{n}{2}-\binom{n}{3}+\cdots+(-1)^k\binom{n}{k} \\
    &=\binom{n-1}{0}-\left[\binom{n-1}{0}+\binom{n-1}{1}\right]+\left[\binom{n-1}{1}+\binom{n-1}{2}\right]-\cdots+(-1)^m\left[\binom{n-1}{m-1}+\binom{n-1}{m}\right] \\
    &=(-1)^m\binom{n-1}{m}
\end{align*}
\hspace{1em}
For the second identity, consider m is a non-negetive number. So when $k<m$, $\binom{k}{m}=0$, then:
\begin{equation*}
  \sum_{k=0}^n\binom{n}{k}\binom{k}{m} = \sum_{k=m}^n\binom{n}{k}\binom{k}{m}
\end{equation*}
\hspace{1em}
Easy to find:
\begin{align*}
  \binom{n}{k}\binom{k}{m}
    &= \frac{n!}{k!(n-k)!}\frac{k!}{m!(k-m)!} \\
    &= \frac{n!}{(n-k)!(k-m)!m!} \\
    &= \frac{n!}{(n-m)!m!}\frac{(n-m)!}{(n-k)!(k-m)!} \\
    &= \binom{n-m}{k-m}\binom{n}{m}
\end{align*}
\hspace{1em}
So:
\begin{equation*}
\sum_{k=0}^n\binom{n}{k}\binom{k}{m}=\binom{n}{m}\sum_{k=m}^n\binom{n-m}{k-m} = \binom{n}{m}\sum_{i=0}^{n-m}\binom{n-m}{i}=\binom{n}{m}2^{n-m}
\end{equation*}
\end{homeworkProblem}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% HOMEWORK-2-LPV 3.8.12
\begin{homeworkProblem}[LPV 3.8.12]
Prove that
\begin{equation*}
  1+\binom{n}{1}2+\binom{n}{2}4+\cdots+\binom{n}{n-1}2^{n-1}+\binom{n}{n}2^n=3^n.
\end{equation*}
Try to find a combinatorial proof.

\Answer

Consider $n=1$, obviously we have $1+\binom{1}{1}2=3=3^1$, equation is true. If the equation is true when $n=k-1$:
\begin{equation*}
  1+\binom{k-1}{1}2+\binom{k-1}{2}4+\cdots+\binom{k-1}{k-1}2^{k-1} = 3^{k-1}
\end{equation*}
\hspace{1em}
Then for $n=k$, we have:
\begin{align*}
  & 1+\binom{k}{1}2+\binom{k}{2}4+\cdots+\binom{k-1}{k-1}2^{k-1}+\binom{k}{k}2^{k} \\
    & = 1 + \left[\binom{k-1}{0}+\binom{k-1}{1}\right]2+\left[\binom{k-1}{1}+\binom{k-1}{2}\right]4+\cdots+\left[\binom{k-1}{k-1}+\binom{k-1}{k}\right]2^k \\
    & = 1+\binom{k-1}{1}2+\binom{k-1}{2}4+\cdots+\binom{k-1}{k-1}2^{k-1} + 2 +\binom{k-1}{1}4+\cdots+\binom{k-1}{k-1}2^{k} \\
    & = 3^{k-1}+2\times 3^{k-1} \\
    & = 3^k
\end{align*}
\hspace{1em}
So the equation is true for all $n=1,2,3,...$

\end{homeworkProblem}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% HOMEWORK-2-LPV 3.8.14
\begin{homeworkProblem}[LPV 3.8.14]
Let $n$ be a positive integer divisible by 3. Use Stirling’s formula to find the approximate value of $\binom{n}{n/3}$.

\Answer

We know that:
\begin{equation*}
\binom{n}{n/3}=\frac{n!}{(n/3)!(2n/3)!}
\end{equation*}
\hspace{1em}
By the Stirling's formula, we have:
\begin{equation*}
n!\ \sim \sqrt{2\pi n}\left(\frac{n}{e}\right)^n, (n/3)!\ \sim \sqrt{2\pi n/3}\left(\frac{n/3}{e}\right)^{n/3}, (2n/3)!\ \sim \sqrt{4\pi n/3}\left(\frac{2n/3}{e}\right)^{2n/3},
\end{equation*}
\hspace{1em}
And so:
\begin{equation*}
  \binom{n}{n/3}
    =\frac{\sqrt{2\pi n}\left(\frac{n}{e}\right)^n}{\sqrt{2\pi n/3}\left(\frac{n/3}{e}\right)^{n/3} \sqrt{4\pi n/3}\left(\frac{2n/3}{e}\right)^{2n/3}}
    =\frac{1}{2/3\sqrt{\pi n}\left(\frac{1}{3}\right)^n 2^{2n/3}}
    =\frac{3}{2}\sqrt{\frac{1}{\pi n}} 3^n 2^{-\frac{2}{3}n}
\end{equation*}
\hspace{1em}
The comparison between the real value and its approxmation is shown in Figure 1.
\begin{figure}[ht]
  \centering
  \includegraphics[width=1.0\linewidth]{figures/compare}
  \caption{Comparison of between approximation and real value with total number varies from 3 to 99.}
  \label{fig:compare}
\end{figure}

\end{homeworkProblem}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% HOMEWORK-2-LPV 4.3.7
\begin{homeworkProblem}[LPV 4.3.7]
How many subsets does the set $\{1, 2, \cdots , n\}$ have that contain no three consecutive integers? Find a recurrence.

\Answer

Denote the sequence of integers as $A_n$. It's easy to find that $A_1 = 1$, $A_2 = 3$, $A_3 = 6$, $A_4=12$. And as shown in Figure 2, when $A_1, A_2, \cdots,A_n$ are known, we can get $A_{n+1}$ from previous values. (1) Consider the part of subsets without element $n+1$, this part counts to be $A_n$ obviously; and the part contains element $n+1$ can be divide into 2 parts: (2a) $A_n$ with $n+1$ which contains (2b) $A_{n-3}$ exception violating rules. So the recurrence can be written as:
\begin{equation*}
  A_{n+1} = 2A_n-A_{n-3}
\end{equation*}
\hspace{1em}
With this formula, we can get $A_5= 2A_4-A_1=23$, which is proved to be true after counting by hands.
\begin{figure}[ht]
  \centering
  \includegraphics[width=0.5\linewidth]{figures/recurr}
  \caption{Demonstration of the recurrence of $A_n$.}
  \label{fig:recurr}
\end{figure}

\end{homeworkProblem}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% HOMEWORK-2-LPV 4.3.12
\begin{homeworkProblem}[LPV 4.3.12]
Recalling the Lucas numbers $L_n$ introduced in Exercise 4.3.2, prove the following identities:

(a) $ F_{2n}=F_nL_n;$

(b) $ 2F_{k+n}=F_kL_n+F_nL_k;$

(c) $ 2L_{k+n}=5F_kF_n+L_kL_n;$

(d) $ L_{4k}=L_{2k}^2-2;$

(e) $ L_{4k+2}=L_{2k+1}^2+2.$
\Answer

From Exercise 4.3.2 we can easily know that:
\begin{equation*}
L_{n} = F_n+2F_{n-1}
\end{equation*}
\hspace{1em}
(a)
\begin{align*}
F_n L_n
  &=F_n(F_n+2F_{n-1}) \\
  &=F_n^2+2F_nF_{n-1}+F^2_{n-1}-F^2_{n-1} \\
  &=(F_n+F_{n-1})^2-F_{n-1}^2 \\
  &=F_{n+1}^2+F_{n}^2-F_n^2-F_{n-1}^2 \\
  &=F_{2n+1}-F_{2n-1} \\
  &=F_{2n}
\end{align*}
\hspace{2em}
(b) From identity (4.5) $F_{a+b+1}=F_{a+1}F_{b+1}+F_a F_b$, we can get:
\begin{align*}
  F_k L_n + F_n L_k
    &=F_k(F_n+2F_{n-1})+F_n(F_k+2F_{k-1}) \\
    &=2F_k F_n+2F_{n-1}F_k+2F_{k-1}F_n +2F_{k-1}F_{n-1}-2F_{k-1}F_{n-1} \\
    &=2(F_k+F_{k+1})(F_n+F_{n-1})-2F_{k-1}F_{n-1} \\
    &=2(F_{k+1} F_{n+1}+F_k F_n-F_k F_n-F_{k-1}F_{n-1}) \\
    &=2(F_{k+n+1}-F_{k+n-1}) \\
    &=2F_{k+n}
\end{align*}
\hspace{2em}
(c)
\begin{align*}
  5F_k F_n +L_k L_n
    &= 5F_k F_n + (F_k+2F_{k-1})(F_n+2F_{n-1}) \\
    &= 2(F_k F_n +F_{k-1}F_n+2F_{n-1}F_k)+4(F_k F_n+F_{k-1}F_{n-1}) \\
    &= 2F_{k+n}+4F_{k+n-1} \\
    &= 2L_{k+n}
\end{align*}
\hspace{2em}
(d) From (a) and identity (4.5), it's easy to get:
\begin{align*}
  L_{4k}
    &= F_{4k}+2F_{4k-1} \\
    &= F_{2k}L_{2k}+2(F_{2k}F_{2k}+F_{2k-1}F_{2k-1}) \\
    &= L_{2k}^2-L_{2k}(F_{2k}+2F_{2k-1})+F_{2k}L_{2k}+2(F_{2k}F_{2k}+F_{2k-1}F_{2k-1})\\
    &= L_{2k}^2-2F_{2k}F_{2k-1}+2F_{2k}^2-2F_{2k-1}^2 \\
    &= L_{2k}^2+2F_{2k}^2-2F_{2k-1}F_{2k+1}
\end{align*}

\hspace{2em}
Denote $A_n = F_{n}^2-F_{n-1}F_{n+1}$, so:
\begin{align*}
  A_n
    &= F_{n}^2-F_{n-1}F_{n+1} \\
    &= F_n^2-F_{n-1}(F_n+F_{n-1}) \\
    &= (F_n-F_{n-1})F_n-F_{n-1}^2 \\
    &= -(F_{n-1}^2 - F_{n-2}F_n) \\
    &=-A_{n-1} \\
    &= (-1)^{n-1} A_1
\end{align*}

\hspace{2em}
And $A_1 = F_1^2-F_0 F_2=1$, so:
\begin{equation*}
  L_{4k} = L_{2k}^2+2A_{2k}=L_{2k}^2+2(-1)^{2k-1}=L_{2k}^2-2
\end{equation*}

\hspace{2em}
(e) Similar to (d), we have:
\begin{equation*}
  L_{4k+2} = L_{2k+1}^2+2A_{2k+1}=L_{2k+1}^2+2(-1)^{2k}=L_{2k+1}^2+2
\end{equation*}
\end{homeworkProblem}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% HOMEWORK-2-LPV 4.3.14
\begin{homeworkProblem}[LPV 4.3.14]
\hspace{1.2em}
(a) Prove that every positive integer can be written as the sum of different Fibonacci numbers.

(b) Prove even more: every positive integer can be written as the sum of different Fibonacci numbers, so that no two consecutive Fibonacci numbers are used.

(c) Show by an example that the representation in (a) is not unique, but also prove that the more restrictive representation in (b) is.

\Answer

(a) Consider positive integer $N$, when $N$ is equal to a Fibonacci number, the identity is obviously true. If for any $0<N<F_n$, the identity is true, and
\begin{equation*}
  N=\sum_{i=1}^{n-1}a_i F_i, a_i \in \{0,1\}
\end{equation*}
So for bigger integer $F_n<N<F_{n+1}$, we can get:
\begin{equation*}
  N=F_n+\sum_{i=1}^{n-1}b_i F_i, b_i \in \{0,1\}
\end{equation*}
which means if first few integers satisfy the identity, then the identity is true for all integers. Since we have known that for $N=1,2,3,5,8...$, the identity is true. Then we can say  every positive integer can be written as the sum of different Fibonacci numbers.

(b) Similar to (a), we only need to prove that $\sum F_n+F_{n-2}+\cdots \geq F_{n+1}-1$, then for every integers between $F_{n}$ and $F_{n+1}$, the identity are true. Here are inductions:
\begin{equation*}
  F_1+F_3 = F_4,\ \text{then}\ F_1+F_3+F_5=F_4+F_5=F_6
\end{equation*}
\begin{equation*}
  \text{Known} \sum_{i=1}^{k}F_{2k-1}=F_{2k}, \text{then} \sum_{i=1}^{k+1}F_{2k-1}=F_{2k}+F_{2k+1} =F_{2k+1}
\end{equation*}
\begin{equation*}
  F_2+F_4 = F_5-1,\ \text{then}\ F_2+F_4+F_6=F_5-1+F_6=F_7-1
\end{equation*}
\begin{equation*}
  \text{Known} \sum_{i=1}^{k}F_{2k}=F_{2k+1}-1, \text{then} \sum_{i=1}^{k+1}F_{2k}=F_{2k+1}-1+F_{2k+2} =F_{2k+3}-1
\end{equation*}

So $\sum F_n+F_{n-2}+\cdots \geq F_{n+1}-1$ is true for all positive even numbers and odd numbers. Which in result proves the identity.

(c) An example: when $N=32$, there can be 2 ways to represent (a) as below
\begin{equation*}
  32 = 21 + 8 + 3 = 13 + 8 + 5 + 3 + 2 + 1
\end{equation*}
\hspace{1em}
But for representation in (b), there is only one exception that
\begin{equation*}
  F_{2k} = \sum_{i=1}^k F_{2k-1}
\end{equation*}
\hspace{1em}
And all integers left have only one way to get the identity true shown in (b).
\end{homeworkProblem}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% HOMEWORK-2-Special Problem 1
\begin{homeworkProblem}[Special Problem 1]
In class we considered a 3-Person Hat Problem in which each person can see the bits posted on the other two people’s foreheads and tries to guess the bit on his/her own forehead, but each person is permitted to make no guess; the team wins if (1) no one makes an incorrect guess, and (2) at least one person makes a correct guess. We discussed a strategy for the team with a probability 3/4 to win.

\textit{Question:} Give a rigorous proof that this is the best strategy possible. That is, no strategy for the team can win with probability higher than 3/4. Your model should be general enough to include strategies with randomized moves. (Recall that in class, we mentioned a particular strategy in which one person always make a random guess (0 or 1) and the other two don’t speak.)

\textbf{Remarks} You should first define a mathematical model. Define a probability space, how any strategy is specified precisely, and how to define win as an event for the strategy. This allows you to define what the term best strategy means.

\Answer

The state space should be:
\begin{align*}
  & \{0,0,0\}, \ \{0,0,1\}, \ \{0,1,0\}, \ \{0,1,1\},\\
  & \{1,0,0\}, \ \{1,0,1\}, \ \{1,1,0\}, \ \{1,1,1\}
\end{align*}

\hspace{1em}
And probability for each state is all ${1/8}$. The strategy to win ${3/4}$ conditions is:

\hspace{2em}
(1) If first person sees one type of bits, he guess the other type. The other two partners will know their bits.

\hspace{2em}
(2)If first person sees two type of bits, he makes no guess. Since the other two will know each others' bit, then they can guess for themselves.

\hspace{1em}
Consider the infomation passed from the first person, we can know for sure that \textbf{he can not make sure what type of bit he has in every state}. And \textbf{if he always make no guess, he brings nothing to the other two}. Which means he can only \textbf{make no guess in at most half of states to pass infomation}, and \textbf{for the other half, he can only make a guess which can wins in at most half of states left}.

\hspace{1em}
The proof is not rigorous enough, but it explains well for me.

\end{homeworkProblem}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% HOMEWORK-2-Special Problem 2
\begin{homeworkProblem}[Special Problem 2]
We discussed in class a game of ”Finding your IDs” for n students, using a cycle-following strategy for all the students. Let $g(n)$ be the probability of winning in this game, i.e. all students succeed in finding their ID.

(a) Give an explicit mathematical formula for $g(n)$.

(b) Determine the value of $\lim_{n\to \infty}g(n)$.

(c) Let us consider a modified game, in which each student is only allowed to search through $n/3$ boxes (instead of $n/2$). Let $h(n)$ be the probability of winning. Determine the value of $\lim_{n\to\infty} h(n)$.

\Answer

(a) Since each student have half probability to get his ID correct, then $g(n)=(\frac{1}{2})^n$

(b) $\lim_{n\to\infty}g(n)=\lim_{n\to\infty}(\frac{1}{2})^n=0$

(c) Similarly, $h(n)=(\frac{1}{3})^n$, $\lim_{n\to\infty}h(n)=\lim_{n\to\infty}(\frac{1}{3})^n=0$

\end{homeworkProblem}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% HOMEWORK-2-Special Problem 3
\begin{homeworkProblem}[Special Problem 3]
In a New Year’s party with $2n$ people, $k$ random names are picked to receive gifts. Assume that these $2n$ people are actually $n$ husband-wife couples. Let $r_{n,k}$ be the probability that at least for one couple, both husband and wife win gifts.

(a) Give a mathematical formula for $r_{n,k}$.

(b) Determine the value of $\lim_{n\to\infty}r_{n,\sqrt{n}}$ .

\Answer

(a) The opposite condition is that all k persons belong to different couples. So:
\begin{align*}
  & if\ k\leq n, r_{n,k} = 1-\frac{C_{n}^{k} 2^k}{C_{2n}^{k}} \\
  & else, \ r_{n,k}=1
\end{align*}

\hspace{1em}
(b) For ${n,k}$
\begin{equation*}
1-\frac{C_{n}^{k} 2^k}{C_{2n}^{k}} = 1-\frac{n!2^k (2n-k)!}{(2n)!(n-k)!}
\end{equation*}

\hspace{1em}
And with $k=\sqrt{n}$, Stirling's formula $n!\sim \sqrt{2\pi n}(\frac{n}{e})^n$, we have:
\begin{align*}
  \lim_{n\to\infty}{r_{n,\sqrt{n}}}
    &= 1-\lim_{n\to\infty}\frac{\sqrt{2\pi n}\left(\frac{n}{e}\right)^n\sqrt{2\pi (2n-\sqrt{n})}\left(\frac{2n-\sqrt{n}}{e}\right)^{2n-\sqrt{n}}}{\sqrt{2\pi 2n}\left(\frac{2n}{e}\right)^{2n}\sqrt{2\pi(n-\sqrt{n})}\left(\frac{n-\sqrt{n}}{e}\right)^{n-\sqrt{n}}} \\
    &= 1-\lim_{n\to\infty}\sqrt{\frac{2\sqrt{n}-1}{2\sqrt{n}-2}}\left(\frac{2\sqrt{n}-1}{2\sqrt{n}-2}\right)^{n-\sqrt{n}}\left(1-\frac{1}{2\sqrt{n}}\right)^{n}
\end{align*}

\hspace{1em}
Denote $\sqrt{n}$ as $x$, then
\begin{equation*}
  \lim_{n\to\infty}{r_{n,\sqrt{n}}} = 1-\lim_{x\to\infty}\left(\frac{2x-1}{2x-2}\right)^{x^2-x+\frac{1}{2}}\left(1-\frac{1}{2x}\right)^{x^2} \triangleq 1-A
\end{equation*}
\begin{align*}
  \ln{A}
    &= \lim_{x\to\infty}\left(x^2-x+\frac{1}{2}\right)\ln{\left(1+\frac{1}{2x-2}\right)}+\lim_{x\to\infty}x^2\ln\left(1-\frac{1}{2x}\right) \\
    &= \lim_{x\to\infty}\left(-x+\frac{1}{2}\right)\ln{\left(1+\frac{1}{2x-2}\right)}+\lim_{x\to\infty}x^2\ln{\left(1+\frac{1}{2x-2}\right)\left(1-\frac{1}{2x}\right)}
\end{align*}
\hspace{1em}
First part:
\begin{align*}
  \lim_{x\to\infty}\left(-x+\frac{1}{2}\right)\ln{\left(1+\frac{1}{2x-2}\right)}
    &= -\frac{1}{2}\lim_{c\to\infty}(c+1)\ln(1+1/c) \\
    &= -\frac{1}{2}\lim_{c\to\infty}\frac{\partial \ln(1+1/c)}{\partial c}/\frac{\partial \frac{1}{c+1}}{\partial c} \\
    &= -\frac{1}{2}\lim_{c\to\infty}\frac{c+1}{c}\\
    &= -\frac{1}{2}
\end{align*}

\hspace{1em}
Second part:
\begin{align*}
  \lim_{x\to\infty}x^2\ln{\left(1+\frac{1}{2x-2}\right)\left(1-\frac{1}{2x}\right)}
    &= \lim_{x\to\infty}x^2\ln\left(1+\frac{1}{4x(x-1)}\right) \\
    &= \lim_{x\to\infty}\frac{\frac{\partial \ln(1+\frac{1}{4x(x-1)})}{\partial x}}{\frac{\partial \frac{1}{x^2}}{\partial x}} \\
    &= \lim_{x\to\infty}\frac{x^2}{2(x-1)(2x-1)} \\
    &= \frac{1}{4}
\end{align*}

\hspace{1em}
So:
\begin{equation*}
\lim_{n\to\infty}{r_{n,\sqrt{n}}}=1-e^{\ln A}=1-e^{-\frac{1}{2}+\frac{1}{4}}=1-e^{-\frac{1}{4}}
\end{equation*}

\hspace{1em}
And Figure 3 shows the convergence between of $r_{n,\sqrt{n}}$ and $1-e^{-\frac{1}{4}}$.
\begin{figure}[ht]
  \centering
  \includegraphics[width=0.5\linewidth]{figures/conver}
  \caption{Demonstration of the convergence between of $r_{n,\sqrt{n}}$ and $1-e^{-\frac{1}{4}}$.}
  \label{fig:conver}
\end{figure}

\end{homeworkProblem}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% ACKNOWLEGEMENT
\Acknowledgement

[1] Thanks to \href{https://github.com/jiweiqi}{Weiqi Ji} for discussing about SP3(b).

% End edit to here
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\end{spacing}
\end{document}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%