\include{preamble}
\setcounter{try}{25}
\setlength{\parindent}{0pt}
\pagestyle{empty}
\begin{document}
\thispagestyle{empty}
\centerline{\bf Math 365 -- Monday 3/11/19}
\vfill
(We're replacing the old \#26.)
\begin{try}~
\begin{enumerate}[(a)]
\item Consider strings of length 10 consisting of 1's, 2's, and/or 3's.
\begin{enumerate}[(i)]
\item How many of these are there (with no additional restrictions)?
\item How many of these are there that contain exactly three 1's, two 2's, and five 3's?
\end{enumerate}
\item How many anagrams are there of MISSISSIPPI?
\item Suppose you've got eight varieties of doughnuts to choose from at a doughnuts shop.
\begin{enumerate}[(i)]
\item How many ways can you select 6 doughnuts?
\item How many ways can you select a dozen (12) doughnuts?
\item How many ways can you select a dozen doughnuts with at least one of each kind?\\
{[Hint: if there's at least one of each kind, then how many choices are you really making?]}
\end{enumerate}
\item How many different combinations of pennies, nickels, dimes, quarters, and half dollars can a jar contain if it has 20 coins in it?
\item Counting solutions.
\begin{enumerate}[(i)]
\item How many solutions are there to the equation
$x_1 + x_2 + x_3 = 10,$
where $x_1, x_2$, and $x_3$ are nonnegative integers?
\item How many solutions are there to the equation
$x_1 + x_2 + x_3 = 10,$
where $x_1, x_2$, and $x_3$ are strictly positive integers?\\
{[Hint: See problem (c)(iii)]}
\item How many solutions are there to the equation
$x_1 + x_2 + x_3 \leq 10,$
where $x_1, x_2$, and $x_3$ are nonnegative integers?\quad
{[}Hint: Use an extra variable $x_4$ such that $x_1 + x_2 + x_3 + x_4 = 10${]}
\end{enumerate}
\end{enumerate}
\end{try}
\vfill
\begin{try}
~
\begin{enumerate}[(a)]
\item List the partitions of 6, both as box diagrams and as sequences.
\item How many ways are there to distribute 6 identical cookies into 6 identical lunch boxes, possibly leaving some empty?
\item How many ways are there to distribute 6 identical snack bars into 4 identical lunch boxes, possibly leaving some empty?
\item How many ways are there to distribute 4 identical apples into 6 identical lunch boxes, possibly leaving some empty?
\end{enumerate}
\end{try}
\medskip
\begin{try}~
\begin{enumerate}[(a)]
\item Basic counting:
\begin{enumerate}[(a)]
\item[(i)] How many ways are there to distribute 5 distinguishable objects into 3 distinguishable boxes, possibly leaving some empty?
\medskip
\item[(ii)] How many ways are there to distribute 5 indistinguishable objects into 3 distinguishable boxes, possibly leaving some empty?
\medskip
\item[(iii)] How many ways are there to distribute 5 distinguishable objects into 3 indistinguishable boxes, possibly leaving some empty?
\medskip
\item[(iv)] How many ways are there to distribute 5 indistinguishable objects into 3 indistinguishable boxes, possibly leaving some empty?
\medskip
\item[(v)] How many ways are there to distribute 6 distinguishable objects into 4 indistinguishable boxes, possibly leaving some empty?
\medskip
\item[(vi)] How many ways are there to distribute 6 distinguishable objects into 4 indistinguishable boxes so that each of the boxes contains at least one object?
\end{enumerate}
\item How many ways are there to pack 8 identical DVDs into 5 indistinguishable boxes? How many ways to do this task so that each box contains
at least one DVD?
\item How many ways are there to distribute 5 balls into 7 boxes if
\begin{enumerate}[(i)]
\item both the balls and boxes are labeled?
\medskip
\item the balls are labeled, but the boxes are unlabeled?
\medskip
\item the balls are unlabeled, but the boxes are labeled?
\medskip
\item both the balls and boxes are unlabeled?
\end{enumerate}
\item Repeat parts (i)--(iv) of part (c), adding the condition that each bucket can have at \emph{most} one ball in it.
\end{enumerate}
\end{try}
\vfill
\pagebreak
\textbf{\Large Summary of counting techniques:}
\medskip
\hrule
\medskip
\textbf{\large Placing objects in order (``permutation")}
\medskip
\textbf{With replacement:} The number of ways to pick $n$ objects, in order, with possible repetition, from a set of $k$ objects is \fbox{$k^n$}.
\medskip
\textbf{With some indistinguishable objects (anagrams):} The number of ways to place $n$ objects consisting of exactly
$$n_1 ~ \text{`$O_1$'s}, \quad n_2 ~ \text{`$O_2$'s}, \quad \dots, \quad \text{ and } n_k ~ \text{`$O_k$'s}$$
(so that $n = n_1 + \cdots + n_k$), in order is \\
\centerline{\fbox{$\displaystyle\binom{n}{n_1} \binom{n-n_1}{n_2} \cdots \binom{n_r}{n_r} = \frac{n!}{n_1!n_2!n_3!\cdots n_k!}$.}}
\medskip
\hrule
\medskip
\textbf{\large Placing objects into boxes \\ (``combination'': no order inside the boxes)}
\medskip
\textbf{Distinguishable objects, distinguishable boxes:} Distributing $n$ distinguishable objects into $k$ distinguishable boxes is the same as the permutation problems above. If there are no restrictions, then \fbox{$k^n$}. If you restrict to placing exactly $n_i$ objects into box $i$, for $i = 1, 2, \dots, k$ (so that $n = n_1 + \cdots + n_r$), is \\
\centerline{\fbox{$\displaystyle\binom{n}{n_1}\binom{n-n_1}{n_2} \cdots \binom{n_k}{n_k} = \frac{n!}{n_1! n_2! \cdots n_k!}.$}}
\medskip
\textbf{Indistinguishable objects, distinguishable boxes:} (\emph{Stars and bars}) The number of ways to distribute $n$ indistinguishable objects into $k$ distinguishable boxes is \\
\centerline{\fbox{$\displaystyle\binom{n+k-1}{n} = \binom{n+k-1}{k-1} = \frac{(n+k-1)!}{n! (k-1)!}.$}}
\medskip
\textbf{Indistinguishable objects, indistinguishable boxes:} (\emph{Integer partitions}) The number of ways to distribute $n$ indistinguishable objects into $k$ indistinguishable boxes is the same of the number of integer partitions of $n$ into at most $k$ parts, \fbox{$p_k(n)$} (there is no closed formula; you just have to count them).
\medskip
\textbf{Distinguishable objects, indistinguishable boxes:} \ The number of ways to distribute $n$ distinguishable objects into $k$ indistinguishable boxes is given by \\
\centerline{\fbox{$\displaystyle\sum_{j=1}^k S(n,j), \quad \text{ where } \quad S(n,j) = \frac{1}{j!} \sum_{i=0}^{j-1} (-1)^i \binom{j}{i} (j-i)^n.$}}
We call the numbers given by $S(n,j)$ the \emph{Serling numbers of the second kind}.
\medskip
\hrule
\medskip
{\bf A note on conditions like ``where there's at least one of each kind'', or ``where there's at least one object in each box'', or solving linear equations using \emph{strictly positive} values:} these conditions effectively just decrease the number of choices you're making.
\medskip
{\bf Example:} Choose 10 pieces of fruit from a bowl with indistinguishable apples, oranges, and bananas, making sure to choose at least one of each kind.\\
{\bf Answer:} Effectively, you've already picked out three pieces of fruit: one apple, one orange, and one pear. So you only need to count how many ways you can make the remaining $10-3$ choices, for which you will use stars and bars, with $n = 10 - 3 = 7$ and $k=3$ (the number of kinds of fruit).
\end{document}