%
% 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{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:

\begin{document}
%FILL IN THE RIGHT INFO.
%\lecture{**LECTURE-NUMBER**}{**DATE**}{**LECTURER**}{**SCRIBE**}
\lecture{12}{September 13}{Neil Calkin}{Jack Cooper/Sarah Anderson}

\begin{flushleft}
\section{Integer Partitions and Compositions}

\indent

A partition $\lambda$ of an integer $n$ is a non-increasing sequence $\lambda_1, \lambda_2, \ldots, \lambda_k$ of positive integers so that $\lambda_1 + \lambda_2 + \ldots + \lambda_k = n$. We write $\lambda \vdash n$.

\indent
A composition of $n$ is a sum $r_1 + r_2 + \ldots + r_k = n$. Various conventions apply: usually the number of summands is fixed and zero values are allowed. 

\subsection{Composition of $n$ into exactly $k$ non-negative parts}

\indent
We can consider the generating function approach. Consider the $k$-tuple $(r_1, r_2, \ldots, r_k)$ with
\begin{align*}
r_1 \in \mathbb{Z},& r_1 \geq 0 \\
r_2 \in \mathbb{Z},& r_2 \geq 0 \\
&\vdots \\
r_k \in \mathbb{Z},& r_k \geq 0.
\end{align*}
The generating function for all $k$-tuples is 
\[
((1-x)^{-1})^k = (1 - x)^{-k}.
\]
So the numbers of compositions in $k$ parts $\geq 0$ is 
\[
[x^n](1 - x)^{-k} = (-1)^n \binom{-k}{n} = \binom{n + k - 1}{n} = \binom{n + k - 1}{k - 1}.
\]
\subsection{Composition of $n$ into exactly $k$ positive parts}

\indent
The generating function is 
\[
\left(\frac{x}{1 - x}\right)^k.
\]
Hence,
\begin{align*}
[x^n]\frac{x^k}{(1 - x)^k} &= [x^{n - k}] \frac{1}{(1 - x)^k} \\
&= \binom{-k}{n - k} (- 1)^{n - 1} \\
&= \binom{n - 1}{k - 1}.
\end{align*}

\begin{corollary}
The number of compositions of $n$ into positive parts is 
\[
\binom{n - 1}{0} + \binom{n - 1}{1} + \ldots + \binom{n - 1}{n - 1} = 2^{n - 1}.
\]
\end{corollary}

Description of why this is so:

\indent
Take a string of $n$ ones. Choose a subset of the $(n - 1)$ spaces between the ones in each in the subset and write a $+$. Read this as a compositions written as unary. For example, if $n = 12$, $n - 1 = 11$, and the subset is $\{2, 6, 7, 10\}$.
\[
1 \;\; 1\;\; 1\;\; + \;\; 1\;\; 1\;\;1\;\;+ \;\;1\;\;+\;\;1\;\;1\;\;1\;\;+\;\;1
\]
Thus, we $3 + 3 + 1 + 3 + 2$. Clearly, we have $p_n$, the number of partitions of $n$ into positive parts $\leq 2^{n - 1}$, the number of compositions of $n$ in to positive parts. 

\subsection{Generating functions for partitions}
\indent
Alternating representations for partitions via numbers of parts of each size. For example, $7 + 5 + 5 + 5 + 4 + 3 + 3 + 3 + 1 + 1$ will be represented as an infinite sequence $(i_1, i_2, i_3, \ldots)$, $i_j =$ number of parts of size $j$. So in this example, we have $(2, 0, 4, 1, 3, 0, 1, 0, 0, \ldots)$ (only finitely many nonzero a terms). 
\indent
Generating function for $i_1$ is $\frac{1}{1 - x}$. Generating function for $i_2$ is $\frac{1}{1 -x^2} = 1 + x^2 + x^4 + x^6 + \ldots$.
\begin{align*}
i_3 &= \frac{1}{1 - x^3} \\
i_4 &= \frac{1}{1 - x^4} \\
&\vdots \\
i_j &= \frac{1}{1 - x^j}.
\end{align*}
Hence, the generating function for all partitions is now
\[
\prod_{j = 1}^{\infty} (1 - x^j)^{-1} = \prod_{j = 1}^{\infty} (1 + x^j + x^{2j} + \ldots).
\]
Note that the $j^{th}$ term in the product $(1+x^j+x^{2j}+...)\rightarrow_u 1$ as $j\rightarrow \infty$ so the product converges.

\begin{align*}
p_0=1&=\text{empty sum}\\
p_1=1&=1\\
p_2=2&=2, 1+1\\
p_3=3&=3,2+1,1+1+1\\
p_4=5&=4,3+1,2+2,2+1+1,1+1+1+1\\
p_5=7&=5,4+1,3+2,3+1+1,2+2+1,2+1+1+1,1+1+1+1+1
\end{align*}

\textbf{Exercise:} Show $p_n\leq p_{n-1}+p_{n-2}$ for $n\geq2$.

\indent

Hence these $p_n$ are less than the Fib numbers for $n\geq5$.  In fact, $p_n$ grows slower than $\alpha^n$ for all $\alpha>1$.  True growth rate is $\simeq\frac{C}{n}e^{\alpha\sqrt{n}}$.

\indent

How to compute $p_n$: let $p(x)=\displaystyle\prod_{j=1}^{\infty}(1-x^j)^{-1}$.

How can we use this to
\begin{enumerate}
\item compute explicit values?
\item obtain growth rates for $p_n$?
\end{enumerate}
Well,
\begin{enumerate}
\item \[ x\frac{d}{dx}p(x)=x\sum_{j=1}^{\infty}(\prod_{k=1}^{\infty}(1-x^k)^{-1})\frac{jx^{j-1}}{1-x^j}=p(x)\sum_{j=1}^{\infty}\frac{jx^j}{(1-x^j)}\]
\begin{align*}
\frac{xp'(x)}{p(x)}=\sum_{j=1}^{\infty}{\frac{jx^j}{1-x^j}}&=\sum_{j=1}^{\infty}jx^j+jx^{2j}+jx^{3j}+...\\
&=\sum_{n=1}^{\infty}x^n\sum_{j|n}j\\
&=\sum_{n=1}^{\infty}\sigma (n)x^n
\end{align*}
So, $xp'(x)=p(x)\displaystyle\sum_{n\geq1}\sigma(n)x^n$.  Which means $[x^n]xp'(x)=np_n=\displaystyle\sum_{m=1}^n p_{n-m}\sigma(m)$.  Then,

\begin{align*}
p_0&=1\\
1p_1&=1\\
2p_2&=p_0\sigma(2)+p_1\sigma(1)=4\implies p_2=2\\
3p_3&=p_0\sigma(3)+p_1\sigma(2)+p_2\sigma(1)=9\implies p_3=3
\end{align*}
\end{enumerate}

As an aside to see why the coefficients are divisors of the exponent:

\begin{align*}
x&+x^2&+x^3&+x^4&+x^5&+x^6&+x^7&+x^8\\
&+2x^2&&+2x^4&&+2x^6&&+2x^8\\
&&+3x^3&&&+3x^6&&\\
&&&+4x^4&&&&+4x^8\\
&&&&+5x^5&&&\\
&&&&&&+7x^7&\\
&&&&&&&+8x^8\\
\end{align*}
So, $x+(1+2)x^2+(1+3)x^3+(1+2+4)x^4+(1+5)x^5+(1+2+3+6)x^6+...$

\end{flushleft}

\end{document}
