\documentclass[numbers=enddot,12pt,final,onecolumn,notitlepage]{scrartcl}%
\usepackage[headsepline,footsepline,manualmark]{scrlayer-scrpage}
\usepackage[all,cmtip]{xy}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{framed}
\usepackage{comment}
\usepackage{color}
\usepackage[breaklinks=True]{hyperref}
\usepackage[sc]{mathpazo}
\usepackage[T1]{fontenc}
\usepackage{needspace}
\usepackage{tabls}
\usepackage{tikz}
\usepackage{bbding}
%TCIDATA{OutputFilter=latex2.dll}
%TCIDATA{Version=5.50.0.2960}
%TCIDATA{LastRevised=Monday, December 12, 2022 21:03:40}
%TCIDATA{SuppressPackageManagement}
%TCIDATA{<META NAME="GraphicsSave" CONTENT="32">}
%TCIDATA{<META NAME="SaveForMode" CONTENT="1">}
%TCIDATA{BibliographyScheme=Manual}
%TCIDATA{Language=American English}
%BeginMSIPreambleData
\providecommand{\U}[1]{\protect\rule{.1in}{.1in}}
%EndMSIPreambleData
\usetikzlibrary{arrows.meta}
\usetikzlibrary{chains}
\usetikzlibrary{shapes}
\usetikzlibrary{decorations.pathmorphing}
\newcounter{exer}
\newcounter{exera}
\theoremstyle{definition}
\newtheorem{theo}{Theorem}[subsection]
\newenvironment{theorem}[1][]
{\begin{theo}[#1]\begin{leftbar}}
{\end{leftbar}\end{theo}}
\newtheorem{lem}[theo]{Lemma}
\newenvironment{lemma}[1][]
{\begin{lem}[#1]\begin{leftbar}}
{\end{leftbar}\end{lem}}
\newtheorem{prop}[theo]{Proposition}
\newenvironment{proposition}[1][]
{\begin{prop}[#1]\begin{leftbar}}
{\end{leftbar}\end{prop}}
\newtheorem{defi}[theo]{Definition}
\newenvironment{definition}[1][]
{\begin{defi}[#1]\begin{leftbar}}
{\end{leftbar}\end{defi}}
\newtheorem{remk}[theo]{Remark}
\newenvironment{remark}[1][]
{\begin{remk}[#1]\begin{leftbar}}
{\end{leftbar}\end{remk}}
\newtheorem{coro}[theo]{Corollary}
\newenvironment{corollary}[1][]
{\begin{coro}[#1]\begin{leftbar}}
{\end{leftbar}\end{coro}}
\newtheorem{conv}[theo]{Convention}
\newenvironment{convention}[1][]
{\begin{conv}[#1]\begin{leftbar}}
{\end{leftbar}\end{conv}}
\newtheorem{quest}[theo]{Question}
\newenvironment{question}[1][]
{\begin{quest}[#1]\begin{leftbar}}
{\end{leftbar}\end{quest}}
\newtheorem{warn}[theo]{Warning}
\newenvironment{warning}[1][]
{\begin{warn}[#1]\begin{leftbar}}
{\end{leftbar}\end{warn}}
\newtheorem{conj}[theo]{Conjecture}
\newenvironment{conjecture}[1][]
{\begin{conj}[#1]\begin{leftbar}}
{\end{leftbar}\end{conj}}
\newtheorem{exam}[theo]{Example}
\newenvironment{example}[1][]
{\begin{exam}[#1]\begin{leftbar}}
{\end{leftbar}\end{exam}}
\newtheorem{exmp}[exer]{Exercise}
\newenvironment{exercise}[1][]
{\begin{exmp}[#1]\begin{leftbar}}
{\end{leftbar}\end{exmp}}
\newenvironment{statement}{\begin{quote}}{\end{quote}}
\newenvironment{fineprint}{\begin{small}}{\end{small}}
\iffalse
\newenvironment{proof}[1][Proof]{\noindent\textbf{#1.} }{\ \rule{0.5em}{0.5em}}
\newenvironment{convention}[1][Convention]{\noindent\textbf{#1.} }{\ \rule{0.5em}{0.5em}}
\newenvironment{question}[1][Question]{\noindent\textbf{#1.} }{\ \rule{0.5em}{0.5em}}
\fi
\let\sumnonlimits\sum
\let\prodnonlimits\prod
\let\cupnonlimits\bigcup
\let\capnonlimits\bigcap
\renewcommand{\sum}{\sumnonlimits\limits}
\renewcommand{\prod}{\prodnonlimits\limits}
\renewcommand{\bigcup}{\cupnonlimits\limits}
\renewcommand{\bigcap}{\capnonlimits\limits}
\newcommand\arxiv[1]{\href{http://www.arxiv.org/abs/#1}{\texttt{arXiv:#1}}}
\setlength\tablinesep{3pt}
\setlength\arraylinesep{3pt}
\setlength\extrarulesep{3pt}
\setlength\textheight{22.5cm}
\setlength\textwidth{14.8cm}
\newenvironment{verlong}{}{}
\newenvironment{vershort}{}{}
\newenvironment{noncompile}{}{}
\excludecomment{verlong}
\includecomment{vershort}
\excludecomment{noncompile}
\newcommand{\defn}[1]{{\color{darkred}\emph{#1}}}
\newcommand{\CC}{\mathbb{C}}
\newcommand{\RR}{\mathbb{R}}
\newcommand{\QQ}{\mathbb{Q}}
\newcommand{\NN}{\mathbb{N}}
\newcommand{\ZZ}{\mathbb{Z}}
\newcommand{\KK}{\mathbb{K}}
\newcommand{\set}[1]{\left\{ #1 \right\}}
\newcommand{\abs}[1]{\left| #1 \right|}
\newcommand{\tup}[1]{\left( #1 \right)}
\newcommand{\ive}[1]{\left[ #1 \right]}
\newcommand{\floor}[1]{\left\lfloor #1 \right\rfloor}
\newcommand{\are}{\ar@{-}}
\newcommand{\arebi}[1][]{\ar@{<-}@/_/[#1] \ar@/^/[#1]}
\newcommand{\of}{\text{ of }}
\newtheoremstyle{plainsl}
{8pt plus 2pt minus 4pt}
{8pt plus 2pt minus 4pt}
{\slshape}
{0pt}
{\bfseries}
{.}
{5pt plus 1pt minus 1pt}
{}
\theoremstyle{plainsl}
\ihead{Lecture 10, version \today}
\ohead{page \thepage}
\cfoot{}
\begin{document}
\section*{Math 222 Fall 2022, Lecture 10: Introduction}

\textbf{website:}
\texttt{\href{https://www.cip.ifi.lmu.de/~grinberg/t/22fco}{\texttt{https://www.cip.ifi.lmu.de/\symbol{126}%
grinberg/t/22fco}}}

\section{Introduction (cont'd)}

\setcounter{subsection}{3}

\subsection{Counting subsets (cont'd)}

\setcounter{subsubsection}{5}

\subsubsection{Counting subsets with $a$ odd and $b$ even elements (cont'd)}

\setcounter{theo}{10}

Last time, I stated the following proposition:

\begin{proposition}
\label{prop.count-subsets.ab1}Let $n\in\mathbb{N}$ be even. Let $a,b\in
\mathbb{N}$. Then,%
\begin{align*}
&  \left(  \text{\# of subsets of }\left[  n\right]  \text{ that contain
}a\text{ even elements and }b\text{ odd elements}\right) \\
&  =\dbinom{n/2}{a}\dbinom{n/2}{b}.
\end{align*}
(Here, \textquotedblleft$a$ even elements\textquotedblright\ means
\textquotedblleft exactly $a$ even elements\textquotedblright, and
\textquotedblleft$b$ odd elements\textquotedblright\ means \textquotedblleft
exactly $b$ odd elements\textquotedblright.)
\end{proposition}

Let us now prove it:

\begin{proof}
(See the proof of Proposition 1.4.14 in the 2019 notes for details.)

We will give an informal proof and a formal one. More precisely, we will give
one proof in an informal writeup and in a formal one. (You don't need to spell
out your proofs formally on the homework, but you should know how this can be
done if so desired.) \medskip

\textit{Informal proof:} To construct a subset of $\left[  n\right]  $ that
contains $a$ even elements and $b$ odd elements, we just need to choose $a$
elements from the set $E:=\left\{  2,4,6,\ldots,n\right\}  $ and to choose $b$
elements from the set $O:=\left\{  1,3,5,\ldots,n-1\right\}  $. We have
$\dbinom{n/2}{a}$ options for our first choice (by the combinatorial
interpretation of BCs, since $\left\vert E\right\vert =n/2$) and $\dbinom
{n/2}{b}$ options for our second choice (similarly). Since the two choices are
independent, we thus have $\dbinom{n/2}{a}\dbinom{n/2}{b}$ possibilities in
total. \medskip

\textit{Formal proof:} This \textquotedblleft independent
choice\textquotedblright\ language we just used is just shorthand for applying
the product rule. To state our above argument formally, we introduce the
notation $\mathcal{P}_{k}\left(  S\right)  $ for the set of all $k$-element
subsets of a given set $S$. We also let $\mathcal{N}$ denote the set of all
subsets of $\left[  n\right]  $ that contain $a$ even elements and $b$ odd
elements. We must then prove that $\left\vert \mathcal{N}\right\vert
=\dbinom{n/2}{a}\dbinom{n/2}{b}$.

We set $E:=\left\{  2,4,6,\ldots,n\right\}  $ and $O:=\left\{  1,3,5,\ldots
,n-1\right\}  $. The map%
\begin{align*}
\mathcal{N}  &  \rightarrow\mathcal{P}_{a}\left(  E\right)  \times
\mathcal{P}_{b}\left(  O\right)  ,\\
S  &  \mapsto\left(  S\cap E,\ S\cap O\right)
\end{align*}
is a bijection, since the map%
\begin{align*}
\mathcal{P}_{a}\left(  E\right)  \times\mathcal{P}_{b}\left(  O\right)   &
\rightarrow\mathcal{N},\\
\left(  U,V\right)   &  \mapsto U\cup V
\end{align*}
is inverse to it. So, by the bijection principle,%
\begin{align*}
\left\vert \mathcal{N}\right\vert  &  =\left\vert \mathcal{P}_{a}\left(
E\right)  \times\mathcal{P}_{b}\left(  O\right)  \right\vert =\left\vert
\mathcal{P}_{a}\left(  E\right)  \right\vert \cdot\left\vert \mathcal{P}%
_{b}\left(  O\right)  \right\vert \ \ \ \ \ \ \ \ \ \ \left(  \text{by the
product rule}\right) \\
&  =\dbinom{\left\vert E\right\vert }{a}\cdot\dbinom{\left\vert O\right\vert
}{b}\ \ \ \ \ \ \ \ \ \ \left(
\begin{array}
[c]{c}%
\text{since the combinatorial interpretation of}\\
\text{BCs says that }\left\vert \mathcal{P}_{k}\left(  S\right)  \right\vert
=\dbinom{\left\vert S\right\vert }{k}\text{ for all }S\text{ and }k
\end{array}
\right) \\
&  =\dbinom{n/2}{a}\cdot\dbinom{n/2}{b}\ \ \ \ \ \ \ \ \ \ \left(  \text{since
}\left\vert E\right\vert =n/2\text{ and }\left\vert O\right\vert =n/2\right)
.
\end{align*}
This again proves Proposition \ref{prop.count-subsets.ab1}.
\end{proof}

A takeaway from the above argument: \textquotedblleft Independent
choices\textquotedblright\ correspond to an application of the product rule
(and possibly of the bijection principle).

\subsubsection{The addition formula for Fibonacci numbers}

For another example of counting subsets, we shall prove combinatorially the
following property of Fibonacci numbers:

\begin{theorem}
[addition formula for Fibonacci numbers]\label{thm.fibonacci.add}Let
$m,n\in\mathbb{N}$. Then, the Fibonacci sequence satisfies%
\[
f_{m+n+1}=f_{m}f_{n}+f_{m+1}f_{n+1}.
\]

\end{theorem}

There are various easy ways to prove this (e.g., by induction\footnote{For
such a proof, see \cite[Exercise 2.2.3]{20f}. (See also \cite[Exercise 4.9.3
and Exercise 4.9.4]{20f} for generalizations.)}, or using Binet's formula).
But let me show a \textbf{combinatorial} proof, to illustrate a strategy.

First, we begin with a simple piece of notation:

\begin{definition}
\label{def.int-interval}Let $a$ and $b$ be two integers. Then, the subset
\[
\left\{  a,a+1,\ldots,b\right\}  =\left\{  i\in\mathbb{Z}\ \mid\ a\leq i\leq
b\right\}  \ \ \ \ \ \ \ \ \ \ \text{of }\mathbb{Z}%
\]
will be denoted by $\left[  a,b\right]  $. This subset is called the
\textbf{integer interval} from $a$ to $b$. It is empty if $a>b$.
\end{definition}

For example, $\left[  2,5\right]  =\left\{  2,3,4,5\right\}  $. Note that
$\left[  k\right]  =\left[  1,k\right]  $ for every $k\in\mathbb{Z}$.

We can now generalize Proposition 1.4.7 from
\href{https://www.cip.ifi.lmu.de/~grinberg/t/22fco/lec09.pdf}{Lecture 9} as follows:

\begin{proposition}
\label{prop.lacunar-count-a}Let $n\in\left\{  -1,0,1,\ldots\right\}  $ and
$a\in\mathbb{Z}$. Then,%
\[
\left(  \text{\# of lacunar subsets of }\left[  a+1,a+n\right]  \right)
=f_{n+2}.
\]

\end{proposition}

\begin{proof}
Proposition 1.4.7 from
\href{https://www.cip.ifi.lmu.de/~grinberg/t/22fco/lec09.pdf}{Lecture 9} says
that%
\[
\left(  \text{\# of lacunar subsets of }\left[  n\right]  \right)  =f_{n+2}.
\]
However, there is a bijection%
\begin{align*}
\left\{  \text{lacunar subsets of }\left[  n\right]  \right\}   &
\rightarrow\left\{  \text{lacunar subsets of }\left[  a+1,a+n\right]
\right\}  ,\\
S &  \mapsto\left\{  s+a\ \mid\ s\in S\right\}
\end{align*}
(this is simply shifting a lacunar subset of $\left[  n\right]  $ by $a$ units
on the number line, so that it becomes a lacunar subset of $\left[
a+1,a+n\right]  $). Thus, by the bijection principle, we have
\[
\left(  \text{\# of lacunar subsets of }\left[  a+1,a+n\right]  \right)
=\left(  \text{\# of lacunar subsets of }\left[  n\right]  \right)  =f_{n+2}.
\]
This proves Proposition \ref{prop.lacunar-count-a}.
\end{proof}

\begin{proof}
[Proof of Theorem \ref{thm.fibonacci.add} (sketched).]This will be a very
rough sketch; see the 2019 notes (\S 1.4.7) for details.

For $m=0$, the claim is obvious (since $f_{0}=0$ and $f_{1}=1$). So we WLOG
assume that $m\geq1$. Similarly, we WLOG assume that $n\geq1$. Now, let us
count the lacunar subsets of $\left[  m+n-1\right]  $ in two ways:

\textit{First way:} Proposition \ref{prop.lacunar-count-a} (applied to $0$ and
$m+n-1$ instead of $a$ and $n$) yields%
\[
\left(  \text{\# of lacunar subsets of }\left[  m+n-1\right]  \right)
=f_{\left(  m+n-1\right)  +2}=f_{m+n+1}.
\]


\textit{Second way:} We shall call a subset of $\left[  m+n-1\right]  $

\begin{itemize}
\item \textbf{red} if it contains $m$, and

\item \textbf{green} if it does not contain $m$.
\end{itemize}

Thus, by the sum rule, we have%
\begin{align*}
&  \left(  \text{\# of lacunar subsets of }\left[  m+n-1\right]  \right) \\
&  =\left(  \text{\# of lacunar red subsets of }\left[  m+n-1\right]  \right)
\\
&  \ \ \ \ \ \ \ \ \ \ +\left(  \text{\# of lacunar green subsets of }\left[
m+n-1\right]  \right)  .
\end{align*}


A lacunar red subset of $\left[  m+n-1\right]  $ must contain $m$, and thus
cannot contain any of $m-1$ and $m+1$ (since it is lacunar). Hence, if we
remove $m$ from it, then we obtain a union of a lacunar subset of $\left[
m-2\right]  $ with a lacunar subset of $\left[  m+2,\ m+n-1\right]  $.
Conversely, if we take a union of any lacunar subset of $\left[  m-2\right]  $
with any lacunar subset of $\left[  m+2,\ m+n-1\right]  $, and if we insert
$m$ into this union, then we obtain a lacunar red subset of $\left[
m+n-1\right]  $. Hence, we have a bijection%
\begin{align*}
&  \left\{  \text{lacunar red subsets of }\left[  m+n-1\right]  \right\}  \\
&  \rightarrow\left\{  \text{lacunar subsets of }\left[  m-2\right]  \right\}
\times\left\{  \text{lacunar subsets of }\left[  m+2,\ m+n-1\right]  \right\}
\end{align*}
(which sends each subset $S$ to the pair $\left(  S\cap\left[  m-2\right]
,\ S\cap\left[  m+2,\ m+n-1\right]  \right)  $). Hence, by the bijection
principle,%
\begin{align*}
&  \left\vert \left\{  \text{lacunar red subsets of }\left[  m+n-1\right]
\right\}  \right\vert \\
&  =\left\vert \left\{  \text{lacunar subsets of }\left[  m-2\right]
\right\}  \times\left\{  \text{lacunar subsets of }\left[  m+2,\ m+n-1\right]
\right\}  \right\vert \\
&  =\underbrace{\left\vert \left\{  \text{lacunar subsets of }\left[
m-2\right]  \right\}  \right\vert }_{\substack{=f_{m}\\\text{(by Proposition
\ref{prop.lacunar-count-a},}\\\text{applied to }0\text{ and }%
m-2\\\text{instead of }a\text{ and }n\text{)}}}\cdot\underbrace{\left\vert
\left\{  \text{lacunar subsets of }\left[  m+2,\ m+n-1\right]  \right\}
\right\vert }_{\substack{=f_{n}\\\text{(by Proposition
\ref{prop.lacunar-count-a},}\\\text{applied to }m+1\text{ and }%
n-2\\\text{instead of }a\text{ and }n\text{)}}}\\
&  =f_{m}f_{n}.
\end{align*}
In other words,
\[
\left(  \text{\# of lacunar red subsets of }\left[  m+n-1\right]  \right)
=f_{m}f_{n}.
\]


A similar argument (see the 2019 notes for details) yields%
\begin{align*}
&  \left\vert \left\{  \text{lacunar green subsets of }\left[  m+n-1\right]
\right\}  \right\vert \\
&  =\left\vert \left\{  \text{lacunar subsets of }\left[  m-1\right]
\right\}  \times\left\{  \text{lacunar subsets of }\left[  m+1,\ m+n-1\right]
\right\}  \right\vert \\
&  =\underbrace{\left\vert \left\{  \text{lacunar subsets of }\left[
m-1\right]  \right\}  \right\vert }_{=f_{m+1}}\cdot\underbrace{\left\vert
\left\{  \text{lacunar subsets of }\left[  m+1,\ m+n-1\right]  \right\}
\right\vert }_{=f_{n+1}}\\
&  =f_{m+1}f_{n+1}.
\end{align*}


Altogether,
\begin{align*}
&  \left(  \text{\# of lacunar subsets of }\left[  m+n-1\right]  \right) \\
&  =\underbrace{\left(  \text{\# of lacunar red subsets of }\left[
m+n-1\right]  \right)  }_{=f_{m}f_{n}}\\
&  \ \ \ \ \ \ \ \ \ \ +\underbrace{\left(  \text{\# of lacunar green subsets
of }\left[  m+n-1\right]  \right)  }_{=f_{m+1}f_{n+1}}\\
&  =f_{m}f_{n}+f_{m+1}f_{n+1}.
\end{align*}


So we have solved our counting problem (counting the lacunar subsets of
$\left[  m+n-1\right]  $) in two different ways. One way gave us the answer
$f_{m+n+1}$, while the other gave us the answer $f_{m}f_{n}+f_{m+1}f_{n+1}$.
But these two answers must be equal, since they count the same objects. So we
get $f_{m+n+1}=f_{m}f_{n}+f_{m+1}f_{n+1}$. This proves Theorem
\ref{thm.fibonacci.add}.
\end{proof}

The proof we just gave is an example of a \textbf{proof by double counting}:
We posed ourselves a counting problem; we solved it in two different ways;
then we concluded that the two answers must be equal. This is a fairly potent
method of proving equalities, even if the equalities do not originally come
from combinatorics (as long as both sides of the relevant equality have
combinatorial interpretations).

\subsubsection{More subset counting}

The following exercise is solved in the 2019 notes (\S 1.4.8):

\begin{exercise}
A set $S$ of integers is said to be

\begin{itemize}
\item \textbf{self-counting} if $\left\vert S\right\vert \in S$. (For
instance, $\left\{  2,3,4\right\}  $ is self-counting, because $3\in\left\{
2,3,4\right\}  $. But $\left\{  3,4\right\}  $ is not self-counting, because
$2\notin\left\{  3,4\right\}  $).

\item \textbf{self-starting} if $\left\vert S\right\vert =\min S$ (that is,
the size of $S$ is the smallest element of $S$).

\item \textbf{self-ending} if $\left\vert S\right\vert =\max S$ (that is, the
size of $S$ is the largest element of $S$).
\end{itemize}

Let $n\in\mathbb{N}$.

\textbf{(a)} For each $k\in\left[  n\right]  $, find the \# of self-counting
(resp. self-starting, resp. self-ending) $k$-element subsets of $\left[
n\right]  $.

\textbf{(b)} Find the \# of all self-counting (resp. self-starting, resp.
self-ending) subsets of $\left[  n\right]  $.
\end{exercise}

See the notes for a solution, as well as some other exercises on this topic.

\subsubsection{Counting subsets containing a given subset}

For a given $k\in\mathbb{N}$, how many $k$-element subsets of a given set $N$
contain a given subset $D$ as a subset?

\begin{proposition}
Let $n\in\mathbb{N}$, $d\in\mathbb{N}$ and $k\in\mathbb{R}$. Let $N$ be an
$n$-element set. Let $D$ be a $d$-element subset of $N$. Then,%
\[
\left(  \text{\# of }k\text{-element subsets }A\text{ of }N\text{ satisfying
}D\subseteq A\right)  =\dbinom{n-d}{k-d}.
\]

\end{proposition}

\begin{proof}
(See \S 1.4.9 in the 2019 notes for details.)

\textit{Informal proof:} To build a $k$-element subset $A$ of $N$ satisfying
$D\subseteq A$, we start with the $d$ elements of $D$, and we add $k-d$
further elements from the $\left(  n-d\right)  $-element set $N\setminus D$ to
them. The latter $k-d$ elements can be chosen arbitrarily. The \# of ways to
do this is $\dbinom{n-d}{k-d}$, since it boils down to picking a $\left(
k-d\right)  $-element subset of the $\left(  n-d\right)  $-element set
$N\setminus D$.

\textit{Formal proof:} There is a bijection\footnote{Again, we let
$\mathcal{P}_{k}\left(  S\right)  $ denote the set of all $k$-element subsets
of a given set $S$.}%
\begin{align*}
\left\{  k\text{-element subsets }A\text{ of }N\text{ satisfying }D\subseteq
A\right\}   &  \rightarrow\mathcal{P}_{k-d}\left(  N\setminus D\right)  ,\\
A  &  \mapsto A\setminus D
\end{align*}
with inverse map%
\begin{align*}
\mathcal{P}_{k-d}\left(  N\setminus D\right)   &  \rightarrow\left\{
k\text{-element subsets }A\text{ of }N\text{ satisfying }D\subseteq A\right\}
,\\
A  &  \mapsto A\cup D
\end{align*}
(yes, it needs to be checked that both of these maps are well-defined and that
they are actually inverse to each other; but this is all straightforward set
theory). Hence, by the bijection principle,%
\[
\left\vert \left\{  k\text{-element subsets }A\text{ of }N\text{ satisfying
}D\subseteq A\right\}  \right\vert =\left\vert \mathcal{P}_{k-d}\left(
N\setminus D\right)  \right\vert =\dbinom{n-d}{k-d}%
\]
(by the combinatorial interpretation of BCs, since $\left\vert N\setminus
D\right\vert =n-d$). This proves the proposition.
\end{proof}

\subsection{Counting tuples and maps}

Having counted various kinds of subsets, let us now move on to counting tuples.

\subsubsection{Tuples}

Let us recall the definition of the Cartesian product of sets:

\begin{definition}
Let $A_{1},A_{2},\ldots,A_{n}$ be $n$ sets. Then, their \textbf{Cartesian
product} $A_{1}\times A_{2}\times\cdots\times A_{n}$ is defined to be the set
of all $n$-tuples $\left(  a_{1},a_{2},\ldots,a_{n}\right)  $, where $a_{1}\in
A_{1}$ and $a_{2}\in A_{2}$ and $\cdots$ and $a_{n}\in A_{n}$. In other words,%
\begin{align*}
&  A_{1}\times A_{2}\times\cdots\times A_{n}\\
&  =\left\{  \left(  a_{1},a_{2},\ldots,a_{n}\right)  \ \mid\ a_{1}\in
A_{1}\text{ and }a_{2}\in A_{2}\text{ and }\cdots\text{ and }a_{n}\in
A_{n}\right\} \\
&  =\left\{  \left(  a_{1},a_{2},\ldots,a_{n}\right)  \ \mid\ a_{i}\in
A_{i}\text{ for all }i\in\left[  n\right]  \right\}  .
\end{align*}

\end{definition}

Note that:

\begin{itemize}
\item A $2$-tuple is the same as a pair (i.e., ordered pair). For example, the
Cartesian product $\left\{  1,2\right\}  \times\left\{  5,6,7\right\}  $
contains the pairs (= $2$-tuples)%
\begin{align*}
&  \left(  1,5\right)  ,\ \left(  1,6\right)  ,\ \left(  1,7\right)  ,\\
&  \left(  2,5\right)  ,\ \left(  2,6\right)  ,\ \left(  2,7\right)  .
\end{align*}


\item A $3$-tuple is the same as a triple.

\item A $1$-tuple consists of a single element (but, to be pedantic, it is not
the same as this element). For example, $\left(  7\right)  $ is a $1$-tuple of
integers. Thus, a Cartesian product of a single set $A_{1}$ can be viewed as a
copy of $A_{1}$, except that each element is \textquotedblleft enclosed in
parentheses\textquotedblright.

\item A $0$-tuple has no entries; thus, it looks like this: $\left(
{}\right)  $. So there is only one $0$-tuple.
\end{itemize}

How do we count these tuples?

\begin{theorem}
[the product rule for $n$ sets]\label{thm.prodrule-n}Let $A_{1},A_{2}%
,\ldots,A_{n}$ be $n$ finite sets. Then, their Cartesian product $A_{1}\times
A_{2}\times\cdots\times A_{n}$ is again finite and has size%
\[
\left\vert A_{1}\times A_{2}\times\cdots\times A_{n}\right\vert =\left\vert
A_{1}\right\vert \cdot\left\vert A_{2}\right\vert \cdot\cdots\cdot\left\vert
A_{n}\right\vert .
\]

\end{theorem}

A particularly important example of Cartesian products is when all the factors
are the same:

\begin{definition}
Let $A$ be a set, and let $n\in\mathbb{N}$. Then, the $n$-th
\textbf{(Cartesian) power} of $A$ is the set
\[
A^{n}:=\underbrace{A\times A\times\cdots\times A}_{n\text{ times}}.
\]

\end{definition}

\begin{corollary}
Let $A$ be a finite set, and let $n\in\mathbb{N}$. Then, $A^{n}$ is finite and
has size%
\[
\left\vert A^{n}\right\vert =\left\vert A\right\vert ^{n}.
\]

\end{corollary}

\begin{thebibliography}{999}                                                                                              %
\bibitem[20f]{20f}Darij Grinberg, \textit{Math 235: Mathematical Problem
Solving}, 25 December 2021.\newline\url{http://www.cip.ifi.lmu.de/~grinberg/t/20f/mps.pdf}
\end{thebibliography}


\end{document}