%==============================================================================
\chapter{Quantification of the Difference}
\label{chap:quantifing}
%==============================================================================

Having shown explicitly the discrepancy between the pure and the thermal
descriptions as well as where it is most significant, the author will then
quantify the difference. Related definitions of distances in quantum
mechanics are introduced in \cref{chap:distappd}.
%In this chapter, it will be explained why the difference between the two cases
%is expected to be negatively correlated to the mass of the black hole, then
%the difference will be evaluated.

%------------------------------------------------------------------------------
\section{The Canonical State} %Popescu--Winter Theorem
\label{sec:arbitrary-canonical}
%------------------------------------------------------------------------------

It has been shown in \cite{Popescu2006} that a small subsystem in a large,
isolated system which is subject to a \emph{constraint}, is expected to be very
close to a \emph{canonical state} of it, which reduces to the usual
thermodynamic \emph{canonical ensemble} when the total system is under an
\emph{energy constraint}.

Denoted by $U$, the large system has all its possible pure states in Hilbert
space $\mscrH_U$ which has a finite dimension $d_R = \dim \mscrH_U$. A global
constraint $R$ is also imposed, which restricts the physical Hilbert space of
$U$ to $\mscrH_R \subseteq \mscrH_U$. The \emph{equiprobable state} of $U$ is
\begin{equation}
\mscrE_R \coloneqq d_R^{-1} \Bbbone_R,
\end{equation}
where $\Bbbone_R$ is the identity operator on $\mscrH_R$. An energy constraint,
for instance, reads
\begin{equation}
\abr{H_U} = E_R,
\label{eq:ene-constraint}
\end{equation}
so that a state $\Ket{\alpha}$ in $\mscrH_R^{\rbr{\text{E}}}$ satisfies
\begin{equation}
E_R = \Braket{\alpha | H_U | \alpha} = \sum_E \vbr{\Braket{E | \alpha}}^2 E,
\end{equation}
where $\Ket{E}$ is an energy eigenstate of $U$ with eigenvalue $E$.

The subsystem in concern is named $S$, with \emph{all possible} states in the
Hilbert space $\mscrH_S$; the rest of $U$ is called the \emph{environment} and
denoted by $E$, the pure states of which lie in $\mscrH_E$. One has
\begin{equation}
\mscrH_S \otimes \mscrH_E = \mscrH_U \supseteq \mscrH_R,\qquad
H_U = H_S + H_E + H_\text{int},
\end{equation}
where $H_S$, $H_E$ and $H_\text{int}$ are the system, environment and
interaction Hamiltonian, respectively.

The \emph{canonical state} of $S$ is defined as
\begin{equation}
{\Omega}_S \coloneqq \tr_E {\mscrE}_R,
\end{equation}
where the trace is taken over all the degrees of freedom in the environment.
When the energy constraint \cref{eq:ene-constraint} is used, it can be shown
that $\Omega_S^{(E)}$ is a canonical ensemble\footnote{A derivation of
\cref{eq:canonical-state-def} in classical statistical physics can be found in
\cite[sec.~28]{Landau1980}.}
\begin{equation}
\Omega_S^{(E)} \propto \ee^{- H_S/T_\text{m}}
= \sum_{E_S} \ee^{-E_S/T_\text{m}} \Ket{E_S}\Bra{E_S},
\label{eq:canonical-state-def}
\end{equation}
where $T_\text{m}$ can be identified with a temperature, and $\Ket{E_S}$ is an
eigenstate of the system with eigenvalue $E$. In this case it reduces to
the traditional thermodynamic statistical physics.

%To state the theorems, one additional definition is needed:
The environment also has an \emph{effective} dimension
\begin{equation}
d_E^\text{eff} \coloneqq \rbr{\tr \Omega_E^2}^{-1} \geq d_R/d_S,
\label{eq:def-effective-dim}
\end{equation}
where ${\Omega}_E = \tr_S {\mscrE}_R$. When no constraint is enforced, so that
$\mscrH_S \otimes \mscrH_E \equiv \mscrH_U = \mscrH_R$,
\cref{eq:def-effective-dim} reduces to
\begin{equation}
d_E^\text{eff} = d_R/d_S = d_E.
\end{equation}
Detailed discussions about $d_E^\text{eff}$ can be found in \cite{Popescu2006}.

Equipped with all the definitions above, one picks an arbitrary pure state
$\Ket{\phi}\in\mscrH_R$ and denote the \emph{reduced state} of $S$ by
\begin{equation}
\rfun{\rho_S}{\phi} = \tr_E \Ket{\phi}\Bra{\phi}
\end{equation}
Then a lemma states that the average \emph{trace distance}\footnote{See
\cref{sec:trace-dist}.} between $\rho_S$ and $\Omega_S$ is very small in terms
of the ratio between $d_S$ and $d_S/d_E^\text{eff}$, i.e.\
\begin{equation}
\abr{\rfun{T}{\rfun{\rho_S}{\phi}, {\Omega}_S}} \le \frac{1}{2}
\sqrt{\frac{d_S}{d_E^\text{eff}}}.
\end{equation}
In a typical division where $d_S/d_E$ is small, this average distance will also
be tiny.

More over, the main theorem asserts that those ${\rho}_S$'s which are close to
${\Omega}_S$ dominate; the probability of a large deviation is exponentially
small with respect to the deviation. For an arbitrary $\epsilon > 0$, the
theorem states that
\begin{equation}
\frac{\sfun{V}{\cbr{\Ket{\phi} \in \mscrH_R |
\rfun{T}{\rfun{\rho_S}{\phi}, \Omega_S} \geq \eta}}}
{\sfun{V}{\cbr{\Ket{\phi} \in \mscrH_R}}} \leq \eta',
\label{eq:main-theorem-Popescu}
\end{equation}
where
\begin{equation}
\eta = \epsilon + \frac{1}{2}\sqrt{\frac{d_S}{d_E^\text{eff}}}; \qquad
\eta' = 4\rfun{\exp}{-C d_R \epsilon^2},\quad C = \frac{2}{9\pp^3}.
\label{eq:main-theorem-supp}
\end{equation}
To understand the theorem, first note that the left-hand side of
\cref{eq:main-theorem-Popescu} is a probability measure. More over, one can
choose $\epsilon = d_R^{-1/3}$ as well, so that
\begin{equation}
\eta = \epsilon + \frac{1}{2}\sqrt{\frac{d_S}{d_E^\text{eff}}} \gtrsim
d_R^{-1/3};\qquad
\eta' = 4\rfun{\exp}{-C d_R \epsilon^2} = 4\rfun{\exp}{-C d_R^{+1/3}},
\end{equation}
where $d_E^\text{eff} \gg d_S$ is also assumed. In this case, the probability
of the deviation greater than $d_R^{-1/3}$ is smaller than an
\emph{exponential} of $d_R^{+1/3}$.

Further explanations and proofs of the lemma and the theorem can
be found in \cite{Popescu2006,Popescu2007}.

%------------------------------------------------------------------------------
\section{Distance between the Pure and Mixed States}
\label{sec:dist-radiation}
%------------------------------------------------------------------------------

To apply the aforementioned formalism to the Hawking radiation, one recognises
the universe in the CGHS model as the total isolated system $U$, whereas the
gravitational degrees of freedom as $E$, and the system in concern $S$ is the
radiation field. It has been shown in \cite{Demers1996,Kiefer2001} that the
reduced state of the radiation field can indeed be \emph{thermal} in certain
\emph{decoherence} schemes, while in the collapsing case discussed in
\cref{sec:hawrad-1+1dila,sec:1+1ddlt}, the radiation field remains pure.

In this section, the trace distance between the pure and thermal descriptions
will be evaluated. Due to technical difficulties, the distance has not been able
to be derived exactly. Instead, a lower and an upper bound have been set to the
distance by \emph{Fuchs-van de Graaf inequality} in \cref{eq:ineq-fvdg}, where
only the calculable \emph{Fidelity} (see \cref{sec:fidelity}) is needed.

Note that the wave functional of the Hawking radiation field
\cref{eq:squeezed-wave-functional} is, roughly speaking, the superposition of
quantum-mechanical wave functions per Fourier mode,
\begin{equation}
\sfun{\chi_b}{g} \sim \sum_p \rfun{\chi_b^\rbr{p}}{g_p}
= \sum_p \Braket{g_p | \chi_b^\rbr{p}},
\label{eq:wave-function-decomposed}
\end{equation}
where $g_p \coloneqq \rfun{g}{p}$ is the Fourier transform of the field $g$
evaluated at $p$. On the other hand, the thermal state of the free field can
also be sloppily written as the product of the quantum-mechanical density
operators per mode,
\begin{equation}
{\rho}_\text{th} \sim \bigotimes_p {\rho}_\text{th}^\rbr{p}.
\end{equation}
By \cref{eq:fidelity-pure-mixed}, the fidelity of $\sfun{\chi_b}{g}$ and
$\rho_\text{th}$ can be reduced to the product of the fidelity per mode, because
\begin{equation}
\Braket{\chi_b | {\rho}_\text{th} | \chi_b} \sim \prod_p
\Braket{\chi_b^\rbr{p} | {\rho}_\text{th}^\rbr{p} | \chi_b^\rbr{p}}.
\label{eq:expectation-decomposed}
\end{equation}

Since $\Ket{\chi_b^\rbr{p}}$ is just a quantum-mechanical general Gaussian
state (see \cref{sec:single-harosc}), the result in \cref{eq:fidelity-gg-th}
can be adapted by substituting
\begin{equation}
\Omega = \vbr{p},\qquad \omega = p\,\coth\frac{\pp p}{2\lambda}\quad
\text{and}\quad T = T_\text{HD} \equiv \frac{\lambda}{2\pp},
\end{equation}
yielding the \emph{fidelity per mode}
\begin{equation}
F^\rbr{p} = \frac{\sqrt{u-1}}{\sqrt[4]{u^2+u+1}},\qquad
u \coloneqq \ee^q \equiv \ee^{\vbr{p}/T_\text{HD}},
\label{eq:fidelity-pt}
\end{equation}
so that the trace distance per Fourier mode can be evaluated, see
\cref{fig:trace-dist-per-mode}.

\begin{figure}
\begin{center}
\input{./graphics/graph_trace_dist_mode_bounds}
\end{center}
\caption[Possible value of the trace distance per Fourier mode]{Possible value
of the trace distance between mode wave functions in
\cref{eq:wave-function-decomposed} and the corresponding thermal density
operators. One sees that the difference becomes exponentially small with respect
to $p/T_\text{HD}$, which suggests it would be difficult to distinguish the pure
and thermal descriptions by detecting the high-energy modes in the Hawking
radiation, confirming the results in \cref{sec:corr_Fourier}.
\label{fig:trace-dist-per-mode}}
%, evaluated in terms of lower and upper bound by fidelity
\end{figure}

To approach the trace distance for the wave functional and the total thermal
state, one needs to deal with the product with continuous index in
\cref{eq:expectation-decomposed}. A popular way to go to the `continuous limit'
in \emph{summation} is
\begin{equation}
\sum_p \rfun{g}{p} \to \frac{1}{2\pp\Lambda} \int \dd p\,\rfun{g}{p},
\end{equation}
where $\Lambda$ has the same dimension as $p$ in order to fix the dimension; in
the box-normalisation scheme, for example, the corresponding $\Lambda$ would be
proportional to the volume of the box $V$. A similar method may be used to
normalise the product, namely
\begin{equation}
\prod_p \rfun{f}{p} = \cfun{\exp}{\sum_p \ln\rfun{f}{p}} \to
\cfun{\exp}{\frac{1}{2\pp\Lambda}\int \dd p\,\ln\rfun{f}{p}}.
\end{equation}
Note that the wave functional \cref{eq:squeezed-wave-functional}, which has
always been dealt with, can also be seen as being normalised by the method.
One thus derives
\begin{equation}
F = \cfun{\exp}{\frac{2}{2\pp\Lambda}\int_0^{+\infty}\dd p\,\ln F^\rbr{p}}
= \rfun{\exp}{-\frac{\pp}{9} \frac{T_\text{HD}}{\Lambda}},
\end{equation}
which is shown in \cref{fig:trace-dist-total}.

\begin{figure}
\begin{center}
\input{./graphics/graph_trace_dist_total_bounds}
\end{center}
\caption[Possible value of the trace distance between pure and thermal
descriptions]{Possible value of the trace distance between the pure and thermal
descriptions of the Hawking radiation field. One sees that the difference
between the two cases is positively (negatively) correlated with the Hawking
temperature temperature (mass of black hole).
\label{fig:trace-dist-total}}
\end{figure}

%------------------------------------------------------------------------------
\section{Discussion}
\label{sec:dist-discussion}
%------------------------------------------------------------------------------
Strictly speaking, the formalism in \cref{sec:arbitrary-canonical} is \emph{not}
applicable to the radiation field considered here, because they were proved for
\emph{finite dimensional systems}, while the cases in this work are all
\emph{infinite-dimensional}. However, since a regularised result can be
obtained, it is believable that a mathematically rigorous approach exists, which
will justify the result, similar to the renormalisation procedure in quantum
field theory.

Though the asymptotic behaviour of the trace distance with respect to Hawking
temperature has clearly been revealed by setting bounds to it, it is still
appealing to calculate its \emph{exact value}. One possible approach is by
using the results in \cite{Joos1985}, where the eigenfunctions and eigenvalues
of a general Gaussian density operator have been explicitly solved.

The evaluation of the trace distance was motivated by \citeauthor{Hsu2009} in
\cite{Hsu2009}, where operational meaning of the distance was also discussed in
terms of toy models, which is unfortunately not applicable to the field system.
In future works, it is expected that the distance between the pure and thermal
states will be understood in terms of \emph{experiments} or \emph{observations},
where the essence of physical science lies.

%%% Local Variables:
%%% mode: latex
%%% TeX-master: "../mythesis"
%%% End:


\hypertarget{classnumpp_1_1matrix_1_1sparse_1_1block}{}\section{numpp\+:\+:matrix\+:\+:sparse\+:\+:block$<$ T, Rows, Columns $>$ Class Template Reference}
\label{classnumpp_1_1matrix_1_1sparse_1_1block}\index{numpp\+::matrix\+::sparse\+::block$<$ T, Rows, Columns $>$@{numpp\+::matrix\+::sparse\+::block$<$ T, Rows, Columns $>$}}

Block version of sparse matrix.

{\ttfamily \#include $<$sparse\+\_\+block.\+hpp$>$}

\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item
\mbox{\Hypertarget{classnumpp_1_1matrix_1_1sparse_1_1block_ae63cfc45208606404488f5fe326bb1d3}\label{classnumpp_1_1matrix_1_1sparse_1_1block_ae63cfc45208606404488f5fe326bb1d3}}
using {\bfseries value\+\_\+type} = T
\item
\mbox{\Hypertarget{classnumpp_1_1matrix_1_1sparse_1_1block_a9cc87ccc78269d5061ede24a826095b7}\label{classnumpp_1_1matrix_1_1sparse_1_1block_a9cc87ccc78269d5061ede24a826095b7}}
using {\bfseries size\+\_\+type} = std\+::size\+\_\+t
\item
\mbox{\Hypertarget{classnumpp_1_1matrix_1_1sparse_1_1block_a2e487b67c00d269e7e64f59548e9de61}\label{classnumpp_1_1matrix_1_1sparse_1_1block_a2e487b67c00d269e7e64f59548e9de61}}
using {\bfseries reference} = T \&
\item
\mbox{\Hypertarget{classnumpp_1_1matrix_1_1sparse_1_1block_a469a9838360107bb0ad15b5f8b22910f}\label{classnumpp_1_1matrix_1_1sparse_1_1block_a469a9838360107bb0ad15b5f8b22910f}}
using {\bfseries const\+\_\+reference} = const T \&
\item
\mbox{\Hypertarget{classnumpp_1_1matrix_1_1sparse_1_1block_a51437641f0fb291201fa88ade1ecc187}\label{classnumpp_1_1matrix_1_1sparse_1_1block_a51437641f0fb291201fa88ade1ecc187}}
using {\bfseries pointer} = T $\ast$
\item
\mbox{\Hypertarget{classnumpp_1_1matrix_1_1sparse_1_1block_a810d06f6c2e6b0e92f73bbb971eeff7c}\label{classnumpp_1_1matrix_1_1sparse_1_1block_a810d06f6c2e6b0e92f73bbb971eeff7c}}
using {\bfseries const\+\_\+pointer} = const T $\ast$
\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item
\mbox{\Hypertarget{classnumpp_1_1matrix_1_1sparse_1_1block_a83470439e34e65f8abc0d59c81bf09c4}\label{classnumpp_1_1matrix_1_1sparse_1_1block_a83470439e34e65f8abc0d59c81bf09c4}}
{\bfseries block} (const \hyperlink{classnumpp_1_1matrix_1_1sparse_1_1block}{block} \&)=default
\item
\mbox{\Hypertarget{classnumpp_1_1matrix_1_1sparse_1_1block_a48e8a9c7c0610bb7e8b84b67db6e5a6c}\label{classnumpp_1_1matrix_1_1sparse_1_1block_a48e8a9c7c0610bb7e8b84b67db6e5a6c}}
{\bfseries block} (\hyperlink{classnumpp_1_1matrix_1_1sparse_1_1block}{block} \&\&)=default
\item
\mbox{\Hypertarget{classnumpp_1_1matrix_1_1sparse_1_1block_aecf67898fb5cd432a940c4cb22b6790b}\label{classnumpp_1_1matrix_1_1sparse_1_1block_aecf67898fb5cd432a940c4cb22b6790b}}
\hyperlink{classnumpp_1_1matrix_1_1sparse_1_1block}{block} \& {\bfseries operator=} (\hyperlink{classnumpp_1_1matrix_1_1sparse_1_1block}{block} \&\&)=default
\item
\mbox{\Hypertarget{classnumpp_1_1matrix_1_1sparse_1_1block_a8ba9f28a47fd22af6fc63d6ba2a467ce}\label{classnumpp_1_1matrix_1_1sparse_1_1block_a8ba9f28a47fd22af6fc63d6ba2a467ce}}
\hyperlink{classnumpp_1_1matrix_1_1sparse_1_1block}{block} \& {\bfseries operator=} (const \hyperlink{classnumpp_1_1matrix_1_1sparse_1_1block}{block} \&)=default
\item
\mbox{\Hypertarget{classnumpp_1_1matrix_1_1sparse_1_1block_ab613bba3b224199917249af76563a7c3}\label{classnumpp_1_1matrix_1_1sparse_1_1block_ab613bba3b224199917249af76563a7c3}}
{\bfseries block} (std\+::initializer\+\_\+list$<$ std\+::initializer\+\_\+list$<$ T $>$$>$ elements)
\item
\mbox{\Hypertarget{classnumpp_1_1matrix_1_1sparse_1_1block_a0cafdc2b3674aa15cfe3575ed8d797c4}\label{classnumpp_1_1matrix_1_1sparse_1_1block_a0cafdc2b3674aa15cfe3575ed8d797c4}}
size\+\_\+type {\bfseries size} () const noexcept
\item
\mbox{\Hypertarget{classnumpp_1_1matrix_1_1sparse_1_1block_a36977c382b70c3865ab252138d4617f4}\label{classnumpp_1_1matrix_1_1sparse_1_1block_a36977c382b70c3865ab252138d4617f4}}
const std\+::array$<$ std\+::vector$<$ T $>$, Rows $>$ \& {\bfseries data} () const noexcept
\item
\mbox{\Hypertarget{classnumpp_1_1matrix_1_1sparse_1_1block_acd407b6661d5051136ec040a009651d8}\label{classnumpp_1_1matrix_1_1sparse_1_1block_acd407b6661d5051136ec040a009651d8}}
std\+::array$<$ std\+::vector$<$ T $>$, Rows $>$ \& {\bfseries data} () noexcept
\item
{\footnotesize template$<$typename U $>$ }\\auto \hyperlink{classnumpp_1_1matrix_1_1sparse_1_1block_a9ee2ec26bf97fe00dfc11957de26156c}{operator$\ast$} (const \hyperlink{classnumpp_1_1vector}{numpp\+::vector}$<$ U, Columns, false $>$ \&vec)
\end{DoxyCompactItemize}

\subsection{Detailed Description}
\subsubsection*{template$<$typename T, std\+::size\+\_\+t Rows, std\+::size\+\_\+t Columns$>$\newline
class numpp\+::matrix\+::sparse\+::block$<$ T, Rows, Columns $>$}

Block version of sparse matrix.

\begin{DoxyTemplParams}{Template Parameters}
{\em T} & arithmetic type contained in matrix class \\
\hline
{\em Rows} & number of rows in matrix \\
\hline
{\em Columns} & number of columns in matrix\\
\hline
\end{DoxyTemplParams}
{\bfseries This implementation is an experiment in cache hit-\/rate.~\newline
 } Whole sparse matrix is contained in one array, divided based on blocks of contiguous non-\/zero numbers.~\newline
After each block operation calculating row is performed.

\begin{DoxyWarning}{Warning}
{\bfseries For parallelization of the sparse matrix dense vector multiplication you need compiler with Open\+MP support}

Only sparse matrix dense vector multiplication implemented

{\bfseries Each row has to be seperate std\+::initializer\+\_\+list}
\end{DoxyWarning}
{\bfseries Pros\+:}
\begin{DoxyItemize}
\item Obviously lower memory overhead, for 50\% sparse matrix with no blocks it contains only 150\% storage of dense matrix.
\item Higher cache locality (at least in theory)
\end{DoxyItemize}

{\bfseries Cons\+:}
\begin{DoxyItemize}
\item Impossible S\+I\+MD optimization
\item Additional operations of read for every block
\end{DoxyItemize}

{\bfseries Example\+:}
\begin{DoxyCode}
\hyperlink{classnumpp_1_1matrix_1_1sparse_1_1nested}{numpp::matrix::sparse::nested<double, 3,3>} mat\{\{0,  0,   1\},
                                                \{0,  2.3, 0\},
                                                \{0,  0,   13.7\}
                                               \};
constexpr numpp::matrix::vector<double, 3> vec\{1,2,3\};
\textcolor{keyword}{auto} result = mat*vec;
\end{DoxyCode}

\begin{DoxyCode}
\textcolor{preprocessor}{#include"numpp/structures/matrices/sparse.hpp"}
\end{DoxyCode}

\subsection{Member Function Documentation}
\mbox{\Hypertarget{classnumpp_1_1matrix_1_1sparse_1_1block_a9ee2ec26bf97fe00dfc11957de26156c}\label{classnumpp_1_1matrix_1_1sparse_1_1block_a9ee2ec26bf97fe00dfc11957de26156c}}
\index{numpp\+::matrix\+::sparse\+::block@{numpp\+::matrix\+::sparse\+::block}!operator$\ast$@{operator$\ast$}}
\index{operator$\ast$@{operator$\ast$}!numpp\+::matrix\+::sparse\+::block@{numpp\+::matrix\+::sparse\+::block}}
\subsubsection{\texorpdfstring{operator$\ast$()}{operator*()}}
{\footnotesize\ttfamily template$<$typename T , std\+::size\+\_\+t Rows, std\+::size\+\_\+t Columns$>$ \\
template$<$typename U $>$ \\
auto \hyperlink{classnumpp_1_1matrix_1_1sparse_1_1block}{numpp\+::matrix\+::sparse\+::block}$<$ T, Rows, Columns $>$\+::operator$\ast$ (\begin{DoxyParamCaption}\item[{const \hyperlink{classnumpp_1_1vector}{numpp\+::vector}$<$ U, Columns, false $>$ \&}]{vec }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}

Function multiplying sparse matrix and dense vector

\begin{DoxyParams}{Parameters}
{\em vec} & Vector which will be multiplied \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
vector$<$\+U, Rows, false$>$
\end{DoxyReturn}

The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item
structures/matrices/sparse/sparse\+\_\+block.\+hpp\end{DoxyCompactItemize}


\documentclass[main.tex]{subfiles}
\begin{document}

\marginpar{Tuesday\\ 2020-11-3, \\ compiled \\ \today}

\begin{figure}[ht]
\centering
\includegraphics[width=\textwidth]{figures/roche-equipotential}
\caption{Equipotential lines for the Roche potential \(\phi _R\). \(M_{1, 2}\) mark the two masses, while the Lagrange points\(L\) are the ones in which the potential is stationary: \(\nabla \phi _R = 0\).}
\label{fig:roche-equipotential}
\end{figure}

% The equation of motion of a particle in the corotating frame is
% %
% \begin{align}
% \pdv{\vec{v}}{t}
% + \qty(\vec{v} \cdot \vec{\nabla}) \vec{v}
% = - \frac{1}{\rho } \vec{\nabla} P
% - \vec{\omega} \wedge \vec{v}
% - \vec{\nabla} \phi _R
% \,,
% \end{align}
% %
% where \(\phi _R\) is the Roche potential, which can be written in terms of the parameters \(q = M_2 / M_1 \) and \(a\);
%
% \todo[inline]{there might be a wrong sign in the last lecture!}
%
% \begin{align}
% \phi _R = - \frac{GM_1}{\abs{\vec{r} - \vec{r}_1}}
% - \frac{GM_2}{\abs{\vec{r} - \vec{r}_2}}
% - \frac{1}{2} \qty(\vec{\omega} \wedge \vec{r})^2
% \,.
% \end{align}
% \todo[inline]{insert diagram for the quantities in the potential}

Also, if \(\theta \) is the angle between \(\vec{\omega}\) and \(\vec{r}\) we can write
%
\begin{align}
\qty(\vec{\omega} \wedge \vec{r})^2 = \omega^2 r^2 \sin^2 \theta
\,.
\end{align}

Let us come back to the Roche potential, whose equipotential contours we sketch in figure \ref{fig:roche-equipotential}.
In terms of the aforementioned variables \(q\) and \(\theta \) it can be written as
%
\begin{align}
\phi _R &=
- G (M_1 + M_2 ) \qty[ + \frac{1}{2} \frac{\omega^2 r^2 \sin^2\theta }{G (M_1 + M_2 )}
+ \frac{GM_1 }{G (M_1 + M_2 ) \abs{\vec{r} - \vec{r}_1 }}
+ \frac{GM_2 }{G (M_1 + M_2 ) \abs{\vec{r} - \vec{r}_2 }}
 ]  \\
 &= - G (M_1 + M_2 )
 \qty[
     \frac{1}{2} \frac{\omega^2r^2 \sin^2\theta }{G(M_1 + M_2 )}
     + \frac{1}{(1 + q) \abs{\vec{r} - \vec{r}_1}}
     + \frac{q}{(1 + q) \abs{\vec{r} - \vec{r}_2}}
 ]
\,.
\end{align}

We can then use Cartesian coordinates centered in \(M_1 \):
then,
%
\begin{align}
\phi _R = - \frac{G (M_1 + M_2  )}{2 a^3}
\qty[ \frac{2 a^3}{1 + q}
\frac{1}{\sqrt{x^2 +y^2 +z^2}}
+
\frac{2 q a^3}{1 + q}
\frac{1}{\sqrt{(x-a)^2 + y^2 +z^2}}
+ \qty[(x - x _{\text{CM}})^2 + y^2]
]
\,,
\end{align}
%
where
%
\begin{align}
x _{\text{CM}} = \frac{qa}{1 + q}
\,,
\end{align}
%
so if we rescale all the spatial coordinates by the major semi axis \(a\) we get
%
\begin{align}
\phi _R = - \frac{G (M_1 + M_2 )}{2a}
\qty[
\frac{2}{1 +q}
\frac{1}{\sqrt{x^2 +y^2 +z^2}}
+
\frac{2 q}{1 + q}
\frac{1}{\sqrt{(x-1)^2 + y^2 + z^2}}
+ \qty[\qty(x - \frac{q}{1 + q})^2 + y^2]
]
\,.
\end{align}

If the stars are stationary, or in slow evolution. Then, their surfaces will be (at least in first approximation) at rest. Therefore, the derivative terms vanish, and we get
%
\begin{align}
0  = - \frac{1}{\rho } \vec{\nabla} P - \vec{\nabla} \phi _R
\,,
\end{align}
%
but the surface is defined by \(\vec{\nabla} P = 0\), which by this equation corresponds to \(\vec{\nabla} \phi _R = 0\).

The star will then take the shape of an equi-Roche potential surface.
What is this shape? See \ref{fig:roche-equipotential}.

% \todo[inline]{Make 2D plots, cuts of the surface}

\subsection{The Roche lobe}

We have roughly spherical contours near the stars, and a figure-eight contour eventually.
The center of this contour is called \(L_1 \), the first or ``inner'' Lagrange point.

Analogy with a dog food container for Roche Lobe overflow.

Is the overflow stable? It depends on whether the volume of the Roche lobe increases or decreases as the donor star loses mass: in the latter case.

% Tight worn jeans?

We can introduce a characteristic \textbf{radius} of the Roche Lobe, calculated by
%
\begin{align}
V _{\text{lobe}} = \frac{4}{3} \pi R _{\text{lobe}}^3
\,,
\end{align}
%
although the lobe is not a sphere this allows us to give a characteristic number.
We can calculate \cite[]{eggletonApproximationsRadiiRoche1983}:
%
\begin{align}
\frac{R_{\text{lobe}}}{a} = f(q) \approx
\begin{cases}
    \num{.38} + \num{.2} \log_{10} q  & \num{.5} < q < \num{20}\\
    \num{.46}  \qty( \frac{q}{1 + q})^{1/3}
    & 0 < q < \num{.5}
\end{cases}
\,,
\end{align}
%
and we can see that the dependence on \(q\) is quite weak. A plot of this is shown in figure \ref{fig:roche-lobe-radius}:
%
\begin{figure}[ht]
\centering
\includegraphics[width=\textwidth]{figures/roche-lobe-radius}
\caption{Radius of the Roche lobe as a function of \(q\).}
\label{fig:roche-lobe-radius}
\end{figure}

However, the orbital separation \(a\) is itself a function of \(q\), and the dependence \(a(q)\) is much more relevant than the dependence of \(R _{\text{lobe}} / a\).

In order to calculate \(a(q)\), let us make some assumptions.
\begin{enumerate}
    \item \(M_1 + M_2 = \const\). This is realistic: it is hard for the binary star system as a whole to lose or gain mass.
    \item The total angular momentum \(L _{\text{tot}}\) is a constant. This is a bit tricky: even a small amount of mass loss can result in high angular momentum loss.
    \item \(L _{\text{tot}} = L _{\text{orb}}\): all the angular momentum is orbital. We are neglecting the spins of the stars, and the angular momentum of the gas. This is realistic, since tidal forces move the configuration towards a tidally locked state.
\end{enumerate}

The conservation of mass tells us that \(M_1 (1 + q)\) is constant.
The orbital angular momentum is written in terms of the distances of the stars from the center of mass:
%
\begin{align}
L _{\text{orb}} &= M_1 v_1 a_1 + M_2 v_2 a_2  \\
&= M_1 a_1^2 \omega + M_2 a_2^2 \omega
\,,
\end{align}
%
so if we place the origin of our coordinates in the center of mass we can write everything in terms of the orbital separation \(a = a_1 + a_2 \):
% \todo[inline]{So \(a\) is not the semimajor axis}
%
\begin{align}
-M_1 a_1 + M_2 a_2 &= 0  \\
- (M_1 + M_2 ) a_1 + M_2 a &= 0  \\
a_1 &= \frac{qa}{1+q} \\
a_2 &= \frac{a}{1 +q}
\,.
\end{align}

In terms of angular momentum we get
%
\begin{align}
\qty[
    M_1 \frac{q^2 a^2}{(1 + q)^2}
    + M_2 \frac{a^2}{(1+q)^2}
]\omega &= \const \\
M_1 a^2
\qty[
    \frac{q^2}{(1 + q)^2}
    + \frac{q}{(1+q)^2}
]\omega &= \const
\,,
\end{align}
%
which means
%
\begin{align}
\frac{a^2 M_1 \omega q}{1 + q} =
\frac{a^2 M_1 2 \pi  q}{P(1 + q)}
= \const
\,,
\end{align}
%
since \(\omega = 2\pi / P\), where \(P\) is the orbital period.
We also know that (because of mass conservation) \(M_1 \propto (1 + q)^{-1}\), therefore
%
\begin{align}
\frac{a^2 q}{(1+q)^2} \frac{1}{P}
\,,
\end{align}
%
but also Kepler's third law tells us that \(a^3 \propto P^2\): so, \(P \propto a^{3/2}\). This yields
%
\begin{align}
\frac{a^{2 - 3/2} q}{(1+q)^2} = \sqrt{a} \frac{q}{(1+q)^2} = \const
\,,
\end{align}
%
therefore
%
\begin{align}
a \propto \frac{(1 + q)^{4}}{q^2}
\,.
\end{align}

The Roche lobe \(R_2\) for \(M_2\) is given by \(R_2 = a f\), therefore
%
\begin{align}
\log R_2 = \log a + \log f
\,,
\end{align}
%
and if we consider a variation of \(q\), the variation of \(\log R_2 \) will be given by the sum of the variations of the two logarithms.

Because of the expression we derived, we have
%
\begin{align}
\log a &= 4 \log (1 +q) - 2 \log q + \const \\
\Delta \log a &= 4 \frac{\Delta q}{1 + q} - 2 \frac{\Delta q}{q }  \\
&= \frac{4q -2 -2 q}{(1 + q) q} \Delta q = 2 \frac{\Delta q}{q} \frac{q -1}{q +1}
\,.
\end{align}

Then, the fractional variation is approximately
%
\begin{align}
\frac{\Delta R_2}{R_2} = \Delta \log R_2 \approx
2\frac{\Delta q}{q} \frac{q -1}{q +1}
\,,
\end{align}
%
since \(\Delta \log f\) is negligible (see figure \ref{fig:roche-lobe-relative-corrections}).
As the star \(M_2 \) donates mass, \(M_2 \) decreases and \(M_1 \) increases. Then, \(q = M_2 / M_1 \) decreases, therefore \(\Delta q < 0\).

\begin{figure}[ht]
\centering
\includegraphics[width=\textwidth]{figures/roche-lobe-relative-corrections.pdf}
\caption{Relative size of the corrections --- \(\Delta \) means derivative with respect to \(q\). One can notice that for typical \(q \gtrsim 2\) the magnitude of \(\Delta \log a\) is about one order of magnitude larger than that of \(\Delta \log f\). Also, we can see that \(\Delta \log a + \Delta \log f\) is indeed positive for \(q > 1\) --- the curve is not shown in the region in which it is negative.}
\label{fig:roche-lobe-relative-corrections}
\end{figure}

If we want the Roche lobe to shrink, we want \(\Delta R_2 < 0\): so, we want \(q - 1 > 0\).
This means that \textbf{Roche lobe accretion is self-sustaining, or stable iff the donor star is larger than the receiver}.
% Including \(\Delta f\), things don't change by much.
If we include \(\Delta f\), as one can see in figure \ref{fig:roche-lobe-relative-corrections}, the picture is quite similar --- the noticeable correction we have is that systems with \(\num{.8} < q < 1\) might still have Roche Lobe Overflow.

Is this the case in real systems? Usually the mass of the BH is of at least a few solar masses, so we need an unusually large companion.
For example, the companion to the BH in Cygnus X-1 is a very large O-star.

\section{Accretion disks}

Now we will discuss what happens when this is indeed the case. What is the fate of the matter passing through the inner Lagrange point?

\subsection{Circularization}

Let us change the perspective: we are not comoving with respect to the orbiting stars anymore.
Let us call \(b_1 \) the separation of the \(L_1 \) point from the center of star 1. This is slightly larger than \(R_1 \).

If we are stationary at the center the companion compact star will appear to rotate at a large velocity compared to us.

The components of this velocity can be decomposed into the parallel and perpendicular to the separation vector between the star, however the component \(v _ \parallel\) will be of the order of the speed of sound in the gas: roughly,
%
\begin{align}
v_{\parallel} \approx c_s = \sqrt{ \pdv{P}{\rho }} = \sqrt{\frac{k_B T}{\mu m_p}} \approx \num{10} \sqrt{ \frac{T}{\SI{e4}{K}}} \SI{}{km /s}
\,;
\end{align}
%
while the component \(v_\perp\) will be large: of the order of
%
\begin{align}
v_\perp \sim b_1 \omega
\,,
\end{align}
%
and the distance \(b_1\) will be roughly given by \cite[]{plavecTablesRocheModel1964}
%
\begin{align}
b_1 \approx a (\num{.5} - \num{.227} \log q)
\,,
\end{align}
%
while by Kepler's third law
%
\begin{align}
4 \pi^2 a^3 = G (M_1 + M_2 ) P^2
\,,
\end{align}
%
so
%
\begin{align}
a \approx \num{3e11} \qty(\frac{M_1 }{M_{\odot}})^{1/3}
\qty(1 + q)^{1/3}
\qty(\frac{P}{\SI{1}{d}})^{2/3}
\SI{}{cm}
\,,
\end{align}
%
while the angular velocity is
%
\begin{align}
\omega = \frac{2 \pi }{P} \approx \num{7e-5} \qty(\frac{P}{\SI{1}{d}})^{-1} \SI{}{rad/s}
\,.
\end{align}

This means that the perpendicular velocity is approximately
%
\begin{align}
v_{\perp} \approx \num{100} \qty(\frac{M_1 }{M_{\odot}})^{1/3}
\qty(1 + q)^{1/3}
\qty(\frac{P}{\SI{1}{d}})^{-1/3}
\SI{}{km/s}
\,,
\end{align}
%
an order of magnitude more than the speed of sound.

\end{document}


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

\pagestyle{main}
\renewcommand{\chaptermark}[1]{\markboth{\chaptername\ \thechapter\ (#1)}{}}
\setcounter{chapter}{19}

\begin{document}

\chapter{The Second Law of Thermodynamics}
\section{Thermodynamic Cycles}
\begin{itemize}
    \item \marginnote{8/23:}Examples: Engines and pumps.
    \item In a thermodynamic cycle, the energy doesn't change, so $W_\text{on gas}=-Q$, i.e., $W_\text{by gas}=Q_\text{net}$.
    \item Thus, $W_\text{by engine}=Q_\text{in}-Q_\text{out}$ per cycle.
    \item \textbf{Otto cycle}: The thermodynamic cycle used in car engines. \emph{Also known as} \textbf{auto cycle}.
    \begin{figure}[h!]
        \centering
        \begin{tikzpicture}[
            scale=1.8,
            every node/.append style={black},
            pics/point/.style args={#1:#2}{code={
                \node [circle,fill=pix,inner sep=1.5pt,label={#1:$#2$}] {};
            }}
        ]
            \footnotesize
            \draw [stealth-stealth] (0,2) node[above]{$p$} -- (0,0) -- (3,0) node[right]{$V$};

            \draw [blx,thick,dashed] plot[domain=1:2.5,samples=500] (\x,{1.67/\x});
            \draw [blx,thick,dashed] plot[domain=0.6:2.5,samples=500] (\x,{1/\x});
            \draw [blx,thick,dashed] plot[domain=0.3:2.5,samples=500] (\x,{0.5/\x});
            \draw [blx,thick,dashed] plot[domain=0.12:2.5,samples=500] (\x,{0.2/\x});

            \draw [orx,very thick,postaction={decorate},decoration={
                markings,
                mark=at position 0.25  with {\arrow{>} \node[above right,fill=white,inner sep=1.5pt]{$Q=0$};},
                mark=at position 0.465 with {\arrow{>} \node[right=3pt,fill=white,inner sep=1.5pt]{$Q_\text{out}$};},
                mark=at position 0.65  with {\arrow{>} \node[below left,fill=white,inner sep=1.5pt]{$Q=0$};},
                mark=at position 0.91  with {\arrow{>} \node[left =3pt,fill=white,inner sep=1.5pt]{$Q_\text{in}$};}
            }] plot[domain=0.8:2] (\x,{0.845/\x^(1.756)}) -- plot[domain=2:0.8] (\x,{0.4/\x^2}) -- cycle;

            \pic at (0.8,{1/0.8}) {point=:};
        \end{tikzpicture}
        \caption{Otto cycle.}
        \label{fig:ottoCycle}
    \end{figure}
    \begin{itemize}
        \item Two adiabatic and two isochoric processes.
    \end{itemize}
    \item \textbf{Stirling engine cycle}: The thermodynamic cycle used in steam engines.
    \begin{figure}[h!]
        \centering
        \begin{tikzpicture}[
            scale=1.8,
            every node/.append style={black},
            pics/point/.style args={#1:#2}{code={
                \node [circle,fill=pix,inner sep=1.5pt,label={#1:$#2$}] {};
            }}
        ]
            \footnotesize
            \draw [stealth-stealth] (0,2) node[above]{$p$} -- (0,0) -- (3,0) node[right]{$V$};
            \draw [very thin,dashed] (0.8,{0.5/0.8}) -- (0.8,0) node[below]{$V_1$};
            \draw [very thin,dashed] (2,{0.5/2}) -- (2,0) node[below]{$V_2$};

            \draw [blx,thick,dashed] plot[domain=1:2.5,samples=500] (\x,{1.67/\x});
            \draw [blx,thick,dashed] plot[domain=0.6:2.5,samples=500] (\x,{1/\x}) node[right]{$T_1$};
            \draw [blx,thick,dashed] plot[domain=0.3:2.5,samples=500] (\x,{0.5/\x}) node[right]{$T_2$};
            \draw [blx,thick,dashed] plot[domain=0.12:2.5,samples=500] (\x,{0.2/\x});

            \draw [orx,very thick,postaction={decorate},decoration={
                markings,
                mark=at position 0.25 with {\arrow{>} \node[above=4pt,fill=white,inner sep=1.5pt]{$+Q_2$};},
                mark=at position 0.45 with {\arrow{>} \node[right=3pt,fill=white,inner sep=1.5pt]{$-Q_3$};},
                mark=at position 0.65 with {\arrow{>} \node[below=3pt,fill=white,inner sep=1.5pt]{$-Q_4$};},
                mark=at position 0.91 with {\arrow{>} \node[left =3pt,fill=white,inner sep=1.5pt]{$+Q_1$};}
            }] plot[domain=0.8:2] (\x,{1/\x}) -- plot[domain=2:0.8] (\x,{0.5/\x}) -- cycle;
            \draw [orx,very thick] plot[domain=0.8:2] (\x,{1/\x}) -- plot[domain=2:0.8] (\x,{0.5/\x}) -- cycle;

            \pic at (0.8,{1/0.8}) {point=:};
        \end{tikzpicture}
        \caption{Stirling engine cycle.}
        \label{fig:stirlingCycle}
    \end{figure}
    \begin{itemize}
        \item Two isothermal and two isochoric processes.
        \item For the isothermal processes, $\Delta E_\text{int}=0$, so $Q=W_\text{by gas}=nRT\ln(V_f/V_i)$.
        \item For the isochoric process, $Q=nC_V\Delta T$.
        \item $Q_1+Q_3=nC_V(T_1-T_2)+nC_V(T_2-T_1)=0$, so we only have to worry about $Q_2$ and $Q_4$ to determine the work done by the gas:
        \begin{align*}
            W_\text{by gas} &= Q_2+Q_4\\
            &= nR\ln\left( \frac{V_2}{V_1} \right)\cdot(T_1-T_2)
        \end{align*}
        \item To get more work, you want the \textbf{compression factor} to be as big as possible.
        \item You also want the difference between the two temperatures to be as big as possible.
        \item The engine is powered until $T_1=T_2$, because at that point you can't exchange heat.
    \end{itemize}
    \item \textbf{Compression factor}: The ratio of the final volume to the initial volume, i.e., $V_2/V_1$.
    \item \textbf{Efficiency}: The quotient of the work an engine does and the heat you put in per cycle. \emph{Denoted by} $\bm{e}$. \emph{Given by}
    \begin{align*}
        e &= \frac{W_\text{engine}}{Q_\text{in}}\\
        &= \frac{Q_\text{in}-Q_\text{out}}{Q_\text{in}}\\
        &= 1-\frac{Q_\text{out}}{Q_\text{in}}
    \end{align*}
    \item \textbf{Carnot cycle}.
    \begin{figure}[h!]
        \centering
        \begin{tikzpicture}[
            scale=1.8,
            every node/.append style={black},
            pics/point/.style args={#1:#2}{code={
                \node [circle,fill=pix,inner sep=1.5pt,label={#1:$#2$}] {};
            }}
        ]
            \footnotesize
            \draw [stealth-stealth] (0,2) node[above]{$p$} -- (0,0) -- (3,0) node[right]{$V$};

            \draw [blx,thick,dashed] plot[domain=1:2.5,samples=500] (\x,{1.67/\x}) node[right]{$T_H$};
            \draw [blx,thick,dashed] plot[domain=0.6:2.5,samples=500] (\x,{1/\x});
            \draw [blx,thick,dashed] plot[domain=0.3:2.5,samples=500] (\x,{0.5/\x}) node[right]{$T_L$};
            \draw [blx,thick,dashed] plot[domain=0.12:2.5,samples=500] (\x,{0.2/\x});

            \draw [orx,very thick,postaction={decorate},decoration={
                markings,
                mark=at position 0.13 with {\arrow{>} \node[above=6pt,xshift=2pt,fill=white,inner sep=1.5pt]{$Q_\text{in}$};},
                mark=at position 0.33 with {\arrow{>} \node[right=3pt,fill=white,inner sep=1.5pt]{$Q=0$};},
                mark=at position 0.58 with {\arrow{>} \node[below=3pt,fill=white,inner sep=1.5pt]{$Q_\text{out}$};},
                mark=at position 0.81 with {\arrow{>} \node[left =3pt,fill=white,inner sep=1.5pt]{$Q=0$};}
            }] plot[domain=1.1:1.6] (\x,{1.67/\x}) plot[domain=1.6:2] (\x,{21.178/\x^(6.404)}) plot[domain=2:1.4] (\x,{0.5/\x}) plot[domain=1.4:1.1] (\x,{2.69/\x^(6.001)});

            \pic at (1.1,{1.67/1.1}) {point=:};
        \end{tikzpicture}
        \caption{Carnot cycle.}
        \label{fig:carnotCycle}
    \end{figure}
    \begin{itemize}
        \item Two isothermal and two adiabatic processes.
        \item For this engine, $e=1-Q_\text{out}/Q_\text{in}=1-T_L/T_H$.
        \begin{itemize}
            \item Thus, as the temperatures approach each other, efficiency approaches 1.
            \item But, you cannot run an engine when the heat bath temperatures are equal to each other.
        \end{itemize}
        \item Therefore, the Carnot cycle is the most efficient engine you can build, but it's just not physically viable.
        \begin{itemize}
            \item A car run on the Carnot cycle would have great mileage but wouldn't get you very far.
        \end{itemize}
        \item Conclusion: The Carnot cycle is interesting, but it does not yield a particularly useful engine.
    \end{itemize}
\end{itemize}

\section{The Second Law}
\begin{itemize}
    \item \textbf{Second Law of Thermodynamics}: It is not possible to remove heat at a high temperature and convert it entirely to work done by the engine. In other words, some heat is always exhausted to the low temperature.
    \item Maximizing engine efficiency:
    \begin{itemize}
        \item You want to maximize the temperature difference.
        \item You could technically run an engine between air temperature and ice, but it's hard to lug around a bunch of ice.
        \item Additionally, you can't have $T_H$ be too high because hotter engines emit nastier exhaust (specifically, exhaust that contributes more to acid rain).
        \item Recall that the area on a $pV$-graph encompassed by the cycle is equal to the work done by the gas.
    \end{itemize}
    \item If you run a heat engine backwards, you get a \textbf{heat pump}.
    \item \textbf{Heat pump}: A device that removes heat from low temperature sinks and exhausts it into high temperature sinks.
    \begin{itemize}
        \item This is an air conditioner.
        \item The second law of thermodynamics asserts that you can't remove heat at a low temperature and move it to a high temperature without doing work on the gas. Thus, you have to plug in the air conditioner and provide power --- heat won't magically flow from cold to hot.
    \end{itemize}
\end{itemize}

\section{Statistical Mechanics}
\begin{itemize}
    \item Free expansion.
    \begin{itemize}
        \item Imagine you have gas on one side of a thermally insulated container separated from the rest of the container by a partition.
        \item If you remove the partition, the gas will expand out to fill the entire container.
        \item However, the gas is not working against a force ($p=0$) and heat is not flowing in ($Q=0$).
        \item Therefore, $\dd{E_\text{int}}=\dd{Q}-p\dd{V}=0-0\dd{V}=0$.
        \item From this, we can conclude that $\Delta T=0$.
        \item Note that this is an \textbf{irreversible process}.
    \end{itemize}
    \item \textbf{Irreversible process}: A process that looks like it could occur on a microscopic level but could not on a macroscopic level.
    \begin{itemize}
        \item Imagine a video of the milk molecules moving in a cup of coffee (which would look normal forwards and backwards) vs. a video of milk spreading out in a cup of coffee (which most certainly would not look normal backwards).
    \end{itemize}
    \item \textbf{Macrostate}: A set of thermal variables ($n,p,V,T$) defining a system at an instant in time.
    \item \textbf{Microstate}: A way of arranging the molecules in a system that produces a macrostate.
    \begin{itemize}
        \item Multiple microstates can correspond to the same macrostate.
    \end{itemize}
    \item Consider a box with 10 molecules inside.
    \begin{itemize}
        \item Each molecules has a 50/50 chance of being on the left \emph{or} right side of the box.
        \item We want to achieve the macrostate defined by 10 molecules on the left side and 0 on the right.
        \begin{itemize}
            \item There is only 1 corresponding microstate (namely that just described).
        \end{itemize}
        \item We want to achieve the macrostate defined by 3 molecules on the left side and 7 on the right.
        \begin{itemize}
            \item There are $\frac{10!}{7!3!}=120$ corresponding microstates.
        \end{itemize}
        \item For the even 5/5 split, there are $\binom{10}{5}=252$ corresponding microstates.
    \end{itemize}
    \item If there are $N$ molecules and we want $m$ on the left and $N-m$ on the right, the number of microstates that will realize this macrostate is $\frac{N!}{m!(N-m)!}$.
    \begin{itemize}
        \item This corresponds to a binomial distribution.
    \end{itemize}
    \item \textbf{Fundamental Assumption of Statistical Physics}: All microstates of a system are equally probable.
    \item \textbf{Number of microstates of a macrostate}: \emph{Denoted by} $\bm{\Omega_\textbf{macro}}$.
    \item It follows from the fundamental assumption that
    \begin{equation*}
        P_\text{macro} \propto \Omega_\text{macro}
    \end{equation*}
    \item Relating this back to our example, since $P_{m,N-m}\propto\Omega{m,N-m}$ we have that $(5,5)$ is approximately twice as likely as $(3,7)$.
    \item If we have $N_A$ of molecules, it is going to be much more likely that the molecules are evenly (or almost evenly) distributed on both sides of the box than anything else.
    \begin{itemize}
        \item $\Omega_{N_A,0}=1$ still, but $\Omega_{N_A/2,N_A/2}=\frac{N_A!}{(N_A!)^2}\approx 10^{N_A/3}\approx 10^{\num{2e23}}$, which is a huge number.
    \end{itemize}
    \item If you make $N$ and $m$ continuous rather than integer quantities, the binomial distribution becomes a Gaussian distribution.
    \begin{itemize}
        \item Thus, Gaussian distributions describe the probability distribution corresponding to the number of molecules on the left and the right.
        \item The standard deviation of the Gaussian distribution of $N_A$ macrostates is $\sigma\approx\sqrt{N_A}$.
        \item Thus, the fraction of the width of the central peak to all states is $\sigma/N_A\approx 10^{-12}$.
        \item Therefore, the width of the spike is approximately one-trillionth the width of the whole distribution, meaning that although you won't typically see a perfect 50/50 split, you won't see very large fluctuations (even 49/51 is very unlikely).
    \end{itemize}
    \item It's not that you \emph{can't} have all of the air molecules move to one side of the room; it's that you \emph{won't} have this happen.
\end{itemize}

\section{Office Hours (Gazes)}
\begin{itemize}
    \item Preference for sine vs. cosine when describing harmonic waves?
    \begin{itemize}
        \item No preference.
        \item Gazes tends to start with sines, but it really doesn't matter; there is no canonical preference.
    \end{itemize}
    \item We say that the open end of a pipe is a node and we often say that closed ends are antinodes. However, on the midterm, there was a question with a tuning fork at one end of a pipe with water at the bottom, and we were supposed to infer that the open end with the tuning fork was an antinode and the end with water was a node. As such, I'm wondering if there's any unambiguous way we can identify open and closed ends of pipes.
    \begin{itemize}
        \item We do assume the end with the tuning fork to be a pressure node and the water to be a pressure antinode.
        \item It's a \emph{pressure} node at the end of the tube, but a displacement antinode.
        \item Some transmission does occur at the end of a tube.
        \item Flaring the ends of instruments cuts down on reflection and increases transmission.
    \end{itemize}
    \item How do we know that even rays with not so well understood geometry converge on the image?
    \begin{itemize}
        \item A computer can just brute force the problem and come to this conclusion.
    \end{itemize}
    \item When refracting an object through multiple lenses, the side the \emph{original} object is on is always the $+s$ and $-s'$ side, even when the first image may be on the other side of the next lens?
    \begin{itemize}
        \item Yes.
        \item Because the rays just continue on through the second lens. Those \emph{rays} act as the object and effectively determine the sign.
    \end{itemize}
    \item Plano-convex lens on top of a mirror?
    \begin{itemize}
        \item You can make the contraption image the same way as a concave mirror.
        \item Allows analogy of concave mirrors to regular lenses.
        \item Also helps define our sign convention: flips what defines positive image distance.
    \end{itemize}
    \item When do we make use of vibration? In Problem 19.43, shouldn't we have needed to use $\frac{7}{2}nR\Delta T$ for every degree Kelvin above $\SI{1000}{\kelvin}$?
    \begin{itemize}
        \item Didn't quite cross over the threshold.
        \item Won't have to account for this on the final.
        \item Everything is monoatomic on the final!
    \end{itemize}
\end{itemize}

\section{Entropy}
\begin{itemize}
    \item \marginnote{8/24:}\textbf{Entropy} (of a macrostate): The following quantity, where $k$ is the Boltzmann constant. \emph{Denoted by} $\bm{S_\textbf{macro}}$.
    \begin{equation*}
        S_\text{macro} = k\ln\Omega_\text{macro}
    \end{equation*}
    \item $\Delta S>0$ (i.e., entropy increases) for an irreversible process.
    \item Entropies of multiple systems:
    \begin{itemize}
        \item Consider 2 systems in macrostates $A$ and $B$, respectively.
        \item The number of microstates pertaining to each macrostate is $\Omega_A$ and $\Omega_B$, respectively.
        \item We know that $P_A\propto\Omega_A$ and $P_B\propto\Omega_B$.
        \item Moreover, the probability $P_{AB}$ that the combination of the two systems in in microstate $AB$ is equal to $P_AP_B$ by fundamental probability laws, and the total number of microstates for the combination is equal to $\Omega_A\Omega_B$.
        \item It follows that
        \begin{align*}
            S_{AB} &= k\ln(\Omega_A\Omega_B)\\
            &= k\ln\Omega_A+k\ln\Omega_B\\
            &= S_A+S_B
        \end{align*}
        i.e., that entropies are additive.
    \end{itemize}
    \item Primary consequences of the second law of thermodynamics:
    \begin{itemize}
        \item Wrt heat engines: You will never see gas taking in $Q_\text{in}$ and converting entirely to $W_\text{by gas}$ (i.e., there will always be some $Q_\text{out}$).
        \item Wrt heat pumps: You will never see $Q$ extracted from $T_L$ and exhausted to $T_H$ without some $W_\text{on gas}$.
        \item Wrt entropy: You will never see a decrease in entropy.
    \end{itemize}
    \item Change in entropy for a reversible process:
    \begin{itemize}
        \item Consider the Carnot cycle (Figure \ref{fig:carnotCycle}).
        \item For the cycle, $\Delta S_\text{gas}=0$.
        \item If we add or subtract $Q$ of heat at a constant $T$,
        \begin{equation*}
            \Delta S = \frac{Q}{T}
        \end{equation*}
        \item Thus,
        \begin{align*}
            \Delta S_\text{univ} &= \Delta S_{Q_\text{in}}+\Delta S_{Q_\text{out}}\\
            &= \frac{Q_\text{in}}{T_H}-\frac{Q_\text{out}}{T_L}\\
            \intertext{The above is true for any thermodynamic cycle. But since $Q_\text{in}/Q_\text{out}=T_H/T_L$ for a Carnot cycle\dots}
            &= \frac{Q_\text{out}T_H/T_L}{T_H}-\frac{Q_\text{out}}{T_L}\\
            &= 0
        \end{align*}
        for a Carnot cycle.
        \item Thus, overall, $\Delta S=0$. This is actually true of any reversible process.
    \end{itemize}
    \item Thus, since every process is either reversible or irreversible, $\Delta S_\text{univ}\geq 0$ for every process in this universe.
\end{itemize}

\end{document}


% 06Holonomic.tex

\subsection{6.1. The Robenius Integrability Condition}

Can one always find a surface orthogonal to a family of curves in $\mathbb{R}^3$?

\subsection{6.2. Integrability and Constraints}

\subsection{6.3. Heuristic Thermodynamics via Caratheodory}

Can one go adiabatically from some state to any nearby state?

\subsubsection{6.3a. Introduction}

\subsubsection{6.3b. The First Law of Thermodynamics}

Consider system of regions of fluids separated by ``diathermous'' membranes \\
\phantom{\quad \, } allow only passage of heat, not fluids \\

assume system connected \\
assume each state in thermal equilibrium

Let $p_i,v_i$ (uniform) pressure and volume of $i$th region \\
\phantom{\quad \, } at thermal equilibrium, ``equations of state'' $p_iv_i = n_iRT_i$ \\
\phantom{\quad \quad \, } $p_i v_i = n_iRT_i$ eliminate all but 1 pressure
\[
\Longrightarrow p_1, v_1,v_2, \dots v_n
\]
assume globally defined energy function $U$

path in $M^{n+1}$ represents sequence of states each in equilibrium, i.e. assume very slow changes in time, quasi-static irreversible processes, e.g. ``stirring'' \\
on $M$, $\text{dim}{M} = n+1$, assume $\exists \, $ work 1-form $W$, work done by system
\[
W = p_i dv_i = p_i(U,v_1\dots v_n)dv_i \quad \quad \, i=1 \dots n
\]
heat 1-form, heat added or removed from system, assume $Q \neq 0$
\[
Q = \sum_{i=0}^n Q_i(U,v_1 \dots v_n) dv_i \quad \, (v_0 = U)
\]

1st. law of thermodynamics
\[
dU = Q-W
\]
energy conservation

\subsubsection*{6.3c. Some Elementary Changes of State}

1. Heating at constant volume.

\phantom{\quad \, } path $\gamma_I \in M$, $\text{dim}M = n+1$ s.t. $dv_1 = \dots = dv_n =0$.  $W=0$
\phantom{\quad \, } $dU = Q_0 dU$.  $\dot{\gamma}_I = c_0 \frac{\partial}{ \partial U}$

2. Quasi-static adiabatic process.  No heat exchanged,
\[
Q(\dot{\gamma}_{\text{II}}) = 0 \quad \, \text{ so } dU = -W
\]

3. Stirring at constant volume adiabatic, but not quasistatic  \\
\phantom{\quad \, } $Q,W$ makes no sense but \\
\phantom{\quad \, } work is being done by (or on) system, $U(y') - U(x)$, difference of internal energy \\
assume connected mechanical manifold $V$, $\text{dim}V =n$ \\
\phantom{assume } diff. $\pi:M \to V$ \\
\phantom{assume diff} $\pi$ onto \\
\phantom{assume diff} $\pi_*$ onto \\
\phantom{assume diff} $\pi$ submersion

By main thm. on submanifolds of Sec. 1.3d, \\
\phantom{\quad \, } if $v\in V$, then $\pi^{-1}(v)$ 1-dim. embedded submanifold of $M$ \\
\phantom{\quad \quad \, } assume $\forall \, \pi^{-1}(v)$ connected, we're assuming given any pair of states \\
\phantom{\quad \quad \quad \, } lying on $\pi^{-1}(v)$, 1 of them can be obtained by other by ``heating at constant volume''

assume $W$ on $M$ is $0$ when $\left. W \right|_{\pi^{-1}(v)} =0$ \\
on the other hand, $Q \neq 0$ on $\pi^{-1}(v)$; $dU = Q \neq 0$ (first law) \\
\phantom{\quad \, } $(U,v^1 \dots v^n)$ local coordinate system for $M$ ($U$ global coordinate)

\subsubsection{6.3d. The Second Law of Thermodynamics}

cyclic process starts and ends at the same state

Kelvin 2nd. law of thermodynamics \\
\phantom{\quad \, } $\nexists $ quasistatic cyclic process can $Q$ converted entirely into $W$  \\

Caratheodory (1909) 2nd. law of thermodynamics \\
\phantom{\quad \, } $\forall \, $ neighborhood $N \ni $ state $x$, $\exists \, y$ not accessible from $x$ via quasistatic adiabatic paths, i.e. paths s.t. $Q=0$

LaTeX_and_pdfs/the geometry of physics problems/06Holonomic.tex


\clearpage
\makeatletter
\efloat@restorefloats
\makeatother

\begin{appendix}
\hypertarget{parallel-set-of-non-bayesian-analyses}{%
\section{Parallel set of non-Bayesian
analyses}\label{parallel-set-of-non-bayesian-analyses}}

In this appendix, we report the output of a parallel set of non-Bayesian
linear mixed-effects models for the primary analyses (Reaction Time,
Accuracy, EWMA) in Experiments 1 and 2. The \(p\) values for each
coefficient were computed via the Satterthwaite approximation using the
\texttt{lmerTest} R package (Kuznetsova, Brockhoff, \& Christensen,
2017).

\begin{table}[h]
\begin{center}
\begin{threeparttable}
\caption{\label{tab:mle rt trio}Output of the MLE model predicting log reaction time as a function of center stimulus type in Experiment 1.}
\begin{tabular}{llllll}
\toprule
term & \multicolumn{1}{c}{estimate} & \multicolumn{1}{c}{std.error} & \multicolumn{1}{c}{statistic} & \multicolumn{1}{c}{df} & \multicolumn{1}{c}{p.value}\\
\midrule
Intercept (ASL) & 6.96 & 0.08 & 91.84 & 62.58 & < .001\\
Face & -0.37 & 0.11 & -3.32 & 84.45 & < .01\\
Object & -1.12 & 0.10 & -11.13 & 79.76 & < .001\\
Bullseye & -1.30 & 0.13 & -10.04 & 97.77 & < .001\\
scale(Months) & -0.01 & 0.04 & -0.18 & 75.55 & 0.86\\
\bottomrule
\addlinespace
\end{tabular}
\begin{tablenotes}[para]
\normalsize{\textit{Note.} Model specification: log(RT) \textasciitilde{} stimuli + scale(Months) + (1 | subid) + (1 | target\_image)}
\end{tablenotes}
\end{threeparttable}
\end{center}
\end{table}

\begin{table}[h]
\begin{center}
\begin{threeparttable}
\caption{\label{tab:mle acc trio}Output of the MLE model predicting accuracy as a function of center stimulus type in Experiment 1.}
\begin{tabular}{lllll}
\toprule
term & \multicolumn{1}{c}{estimate} & \multicolumn{1}{c}{std.error} & \multicolumn{1}{c}{statistic} & \multicolumn{1}{c}{p.value}\\
\midrule
Intercept (ASL) & 1.07 & 0.14 & 7.66 & < .001\\
Face & -0.64 & 0.20 & -3.19 & < .01\\
Object & -1.14 & 0.19 & -6.16 & < .001\\
Bullseye & -1.15 & 0.22 & -5.26 & < .001\\
\bottomrule
\addlinespace
\end{tabular}
\begin{tablenotes}[para]
\normalsize{\textit{Note.} Model specification: correct \textasciitilde{} stimuli + (1 | subid) + (1 | target\_image)}
\end{tablenotes}
\end{threeparttable}
\end{center}
\end{table}

\begin{table}[h]
\begin{center}
\begin{threeparttable}
\caption{\label{tab:mle ewma trio prop lang}Output of the MLE model estimating the difference in random responding in the EWMA as a function of center stimulus type in Experiment 1.}
\begin{tabular}{lllll}
\toprule
term & \multicolumn{1}{c}{estimate} & \multicolumn{1}{c}{std.error} & \multicolumn{1}{c}{statistic} & \multicolumn{1}{c}{p.value}\\
\midrule
Intercept (ASL) & 1.73 & 0.21 & 8.31 & < .001\\
Face & -1.80 & 0.29 & -6.26 & < .001\\
\bottomrule
\addlinespace
\end{tabular}
\begin{tablenotes}[para]
\normalsize{\textit{Note.} Model specification: guess \textasciitilde{} stimuli + (1 | subid) + (1 | target\_image)}
\end{tablenotes}
\end{threeparttable}
\end{center}
\end{table}

\begin{table}[h]
\begin{center}
\begin{threeparttable}
\caption{\label{tab:mle rt noise}Output of the MLE model predicting log reaction time as a function of noise condition and age category (adults vs. children) in Experiment 2.}
\begin{tabular}{llllll}
\toprule
term & \multicolumn{1}{c}{estimate} & \multicolumn{1}{c}{std.error} & \multicolumn{1}{c}{statistic} & \multicolumn{1}{c}{df} & \multicolumn{1}{c}{p.value}\\
\midrule
Intercept (Clear) & -0.76 & 0.05 & -13.92 & 49.62 & < .001\\
noise & 0.09 & 0.04 & 2.31 & 54.35 & 0.02\\
adults & 0.16 & 0.06 & 2.88 & 56.01 & < .01\\
\bottomrule
\addlinespace
\end{tabular}
\begin{tablenotes}[para]
\normalsize{\textit{Note.} Model specification: log(rt) \textasciitilde{} noise\_condition + age\_category + (noise\_condition | subid) + (1 | target\_image)}
\end{tablenotes}
\end{threeparttable}
\end{center}
\end{table}

\begin{table}[h]
\begin{center}
\begin{threeparttable}
\caption{\label{tab:mle acc noise}Output of the MLE model predicting accuracy as a function of noise condition and age category (adults vs. children) in Experiment 2.}
\begin{tabular}{lllll}
\toprule
term & \multicolumn{1}{c}{estimate} & \multicolumn{1}{c}{std.error} & \multicolumn{1}{c}{statistic} & \multicolumn{1}{c}{p.value}\\
\midrule
Intercept (Clear) & 0.48 & 0.13 & 3.78 & < .001\\
noise & 0.22 & 0.14 & 1.52 & 0.13\\
adults & 1.75 & 0.15 & 11.54 & < .001\\
\bottomrule
\addlinespace
\end{tabular}
\begin{tablenotes}[para]
\normalsize{\textit{Note.} Model specification: correct \textasciitilde{} noise\_condition + age\_category + (noise\_condition | subid) + (1 | target\_image)}
\end{tablenotes}
\end{threeparttable}
\end{center}
\end{table}

\begin{table}[h]
\begin{center}
\begin{threeparttable}
\caption{\label{tab:mle ewma noise}Output of the MLE model estimating the difference in random responding (EWMA model) as a function of noise condition and age category (adults vs. children) in Experiment 2.}
\begin{tabular}{lllll}
\toprule
term & \multicolumn{1}{c}{estimate} & \multicolumn{1}{c}{std.error} & \multicolumn{1}{c}{statistic} & \multicolumn{1}{c}{p.value}\\
\midrule
Intercept (Clear) & 1.81 & 0.15 & 12.23 & < .001\\
noise & 0.73 & 0.17 & 4.18 & < .001\\
children & -2.56 & 0.10 & -25.75 & < .001\\
\bottomrule
\addlinespace
\end{tabular}
\begin{tablenotes}[para]
\normalsize{\textit{Note.} Model specification: guess\_num \textasciitilde{} noise\_condition + age\_category + (noise\_condition | subid) + (noise\_condition | target\_image)}
\end{tablenotes}
\end{threeparttable}
\end{center}
\end{table}

\hypertarget{bayesian-data-analysis-models-experiment-1}{%
\section{Bayesian data analysis models: Experiment
1}\label{bayesian-data-analysis-models-experiment-1}}

In this appendix, we report the full output of the Bayesian linear mixed
effects models in Experiment 1.

\begin{table}[h]
\begin{center}
\begin{threeparttable}
\caption{\label{tab:trio-rt-model}Output of the regression predicting reaction time (milliseconds) as a function of center stimulus type in Experiment 1.}
\begin{tabular}{lll}
\toprule
Center Stimulus Type & \multicolumn{1}{c}{Mean RT} & \multicolumn{1}{c}{95\% HDI}\\
\midrule
Bullseye & 288.71 & [229.8, 355.17]\\
Object & 344.51 & [295.71, 397.31]\\
Face & 724.78 & [603.2, 862.81]\\
ASL & 1,047.89 & [897.29, 1213.52]\\
\bottomrule
\end{tabular}
\end{threeparttable}
\end{center}
\end{table}

\begin{table}[h]
\begin{center}
\begin{threeparttable}
\caption{\label{tab:trio-acc-model}Output of the logistic regression predicting accuracy as a function of center stimulus type in Experiment 1.}
\begin{tabular}{lll}
\toprule
Center Stimulus Type & \multicolumn{1}{c}{Mean Accuracy} & \multicolumn{1}{c}{95\% HDI}\\
\midrule
Object & 0.46 & [0.37, 0.53]\\
Bullseye & 0.48 & [0.38, 0.58]\\
Face & 0.63 & [0.54, 0.7]\\
ASL & 0.76 & [0.7, 0.81]\\
\bottomrule
\end{tabular}
\end{threeparttable}
\end{center}
\end{table}

\begin{table}[h]
\begin{center}
\begin{threeparttable}
\caption{\label{tab:trio-acc-contrasts}Output of the model estimating differences in Accuracy for specific contrasts of interest in Experiment 1.}
\begin{tabular}{lll}
\toprule
Contrast & \multicolumn{1}{c}{Mean Difference Accuracy} & \multicolumn{1}{c}{95\% HDI}\\
\midrule
Object vs. Chance & -0.04 & [-0.13, 0.03]\\
Bullseye vs. Chance & -0.02 & [-0.12, 0.08]\\
ASL vs. Face & 0.13 & [0.04, 0.23]\\
Face vs. Object/Bullseye & 0.16 & [0.07, 0.24]\\
ASL vs. English & 0.23 & [0.17, 0.29]\\
\bottomrule
\end{tabular}
\end{threeparttable}
\end{center}
\end{table}

\begin{table}[h]
\begin{center}
\begin{threeparttable}
\caption{\label{tab:trio-rt-contrasts}Output of the model estimating differences in RT for specific contrasts of interest in Experiment 1.}
\begin{tabular}{lll}
\toprule
Contrast & \multicolumn{1}{c}{Mean Difference RT} & \multicolumn{1}{c}{95\% HDI}\\
\midrule
ASL vs. Face & 323.10 & [132.3, 522.6]\\
Face vs. Object/Bullseye & 408.20 & [286.6, 546.2]\\
ASL vs. English & 595.20 & [444.6, 760.8]\\
\bottomrule
\end{tabular}
\end{threeparttable}
\end{center}
\end{table}

\begin{table}[h]
\begin{center}
\begin{threeparttable}
\caption{\label{tab:trio-ewma-cuts}Output of the model estimating the point in the Reaction Time distribution when children's Exponentially Weighted Moving Average statistic crossed the pre-defined guessing threshold for the ASL and Face center stimulus types in Experiment 1.}
\begin{tabular}{lll}
\toprule
Center Stimulus Type & \multicolumn{1}{c}{Mean EWMA Cut Point} & \multicolumn{1}{c}{95\% HDI}\\
\midrule
ASL & 0.68 & [0.59, 0.78]\\
Face & 0.90 & [0.77, 1.03]\\
\bottomrule
\end{tabular}
\end{threeparttable}
\end{center}
\end{table}

\begin{table}[h]
\begin{center}
\begin{threeparttable}
\caption{\label{tab:trio-guess-cuts}Output of the model estimating the mean proportion of shifts categorized as language-driven by the Exponentially Weighted Moving Average model for the ASL and Face center stimulus types in Experiment 1.}
\begin{tabular}{lll}
\toprule
Center Stimulus Type & \multicolumn{1}{c}{Mean Language-driven} & \multicolumn{1}{c}{95\% HDI}\\
\midrule
Face & 0.34 & [0.23, 0.46]\\
Asl & 0.75 & [0.65, 0.84]\\
\bottomrule
\end{tabular}
\end{threeparttable}
\end{center}
\end{table}

\begin{table}[h]
\begin{center}
\begin{threeparttable}
\caption{\label{tab:trio-hddm}Summary of the Drift Diffusion Model output for the drift rate and boundary separation parameters for both all four center stimulus types in Experiment 1.}
\begin{tabular}{llll}
\toprule
Parameter & \multicolumn{1}{c}{Center Stim Type} & \multicolumn{1}{c}{Mean Param Estimate} & \multicolumn{1}{c}{95\% HDI}\\
\midrule
Boundary & Face & 1.34 & [1.21, 1.47]\\
Boundary & ASL & 1.76 & [1.65, 1.88]\\
Drift & Face & 0.55 & [0.3, 0.8]\\
Drift & ASL & 0.63 & [0.44, 0.82]\\
\bottomrule
\end{tabular}
\end{threeparttable}
\end{center}
\end{table}

\hypertarget{bayesian-data-analysis-models-experiment-2}{%
\section{Bayesian data analysis models: Experiment
2}\label{bayesian-data-analysis-models-experiment-2}}

In this appendix, we report the full output of the Bayesian linear mixed
effects models in Experiment 2.

\begin{table}[h]
\begin{center}
\begin{threeparttable}
\caption{\label{tab:noise-acc-model}Output of the logistic regression predicting accuracy as a function of noise condition and age group in Experiment 2.}
\begin{tabular}{llll}
\toprule
Noise Condition & \multicolumn{1}{c}{Age Group} & \multicolumn{1}{c}{Mean Accuracy} & \multicolumn{1}{c}{95\% HDI}\\
\midrule
Clear & children & 0.61 & [0.54, 0.68]\\
Noise & children & 0.67 & [0.6, 0.74]\\
Clear & adults & 0.90 & [0.87, 0.93]\\
Noise & adults & 0.92 & [0.89, 0.95]\\
\bottomrule
\end{tabular}
\end{threeparttable}
\end{center}
\end{table}

\begin{table}[h]
\begin{center}
\begin{threeparttable}
\caption{\label{tab:noise-rt-model}Output of the regression estimating reaction times (milliseconds) as a function of noise condition and age group in Experiment 2.}
\begin{tabular}{llll}
\toprule
Noise Condition & \multicolumn{1}{c}{Age Group} & \multicolumn{1}{c}{Mean RT} & \multicolumn{1}{c}{95\% HDI}\\
\midrule
Clear & children & 455.70 & [407, 503.6]\\
Noise & children & 500.20 & [446.6, 555.6]\\
Clear & adults & 542.40 & [486.2, 602.4]\\
Noise & adults & 595.20 & [532.4, 665.3]\\
\bottomrule
\end{tabular}
\end{threeparttable}
\end{center}
\end{table}

\begin{table}[h]
\begin{center}
\begin{threeparttable}
\caption{\label{tab:noise-guess-cuts}Output of the model estimating the mean proportion of shifts categorized as language-driven by the Exponentially Weighted Moving Average model for the each noise condition and age group in Experiment 2.}
\begin{tabular}{llll}
\toprule
Noise Condition & \multicolumn{1}{c}{Age Group} & \multicolumn{1}{c}{Mean Language-driven} & \multicolumn{1}{c}{95\% HDI}\\
\midrule
Clear & children & 0.36 & [0.32, 0.4]\\
Noise & children & 0.47 & [0.43, 0.51]\\
Clear & adults & 0.81 & [0.77, 0.86]\\
Noise & adults & 0.93 & [0.89, 0.97]\\
\bottomrule
\end{tabular}
\end{threeparttable}
\end{center}
\end{table}

\begin{table}[h]
\begin{center}
\begin{threeparttable}
\caption{\label{tab:noise-hddm}Summary of the Drift Diffusion Model output for the drift rate and boundary separation parameters for both processing contexts and age groups in Experiment 2.}
\begin{tabular}{llll}
\toprule
Parameter & \multicolumn{1}{c}{Age Group} & \multicolumn{1}{c}{Mean Parameter Estimate} & \multicolumn{1}{c}{95\% HDI}\\
\midrule
Drift & Children & 0.59 & [0.3, 0.89]\\
Drift & Adults & 1.86 & [1.48, 2.25]\\
Boundary & Children & 1.16 & [0.94, 1.39]\\
Boundary & Adults & 1.78 & [1.53, 2.05]\\
\bottomrule
\end{tabular}
\end{threeparttable}
\end{center}
\end{table}
\end{appendix}


\documentclass{article}
\title{Compsci 590T Homework 8}
\usepackage[margin=1in]{geometry}
\usepackage[loose,nice]{units}
\usepackage{enumitem}
\usepackage{amsmath}
\usepackage{multirow,array}
\newcommand{\pvec}[1]{\vec{#1}\mkern2mu\vphantom{#1}}
\usepackage{amssymb}
\usepackage{cancel}
\usepackage{mathabx}
\usepackage{hyperref}
\newcommand\tab[1][1cm]{\hspace*{#1}}
\usepackage{tikz}
\newcommand*\circled[1]{\tikz[baseline=(char.base)]{
            \node[shape=circle,draw,inner sep=2pt] (char) {#1};}}

\usetikzlibrary{positioning}
\tikzset{main node/.style={circle,fill=blue!20,draw,minimum size=4mm,inner sep=0pt},}
\author{Student: Brian Sun, Collaborator: Thai On}
\date{}

\begin{document}
\maketitle

\section{Problem 1}
Assume player $i$ (players who values all rooms equally) is not always pay the least amount of rent in any envy-free outcome. If this is true, there will exist an envy-free outcome that at least one player $i'$ who don't value all room the same and pay less than $i$.\\\\
Therefore the room $i'$ get is cost less than the room $i$ get.\\
However this violate the evny-free property: $v_{i\sigma(i)} - p_{\sigma(i)} \geq v_{ij} - p_j,\ \forall j$.\\
Since $i$ values all rooms equally and the room $i'$ get is cost less than the room $i$ get. \\
So $p_{\sigma(i)} > p_k \tab$(define room $k$ is the room player $i'$ get)\\
which leads to $v_{i\sigma(i)} - p_{\sigma(i)} \not\geq v_{ik} - p_k \tab$\\\\
So the statement "player $i$ (players who values all rooms equally) is not always pay the least amount of rent in any envy-free outcome" is false. Therefore player $i$ pays the least amount of rent in any envy-free outcome, since if there exist an player who pay less than $i$, than it's not envy-free anymore.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newpage
\section{Problem 2}

Base on the envy-free property we have: $\overbrace{v_{i\sigma(i)}- p_{\sigma(i)}}^{A} \geq \overbrace{v_{ij} - p_j}^{B},\ \forall j$\\
define $A = v_{i\sigma(i)}- p_{\sigma(i)}$ and $B = v_{ij} - p_j$\\
To satisfy envy-free there will have two different outcome:\\
1: when $A>B$\\
2: when $A=B$\\\\
For case 1:\\
if $A > B$ that means there exist an room $j^*$ such that $v_{i\sigma(i)}- p_{\sigma(i)} > v_{ij^*} - p_{j^*}$\\
since room $j^*$ will assign to a player $i'$ and because everyone have the same valuation for all the rooms so $i' = i$.\\
Therefore we have $v_{i'j^*} - p_{j^*} < v_{i\sigma(i)} - p_{\sigma(i)}$,
since $v_{i'j^*} - p_{j^*} \not \geq v_{i\sigma(i)} - p_{\sigma(i)}$ which break the envy-free property.
Therefore case 1 cannot happen, since when $A > B$, then the outcome is not envy-free.\\\\
For case 2:\\
since base on case 1 we know $A > B$ cannot satisfy envy-free, so we have to assume $A = B$ for all players, so the outcome satisfy envy-free.\\\\
when $A = B$ there will have three cases:\\
$a$: $A = B > 0$\\
$b$: $A = B < 0$\\
$c$: $A = B = 0$\\\\
For case $(a)$:\\
if $A = B > 0$ happen, that means $v_{i\sigma(i)} > p_{\sigma(i)},\ \forall i$\\
Therefore $\sum_{i = 1}^n v_{i\sigma(i)} > \sum_{i = 1}^n p_{\sigma(i)}$\\\\
$\sum_{i}^n v_{i\sigma(i)}$ means the sum of all the player value their assign room. Since there are $n$ players and $n$ rooms and everyone cannot get the same room, therefore $\sum_{i = 1}^n v_{i\sigma(i)} = \sum_{j = 1}^n v_{ij}$\\
$\sum_{i = 1}^n p_{\sigma(i)}$ means the sum of all the room price that assign to players. Since there are $n$ players and $n$ rooms and everyone cannot get the same room, therefore $\sum_{i = 1}^n p_{\sigma(i)} = \sum_{j = 1}^n p_{j}$\\\\
Since $\sum_{i = 1}^n v_{i\sigma(i)} = \sum_{j = 1}^n v_{ij}$ and $\sum_{i = 1}^n p_{\sigma(i)} = \sum_{j = 1}^n p_{j}$ and $\sum_{i = 1}^n v_{i\sigma(i)} > \sum_{i = 1}^n p_{\sigma(i)}$\\
so we got $\sum_{j = 1}^n v_{ij} > \sum_{j = 1}^n p_{j}$\\
Which this break the requirement from the question: $\sum_{j = 1}^n v_{ij} = \sum_{j = 1}^n p_{j}$\\
Since case $a$ break the requirement from the question, therefore case $a$ cannot happen too.\\\\
For case $(b)$:\\
if $A = B > 0$ happen, that means $v_{i\sigma(i)} < p_{\sigma(i)},\ \forall i$\\
Therefore $\sum_{i = 1}^n v_{i\sigma(i)} < \sum_{i = 1}^n p_{\sigma(i)}$\\\\
Since $\sum_{i = 1}^n v_{i\sigma(i)} = \sum_{j = 1}^n v_{ij}$ and $\sum_{i = 1}^n p_{\sigma(i)} = \sum_{j = 1}^n p_{j}$ and $\sum_{i = 1}^n v_{i\sigma(i)} < \sum_{i = 1}^n p_{\sigma(i)}$\\
so we got $\sum_{j = 1}^n v_{ij} < \sum_{j = 1}^n p_{j}$\\
Which this break the requirement from the question: $\sum_{j = 1}^n v_{ij} = \sum_{j = 1}^n p_{j}$\\
Since case $b$ break the requirement from the question, therefore case $b$ cannot happen too.\\\\
For case $(c)$:\\
if $A=B=0$ happen, that means $v_{i\sigma(i)} = p_{\sigma(i)},\ \forall i$\\
Therefore $\sum_{i = 1}^n v_{i\sigma(i)} = \sum_{i = 1}^n p_{\sigma(i)}$\\\\
Since $\sum_{i = 1}^n v_{i\sigma(i)} = \sum_{j = 1}^n v_{ij}$ and $\sum_{i = 1}^n p_{\sigma(i)} = \sum_{j = 1}^n p_{j}$ and $\sum_{i = 1}^n v_{i\sigma(i)} = \sum_{i = 1}^n p_{\sigma(i)}$\\
so we got $\sum_{j = 1}^n v_{ij} = \sum_{j = 1}^n p_{j}$.\\
Since case $(c)$ is the only case that satisfy envy-free and $\sum_{j = 1}^n v_{ij} = \sum_{j = 1}^n p_{j}$. Therefore there exist only one unique EF price vector. That is $p_{\sigma(i)} = v_{i\sigma(i)},\ \forall i$ which is set all the room price equal to player's room valuation.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newpage
\section{Problem 3}

If this is not true that means there exist an room $j^*$ such that $p_{j} > p_{j^*}$ and the outcome is envy-free.\\
Base on the given information we know every player value room $j$ the least, therefore $v_{ij} < v_{ij^*}$\\\\
Assume player $i$ got assign to room $j$
\\therefore base on the envy-free property we know $v_{ij} - p_j \geq v_{ij^*} - p_{j^*} \longrightarrow (\star)$\\\\
However since $p_{j} > p_{j^*} = -p_{j} < -p_{j^*}$ and  $v_{ij} < v_{ij^*}$ we know $v_{ij} - p_j < v_{ij^*} - p_{j^*}$ which contradict with $(\star)$.\\\\
Therefore the statement "there exist an room $j^*$ such that $p_{j} > p_{j^*}$ and the outcome is envy-free" is false. So the price of room $j$ should be the lowest, since if there are room lower that $j$ than it's not envy-free anymore.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newpage
\section{Problem 1.a}
Base on the VCG mechanism determine the payment for each player we have:
$$p_i = \sum_{j \not = i} v_j(o_{-i}^*) - \sum_{j \not = i}v_j(o^*) = \sum_{j \not = i}[v_j(o_{-i}^*) - v_j(o^*)] \longrightarrow (\star)$$
Define $S^*$ as the set contain all the successful bidders from $o^*$. Another way to say this is $S^*$ has all the bidders form $o^*$ who's utility is greater than $0$.\\\\
Since there are $k$ items and each bidder only can have one item, therefore both $S^*$ will have the size of $k$ bidders.\\\\
Base on VCG mechanism, $o^*_{-i}$ is the socially optimal outcome without $i$. Therefore given any $i$ was in $S^*$ that means we have to make a new set $S^*_{-i}$ to find the substitute bidder $i'$ for $i$.\\
Since we are making the socially optimal outcome, therefore $i'$ should be the highest bidder amount all the bidders who are not in $S^*$. Because if $i'$ is not the highest bidder amount all the bidders who are not in $S^*$, then it's not socially optimal outcome anymore.\\\\
Base on $(\star)$ we know how we assign the value for these successful bidders is base on the sum of $v(j) \in S^*_{-i}$ minus the sum of $v(j) \in S^* \setminus i$ $\tab \bullet$($j$ is a player)\\
Since the only different between $S^*$ and $S^*_{-i}$ is $S^*$ have $i$ but don't have $i'$ and $S^*_{-i}$ have $i'$ but don't have $i$. Therefore the only different between $S^*\setminus i$ and $S^*_{-i}$ is $S^*_{-i}$ have $i'$ but $S^*$ don't have.\\\\
Since the only different between $S^*\setminus i$ and $S^*_{-i}$ is $S^*_{-i}$ have $i'$ but $S^*$ don't have. Therefore the sum of $v(j) \in S^*_{-i}$ minus the sum of $v(j) \in S^* \setminus i$ is always equal to $v(i')$\\\\
Since no matter which bidder we take away from $S^*$ VCG will always find the same bidder $i'$ to substitute $i$. Therefore all the successful bidder will have the same pay, since base on $(\star)$ the formula will always return $v(i')$.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newpage
\section{Problem 1.b}
 It is possible for example: \\
 Assume the auction have 4 bidders and 3 items A,B and C.\\
 set A and B are identical\\
 then we can make a table of each player bids the items.
 \begin{center}
\begin{tabular}{ | m{4em} | m{4em}| m{4em} | m{4em} |}
  \hline
   & A,B & C \\
  \hline
  $p_1$ & 100 & 100 \\
  \hline
  $p_2$ & 100 & 200 \\
  \hline
  $p_3$ & 200 & 100 \\
  \hline
  $p_4$ & 50 & 100 \\
  \hline
\end{tabular}
\end{center}
Base on the VCG mechanism we know $o^* = 500$ with $p_1$ get item A, $p_2$ get item C and $p_3$ get item B.\\
set $W^+_i = \sum_{j \not = i} v_j(o^*)$\\
set $W^-_i = \sum_{j \not = i} v_j(o_{-i}^*)$\\\\
Base on VCG mechanism we know they way it determine the payment for bidder $i$ will be:
\begin{align*}
&W^+_1 = 400\\
&W^-_1 = 450\\
&p_1 = 450 - 400 = 50\\\\
&W^+_2 = 300\\
&W^-_2 = 400\\
&p_2 = 400 - 300 = 100\\\\
&W^+_3 = 300\\
&W^-_3 = 350\\
&p_3 = 350 - 300 = 50\\
\end{align*}
Since bidder $2$ and $3$ receive items they value the same ($p_2$ get item C and $p_3$ get item B). But $p_3$ pay $50$ and $p_2$ pay $100$. Therefore it is possible that two bidders who receive items they value the same will pay different prices.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newpage
\section{Problem 2}

VCG cannot extract truthful valuations from the bidders.\\
For example there exist cases such as:\\
$v_1 > v_2 > v_3 > ... v_n$\\
In this case if $p_1$ works with $p_2$, they can maximize their joint utility by let $p_2$ say $v_2 = 0$ therefore base on the valuation, we will have  $v_1 > v_3 > ... v_n$\\
Base on this valuation, VCG will let $p_1$ be the winner of the auction and let $p_1$ pay the second highest price, which is $v_3$. Since this is the single item auction, therefore everyone except $p_1$ utility will be $0$ and $p_1$ utility will be $u_1 = v_1 - v_3$. Therefore $p_1$ and $p_2$ joint utility will be $u_1 + u_2 = v_1 - v_3 + 0$\\\\
Which compare to if they don't work together, $p_1$ will be the winner of the auction. $p_1$ will still be the winner, since $p_1$ is the highest and base on VCG, $p_1$ will pay the second price which is $v_2$. Since this is the single item auction therefore everyone's utility will be $0$ except $p_1$'s utility will be: $u_1 = v_1 - v_2$. $p_1$ and $p_2$ joint utility will be $v_1 - v_2 + 0$\\\\
Since $v_3 < v_2$ therefore $v_1 - v_2 + 0 < v_1 - v_3 + 0$ Which means $p_1$ and $p_2$ can have a higher joint utility when they work together. therefore VCG cannot extract truthful valuations from the bidders in this case.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newpage
\section{Problem 3.a}

Third price auction is not truthful.
If the third price auction is truthful, that means all bidders best response is always to bid truthfully. however this is not truth base on the case where the second highest bidder $i$ bidding honestly or dishonestly will win or lose the auction.\\\\
If $i$ bidding honestly, and $i$ is the second highest bidder, then $i$ cannot win the auction since he is not the highest bidder, therefore $i$'s utility is $0$.\\
If $i$ bidding untruthfully by increase his value higher the the highest bidder, than $i$ become the highest bidder and win the auction. Since $i$ win the auction so he will pay the third highest prise. Since $i$'s true value for the item is higher than the third highest bidder, therefore it is good for $i$ since he win the auction and pay less than what he actually think the item is.\\\\
Therefore third price auction is not truthful, since the second highest bidder can lie his bid to be highest and win the auction without paying more than what he actually values it.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newpage
\section{Problem 3.b}

This auction is truthful since players lie to increase or decrease their value will not increase their utility.\\\\
To prove this is true, we are going to look at:\\
1. when player $i$ win by telling the truth\\
2. when player $i$ lose by telling the truth\\\\
For the first case:\\
when player $i$ win, that means $i$ is going to pay the second highest bid, or the reserve price (whichever is higher).\\
If $i$ lie by increase his bid, this action will not effect the second highest bid or the reserve price, so he is still going to pay $max(b_2,r)$. Which means his utility still the same $u_i = v_i - max(b_2,r)$.\\
If $i$ lie by decrease his bid, if $b_i$ still greater than $max(b_2,r)$, then this action will still not effect the second highest bid or the reserve price. So he is still going to pay $max(b_2,r)$ which means his utility still the same $u_i = v_i - max(b_2,r)$.\\
If $i$ lie by decrease his bid, if $b_i$ less or equal to $max(b_2,r)$, then this action will change the fact that $i$ is the winner, since $b_1 \leq max(b_2,r)$. Since $i$ is not the winner anymore therefore his utility will from  $u_i = v_i - max(b_2,r)$ to $u_i = 0$ which is worse than before.\\
In the first case, since no matter how $i$ lie by increase or decrease the value his utility will either be the same or become worse, therefore there is no reason for bidder $i$ to lie.\\\\
For the second case:\\
when player $i$ lose the auction, that means it's either: \\
a. $b_i$ is the highest bid but less than $r$\\
b. $b_i$ is not the highest bid which $b_i < max(b_1,r)$\\\\
For case a: \\
If $i$ increase his bid higher but still not greater than $r$, than this action will not change the fact that he lose the auction. Since $i$ still lose the auction, so his utility will still be $0$ like before.\\
If $i$ increase his bid higher than $r$, than this action will make him become the winner, but this will decrease his utility since his true valuation is $v_i < r$ and now $i$ has to pay $r$ therefore his utility will be $u_i = v_i - r < 0$ which is worse than before.\\
If $i$ decrease his bid, than this action ill not change the fact that he lose the auction. Since $i$ still lose the auction, so his utility will still be $0$ like before.\\\\
For case b:\\
If $i$ increase his bid higher but will not greater than $max(b_1,r)$ than this action will not change the fact that he lose the auction. Since $i$ still lose the auction, so his utility will still be $0$ like before.\\
If $i$ increase his bid higher than $max(b_1,r)$, than this action will make him become the winner, but this will decrease his utility since his true valuation is $v_i < r$ and now $i$ has to pay $r$ therefore his utility will be $u_i = v_i - max(b_1,r) < 0$ which is worse than before.\\
If $i$ decrease his bid, than this action ill not change the fact that he lose the auction. Since $i$ still lose the auction, so his utility will still be $0$ like before.\\\\
In the second case, since no matter how $i$ lie by increase or decrease the value, his utility will either be the same or become worse, therefore there is no reason for bidder $i$ to lie.\\\\
Since no matter the player win or lose they cannot increase their utility by give a wrong valuation, therefore this auction is truthful.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newpage
\section{Problem 4}
Assume bidder $i'$ bid $\frac{n-1}{n}v_{i'}$ and bidder $i$ bids $s_i$\\
$i$ will win when $v_{i'} < \frac{n-1}{n}s_i$ and will have the utility of $v_i - s_i$, but will lose when $v_{i'} >  \frac{n-1}{n}s_i$ and will have the utility $0$.
Base on these information we can have expected probability for player $i$:
\begin{align*}
E[u_i] &= \int_0^{\frac{n-1}{n}s_i} (v_r - s_r) dv_{i'} + \int_{\frac{n-1}{n}s_i}^1 (0) dv_{i'}\\
&= \frac{n}{n-1}s_iv_i - \frac{n}{n-1}s_i^2
\end{align*}
Find player $i$ best bid by derivative the result:
\begin{align*}
\frac{d}{ds_i}(\frac{n}{n-1}s_iv_i - \frac{n}{n-1}s_i^2) &= 0\\
\frac{n}{n-1}v_i - 2\frac{n}{n-1}s_i &= 0\\
s_i = \frac{1}{2}v_i
\end{align*}
This apply to when $i'$ bit $s_{i'}$\\
Since this is only for two player game, so $n = 2$
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\end{document}