%
% This is the LaTeX template file for preparing lecture notes for 
% courses taught by Neil Calkin.  When preparing 
% LaTeX notes for this class, please use this template.
%
% The body contains examples: study them, run 
%
%	pdflatex <yourfilename.tex>
%
% and see how they work.   View the output file with acrobat,
% or print it out to compare input and result.
%
%
%
%
%


\documentclass{article}
\usepackage{epsfig,amsmath,amssymb}
\usepackage{color}
\usepackage{graphicx}
\usepackage[myheadings]{fullpage}
%
% The following commands set up the lecnum (lecture number)
% counter and make various numbering schemes work relative
% to the lecture number.
%
\newcounter{lecnum}
\renewcommand{\thepage}{\thelecnum-\arabic{page}}
\renewcommand{\thesection}{\thelecnum.\arabic{section}}
\renewcommand{\theequation}{\thelecnum.\arabic{equation}}
\renewcommand{\thefigure}{\thelecnum.\arabic{figure}}
\renewcommand{\thetable}{\thelecnum.\arabic{table}}

%
% The following macro is used to generate the header.
%
\newcommand{\lecture}[4]{
   \pagestyle{myheadings}
   \thispagestyle{plain}
   \newpage
   \setcounter{lecnum}{#1}
   \setcounter{page}{1}
   \noindent
   \begin{center}
   \framebox{
      \vbox{\vspace{2mm}
    \hbox to 6.28in { {\bf Combinatorial Analyis
                        \hfill Fall 2010} }
       \vspace{4mm}
       \hbox to 6.28in { {\Large \hfill Lecture #1: #2  \hfill} }
       \vspace{2mm}
       \hbox to 6.28in { {\it Lecturer: #3 \hfill Scribe: #4} }
      \vspace{2mm}}
   }
   \end{center}
   \markboth{Lecture #1: #2}{Lecture #1: #2}
   {\bf Disclaimer}: {\it These notes are intended for students in the class
listed above: they are not guaranteed to be complete or even necessarily
correct.  They may only be redistributed with permission, which you may
expect will be liberally granted.  Ask first, please.} \vspace*{4mm}
}

%
% Convention for citations is authors' initials followed by the year.
% For example, to cite a paper by Leighton and Maggs you would type
% \cite{LM89}, and to cite a paper by Strassen you would type \cite{S69}.
% (To avoid bibliography problems, for now we redefine the \cite command.)
% Also commands that create a suitable format for the reference list.
\renewcommand{\cite}[1]{[#1]}
\def\beginrefs{\begin{list}%
        {[\arabic{equation}]}{\usecounter{equation}
         \setlength{\leftmargin}{2.0truecm}\setlength{\labelsep}{0.4truecm}%
         \setlength{\labelwidth}{1.6truecm}}}
\def\endrefs{\end{list}}
\def\bibentry#1{\item[\hbox{[#1]}]}

%Use this command for a figure; it puts a figure in wherever you want it.
%usage: \fig{NUMBER}{SPACE-IN-INCHES}{CAPTION}
\newcommand{\fig}[3]{
			\vspace{#2}
			\begin{center}
			Figure \thelecnum.#1:~#3
			\end{center}
	}
% Use these for theorems, lemmas, proofs, etc.
\newtheorem{theorem}{Theorem}[lecnum]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{claim}[theorem]{Claim}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{definition}[theorem]{Definition}
\newenvironment{proof}{{\bf Proof:}}{\hfill\rule{2mm}{2mm}}


\def\Z{\hbox{$\mathbb Z$}}
\def\Q{\hbox{$\mathbb Q$}}
\def\R{\hbox{$\mathbb R$}}
\def\N{\hbox{$\mathbb N$}}
\def\C{\hbox{$\mathbb C$}}



% **** IF YOU WANT TO DEFINE ADDITIONAL MACROS FOR YOURSELF, PUT THEM HERE:

% This macro for summation was created but not used since it did not really simplify much
%\newcommand{\Sum}[3]{\sum\limits_{#1}^{#2}{#3}}

\begin{document}
%FILL IN THE RIGHT INFO.
%\lecture{**LECTURE-NUMBER**}{**DATE**}{**LECTURER**}{**SCRIBE**}
\lecture{18}{September 27}{Neil Calkin}{Shihwei Chao and Dominique Morgan}

\begin{flushleft}
\section{Set Partitions}
$A\left(z\right)$ is the generating function for necklaces of objects
from $\mathcal{B}$. $\mathcal{B}$ having generating fuction $B\left(z\right)$,
then 
\[
A\left(z\right)=\sum_{k=1}^{\infty}\frac{-\varphi\left(k\right)}{k}\log\left(1-B\left(z^{k}\right)\right).\]
Last time:
Generating function for set partitions is 
\[
b\left(z\right)=\sum_{n\geq0}b_{n}\frac{z^{n}}{n!}=e^{e^{z}-1},\]
the exponential generating function for $b_{n}$.
What does this tell us about, say, the growth rate of $b_{n}$?
\[
\frac{b_{n}}{n!}\leq\frac{e^{e^{x}-1}}{x^{n}},\quad\forall x>0,\]
minimmized when 
\[
\frac{e^{e^{x}-1}\cdot e^{x}}{x^{n}}-\frac{n\cdot e^{e^{x}-1}}{x^{n+1}}=0\]
i.e. $n=xe^{x}$.\\
\vspace{5mm} 
\textbf{
{\color{red}Exercise (NTBHI): Learn about Lambert's W function.}}\\
\vspace{5mm}
How does $xe^{x}$ behave for $x\in\left(0,\infty\right)$?\\
\vspace{2mm} $\frac{d}{dx}\left(xe^{x}\right)=\left(x+1\right)e^{x}>0$, $\forall x\in(0,1)$
and $xe^{x}\left|_{x=0}\right.=0$ and $\lim\limits_{x\rightarrow\infty}xe^{x}=\infty$.
Hence for any real $y\geq0$,
$y=xe^{x}$ has a unique solution $x$ with $x\geq0$.\\
\vspace{5mm} How big should $x$ be if $xe^{x}=n$? ($n$ large)\\
\vspace{2mm} $x$ should be on the order of magnitude of $\log n$.
$x=\log n$ is too big since $\log n\cdot e^{\log n}=n\cdot\log n>n$.
Observe $x=\log\left(\frac{n}{\log n}\right)<\log n$:
\[
\log\left(\frac{n}{\log n}\right)\cdot e^{\log\left(\frac{n}{\log n}\right)}=\frac{n\left(\log n-\log\log n\right)}{\log n}<n.\]
So it appears that $x=\log n-\log\log n$ is a better estimate.
Set $x=\log n-\log\log n+c$, then
\[
xe^{x}=\frac{\log n-\log\log n+c}{\log n} \cdot ne^{c},\]
so 
\[
e^{-c}=1-\frac{\log\log n}{\log n}+\frac{c}{\log n}.\]
So, assuming $c$ is $o\left(1\right)$, terms up to $O\left(c^{2}\right)$,
give
\[
1-c=1-\frac{\log\log n}{\log n}+\frac{c}{\log n}.\]
So $c\left(\frac{\log n-1}{\log n}\right)=\frac{\log\log n}{\log n}$, 
and hence $c=\frac{\log\log n}{\log n-1}$.
So our minimizing happens for 
\[
x\simeq\log n-\log\log n+\frac{\log\log n}{\log n-1}+o\left(1\right).\]
Then, using, say $x=\log n-\log\log n$,
\[
e^{e^{x}-1}=e^{\frac{n}{\log n}-1}=\left(e^{\frac{1}{\log n}}\right)^{n} \cdot \frac{1}{e},\]
\[
x^{n}=\left(\log n\left(1-\frac{\log\log n}{\log n}\right)\right)^{n}\simeq\left(\log n\right)^{n}e^{-\frac{n\log\log n}{\log n}}.\]
So
\[
\frac{b_{n}}{n!}\leq e^{\left(\frac{1}{\log n}-\log\log n+\frac{\log\log n}{\log n}\right)^{n}} \cdot \frac{1}{e}\simeq\left(e^{-\log\log n}\right)^{n}<d^{n}\]
for any fixed $d>0$.\\
\vspace{2mm} So $\frac{b_{n}}{n!}\rightarrow0$ very rapidly ( but not as rapidly as $\frac{1}{n!}$ ).
\[
n!\simeq\left(\frac{n}{e}\right)^{n}\sqrt{2\pi n}=e^{n\log n-n+\frac{1}{2}\log n+\cdots}\]
$b_{n}$ grows like
\[
e^{n\log n-n\log\log n-n+n\frac{1+\log\log n}{\log n}+\cdots}\]
Not very illuminating, it says more if we say $\log b_{n}\simeq n\log n-n\log\log n+\cdots$\\
\vspace{2mm} If $b_{n}$ doesn't have a simple growth rate, then we probably can't
expect some of the following to either \ldots
\vspace{5mm} Define $S\left(n,k\right)$ to be the number of set partitions of
$\left\{ 1,2,\cdots,n\right\} $ having exactly $k$ parts.\\
\vspace{2mm} $S\left(n,1\right)=1$\\
\vspace{1mm} $S\left(n,n\right)=1$\\
\vspace{1mm} $S\left(n,k\right)=\frac{1}{k!}\cdot\#$ onto functions from $\left\{ 1,2,\cdots,n\right\} $
to $\left\{ 1,2,\cdots,k\right\} $\\
\vspace{1mm} $S\left(n,n-1\right)=\binom{n}{2}$\\
\vspace{1mm} $S\left(n,2\right)=2^{n-1}-1$\\
\vspace{1mm} $S\left(n,n-2\right)=$ ?
part sizes possible: $2,2,1,\cdots,1$ or $3,1,1,\cdots,1$.
\[
S\left(n,n-2\right)=\binom{n}{3}+\frac{1}{2}\binom{n}{2}\binom{n-2}{2}=\frac{n\left(n-1\right)\left(n-2\right)}{6}+\frac{n\left(n-1\right)\left(n-2\right)\left(n-3\right)}{8}.\]
This appears perhaps to give a little insight:
\[
S\left(n,k\right)=\sum_{\begin{array}{c}
\lambda\vdash n\\
\lambda\,\mathrm{has\,}k\,\mathrm{parts}\end{array}}\binom{n}{\lambda_{1},\lambda_{2},\cdots,\lambda_{k}}\frac{1}{i_{1}!i_{2}!i_{3}!\cdots},\]
where $i_{j}=\#$ copies of $j$ in $\lambda$.\\
\vspace{3mm}
\textbf{
{\color{red}Exercise: $c_{\lambda}$?}}\\

\vspace{2mm} Easier approach to $S(n,k)$: $S(n+1,k) = S(n,k-1)+kS(n,k)$\\
\vspace{1mm} compare to Pascal's identity ${n+1 \choose k} = {n \choose k-1} + {n \choose k}$.\\ 

\vspace{2mm} So, $S(1,1) = 1$\\
\hspace{5mm} $S(2,1) = 1$\\
\hspace{5mm} $S(2,2)=1$\\

\begin{center}
\begin{tabular}{c|c c c c c c c}
   &    &    &    & k &    &    &    \\
n  & 1 & 2 & 3 & 4 & 5 & 6 & 7 \\ 
\hline
1 & 1 &    &    &    &    &    &    \\ 
2 & 1 & 1 &    &    &    &    &    \\
3 & 1 & 3 & 1 &    &    &    &    \\
4 & 1 & 7 & 6 & 1 &    &    &    \\
5 & 1 & 15 & 25 & 10 & 1 &    \\
6 & 1 & 31 & 90 & 65 & 15 & 1 \\  
\end{tabular}
\end{center}

What about other similar recurrences?\\
\vspace{2mm} $T(n+1,k) = f(n,k) \cdot T(n,k-1) + g(n,k) \cdot T(n,k)$ where $f(n,k)$ and $g(n,k)$ are nice simple functions.\\

\vspace{2mm} e.g.\\
\vspace{1mm} $T(n+1,k) = k \cdot T(n,k-1) + T(n,k)$? \\
\vspace{1mm} $T(n+1,k) = T(n,k-1) + n \cdot T(n,k)$? \\
\vspace{1mm} $T(n+1,k) = n \cdot T(n,k-1) + T(n,k)$? \\
\vspace{1mm} $T(n+1,k) = T(n,k-1) + (n-k) \cdot T(n,k)$? \\

\vspace{5mm} \textbf{
{\color{red} Exercise: Investigate these computationally. Are there any nice patterns? Do you ever get nice row sums? diagonal sums? (Due Next Friday on Oct. 8th)}}\\


\end{flushleft}

\end{document}