\include{preamble}
\setcounter{try}{40}




\pagestyle{empty}
\begin{document}
\thispagestyle{empty}
\centerline{\bf Math 365 -- Monday 4/1/19}
\centerline{8.5 (inclusion/exclusion) and 9.1 \& 9.5 (equivalence relations)}

\begin{try}Use inclusion/exclusion to answer the following questions.
\begin{enumerate}[(a)]
\item How many elements are in $A_1 \cup A_2$ if there are 12 elements in $A_1$, 18 elements in $A_2$, and
\begin{enumerate}[(i)]
\item $|A_1 \cap A_2| = 6$?
\item $A_1 \cap A_2 = \emptyset$?
\item $A_1 \subseteq A_2$?
\end{enumerate}

\medskip

\item A survey of households in the United States reveals that 96\% have at least one television set, 42\% have a land-line telephone service, and 39\% have land-line telephone service and at least one television set. What percentage of households in the United States have neither telephone service nor a television set?\\
{\small [Start by naming your sets, as in ``Let $A$ be the set of households that have at least one TV set," and so on.]}


\medskip

\item How many students are enrolled in a course either in 

\centerline{(1) \emph{calculus 1}, \qquad (2) \emph{discrete math},}
\centerline{(3) \emph{data structures}, \quad  or  \quad (4) \emph{intro to computer science}} 

\noindent at a school if there are 507, 292, 312, and 344 students in these courses, respectively; 14 in both calculus and data structures; 213 in both calculus and intro to CS; 211 in both discrete mathematics and data structures; 43 in both discrete mathematics and intro to CS; and no student may take calculus and discrete mathematics at the same time, nor intro to CS and data structures at the same time?\\
{\small [Again, start by naming your sets, as in ``Let $A$ be the set of students enrolled in calculus 1," and so on.]}


\medskip

\item Find the number of  integers $1 \le n \le 100$ that are odd and/or the square of an integer.

\medskip

\item Find the number of integers $1 \le n \le  500$ that are \emph{not} a multiple of $3$, $5$, or $7$. 
\end{enumerate}
\end{try}


\vfill

\begin{try} Recall that the \emph{Stirling numbers (of the second kind)} count arrangements of distinguishable objects into indistinguishable boxes, namely 
$$S(n,k) = \left|\left\{ \begin{matrix}\text{Ways to place $n$ distinguishable objects}\\
		\text{into $k$ indistinguishable boxes}\\
		\text{so that no box is left empty}
		\end{matrix}\right\}\right|.$$
We stated in section 6.5 that 
$$S(n,k) = \frac{1}{k!} \sum_{\ell=0}^{k-1} (-1)^\ell \binom{n}{\ell} (k - \ell)^n.$$
We can now check this using inclusion/exclusion! 
\medskip

But first, we count the number of surjective functions from $X = \{1, 2, \dots, n\}$ to $Y = \{1, \dots, k\}$ (where $k \le n$). To that end, let $U$ be the set of \emph{all} functions from $X$ to $Y$, and for $i = 1, \dots, k$, let 
$$A_i = \{ \text{functions } f: X \to Y ~|~  i \notin f(X)\}.$$

\pagebreak

\begin{enumerate}[(a)]
\item What is $|U|$, i.e.\ how many functions are there from $X$ to $Y$? \\
{[Don't put any restrictions on the functions here---this is a simple product rule question.]}



\item For $X = \{1,2,3\}$ and $Y = \{1,2, 3\}$, we have 
$$A_1 = \{ f_1, f_2, f_3, f_4, f_5, f_6, f_7, f_8\}$$
where
$$
f_1 \text{ sends } \begin{matrix}1 \mapsto 2,\\2 \mapsto 2,\\3 \mapsto 2;\end{matrix}
\qquad 
f_2 \text{ sends } \begin{matrix}1 \mapsto 3,\\2 \mapsto 2,\\3 \mapsto 2;\end{matrix}
\qquad 
f_3 \text{ sends } \begin{matrix}1 \mapsto 2,\\2 \mapsto 3,\\3 \mapsto 2;\end{matrix}
\qquad
f_4 \text{ sends } \begin{matrix}1 \mapsto 2,\\2 \mapsto 2,\\3 \mapsto 3;\end{matrix}
$$
\smallskip
$$
f_5 \text{ sends } \begin{matrix}1 \mapsto 3,\\2 \mapsto 3,\\3 \mapsto 2;\end{matrix}
\qquad
f_6 \text{ sends } \begin{matrix}1 \mapsto 3,\\2 \mapsto 2,\\3 \mapsto 3;\end{matrix}
\qquad
f_7 \text{ sends } \begin{matrix}1 \mapsto 2,\\2 \mapsto 3,\\3 \mapsto 3;\end{matrix}
\quad \text{and}\quad 
f_8 \text{ sends } \begin{matrix}1 \mapsto 3,\\2 \mapsto 3,\\3 \mapsto 3.\end{matrix}
$$

\begin{enumerate}[(i)]
\item What is $A_2$?\hfill
{[Describe the \emph{set}, not its size.]}
\item What is $A_1 \cap A_2$?
\item What is $A_1 \cap A_2 \cap A_3$? \\
	{[You should be able to do this without computing $A_3$.]}
\end{enumerate}

\item Explain why, for general $n$ and $k$, we have the following:
\begin{enumerate}[(i)]
\item $|A_1| = (k-1)^n$;
\item $|A_ 1 \cap A_2| = (k-2)^n$;
\item $|A_1 \cap A_2 \cap \cdots \cap A_{\ell}| = (k-\ell)^n$ (for any $\ell \leq k$);
\item $|A_1 \cap A_2 \cap \cdots \cap A_k| = 0$.
\end{enumerate}
\item Explain why for any subset $S \subseteq \{A_1, A_2, \dots, A_k\}$ of size $\ell$, we have 
$$\left| \bigcap_{A_i \in S} A_i \right| = |A_1 \cap \cdots \cap A_\ell|.$$
{[For example $|A_1 \cap A_3 \cap A_7| = |A_1 \cap A_2 \cap A_3|$.]}
\item Use inclusion/exclusion to give a formula for $|A_1 \cup A_2 \cup \cdots \cup A_k|$. 
\item Explain why the set of surjective functions $f: X \to Y$ is 
$$\overline{A_1 \cup A_2 \cup \cdots \cup A_k}, \quad \text{i.e.} \quad U - A_1 \cup A_2 \cup \cdots \cup A_k.$$
\item Use the last two parts, together with part (a), to give the number of surjective functions from $X$ to $Y$.\hfill
{[Your answer should line up Theorem 1 in Section 8.6.]}
\item Use division rule to explain why $S(n,k)$ is $\frac{1}{k!}$ times your answer to (g). Check that this agrees with the formula we gave above.
\end{enumerate}

\end{try}

\pagebreak

\begin{try}(Relations) \label{try:relations}
\begin{enumerate}[(a)]
\item 
Which of these relations on $\{0, 1, 2, 3\}$ are equivalence relations? For those that are not, what  properties do they lack?
\begin{enumerate}[(i)]
\item $\{ 0 \sim 0 , 1 \sim 1 , 2 \sim 2 , 3 \sim 3\}$ 
\item $\{ 0 \sim 0 , 0 \sim 2 , 2 \sim 0 , 2 \sim 2 , 2 \sim 3 , 3 \sim 2 , 3 \sim 3\}$
\item $\{ 0 \sim 0 , 1 \sim 1 , 1 \sim 2 , 2 \sim 1 , 2 \sim 2 , 3 \sim 3\}$
\item $\{ 0 \sim 0 , 1 \sim 1 , 1 \sim 3 , 2 \sim 2 , 2 \sim 3 , 3 \sim 1 , 3 \sim 2 , 3 \sim 3\}$
\item $\{ 0 \sim 0 , 0 \sim 1 , 0 \sim 2 , 1 \sim 0 , 1 \sim 1 , 1 \sim 2 , 2 \sim 0 , 2 \sim 2 , 3 \sim 3\}$
\end{enumerate}

\medskip

 \item For each of the equivalence relations in part (a), list the equivalence classes. 
 
 \medskip
 
\item Which of these relations on the set of all people are equivalence relations? For those that are not, what  properties do they lack?\begin{enumerate}[(i)]
\item $a \sim b$ if $a$ and $b$ are the same age;
\item $a \sim b$ if $a$ and $b$ have the same parents;
\item $a \sim b$ if $a$ and $b$ share a common parent;
\item $a \sim b$ if $a$ and $b$ have met;
\item $a \sim b$ if $a$ and $b$ speak a common language.
\end{enumerate}

\medskip

\item For the following relations on $A$ determine whether they are reflexive, symmetric, and/or transitive. State whether they are equivalence relations or not, and if they are describe their equivalence classes.
\begin{enumerate}
\item Let $A=\ZZ$ and define $\sim$ by $a\sim b$ whenever  $a- b$ is odd.
\item Let $A=\RR$ and define $\sim$ by $a\sim b$ whenever $ab \neq 0$.
\item Let $A = \{f: \ZZ \to \ZZ\}$ and define $\sim$ by $f \sim g$  whenever  $f(1) = g(1)$. 
\end{enumerate}



\medskip


\item Verify that the relation
$$f(x) \sim g(x) \qquad \text{ if } \qquad \frac{d}{dx}f(x) = \frac{d}{dx}g(x)$$
is an equivalence relation on the set 
$$D = \{ \text{differentiable functions  $\varphi: \RR \to \RR$}\},$$
 and describe the set of functions that are equivalent to $f(x) = x^2$. 
\end{enumerate}
\end{try}

\end{document}

