%
% 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}
%
% 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$}}

\def\A{\hbox{$\mathcal A$}}
\def\B{\hbox{$\mathcal B$}}
% **** 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{2}{August 20}{Neil Calkin}{Jack Cooper/Erin Doolittle}

\section{Principles of Counting}
\subsection{Two Basic Principles}
\begin{enumerate}
\item Addition: If $A, B$ are finite and $A\cap B = \emptyset$, that is $A,B$ are disjoint, then $|A\cup B| = |A|+|B|$.\\
(More generally, we have $|A\cup B| = |A|+|B|-|A\cap B|$.)\\
(We'll extend this idea to the principle of Inclusion-Exclusion.)
\item Multiplication: If $A,B$ are finite sets, then $|A\times B| = |A|\cdot|B|$ where $A\times B = \{(a,b) : a\in A, b\in B\}$.
\end{enumerate}•

\begin{tabular}{|ll|}
\hline
Aside:&\\
&How to talk about ordered pairs if all you are allowed is sets?\\
&We can build $A\times B$ as the set of all elements of the form $\{a, \{a,b\}\}$.\\
&If $a=b$, then we get $\{a, \{a\}\}$ and we know the ordered pair in question was $(a,a)$. \\
\hline
\end{tabular}

\section{Combinatorial Classes}
A combinatorial class $\A$ is a countable or finite set, together with a map (size, weight,...).
\[w : \A \longrightarrow \N = \{0,1,2,...\}\]
So, each element of $\A$ has a ``size'' or ``weight'' associated with it.

Later, we'll have more than one : for example, partitions of $n$ into $k$ parts have total weight $n$ and $k$ parts.

Further, we require that the inverse image of each $n$ is finite, that is $w^{-1}(n) = \{a\in \A : w(a) = n\}$ is finite, i.e. only finitely many elements of weight $n$.

So we can define a finite set
\[\A_n = \{a\in \A : w(a) = n\}\]
and we see that $\A = \bigcup\limits_{n} \A_n$.

We'll write $A_n$ or, sometimes, $a_n$ for $|\A_n|$.

We'll define the generating function got the combinatorial class $\A$ (with $x$ marking weight) to be 
\[\sum\limits_{a\in \A} x^{w(a)} = \sum\limits_{n\ge 0} A_nx^n = A_0 + A_1x + A_2x^2 + ...\]
If we call this formal power series $f(x)$, we denote by $[x^n] f(x)$ the coefficient of $x^n$ in $f(x)$.  That is, $[x^n]f(x) = A_n$.

\subsection{Facts about coefficient extraction}
\begin{enumerate}
\item $[x^n]$ is a linear operator.

So, $[x^n](f(x) + g(x) ) = ([x^n]f(x)) + ([x^n]g(x))$.
\item $[x^n]x^kf(x) = [x^{n-k}]f(x)$
\item 
\[[x^n]f(x) = \frac{1}{2\pi i}\oint\limits_{|z| = r} \frac{f(x)}{x^{n+1}} dx\]
if $f(x)$ is analytic in the disk of radius $R < r < 0$.
\item BEWARE : We \underline{CANNOT} do things like 
\[([x^m]f(x)) + ([x^n]f(x)) = [x^m+x^n]f(x)\]
IT IS NONSENSICAL!
\end{enumerate}•




\section{Generating Functions:}


We have a natural bijection between sequences (one-way infinite) e.g. $(f_0, f_1, f_2, ...)$ and generating function $f_0+f_1x+f_2x^2+...$. BUT often generating functions dispose of the following problem:

\indent

What is the next term in the series (1,2,4,8,16,...)?  The natural choice is 32, but there could certainly be another sequence that starts this way and does not have a 32 there.

\indent

Look at the sequence whose general term is $2^n$, in this case the generating function is $\displaystyle\sum_{n\geq0}{2^nx^n}$, call it $f(x)$.

Then,
\begin{align*}
2xf(x)&=\sum_{n\geq0}{2^{n+1}x^{n+1}}
\\&=\sum_{n\geq1}{2^{n}x^{n}}
\\&=f(x)-1
\\ \Rightarrow f(x)&=(1-2x)^{-1}
\end{align*}

As formal power series, $g(x)=f(x)^{-1}$ means precisely $f(x)g(x)=1$.

\indent

\subsection{Manipulating formal power series}
\begin{enumerate}
\item $\displaystyle\sum_{n\geq0}{f_nx^n}+\sum_{n\geq0}{g_nx^n}=\sum_{n\geq0}{(f_n+g_n)x^n}$
\item $\displaystyle (\sum_{k\geq0}{f_kx^k})(\sum_{l\geq0}{g_lx^l})=\sum_{k\geq0,l\geq0}{f_kg_lx^{k+l}}=\sum_{n\geq0}{(\sum_{k+l=n}{f_kg_l})x^n}$
\end{enumerate}

Notice that item number 2 gives you what you would expect when expanding a product of polynomials i.e.
$(f_0+f_1x+f_2x^2+f_3x^3+...)(g_0+g_1x+g_2x^2+g_3x^3+...)=f_0g_0+(f_0g_1+f_1g_0)x+(f_0g_2+f_1g_1+f_2g_0)x^2+...$

\indent

\textbf{Exercise TBHI:} Check that $(1-2x)(1+2x+2^2x^2+2^3x^3+...)=1$

\begin{theorem}
Suppose $\mathcal{A}$ and $\mathcal{B}$ are combinatorial classes with $\mathcal{A}\cap\mathcal{B}=\emptyset$, respective weights $w_1, w_2$, and generating functions $f(x),g(x)$ then $(\mathcal{A}\cup\mathcal{B},w_s)$ is a combinatorial class with generating fucntion $f(x)+g(x)$ where
\begin{align*}
w_s|_{\mathcal{A}}&=w_1
\\w_s|_{\mathcal{B}}&=w_2
\end{align*}
\end{theorem}

\begin{theorem}
For arbitrary classes $\mathcal{A}$ and $\mathcal{B}$ define:
\begin{align*}
w_p:\mathcal{A}\times\mathcal{B}\rightarrow \N
\\w_p:(a,b)\rightarrow w_1(a)+w_2(b)
\end{align*}
then $(\mathcal{A}\times\mathcal{B},w_p)$ is a combinatorial class with generating function $f(x)g(x)$
\end{theorem}

\textbf{Exercise TBHI:} Prove this

\end{document}
