\documentclass[letterpaper,11pt]{article}
\usepackage[dvips]{color}
\usepackage{epsfig}
%\usepackage{gastex}

\setlength{\textwidth}{6.5in} \setlength{\evensidemargin}{0.0in}
\setlength{\oddsidemargin}{0.0in} \setlength{\topmargin}{-0.5in}

\textheight 8.5in \setlength{\footskip}{.8in}

%\begin{figure}[htbp]
%\centerline{\psfig{figure=figs/graph32l.eps,width=4.0in,clip=}}
%\caption{Speedup over $T_4$ for varying depth increments.}
%\label{fig:graph32l}
%\end{figure}

\begin{document}

\title{ {\sc Combinatorics Summary} }
\author{
    Department of Computer Science \\
    University of California, Santa Barbara
}
\date{Fall 2006}
\maketitle

%\section*{\center \sc The Basics of Counting}

\subsection*{\sc The Product Rule}
If a procedure has 2 steps and there are $n_1$ ways to do the
$1^{st}$ task and, \emph{for each of these ways}, there are $n_2$
ways to do the $2^{nd}$ task, then there are $n_1 n_2$ ways to do
the procedure.

\subsection*{\sc The Sum Rule}
If sets $A$ and $B$ are \emph{disjoint}, then $|A \cup B| = |A| +
|B|$.

%\section*{\center \sc Permutations \& Combinations}

\subsection*{\sc Permutations}
\begin{enumerate}

  \item
  A \textcolor[rgb]{0.00,0.00,0.50}{\emph{permutation}} of a set of
  objects is an arrangement of these objects.

  \item
  An arrangement of $r$ elements of a set is called an
  \textcolor[rgb]{0.00,0.00,0.50}{$r$-\emph{permutation}}.

  \item
  If $n \in \textbf{Z}^+$ and $r \in \textbf{Z}^+$ with $1 \leq r
  \leq n$, then there are
  \[
  P(n, r) = n(n - 1)(n - 2) \cdots (n - r + 1) = n!/(n - r)!
  \]
  $r$-permutations of a set with $n$ elements.
\end{enumerate}

\subsection*{\sc Combinations}
\begin{enumerate}

  \item
  An \textcolor[rgb]{0.00,0.00,0.50}{$r$-\emph{combination}} of elements of a set is a subset with $r$ elements.

  \item
  The number of $r$-combinations (or $r$-subsets) of a set of $n$
  elements is denoted $C(n, r)$ or $\left( \begin{array}{c} n \\ r \end{array}
  \right)$. These numbers are referred to as \textcolor[rgb]{0.00,0.00,0.50}{\emph{binomial coefficients}}.

  \item
  The number of $r$-\emph{permutations} from a set of $n$ elements, $P(n, r)$, can be
  counted using the product rule:
  \begin{enumerate}
    \item Select the $r$ elements to be permuted from the set of $n$
    elements: $\left( \begin{array}{c} n \\ r \end{array} \right)$

    \item
    Permute the $r$ elements: $r!$
  \end{enumerate}

  That is,
  \[
  P(n, r) =  \left( \begin{array}{c} n \\ r \end{array} \right) P(r, r) .
  \]

  Thus,
  \[
  \left( \begin{array}{c} n \\ r \end{array} \right) = \frac{P(n, r)}{P(r, r)}
  = \frac{n!}{(n-r)!r!} = n(n - 1)(n - 2) \cdots (n - r + 1)/r! .
  \]

  \item
  For every subset of $r$ elements, $A$, there is a corresponding subset, $\overline{A}$, of $n - r$
  elements:
  The number of $r$-subsets equals the number of $(n-r)$-subsets:
  \[
  \left( \begin{array}{c} n \\ r \end{array} \right) = \left( \begin{array}{c} n \\ n - r \end{array}
  \right) .
  \]
\end{enumerate}

\subsection*{\sc The Binomial Theorem}

  \begin{eqnarray}
  (x + y)^n  & = & \sum_{j = 0 }^n \left( \begin{array}{c} n \\ j \end{array} \right) x^{n - j} y^j \nonumber \\
             & = & \left( \begin{array}{c} n \\ 0 \end{array} \right) x^{n} y^0 + \left( \begin{array}{c} n \\ 1 \end{array} \right) x^{n - 1} y^1 + \left( \begin{array}{c} n \\ 2 \end{array} \right) x^{n - 2} y^2 + \cdots + \left( \begin{array}{c} n \\ n \end{array} \right) x^{0}
             y^n  . \nonumber
  \end{eqnarray}

\begin{enumerate}

  \item
  Evaluating the Binomial Theorem at $x = y = 1$, we get
  \begin{eqnarray}
  2^n  & = & \sum_{j = 0 }^n \left( \begin{array}{c} n \\ j \end{array} \right) \nonumber \\
             & = & \left( \begin{array}{c} n \\ 0 \end{array} \right) + \left( \begin{array}{c} n \\ 1 \end{array} \right) + \left( \begin{array}{c} n \\ 2 \end{array} \right) + \cdots + \left( \begin{array}{c} n \\ n \end{array}
             \right) \nonumber
             .
  \end{eqnarray}


  \item
  Evaluating the Binomial Theorem at $x = 1$ and $y = -1$, we get
  \[
  0 = \sum_{j = 0 }^n \left( \begin{array}{c} n \\ j \end{array} \right) (-1)^j
  \]

  Moving all the negative terms to the other side, we get
  \[
  \left( \begin{array}{c} n \\ 0 \end{array} \right) + \left( \begin{array}{c} n \\ 2 \end{array} \right) + \left( \begin{array}{c} n \\ 4 \end{array} \right) + \cdots =
  \left( \begin{array}{c} n \\ 1 \end{array} \right) + \left( \begin{array}{c} n \\ 3 \end{array} \right) + \left( \begin{array}{c} n \\ 5 \end{array} \right) +
  \cdots .
             .
  \]

  \item
  Any valid manipulation of the Binomial Theorem yields some
  identity involving binomial coefficients.

\end{enumerate}

\subsection*{\sc Some other Binomial Identities}
We can use committee arguments to arrive at other binomial
identities.

\subsubsection*{\sc Pascal's Identity}

\[
  \left( \begin{array}{c} n + 1 \\ k \end{array} \right) = \left( \begin{array}{c} n \\ k - 1 \end{array} \right) + \left( \begin{array}{c} n \\ k \end{array} \right) .
\]

\subsubsection*{\sc Vandermonde's Identity}

\[
  \left( \begin{array}{c} m + n \\ r \end{array} \right) = \sum_{k = 0}^r \left( \begin{array}{c} m \\ r - k \end{array} \right) \left( \begin{array}{c} n \\ k \end{array} \right) .
\]


\subsection*{\sc Combinations with Repetition}

\begin{itemize}
  \item
  How many ways are there to select $n$ items from a set of $r$
  elements \emph{when repetition is allowed}?

  \item
  How many \emph{nonnegative integer} solutions are there to the equation
  \[
  x_1 + x_2 + \cdots + x_r = n ?
  \]

  \item
  How many ways are there to distribute $n$ identical objects into
  $r$ distinct boxes?
\end{itemize}

The answer to the questions above is $\left( \begin{array}{c} n + r
-1 \\ r - 1 \end{array} \right) = \left( \begin{array}{c} n + r -1
\\ n \end{array} \right)$.


\subsection*{\sc Arrangements with Repetition}

\begin{itemize}
  \item
  How many arrangements are there of $n_1$ objects of type 1,
  $n_2$ objects of type 2, $\ldots$, $n_r$ objects of type $r$, where $n_1 + n_2 + \cdots + n_r = n$ ?

  \item
  How many ways are there to distribute $n$ distinct objects into
  $r$ distinct boxes so that $n_i$ objects are put in box $i$, for $i = 1, 2, \ldots, r$?
\end{itemize}

The answer to the questions above is
\[
\frac{n!}{n_1 ! n_2 ! \cdots n_r !} .
\]

\subsection*{\sc Inclusion-Exclusion}
Let's say that we want to count a set of objects that can be
characterized as having \emph{either} property $P_1, P_2, \ldots,$
\emph{or} $P_n$. Further, $A_i$ is the set of objects that have
property $P_i$, for $i = 1, 2, \ldots, n$. Then the set of objects
we are interested in counting is
\[
A_1 \cup A_2 \cup \cdots \cup A_n  .
\]

The inclusion-exclusion formula allows us to count the elements in
this union of sets, even though the sets may not be disjoint:

\begin{eqnarray}
|A_1 \cup A_2 \cup \cdots \cup A_n | & = & \sum_{1 \leq i \leq n}
|A_i | - \sum_{1 \leq i < j \leq n} |A_i \cap A_j | \nonumber \\
 & + & \sum_{1 \leq i < j < k \leq n} |A_i \cap A_j \cap A_k | - \cdots + (-1)^{n + 1} |A_1 \cap A_2 \cap \cdots \cap A_n | \nonumber
\end{eqnarray}

Now, let's say that we want to count a set of objects that can be
characterized as having property $P_1, P_2, \ldots,$
\emph{\textcolor[rgb]{0.50,0.00,0.00}{and}} $P_n$. Further, $A_i$ is
the set of objects that \textcolor[rgb]{0.50,0.00,0.00}{\emph{do not
have}} property $P_i$, for $i = 1, 2, \ldots, n$. Then, the set of
objects we are interested in counting is
\[
\overline{A_1} \cap \overline{A_2} \cap \cdots \cap \overline{A_n} .
\]
However, by De Morgan's law,
\[
\overline{A_1} \cap \overline{A_2} \cap \cdots \cap \overline{A_n} =
\overline{A_1 \cup A_2 \cup \cdots \cup A_n } = U - (A_1 \cup A_2
\cup \cdots \cup A_n) .
\]

The inclusion-exclusion formula thus allows us to solve such
counting problems.



\end{document}
