%
% 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{graphicx}
\usepackage[myheadings]{fullpage}

% Erin's additions
\usepackage[usenames]{color} 
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.fractals}

%
% 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 Analysis
                        \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:



\begin{document}
%FILL IN THE RIGHT INFO.
%\lecture{**LECTURE-NUMBER**}{**DATE**}{**LECTURER**}{**SCRIBE**}
\lecture{17}{September 24}{Neil Calkin}{Jeannie Friedel and Shihwei Chao}


\begin{flushleft}
\section{Another Construction}
	Again, we'll have a family of nontrivial objects $\mathcal{B}$ with generating function $B(x)$.
	(The $\mathcal{B}$ will play the role of connected graphs or partitions etc.)
	Then we can consider all sequences of $m$ elements of $\mathcal{B}$
		\[(b_1,b_2,b_2,\ldots,b_m)\]
	with repetition allowed.
	This has generating function $B(x)^m$.
	Since all the elements of $\mathcal{B}$ are nontrivial, i.e. have positive weight, $B(0) = 0$,
	so $\displaystyle{\left| B(x)\right|_u < 1}$, so $\displaystyle{\sum_{m\geq 0}B(x)^m}$ converges
	and hence the set of all finite sequences of elements of $B$ has generating function 
		\[\frac{1}{1-B(x)}.\]
	And, if we wanted to enumerate not just by weight, but by length of sequence as well, we could consider
		\[\sum_{m \geq 0} y^mB(x)^m = \frac{1}{1-yB(x)}.\]
	
	\underline{Example:} $01$ strings.
	
	\subsection{New construction}
	Now we will introduce a new construction: Say that two sequences $(b_1,b_2,\ldots, b_m)$,
	$(c_1,c_2,\ldots, c_m)$ are equivalent, $\sim$, if one is a cyclic rotation of the other.
	So, we have
		\[(b_1,b_2,b_3,\ldots,b_m) \sim (b_2,b_3,\ldots,b_m,b_1) \sim (b_3,b_4\ldots,b_m,b_1,b_2) \sim \cdots
		 \sim (b_m,b_1,b_2,\ldots,b_{m-1})\]
	Now, consider the set
		\[\mathcal{C}_m = \mathcal{B}^m / \sim \]
	of necklaces, that is, equivalence classes of sequences of length $m$ under $\sim$.
	(Note: There is another term, bracelets, which is similar, only reflections cause elements to be
	in the same equivalence class as well.)
	
	\begin{color}{teal}
	\underline{Example:} How many necklaces of $0$s and $1$s are there?
		\[\begin{array}{c|lc}
			m & \text{strings} & \text{number}\\
			\hline
			0	&	\text{empty string}	&	1	\\
			1	&	0,1	&	2	\\
			2	&	00,01,11	&	3	\\
			3	&	000,001,011,111	&	4	\\
			4	&	0000,0001,0011,0101,0111,1111	&	6	\\
			5	&	00000,00001,00011,00101,	&	8	\\
				&	00111,01011,01111,11111	&		\\
			6	&	000000,000001,000011,000101,	&	14	\\
				&	001001,000111,001011,010101,	&		\\
				&	010011,110110,111010,111100,	&		\\
				&	111110,111111	&		\\
		\end{array}\]
		Turns out that the generating function for necklaces of all lengths is 
			\[N(x) = \sum \frac{-\varphi(k)}{k}\log\left(1-B(x^k)\right).\]
		This is also known as, or comes from, the Polya Enumeration Theory (PET).
	\end{color}
	\section{Counting Set Partitions}
	\begin{definition} A set partition of $S$ with $k$ parts is a set 
		\[\{c_1,c_2,\ldots,c_k\}\]
		of nonempty disjoint sets whose union is $S$. That is,
			\begin{enumerate}
				\item $c_i \neq \emptyset$ for all $i$
				\item $c_i \cap c_j = \emptyset$ for all $i <j$
				\item $\displaystyle\bigcup_jc_j = S.$
			\end{enumerate}
	\end{definition}
	\subsection{Question:}
		How many set partitions of $\{1,2,\ldots,n\}$ are there? Call this number $B_n$.
		
		Generating functions here need to be different (or at least it is helpful if they are
		since the number of set partitions of $n$ grows much faster than the number of subsets of 
		$\{1,2,\ldots, n\}$).
		
		We'll use the exponential generating function for the sequence $\{B_n\}_{n \geq 0}$,
		namely
			\[B(x) = \sum_{n\geq 0} B_n\frac{x^n}{n!}\]
		so that 
			\[B_n = \left[\frac{x^n}{n!}\right]B(x) = n![x^n]B(x).\]
		(This construction gives $B(x)$ a positive radius of convergence.)
		
		\subsection{What is $B(x)$?}
		\[\begin{array}{c|ll}
			n & \text{set paritions}\\
			\hline
			0	&	\{\}	&	B_0 = 1	\\
			1	&	\{\{1\}\}	&	B_1 = 1	\\
			2	&	\{\{1\},\{2\}\},\{\{1,2\}\}	&	B_2 = 2	\\
			3	&	\{\{1\},\{2\},\{3\}\},\{\{1,2\},\{3\}\},\{\{1,3\},\{2\}\},\{\{2,3\},\{1\}\},\{\{1,2,3\}\}	&	B_3 = 5	\\
			4	&		&	B_4 = 15	
		\end{array}\]
		Can we obtain a recurrence for $B_n$? If we collect/group the set partitions of $\{1,2,\ldots, n_1\}$
		according to the size of the part containing $n+1$ we can. Let $k$ be the size of the part containing $n+1$,
		without counting $n+1$. Then we have
			\[B_{n-1} = \sum_{k=0}^n \binom{n}{k}B_{n-k}\]
		
		Now notice something about multiplying generating exponential functions.
		Suppose
			\[f(x) = \sum_{n=0}^\infty f_n \frac{x^n}{n!} \qquad \text{and} \qquad g(x) = \sum_{n=0}^\infty g_n \frac{x^n}{n!}.\]
		Then, 
		\begin{eqnarray*}
			f(x)g(x) &=& f(x) = \sum_{n=0}^\infty x^n \sum_{k=0}^n \frac{f_k}{k!}\frac{g_{n-k}}{(n-k)!}\\
								&=& \sum_{n=0}^\infty \frac{x^n}{n!} \sum_{k=0}^n \frac{n!}{k!(n-k)!}f_kg_{n-k}\\
								&=& \sum_{n=0}^\infty \frac{x^n}{n!} \sum_{k=0}^n \binom{n}{k}f_kg_{n-k}.
		\end{eqnarray*}
		So, 
			\[\left[\frac{x^n}{n!}\right]f(x)g(x) = \sum_{k=0}^nf_kg_{n-k}\binom{n}{k}.\]
		So, 
			\begin{eqnarray*}
				B_{n-1} &=& \sum_{k=0}^n \binom{n}{k}\cdot 1 \cdot B_{n-k}\\
								&=& \left[\frac{x^n}{n!}\right]e^xB(x)
			\end{eqnarray*}
		Now, 
			\[B'(x) = \sum_{n \geq 1} \frac{nx^{n-1}}{n!}B(x)\]
		so,
			\[\begin{array}{lrcl}
				&B_{n+1} &=& \left[\frac{x^n}{n!}\right]B'(x)\\
				\Rightarrow & \frac{B'(x)}{B(x)}	&=& e^x\\
				\Rightarrow & \frac{d}{dx}\log(B(x)) &=& e^x\\
				\Rightarrow & \log(B(x) &=& e^x +c\\
				\Rightarrow & B(x) &=& e^{e^x + c}\\
				\Rightarrow & B(x) &=& e^{e^x-1}
			\end{array}\]
		The last implication comes from the idea that 
			\[e^{e^x + c} = \sum_{k=0}^\infty \frac{3^x + c)^k}{k!}\]
		needs to converge as a power series. So we need 
			\begin{eqnarray*}
				\left|e^x+c\right|_u &<& 1\\
				e^0 + c &=& 0\\
				c &=& -1.
			\end{eqnarray*}
			
			\begin{tikzpicture}[scale=1.0]
        \fill[fill=yellow,draw=black] (0,0) circle (2mm);
        \draw (210:1.3mm) arc (210:330:1.3mm);
        \draw (210:1.1mm)--(210:1.5mm);
        \draw (330:1.1mm)--(330:1.5mm);
        \draw (135:1.1mm) circle (0.2mm);
        \draw (45:1.1mm) circle (0.2mm);
			 \end{tikzpicture}

\end{flushleft}
\end{document}
