% AUTOGENERATED FILE; you probably want to edit the .tex.in file, not this.
\documentclass[letter,12pt]{article}
\usepackage[margin=0.5in,hmargin=4cm]{geometry}
\pagestyle{headings}
\usepackage{amssymb,amsmath,hyperref,enumerate}
\usepackage{parskip}
\usepackage[all,cmtip]{xy}
\parindent=0pt
\newcommand{\defn}{\underline}
\newcommand{\qed}{\hfill\ensuremath{\Box}}
\begin{document}
\section*{Permutations}

A \underline{permutation} of a finite set $S$ is an ordered list of its elements.

An \underline{$r$-permutation} of $S$ is an ordered list of $r$ of its elements.

\paragraph{Warning:}
\mbox{}\\    there is another, related, meaning of 'permutation': an element of the
    group of bijections of $S$. We won't use that meaning in this course.

$P(n,r) :=$ number of $r$-permutations of a set of size $n$.

e.g. $P(26,5) =$ number of strings of 5 distinct letters from the Roman alphabet.

By the multiplication principle,
\\    $P(n,r) = n * (n-1) * ... * (n-(r-1))$
($n$ choices for first, $n-1$ for second...)

$P(n,r) = n! / (n-r)!$

$P(n,n) = n!$

\paragraph{Remark:}
\mbox{}\\    Can interpret "$P(n,r) = n! / (n-r)!$" as follows:
\\	We can obtain an $r$-permutation of $S$ by taking the first $r$ elements of
	a permutation of $S$.
\\	Partition the permutations of $S$ according to the $r$-permutation which
	results from this: we see that the elements of each set of the
	partition correspond to the permutations of the left-over $n-r$
	elements, so we recover the formula by the division principle.

A \underline{circular $r$-permutation} of a set is a way of putting $r$ of its elements
around a circle, with two such considered equal if one can be rotated to the
other.

We can obtain a circular $r$-permutation from an $r$-permutation by "joining the
ends into a circle". Each circular $r$-permutation is obtained from $r$ different
$r$-permutations, so by the division principle:
\\    number of circular $r$-permutations of $n$ elements
\mbox{}\\ \mbox{\hspace{2em}}$= P(n,r) / r$
\mbox{}\\ \mbox{\hspace{2em}}$= n! / r(n-r)!$

\paragraph{Example:}
\mbox{}\\    How many different kinds of necklace can be made from 7 spherical beads
    of different colours? Consider two necklaces to be of the same kind when
    they can be non-destructively manipulated to look the same.
\paragraph{Solution:}
\mbox{}\\    There are $7!/7 = 6!$ circular permutations of the 13 colours. Each kind
    of necklace is obtained from exactly {\bf two} circular permutations, because
    flipping the necklace in space doesn't change the kind. So the answer is
\mbox{}\\ \mbox{\hspace{2em}}$6! / 2 = 360$.

\paragraph{Example:}
\mbox{}\\    How many ways can 13 people be sat around a round table, if Professor Q
    is not to be sat next to his arch-nemesis Inspector P?
\paragraph{Solution:}
\mbox{}\\    Without the restriction, there would be 12! seating arrangements.
\\    Consider seating everyone but P; each such arrangement yields two
    forbidden arrangements of all 13, one by placing P to Q's right and one by
    placing P to Q's left. We count each forbidden arrangement once in this
    way.

    So the answer is $12! - 2*11! = 10*11! = 399168000$


\subsection*{Subsets ("Combinations")}

An \underline{$r$-subset}, or \underline{$r$-combination}, of a set $S$ is a subset of size $r$.

$C(n,r) = {n \choose r} =$ number of $r$-subsets of a set of size $n$.

e.g. ${26 \choose 5} =$ number of unordered selections of 5 letters from the roman
    alphabet

\paragraph{Theorem:}
\mbox{}\\    ${n \choose r} = n! / r!(n-r)!$
\paragraph{Proof:}
\mbox{}\\    The $r$-permutations of a set are precisely the permutations of the
    $r$-subsets. Each $r$-subset has $r!$ permutations, so
\mbox{}\\ \mbox{\hspace{2em}}$P(n,r) = r! * {n \choose r}$.
\\    So
\mbox{}\\ \mbox{\hspace{2em}}${n \choose r} = P(n,r) / r!$
\mbox{}\\ \mbox{\hspace{4em}}$= n! / r!(n-r)!$.

${n \choose r}$ is also called a "binomial coefficient".

\paragraph{Example:}
\mbox{}\\    If we expand out $(x+y)^n$ and collect terms to obtain
\mbox{}\\ \mbox{\hspace{2em}}$a_0 x^n + a_1 x^{n-1}y + ... + a_{n-1} xy^{n-1} + a_n y^n$,
\\    what are the coefficients $a_k$?
\paragraph{Solution:}
\mbox{}\\    $a_k$ is the number of ways of choosing $y$ $k$ times when we have to choose
    either $x$ or $y$ from each factor of the product
\mbox{}\\ \mbox{\hspace{2em}}$(x+y)(x+y)...(x+y)$  ($n$ times),
\\    which is the number of subsets of this set of $n$ factors.

    So $a_k = {n \choose k}$.

\paragraph{Theorem [Pascal's Formula]:}
\mbox{}\\    If $0 < k < n$,
\mbox{}\\ \mbox{\hspace{2em}}${n \choose k} = {n-1 \choose k} + {n-1 \choose k-1}$
\paragraph{Proof:}
\mbox{}\\    $|S| = n$.
\\    Fix $x \in S$; let $S' := S \setminus \{x\}$.
\\    Partition the $k$-subsets of $S$ according to whether they contain $x$.
\\    Those which don't correspond to $k$-subsets of $S'$,
\\    those which do correspond to $(k-1)$-subsets of $S'$.

\paragraph{Theorem:}
\mbox{}\\ \mbox{\hspace{2em}}$\Sigma_{k=0}^n {n \choose k} = 2^n$
\paragraph{Proof:}
\mbox{}\\    $|S| = n$.
\\    $\Sigma_{k=0}^n {n \choose k} =$ number of subsets of $S$.
\\    But to choose a subset of $S$ is to choose for each element of $S$ whether it
    should or should not go in to the subset. That's two choices for each of
    the $n$ elements, so by the multiplication principle there are
    $2*2*...*2 = 2^n$ subsets of $S$.
\end{document}
