% Like most advanced LaTeX files, this one begins with a lot of
% boilerplate. You don't need to understand (or even read) most of it.
% All you need to do is fill in your name, email address,
% and the number of the pset. (Search for "METADATA" to find the place
% for this.) Then, you can go straight to the "EXERCISE 1"
% section and start writing your solutions.
% The "VARIOUS USEFUL COMMANDS" section is probably worth taking a
% look at at some point.

%----------------------------------------------------------------------------------------
%	PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
%----------------------------------------------------------------------------------------
\documentclass[paper=a4, fontsize=12pt]{scrartcl} % A4 paper and 12pt font size
\usepackage[T1]{fontenc} % Use 8-bit encoding that has 256 glyphs
\usepackage[english]{babel} % English language/hyphenation
\usepackage{amsmath,amsfonts,amsthm,amssymb} % Math packages
\usepackage{mathrsfs}    % More math packages
\usepackage{sectsty}  % Allows customizing section commands
\allsectionsfont{\centering \normalfont\scshape} % Make all section titles centered, the default font and small caps %remove this to left align section tites
\usepackage{hyperref} % Turns cross-references into hyperlinks,
                      % and defines \url and \href commands.
\usepackage{graphicx} % For embedding graphics files.
\usepackage{framed}   % For the "leftbar" environment used below.
\usepackage{ifthen}   % Used for the \powset command below.
\usepackage{lastpage} % for counting the number of pages
\usepackage[headsepline,footsepline,manualmark]{scrlayer-scrpage}
\usepackage[height=10in,a4paper,hmargin={1in,0.8in}]{geometry}
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage{tikz}     % This is a powerful tool to draw vector
                      % graphics inside LaTeX. In particular, you can
                      % use it to draw graphs.
\usepackage{verbatim} % For the "verbatim" environment, in which
                      % special symbols can be used freely without
                      % confusing the compiler. (And it's typeset in
                      % a constant-width font.)
                      % Useful, e.g., for quoting code (or ASCII art).
\usepackage{tabls}

%\numberwithin{table}{section} % Number tables within sections (i.e. 1.1, 1.2, 2.1, 2.2 instead of 1, 2, 3, 4)

\setlength\parindent{20pt} % Makes indentation for paragraphs longer.
                           % This makes paragraphs stand out more.

%----------------------------------------------------------------------------------------
%	VARIOUS USEFUL COMMANDS
%----------------------------------------------------------------------------------------
% The commands below might be convenient. For example, you probably
% prefer to write $\powset[2]{V}$ for the set of $2$-element subsets
% of $V$, rather than writing $\mathcal{P}_2(V)$.
% Notice that you can easily define your own commands like this.
% Caveat: Some of these commands need to be properly "guarded" when
% they occur in subscripts or superscripts. So you should not write
% $K_\CC$, but rather $K_{\CC}$.
\newcommand{\CC}{\mathbb{C}} % complex numbers
\newcommand{\RR}{\mathbb{R}} % real numbers
\newcommand{\QQ}{\mathbb{Q}} % rational numbers
\newcommand{\NN}{\mathbb{N}} % nonnegative integers
\newcommand{\Z}[1]{\mathbb{Z}/#1\mathbb{Z}} % integers modulo k
                                            % (syntax: "\Z{k}")
\newcommand{\ZZ}{\mathbb{Z}} % integers
\newcommand{\id}{\operatorname{id}} % identity map
\newcommand{\lcm}{\operatorname{lcm}}
% Lowest common multiple. For historical reasons, LaTeX has a \gcd
% command built in, but not an \lcm command. The preceding line
% rectifies that.
\newcommand{\rev}{\operatorname{rev}} % reversal of a walk
\newcommand{\powset}[2][]{\ifthenelse{\equal{#2}{}}{\mathcal{P}\left(#1\right)}{\mathcal{P}_{#1}\left(#2\right)}}
% $\powset[k]{S}$ stands for the set of all $k$-element subsets of
% $S$. The argument $k$ is optional, and if not provided, the result
% is the whole powerset of $S$.
\newcommand{\set}[1]{\left\{ #1 \right\}}
% $\set{...}$ compiles to {...} (set-brackets).
\newcommand{\abs}[1]{\left| #1 \right|}
% $\abs{...}$ compiles to |...| (absolute value, or size of a set).
\newcommand{\tup}[1]{\left( #1 \right)}
% $\tup{...}$ compiles to (...) (parentheses, or tuple-brackets).
\newcommand{\ive}[1]{\left[ #1 \right]}
% $\ive{...}$ compiles to [...] (Iverson bracket, aka truth value).
\newcommand{\ceil}[1]{\left\lceil #1 \right\rceil}
% $\ceil{...}$ compiles to the ceiling of ..l..
\newcommand{\verts}[1]{\operatorname{V}\left( #1 \right)}
% $\verts{...}$ compiles to V(...) (vertex set of a graph/digraph).
\newcommand{\edges}[1]{\operatorname{E}\left( #1 \right)}
% $\edges{...}$ compiles to E(...) (edge set of a graph).
\newcommand{\arcs}[1]{\operatorname{A}\left( #1 \right)}
% $\arcs{...}$ compiles to A(...) (arc set of a digraph).
\newcommand{\lf}[2]{#1^{\underline{#2}}}
% $\lf{...1}{...2}$ compiles to $...1^{\underline{...2}}$.
% This is a notation for the falling factorial.
\newcommand{\stirling}[2]{\genfrac{\{}{\}}{0pt}{0}{#1}{#2}}
% Stirling numbers of the 2nd kind.
\newcommand{\stirfirst}[2]{\genfrac{[}{]}{0pt}{0}{#1}{#2}}
% Stirling numbers of the 1st kind.
\newcommand{\underbrack}[2]{\underbrace{#1}_{\substack{#2}}}
% $\underbrack{...1}{...2}$ yields
% $\underbrace{...1}_{\substack{...2}}$. This is useful for doing
% local rewriting transformations on mathematical expressions with
% justifications. For example, try this out:
% $ \underbrack{(a+b)^2}{= a^2 + 2ab + b^2 \\ \text{(by the binomial formula)}} $
\newcommand{\horrule}[1]{\rule{\linewidth}{#1}} % Create horizontal rule command with 1 argument of height
\newcommand{\nnn}{\nonumber\\} % Don't number this line in an "align" environment, and move on to the next line.
\newcommand{\explain}[1]{\tup{\hspace{-0.5pc}\text{\begin{tabular}{c}#1\end{tabular}\hspace{-0.5pc}}}}
% $\explain{...}$ interprets the "..." as text (you can
% nest some math inside by putting it in $...$'s as you
% would in any other text block) and puts it in parentheses.

%----------------------------------------------------------------------------------------
%	MAKING SUMMATION SIGNS ALWAYS PUT THEIR BOUNDS ABOVE AND BELOW
%	THE SIGN
%----------------------------------------------------------------------------------------
% The following are hacks to ensure that sums (such as
% $\sum_{k=1}^n k$) always put their bounds (i.e., the $k=1$ and the
% $n$) underneath and above the sign, as opposed to on its right.
% Same for products (\prod), set unions (\bigcup) and set
% intersections (\bigcap). Remove the 8 lines below if you do not want
% this behavior.
\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}

%----------------------------------------------------------------------------------------
%	ENVIRONMENTS
%----------------------------------------------------------------------------------------
% The incantations below define how theorem environments
% (\begin{theorem} ... \end{theorem}) and their likes will look like.
\newtheoremstyle{plainsl}% <name>
  {8pt plus 2pt minus 4pt}% <Space above>
  {8pt plus 2pt minus 4pt}% <Space below>
  {\slshape}% <Body font>
  {0pt}% <Indent amount>
  {\bfseries}% <Theorem head font>
  {.}% <Punctuation after theorem head>
  {5pt plus 1pt minus 1pt}% <Space after theorem headi>
  {}% <Theorem head spec (can be left empty, meaning `normal')>

% Environments which make the text inside them slanted:
\theoremstyle{plainsl}
  \newtheorem{theorem}{Theorem}[section]
  \newtheorem{proposition}[theorem]{Proposition}
  \newtheorem{lemma}[theorem]{Lemma}
  \newtheorem{corollary}[theorem]{Corollary}
  \newtheorem{conjecture}[theorem]{Conjecture}
% Environments that don't:
\theoremstyle{definition}
  \newtheorem{definition}[theorem]{Definition}
  \newtheorem{example}[theorem]{Example}
  \newtheorem{exercise}[theorem]{Exercise}
  \newtheorem{examples}[theorem]{Examples}
  \newtheorem{algorithm}[theorem]{Algorithm}
  \newtheorem{question}[theorem]{Question}
 \theoremstyle{remark}
  \newtheorem{remark}[theorem]{Remark}
\newenvironment{statement}{\begin{quote}}{\end{quote}}
\newenvironment{fineprint}{\begin{small}}{\end{small}}

%----------------------------------------------------------------------------------------
%	METADATA
%----------------------------------------------------------------------------------------
\newcommand{\myname}{Darij Grinberg} % ENTER YOUR NAME HERE
\newcommand{\mymail}{darij.grinberg@drexel.edu} % ENTER YOUR EMAIL HERE
\newcommand{\psetnumber}{5} % ENTER THE NUMBER OF THIS PSET HERE

%----------------------------------------------------------------------------------------
%	HEADER AND FOOTER
%----------------------------------------------------------------------------------------
\ihead{Solutions to homework set \#\psetnumber} % Page header left
\ohead{page \thepage\ of \pageref{LastPage}} % Page header right
\ifoot{\myname} % left footer
\ofoot{\mymail} % right footer

%----------------------------------------------------------------------------------------
%	TITLE SECTION
%----------------------------------------------------------------------------------------
\title{	
\normalfont \normalsize 
\textsc{Drexel University, Department of Mathematics} \\ [25pt] % Your university, school and/or department name(s)
\horrule{0.5pt} \\[0.4cm] % Thin top horizontal rule
\huge Math 222: Enumerative Combinatorics, \\
Fall 2022:
Homework \psetnumber\\% The assignment title
\horrule{2pt} \\[0.5cm] % Thick bottom horizontal rule
}
\author{\myname}

\begin{document}

\maketitle % This command causes the title part to be printed.

\begin{center} % Delete this if you want to save space!
{\vspace{-1.5pc} \large due date: \textbf{Monday, 2022-12-05} at 11:59 PM on gradescope.

\vspace{0.5pc}Please solve \textbf{3 of the 6 exercises}!}
\end{center}

%----------------------------------------------------------------------------------------
%	EXERCISE 1
%----------------------------------------------------------------------------------------
\horrule{0.3pt} \\[0.4cm]

\section{Exercise 1}

\subsection{Problem}

Let $n \in \ZZ$ and $k \in \NN$. Prove that
\[
p_0\tup{n} + p_1\tup{n} + \cdots + p_k\tup{n}
= p_k\tup{n+k} .
\]
(Recall that $p_i\tup{m}$ denotes the \# of partitions of
$m$ into $i$ parts.)

\subsection{Solution}

[...] % Enter your solution here!

%----------------------------------------------------------------------------------------
%	EXERCISE 2
%----------------------------------------------------------------------------------------
\horrule{0.3pt} \\[0.4cm]

\section{Exercise 2}

\subsection{Problem}

Let $n$ and $k$ be two positive integers such that $k > 1$.

Let $u$ be the \# of compositions $\alpha$ of $n$ such that
each entry of $\alpha$ is congruent\footnote{We say that
an integer $a$ is \emph{congruent} to an integer $b$
\emph{modulo} an integer $k$ if the difference $a-b$ is a
multiple of $k$. For instance, the even integers are
congruent to $0$ modulo $2$, whereas the odd integers are
congruent to $1$ modulo $2$.} to $1$ modulo $k$.

Let $w$ be the \# of compositions $\gamma$ of $n-1$ such
that each entry of $\gamma$ is either $1$ or $k$.

Prove that $u = w$.

\subsection{Remark}

For instance, if $n = 5$ and $k = 3$, then
$u$ counts the compositions
\[
\tup{4, 1}, \qquad \tup{1, 4}, \qquad \tup{1, 1, 1, 1, 1},
\]
while $w$ counts the compositions
\[
\tup{3, 1}, \qquad \tup{1, 3}, \qquad \tup{1, 1, 1, 1} .
\]

If $k = 2$, then both $u$ and $w$ equal the Fibonacci
number $f_n$. (Indeed, $w = f_n$ follows from
\cite[Exercise 2.10.5 \textbf{(a)}]{notes}.)

\subsection{Solution}

[...] % Enter your solution here!

%----------------------------------------------------------------------------------------
%	EXERCISE 3
%----------------------------------------------------------------------------------------
\horrule{0.3pt} \\[0.4cm]

\section{Exercise 3}

\subsection{Problem}

Let $n \in \NN$ and $k \in \NN$.
Prove that
\[
\sum_{\substack{\tup{a_1, a_2, \ldots, a_k} \text{ is a
composition}\\ \text{of } n \text{ into } k \text{ parts}}}
\dfrac{1}{a_1 a_2 \cdots a_k}
= \dfrac{k!}{n!} \stirfirst{n}{k} .
\]
(Recall that $\stirfirst{n}{k}$ denotes the \# of
permutations $\sigma \in S_n$ with exactly $k$ orbits;
it is a Stirling number of the first kind.)

\subsection{Hint}

Define an \emph{orbit-numbered permutation} to be a
permutation $\sigma \in S_n$ whose orbits are numbered by
$1, 2, \ldots, j$ in some order (where $j$ is its \# of
orbits).
How many orbit-numbered permutations have $k$ orbits?

(This is not the only approach; there are also
non-combinatorial solutions.)

\subsection{Solution}

[...] % Enter your solution here!

%----------------------------------------------------------------------------------------
%	EXERCISE 4
%----------------------------------------------------------------------------------------
\horrule{0.3pt} \\[0.4cm]

\section{Exercise 4}

\subsection{Problem}

Let $X$ be a finite set.
Let $A$ and $B$ be two subsets of $X$ such that
$A \cup B = X$ and $A \cap B = \varnothing$.
Let $\sigma$ be a permutation of $X$.
Prove that
\[
\abs{\sigma\tup{A} \cap B}
= \abs{\sigma\tup{B} \cap A} .
\]
(Here, if $C$ is any subset of $X$, then
$\sigma\tup{C}$ denotes the set
$\set{\sigma\tup{c} \mid c \in C}$.)

\subsection{Solution}

[...] % Enter your solution here!

%----------------------------------------------------------------------------------------
%	EXERCISE 5
%----------------------------------------------------------------------------------------
\horrule{0.3pt} \\[0.4cm]

\section{Exercise 5}

\subsection{Problem}

Let $n \in \NN$.
Let $X$ be an $n$-element set, and let $i$ and $j$ be two
distinct elements of $X$.
Prove that there are exactly $n!/2$ permutations
$\sigma \in S_X$ that satisfy $i \overset{\sigma}{\sim} j$.

(Recall that $i \overset{\sigma}{\sim} j$ means that
$i = \sigma^k\tup{j}$ for some $k \in \NN$.)

\subsection{Solution}

[...] % Enter your solution here!

%----------------------------------------------------------------------------------------
%	EXERCISE 6
%----------------------------------------------------------------------------------------
\horrule{0.3pt} \\[0.4cm]

\section{Exercise 6}

\subsection{Problem}

Let $n \in \NN$.
Let $X$ be an $n$-element set.
Let $d$ be the lowest common multiple of the first $n$
positive integers $1, 2, \ldots, n$
(that is, the smallest positive integer that is divisible
by each of $1, 2, \ldots, n$).

Let $k \in \NN$.
Prove that the following two statements are equivalent:
\begin{enumerate}
\item We have $\sigma^k = \id$ for each permutation
$\sigma \in S_X$.
\item The number $k$ is a multiple of $d$.
\end{enumerate}

\subsection{Remark}

For example, if $n = 5$, then
$d = \lcm\tup{1, 2, 3, 4, 5} = 60$. Thus, the exercise
claims that every permutation $\sigma$ of a $5$-element
set satisfies $\sigma^{60} = \id$, and more generally,
$\sigma^k = \id$ whenever $k$ is a multiple of $60$;
and conversely, if $k$ is not a multiple of $60$, then
some permutation $\sigma$ does not satisfy
$\sigma^k = \id$.

\subsection{Solution}

[...] % Enter your solution here!

\horrule{0.3pt} \\[0.4cm]

\begin{thebibliography}{99999999}                                                                                         %

% This is the bibliography: The list of papers/books/articles/blogs/...
% cited. The syntax is: "\bibitem[name]{tag}Reference",
% where "name" is the name that will appear in the compiled
% bibliography, and "tag" is the tag by which you will refer to
% the source in the TeX file. For example, the following source
% has name "Math222" (so you will see it referenced as
% "[Math222]" in the compiled PDF) and tag "notes" (so you
% can cite it by writing "\cite{notes}").

\bibitem[17f-hw7s]{17f-hw7s}
Darij Grinberg,
\textit{UMN Fall 2017 Math 4990
homework set \#7 with solutions},
\url{http://www.cip.ifi.lmu.de/~grinberg/t/17f/hw7os.pdf}

\bibitem[Math222]{notes}
Darij Grinberg,
\textit{Enumerative Combinatorics: class notes},
13 September 2022. \\
\url{http://www.cip.ifi.lmu.de/~grinberg/t/19fco/n/n.pdf} 
Also available on the mirror server
\url{http://darijgrinberg.gitlab.io/t/19fco/n/n.pdf}

\end{thebibliography}

\end{document}

% OUTTAKES:

\subsection{Problem}

If $f : A \to B$ is a map between two finite sets $A$ and $B$,
then the \emph{miss number} of $f$ is defined to be
$m\tup{f} := \abs{B} - \abs{f\tup{A}}$.
Here, $f\tup{A}$ denotes the range of $f$, that is, the set
of all values of $f$.

Let $A$, $B$ and $C$ be three finite sets, and let
$f : B \to C$ and $g : A \to B$ be two maps. Prove that
\[
m\tup{f \circ g} \leq m\tup{f} + m\tup{g} .
\]

\subsection{Remark}

This is a (quantitative) generalization of the fact that
a composition of two surjective maps is surjective.
Indeed, a map $f : A \to B$ between two finite sets $A$ and
$B$ is surjective if and only if $m\tup{f} = 0$.

\subsection{Hint}

If $h : X \to Y$ is any map between two sets, and if $S$
is a finite subset of $X$, then
$\abs{h\tup{S}} \leq \abs{S}$ (because applying $h$ to a
bunch of elements can only decrease the \# of distinct
elements, not increase it).
