Skip to main content
Logo image

Appendix B Selected Solutions

0 Introduction and Preliminaries

0 Introduction and Preliminaries
0.2 Mathematical Statements

Exercises

0.2.3.

Solution.
  1. \(P \wedge Q\text{.}\)
  2. \(P \imp \neg Q\text{.}\)
  3. Jack passed math or Jill passed math (or both).
  4. If Jack and Jill did not both pass math, then Jill did.
    1. Nothing else.
    2. Jack did not pass math either.

0.2.5.

Solution.
The main thing to realize is that we do not know the colors of these two shapes, but we do know that we are in one of three cases: We could have a yellow square and purple circle. We could have a square that was not yellow but a purple circle. Or we could have a square that was not yellow and a circle that was not purple. The case in which the square is yellow but the circle is not purple cannot occur, as that would make the statement false.

0.2.6.

Solution.
The only way for an implication \(P\rightarrow Q\) to be true but its converse to be false is for \(Q\) to be true and \(P\) to be false. Thus we know that circle is blue and that diamond is not purple.

0.2.7.

Solution.
The converse is "If I will give you magic beans, then you will give me a cow." The contrapositive is "If I will not give you magic beans, then you will not give me a cow." All the other statements are neither the converse nor contrapositive.

0.2.10.

Solution.
  1. If you have lost weight, then you exercised.
  2. If you exercise, then you will lose weight.
  3. If you are American, then you are patriotic.
  4. If you are patriotic, then you are American.
  5. If a number is rational, then it is real.
  6. If a number is not even, then it is prime. (Or the contrapositive: if a number is not prime, then it is even.)
  7. If the Broncos don’t win the Super Bowl, then they didn’t play in the Super Bowl. Alternatively, if the Broncos play in the Super Bowl, then they will win the Super Bowl.

0.2.12.

Solution.
\(P(15)\) is the statement “\(17\cdot 15 + 1\) is even”, which is true. Thus the statement \(\exists x P(x)\) is true (for example, 15 is such an \(x\)). However, we cannot tell anything about \(\forall x P(x)\) since we do not know the truth value of \(P(x)\) for all elements of the domain of discourse. In this case, \(\forall x P(x)\) happens to be false (since \(P(4)\) is false, for example).

0.2.13.

Solution.
\(P(15)\) is the statement “\(18\cdot 15 + 1\) is even”, which is false. Thus the statement \(\forall x P(x)\) is false (for example, 15 is a counterexample). However, we cannot tell anything about \(\exists x P(x)\) since we do not know the truth value of \(P(x)\) for other elements of the domain of discourse. In this case, \(\exists x P(x)\) happens to be true (since \(P(1)\) is true, for example).

0.2.14.

Solution.
  1. The claim that \(\forall x P(x)\) means that \(P(n)\) is true no matter what \(n\) you consider in the domain of discourse. Thus the only way to prove that \(\forall x P(x)\) is true is to check or otherwise argue that \(P(n)\) is true for all \(n\) in the domain.
  2. To prove \(\forall x P(x)\) is false all you need is one example of an element in the domain for which \(P(n)\) is false. This is often called a counterexample.
  3. We are simply claiming that there is some element \(n\) in the domain of discourse for which \(P(n)\) is true. If you can find one such element, you have verified the claim.
  4. Here we are claiming that no element we find will make \(P(n)\) true. The only way to be sure of this is to verify that every element of the domain makes \(P(n)\) false. Note that the level of proof needed for this statement is the same as to prove that \(\forall x P(x)\) is true.

0.2.16.

Solution.
  1. \(\neg \exists x (E(x) \wedge O(x))\text{.}\)
  2. \(\forall x (E(x) \imp O(x+1))\text{.}\)
  3. \(\exists x(P(x) \wedge E(x))\) (where \(P(x)\) means “\(x\) is prime”).
  4. \(\forall x \forall y \exists z(x \lt z \lt y \vee y \lt z \lt x)\text{.}\)
  5. \(\forall x \neg \exists y (x \lt y \lt x+1)\text{.}\)

0.2.17.

Solution.
  1. Any even number plus 2 is an even number.
  2. For any \(x\) there is a \(y\) such that \(\sin(x) = y\text{.}\) In other words, every number \(x\) is in the domain of sine.
  3. For every \(y\) there is an \(x\) such that \(\sin(x) = y\text{.}\) In other words, every number \(y\) is in the range of sine (which is false).
  4. For any numbers, if the cubes of two numbers are equal, then the numbers are equal.

0.3 Sets

Exercises

0.3.1.

Solution.
  1. \(A \cup B = {\left\{3,5,6,7,8,9,12\right\}}\text{.}\) It includes everything that is in \(A\) or \(B\) or both.
  2. \(A \cap B = {\left\{3,6,7\right\}}\text{.}\) It contains everything that is in both \(A\) and \(B\text{.}\)
  3. \(A \setminus B = {\left\{5,8\right\}}\text{.}\) It contains everything that is in \(A\) except anything that is also in \(B\text{.}\) We could also have written this set as \(A \cap \bar{B}\text{.}\)
  4. \(B \setminus A = {\left\{9,12\right\}}\text{.}\) It contains everything in \(B\) except anything that is also in \(A\text{.}\) Another way to write this is \(B \cap \bar{A}\text{.}\) Note that \(A \setminus B \ne B \setminus A\text{.}\)

0.3.2.

Solution.
  1. This is the set \(\{3, 4, 5 \ldots \}\) since we need each element to be a natural number whose square is at least 4 more than 5. Since \(3^2 - 4 = 5\) but \(2^2 - 4 = 0\) we see that the first such natural number is 3.
  2. We get the same set as we did in the previous part, and the smallest non-negative number for which \(n^2 - 9\) is a natural number is 3.
    Note that if we didn’t specify \(n \ge 0\) by saying that \(n \in \mathbb N\) then any integer less than \(-3\) would also be in the set, so there would not be a least element.
  3. This is the set \(\{1, 2, 5, 10, \ldots\}\text{,}\) namely the set of numbers that are the result of squaring and adding 1 to a natural number. (\(0^2 + 1 = 1\text{,}\) \(1^2 + 1 = 2\text{,}\) \(2^2 + 1 = 5\) and so on.) Thus the least element of the set is 1.
  4. Now we are looking for natural numbers that are equal to taking some natural number, squaring it and adding 1. That is, \(\{1, 2, 5, 10, \ldots\}\text{,}\) the same set as the previous part. So again, the least element is 1.

0.3.3.

Solution.
  1. \(31 = 35 - 5 + 1\text{.}\) We need to add one in order to count 5 itself.
  2. \(100 = 97 + 2 + 1\text{.}\)
  3. There are 12 primes not greater than 37: \({\left\{2,3,5,7,11,13,17,19,23,29,31,37\right\}}\text{.}\)

0.3.4.

Solution.
The set of largest size that is a subset of both \(A \text{ and } B\) is the intersection of \(A \text{ and } B \text{,}\) \(A \cap B = {\left\{9\right\}}\text{.}\)

0.3.6.

Solution.
For \(C \subseteq A\) and \(C \subseteq B\text{,}\) we must have that \(C \subseteq A \cap B\text{.}\) This means that the largest \(C\) could be would be to equal \(\newcommand{\N}{\mathbb N}\newcommand{\st}{:}A \cap B = \{n \in \N \st 22 \le n \le 25\}\text{,}\) which contains 4 elements.

0.3.7.

Solution.
There will be exactly 4 such sets: \({\left\{3,9,13\right\}}\text{,}\)\({\left\{2,3,9,13\right\}}\text{,}\) \({\left\{3,9,13,15\right\}}\text{,}\) and \({\left\{2,3,9,13,15\right\}}\text{.}\)

0.3.8.

Solution.
  1. \(\displaystyle A \cap B = {\left\{5,6,7\right\}}\text{.}\)
  2. \(\displaystyle A \cup B = {\left\{3,4,5,6,7,8,9\right\}}\text{.}\)
  3. \(\displaystyle A \setminus B ={\left\{3,4\right\}}\text{.}\)
  4. \(\displaystyle A \cap \overline{(B \cup C)} = {\left\{3\right\}}\text{.}\)

0.3.9.

Solution.
  1. \(A \cap B\) will be the set of natural numbers that are both at least 3 and less than 16, and even. That is, \(\renewcommand{\d}{\displaystyle}\newcommand{\N}{\mathbb N}\newcommand{\st}{:}\renewcommand{\v}{\vtx{above}{}}A \cap B = \{x \in \N \st 3 \le x \lt 16 \wedge x \text{ is even}\} = {\left\{4,6,8,10,12,14\right\}}\text{.}\)
  2. \(A \setminus B\) is the set of all elements that are in \(A\) but not \(B\text{.}\) So this is \(\renewcommand{\d}{\displaystyle}\newcommand{\N}{\mathbb N}\newcommand{\st}{:}\renewcommand{\v}{\vtx{above}{}}\{x \in \N \st 3 \le x \lt 16 \wedge x \text{ is odd}\} = {\left\{3,5,7,9,11,13,15\right\}}\text{.}\)
    Note this is the same set as \(A \cap \overline{B}\text{.}\)

0.3.11.

Solution.
For example, \(A = \{2,3,5,7,8\}\) and \(B = \{3,5\}\) .

0.3.12.

Solution.
For example, \(A = \{1,2,3\}\) and \(B = \{1,2,3,4,5,\{1,2,3\}\}\)

0.3.13.

Solution.
  1. No.
  2. No.
  3. \(2\Z \cap 3\Z\) is the set of all integers which are multiples of both 2 and 3 (so multiples of 6). Therefore \(2\Z \cap 3\Z = \{x \in \Z \st \exists y\in \Z(x = 6y)\}\text{.}\)
  4. \(2\Z \cup 3\Z\text{.}\)

0.3.15.

Solution.
  1. \(A \cup \bar B\text{:}\)
  2. \(\bar{(A \cup B)}\text{:}\)
  3. \(A \cap (B \cup C)\text{:}\)
  4. \((A \cap B) \cup C\text{:}\)
  5. \(\bar A \cap B \cap \bar C\text{:}\)
  6. \((A \cup B) \setminus C\text{:}\)

0.3.17.

Solution.
\begin{align*} \pow(A) = \{\amp \emptyset, \{a\}, \{b\}, \{c\}, \{d\}, \{a,b\}, \{a,c\}, \{a,d\}, \{b,c\}, \{b,d\},\\ \amp \{c,d\} \{a,b,c\}, \{a,b,d\}, \{a,c,d\}, \{b,c,d\}, \{a,b,c,d\}\}\text{.} \end{align*}

0.3.18.

Solution.
Each of the 11 elements can be in a singleton set, so there are 11 of these.
To count the number of doubletons, not that there are 10 sets that include 1, and then 9 sets that include 2 and not 1, and then 8 that include 3 and not 1 or 2, and so on. So you can find 55 by summing the numbers from 1 to 10.

0.3.20.

Solution.
For example, \(A = \{1,2,3,4\}\) and \(B = \{5,6,7,8,9\}\) gives \(A \cup B = \{1,2,3,4,5,6,7,8,9\}\text{.}\)

0.3.28.

Solution.
We need to be a little careful here. If \(B\) contains 3 elements, then \(A\) contains just the number 3 (listed twice). So that would make \(|A| = 1\text{,}\) which would make \(B = \{1, 3\}\text{,}\) which only has 2 elements. Thus \(|B| \ne 3\text{.}\) This means that \(|A| = 2\text{,}\) so \(B\) contains at least the elements 1 and 2. Since \(\card{B} \ne 3\text{,}\) we must have \(\card{B} = 2\text{,}\) which agrees with the definition of \(B\text{.}\)
Therefore it must be that \(A = \{2,3\}\) and \(B = \{1, 2\}\)

0.4 Functions

Exercises

0.4.1.

Solution.
  1. \(f(2) = 5\text{,}\) since 5 is the number below 2 in the two-line notation.
  2. Such an \(n\) is \(n= 4\text{,}\) since \(f(4) = 2\text{.}\) Note that 4 is above a 2 in the notation.
  3. \(n = 3\) has this property. We say that 3 is a fixed point of \(f\text{.}\) Not all functions have such a point.
  4. Such an element is 4 (in fact, that is the only element in the codomain that is not in the range). In other words, 4 is not the image of any element under \(f\text{;}\) nothing is sent to 4.

0.4.5.

Solution.
There are 16 different functions. None of the functions are injective. Exactly 14 of the functions are surjective (there are 2 that are not: send everything to \(a\) or everything to \(b\text{.}\) No functions are both (since no functions here are injective).

0.4.6.

Solution.
There are 16 functions: you have a choice of four outputs for \(f(1)\text{,}\) and for each, you have four choices for the output \(f(2)\text{.}\) Of these functions, 12 are injective, 0 are surjective, and 0 are both (i.e., bijective):
\(\displaystyle{\newcommand{\twoline}[2]{\begin{pmatrix}#1 \\ #2 \end{pmatrix}}\newcommand{\amp}{\amp } f = \twoline{1 \amp 2}{a\amp a} \quad f = \twoline{1 \amp 2}{b \amp b} \quad f = \twoline{1 \amp 2}{c \amp c} \quad f = \twoline{1 \amp 2}{d \amp d} }\)
\(\displaystyle{\newcommand{\twoline}[2]{\begin{pmatrix}#1 \\ #2 \end{pmatrix}}\newcommand{\amp}{\amp } f = \twoline{1 \amp 2}{a\amp b} \quad f = \twoline{1 \amp 2}{a \amp c} \quad f = \twoline{1 \amp 2}{a \amp d} \quad f = \twoline{1 \amp 2}{b \amp c} }\)
\(\displaystyle{\newcommand{\twoline}[2]{\begin{pmatrix}#1 \\ #2 \end{pmatrix}}\newcommand{\amp}{\amp } f = \twoline{1 \amp 2}{b \amp a} \quad f = \twoline{1 \amp 2}{c \amp a} \quad f = \twoline{1 \amp 2}{d \amp a} \quad f = \twoline{1 \amp 2}{c \amp b} }\)
\(\displaystyle{\newcommand{\twoline}[2]{\begin{pmatrix}#1 \\ #2 \end{pmatrix}}\newcommand{\amp}{\amp } f = \twoline{1 \amp 2}{b \amp d} \quad f = \twoline{1 \amp 2}{d \amp b} \quad f = \twoline{1 \amp 2}{c \amp d} \quad f = \twoline{1 \amp 2}{d \amp c} }\)

0.4.7.

Solution.
  1. \(f\) is not injective, since \(f(2) = f(5)\text{;}\) two different inputs have the same output.
  2. \(f\) is surjective, since every element of the codomain is an element of the range.
  3. \(f=\begin{pmatrix}1 \amp 2 \amp 3 \amp 4 \amp 5 \\ 3 \amp 2 \amp 4 \amp 1 \amp 2\end{pmatrix}\text{.}\)

0.4.9.

Solution.
\(f(14) = 4782969\text{.}\) To find \(f(14)\text{,}\) we need to know \(f(13)\text{,}\) for which we need \(f(12)\text{,}\) and so on. So build up from \(f(0) = 1\text{.}\) Then \(f(1) = 3\text{,}\) \(f(2) = 3\cdot3\text{,}\) \(f(3) = 3\cdot3\cdot3\text{,}\) .... In fact, it looks like a closed formula for \(f\) is \(f(n) = 3^n\text{.}\) Later we will see how to prove this is correct.

0.4.10.

Solution.
For each case, you must use the recurrence to find \(f(1)\text{,}\) \(f(2)\) ... \(f(8)\text{.}\) But notice each time you just add 7 to the previous. We do this 8 times.
  1. \(\displaystyle f(8) = 57\text{.}\)
  2. \(\displaystyle f(8) = 58\text{.}\)
  3. \(\displaystyle f(8) = 69\text{.}\)
  4. \(\displaystyle f(8) = 251\text{.}\)

0.4.12.

Solution.
  1. \(f\) is injective, but not surjective (since 0, for example, is never an output).
  2. \(f\) is injective and surjective. Unlike in the previous question, every integers is an output (of the integer 4 less than it).
  3. \(f\) is injective, but not surjective (10 is not 8 less than a multiple of 5, for example).
  4. \(f\) is not injective, but is surjective. Every integer is an output (of twice itself, for example) but some integers are outputs of more than one input: \(f(5) = 3 = f(6)\text{.}\)

0.4.13.

Solution.
  1. \(f\) is not injective. To prove this, we must simply find two different elements of the domain which map to the same element of the codomain. Since \(f(\{1\}) = 1\) and \(f(\{2\}) = 1\text{,}\) we see that \(f\) is not injective.
  2. \(f\) is not surjective. The largest subset of \(A\) is \(A\) itself, and \(|A| = 10\text{.}\) So no natural number greater than 10 will ever be an output.
  3. \(f\inv(1) = \{\{1\}, \{2\}, \{3\}, \ldots \{10\}\}\) (the set of all the singleton subsets of \(A\) ).
  4. \(f\inv(0) = \{\emptyset\}\text{.}\) Note, it would be wrong to write \(f\inv(0) = \emptyset\) - that would claim that there is no input which has 0 as an output.
  5. \(f\inv(12) = \emptyset\text{,}\) since there are no subsets of \(A\) with cardinality 12.

0.4.16.

Solution.
  1. \(|f\inv(3)| \le 1\text{.}\) In other words, either \(f\inv(3)\) is the empty set or is a set containing exactly one element. Injective functions cannot have two elements from the domain both map to 3.
  2. \(|f\inv(3)| \ge 1\text{.}\) In other words, \(f\inv(3)\) is a set containing at least one elements, possibly more. Surjective functions must have something map to 3.
  3. \(|f\inv(3)| = 1\text{.}\) There is exactly one element from \(X\) which gets mapped to 3, so \(f\inv(3)\) is the set containing that one element.

0.4.17.

Solution.
\(X\) can really be any set, as long as \(f(x) = 0\) or \(f(x) = 1\) for every \(x \in X\text{.}\) For example, \(X = \N\) and \(f(n) = 0\) works.

0.4.21.

Solution.
  1. \(f\) is injective.
    Proof.
    Let \(x\) and \(y\) be elements of the domain \(\Z\text{.}\) Assume \(f(x) = f(y)\text{.}\) If \(x\) and \(y\) are both even, then \(f(x) = x+1\) and \(f(y) = y+1\text{.}\) Since \(f(x) = f(y)\text{,}\) we have \(x + 1 = y + 1\) which implies that \(x = y\text{.}\) Similarly, if \(x\) and \(y\) are both odd, then \(x - 3 = y-3\) so again \(x = y\text{.}\) The only other possibility is that \(x\) is even an \(y\) is odd (or visa-versa). But then \(x + 1\) would be odd and \(y - 3\) would be even, so it cannot be that \(f(x) = f(y)\text{.}\) Therefore if \(f(x) = f(y)\) we then have \(x = y\text{,}\) which proves that \(f\) is injective.
  2. \(f\) is surjective.
    Proof.
    Let \(y\) be an element of the codomain \(\Z\text{.}\) We will show there is an element \(n\) of the domain (\(\Z\)) such that \(f(n) = y\text{.}\) There are two cases: First, if \(y\) is even, then let \(n = y+3\text{.}\) Since \(y\) is even, \(n\) is odd, so \(f(n) = n-3 = y+3-3 = y\) as desired. Second, if \(y\) is odd, then let \(n = y-1\text{.}\) Since \(y\) is odd, \(n\) is even, so \(f(n) = n+1 = y-1+1 = y\) as needed. Therefore \(f\) is surjective.

0.4.22.

Solution.
Yes, this is a function, if you choose the domain and codomain correctly. The domain will be the set of students, and the codomain will be the set of possible grades. The function is almost certainly not injective, because it is likely that two students will get the same grade. The function might be surjective – it will be if there is at least one student who gets each grade.

0.4.24.

Solution.
This is not a function.

0.4.25.

Solution.
The recurrence relation is \(f(n+1) = f(n) + n\text{.}\)

0.4.26.

Solution.
In general, \(\card{A} \ge \card{f(A)}\text{,}\) since you cannot get more outputs than you have inputs (each input goes to exactly one output), but you could have fewer outputs if the function is not injective. If the function is injective, then \(\card{A} = \card{f(A)}\text{,}\) although you can have equality even if \(f\) is not injective (it must be injective restricted to \(A\)).

0.4.27.

Solution.
In general, there is no relationship between \(\card{B}\) and \(\card{f\inv(B)}\text{.}\) This is because \(B\) might contain elements that are not in the range of \(f\text{,}\) so we might even have \(f\inv(B) = \emptyset\text{.}\) On the other hand, there might be lots of elements from the domain that all get sent to a few elements in \(B\text{,}\) making \(f\inv(B)\) larger than \(B\text{.}\)
More specifically, if \(f\) is injective, then \(\card{B} \ge \card{f\inv(B)}\) (since every element in \(B\) must come from at most one element from the domain). If \(f\) is surjective, then \(\card{B} \le \card{f\inv(B)}\) (since every element in \(B\) must come from at least one element of the domain). Thus if \(f\) is bijective then \(\card{B} = \card{f\inv(B)}\text{.}\)

1 Counting

1 Counting
1.1 Additive and Multiplicative Principles

Exercises

1.1.1.

Solution.
There are \(6 \cdot 5 \cdot 19 = {570}\) outfits. Use the multiplicative principle.

1.1.2.

Solution.
  1. \(8 + 4 = {12}\) ties. Use the additive principle.
  2. \(8 \cdot 4 = {32}\) ties. Use the multiplicative principle
  3. \(6 \cdot (5+2) + 4 = 42\) outfits.

1.1.3.

Solution.
  1. For example, 16 is the number of choices you have if you want to watch one movie, either a comedy or horror flick.
  2. For example, 63 is the number of choices you have if you will watch two movies, first a comedy and then a horror.

1.1.4.

Solution.
  1. There are 1048576 6-digit hexadecimals in which the first digit is an E (one for each choice of the remaining digits). Similarly, there are 1048576 hexadecimals in which the first digit is an F. We want the union of these two disjoint sets, so there are \(1048576 + 1048576 = 2\cdot1048576=2097152\) 6-digits hexadecimals in which the first digit is either an E or an F.
  2. We can select the first digit in 6 ways, digits 2-4 in 16 ways each, and the final digit in 10 ways. Thus there are \(6\cdot 16^{3} \cdot 10 = 245760\) hexadecimals given these restrictions.
  3. The number of 3-digit hexadecimals that start with a letter is \(6 \cdot 16^2 = 1536\text{.}\) The number of 3-hexadecimals that end with a numeral is \(16^{2} \cdot 10 = 2560\text{.}\) We want all the elements from both these sets. However, both sets include those 3-digit hexadecimals which both start with a letter and end with a numeral( \(6\cdot16^{1}\cdot 10=960\)) so we must subtract these (once). Thus the number of 3-digit hexadecimals starting with a letter or ending with a numeral is:
    \(\displaystyle{ 1536 + 2560 - 960 = 3136 }\)

1.1.5.

Solution.
  1. To maximize the number of elements in common between \(A\) and \(B\text{,}\) make \(A \subset B\text{.}\) This would give \(\renewcommand{\bar}{\overline}\newcommand{\card}[1]{\left| #1 \right|}\card{A \cap B} = 8\text{.}\)
  2. \(A\) and \(B\) might have no elements in common, giving \(\renewcommand{\bar}{\overline}\newcommand{\card}[1]{\left| #1 \right|}\card{A\cap B} = 0\text{.}\)
  3. \(\renewcommand{\bar}{\overline}\newcommand{\card}[1]{\left| #1 \right|}18 \le \card{A \cup B} \le 26\text{.}\) In fact, when \(\renewcommand{\bar}{\overline}\newcommand{\card}[1]{\left| #1 \right|}\card{A \cap B} = 0\) then \(\renewcommand{\bar}{\overline}\newcommand{\card}[1]{\left| #1 \right|}\card{A \cup B} = 26\) and when \(\renewcommand{\bar}{\overline}\newcommand{\card}[1]{\left| #1 \right|}\card{A \cap B} = 8\) then \(\renewcommand{\bar}{\overline}\newcommand{\card}[1]{\left| #1 \right|}\card{A \cup B} = 18\text{.}\)

1.1.6.

Solution.
\(\renewcommand{\bar}{\overline}\newcommand{\card}[1]{\left| #1 \right|}\card{A \cup B} + \card{A \cap B} = {14}\text{.}\) Use PIE: We know \(\renewcommand{\bar}{\overline}\newcommand{\card}[1]{\left| #1 \right|}\card{A \cup B} = \card{A} + \card{B} - \card{A \cap B} = 4 + 10 - \card{A \cap B} \text{.}\)

1.1.7.

Solution.
50 students. Use Venn diagram or PIE: \(30 + 18 + 29 - (11 + 10+14) + 8= {50}\text{.}\)

1.1.8.

Solution.
Using the principle of inclusion/exclusion, the number of students who like their potatoes in at least one of the ways described is
\(\displaystyle{ 32 + 33 + 40 -(15 + 12 + 19) +10 = {69}. }\)
Therefore there are \(89 - {69} = {20}\) students who do not like potatoes. You can also do this problem with a Venn diagram.

1.1.9.

Solution.
342 values of \(n\text{.}\) Use PIE: \(80 + 213+ 128 - (26 + 16 + 42) + 5\) or a Venn diagram. To find out how many numbers are divisible by 3 and 5, for example, take \(640/(3\cdot5)\) and round down.

1.1.10.

Solution.
To find out how many numbers strictly less than 1250 are multiples of 6, we can divide 1250 by 6 and round down. There are 208 many of these. Similarly, there are 178 multiples of 7 and 249 multiples of 5 less than 1250.
We also need the combinations of these. To be a multiple of 6 and 7 means you are a multiple of 42 , and there are 29 multiples of 6 and 7. There will be 41 multiples of 6 and 5. There will be 35 multiples of 7 and 5. Finally, there will be 5 multiples of all three.
Using PIE, we get
\(\displaystyle{ 208 +178+ 249 - (29 + 41 + 35) + 5 = {535} }\)
multiples of 6, 7, or 5 less than 1250.

1.1.12.

Solution.
  1. \(11^{6} = {1.77156\times 10^{6}}\) words, since you select from 11 letters 6 times.
  2. (\(11)\cdot (10)\cdot (9) \dots (11-6+1) = {332640}\) words. After selecting a letter, you have fewer letters to select for the next one.
  3. \(11 ^ {3} ={1331}\) words: you need to select the letters that follow the “ade.”
  4. \(11^{3} + 11^{4} - 11^{1}={15961}\) words. There are \(11^{3}\) words which start with “ade” and another \(11^{4}\) words that end with “be.” Then we need to subtract the words that have both, which we have overcounted.
  5. \((11 \cdot (11-1) \cdot (11-2) \dots (11-6+1)) - (4\cdot (8)\cdot (8-1) \cdot (8-2) \dots 8-3+1)) = {331296}\) words. All possible words without repeats minus the bad ones. The taboo word “bed” can be in any of 4 positions, and for each position we must choose the remaining 3 letters from the remaining 8 letters in our alphabet.

1.2 Binomial Coefficients

Exercises

1.2.1.

Solution.
  1. \(2^{15} = 32768\) subsets. We need to select yes/no for each of the 15 elements.
  2. \(2^{12} = 4096\) subsets. We need to select yes/no for each of the remaining 12 elements.
  3. \(2^{15} - 2^{7} = 32640\) subsets. We subtract the number of subsets which do not contain any odd numbers (\(2^{7}\)-select yes or no for each even element) from the total number of possible subsets.
  4. \({7 \choose 1}\cdot 2^{8} ={1792}\) subsets. First pick the even number. Then say yes or no to each of the odd numbers.

1.2.2.

Solution.
  1. \({10\choose 6} = 210\) subsets.
  2. \({7 \choose 3} = 35\) subsets. We need to select 3 of the 7 remaining elements of \(S\) to be in the subset.
  3. \({10 \choose 6} = 210\) subsets. All subsets of cardinality 6 must contain at least one odd number.
  4. \({5 \choose 1} = 5\) subsets. Select 1 of the 5 even numbers. The remaining 5 odd numbers of \(S\) must all be in the set.

1.2.3.

Solution.
  1. There are \({16}\) subsets. This is \(2^4\text{,}\) which makes sense because we are deciding yes or no on whether to include each element of \(A\) in the subset.
  2. Of the 4 elements in \(A\text{,}\) we must choose 3 of them to be in the subset. So \({4 \choose 3} = {4}\text{.}\)
  3. For each of the 4 elements from \(A\text{,}\) we must decide yes or no on whether to include them in the subset. However, for the odd numbers, we only have one choice: no. So there are only 2 elements we have two choices for, so the answer is \(2^{2} = {4}\text{.}\) (Note, if you wish to exclude the empty set - it does not contain odd numbers, but no evens either - then you could subtract 1).
  4. Count the number of subsets with each possible even cardinality:
    \(\displaystyle{ {4 \choose 0} + {4 \choose 2} + \dots... = {8} }\)

1.2.4.

Solution.
  1. \(2^{11} = {2048}\text{.}\) You have 2 choices for each of the remaining 11 bits.
  2. \({11 \choose 3} = 165\text{.}\) You need to choose 3 of the remaining 11 bits to be 1’s.
  3. 5632. There are \(2^{11}\) strings that start with 011, and another \(2^{12}\) which end with 01 (we choose 1 or 0 for 12 bits). However, we count the strings that start with 011 and end with 01 twice - there are \(2^{9}\) such strings. So using PIE, we have \(2^{11} + 2^{12} - 2^{9} = {5632}\)
  4. 624. There are \({11 \choose 3} = 165\) strings of weight 5 which start with 011, and another \({12 \choose 4} ={495}\) which end with 01. We have over counted again - there are weight 5 strings which both start with 011 and end with 01, in fact \({9 \choose 2} ={36}\) of them. So all together we have \(165+{495}-{36} = {624}\) strings.

1.2.5.

Solution.
  1. We can think of each row as a 8-bit string of weight 4 (since of the 8 coins, we require 4 to be pennies). Thus there are \({8 \choose 4} = {70}\) rows possible. Each row requires 8 coins, so if we want to make all the rows at the same time, we will need 560 coins, half of them nickels and half of them pennies.
  2. Now there are \(2^{8} = 256\) rows possible, which is also \({8 \choose 0} + {8\choose 1} + {8 \choose 2} +\dots + {8 \choose 8}\text{,}\) if you break them up into rows containing 0, 1, 2, etc. pennies. Thus, since there are 8 coins in each row, we need \(8 \cdot 256 = {2048}\) total coins.

1.2.6.

Solution.
Count the number of strings with each permissible number of 1’s separately, then add them up. So there are \({10 \choose 4} + {10 \choose 5} + \cdots {10 \choose 10} = {848}\) strings.

1.2.7.

Solution.
This is the same as a question about 5-bit strings, since we can think of each subset as a 5-bit string with a 1 representing that we include that element in the subset. \({10 \choose 5} + {10\choose 6} + \cdots + {10\choose 10} = {638}\) subsets.

1.2.8.

Solution.
To get an \(x^{9}\text{,}\) we must pick 9 of the 17 factors to contribute an \(x\text{,}\) leaving the other 8 to contribute a 3. There are \({17 \choose 9}\) ways to select these 9 factors. So the term containing an \(x^{9}\) will be \({17 \choose 9}x^{9}3^{8}\text{.}\) In other words, the coefficient of \(x^{9}\) is \({17\choose 9}3^8 = {1.59498\times 10^{8}}\text{.}\)

1.2.9.

Solution.
To get an \(x^{6}\) from the first term, we must pick 6 of the 18 factors to contribute an \(x\text{,}\) leaving the other 12 to contribute a 2. There are \({18 \choose 6}\) ways to select these 6 factors, so the coefficient will be \({18 \choose 6} *2^{12}\text{.}\) Now we must choose 2 of the factors in the second term to contribute an \(x\text{,}\) leaving the other 19 terms to contribute a 3. This gives us \({21 \choose 2}*3^{19}\) for the coefficient resulting from this term. In total, the term containing an \(x^{6}\) will be \({18 \choose 6} *2^{12} + {21 \choose 2}*3^{19}= {2.44151\times 10^{11}}\text{.}\)

1.2.10.

Solution.
  1. \({ 18\choose 9} = {48620}\) paths. The paths all have length 18 (9 steps up and 9 steps right), we just select which 9 of those 18 should be right.
  2. \({11 \choose 7}{7\choose 2} = {6930}\) paths. First travel to \((12,9)\text{,}\) and then continue on to \((14,14)\)) .
  3. \({ 18\choose 9} - {11 \choose 7}{7\choose 2} = {41690}\) paths. Remove all the paths that you found in part (b).

1.2.12.

Solution.
  1. \({8 \choose 5} = {56}\) choices, since you have to select a 5-element subset of the set of 8 toppings.
  2. \({7 \choose 5} = {21}\) choices, since you must select 5 of the 7 non-green pepper toppings.
  3. \({7 \choose 4} = {35}\) choices, since you must select 4 of the remaining 7 non-green pepper toppings to have in addition to the green pepper.
Note that \({56} = {21} + {35}\) choices, which makes sense because every 5-topping pizza either has green pepper or does not have green pepper as a topping.

1.3 Combinations and Permutations

Exercises

1.3.1.

Solution.
  1. \({8 \choose 6} = {28}\) pizzas. We must choose (in no particular order) 6 out of the 8 toppings.
  2. \(2^{8} = {256}\) pizzas. Say yes or no to each topping.
  3. \(P(8,4) = {1680}\) ways. Assign each of the 4 spots in the left column to a unique pizza topping.

1.3.2.

Solution.
Despite its name, we are not looking for a combination here. The order in which the three numbers appears matters. There are \(P(34,3) = 34\cdot 33 \cdot 32\) different possibilities for the “combination”. This is assuming you cannot repeat any of the numbers (if you could, the answer would be \(34^3\)).

1.3.3.

Solution.
  1. This is just the multiplicative principle. There are 8 digits which we can select for each of the 5 positions, so we have \(8^5 = {32768}\) such numbers.
  2. Now we have 8 choices for the first number, 7 for the second, etc. So there are \(8 \cdot 7 \cdot \dots \cdot 5 = P(8,5) = {6720}\) such numbers.
  3. To build such a number we simply must select 5 different digits. After doing so, there will only be one way to arrange them into increasing order. Thus there are \({8 \choose 5} = {56}\) such numbers.

1.3.4.

Solution.
  1. We can write the answer as \(P(23,16) = 23 \cdot 22 \cdot 21 \cdot \dots \cdot 8\) , which is the same as \(\frac{23!}{7!}\) . Or, if you think of picking the 16 books and then arranging those 16, you can write this as \(\binom{23}{16}\cdot 16!\) . Note, that since any order is acceptable, we are distinguishing between different orders, so a permutation is appropriate here.
  2. Here we just need to select the books, and have no choice as how to arrange them. So the answer is just \(\binom{23}{16}\)

1.3.5.

Solution.
You can make \({7\choose 2}{7\choose 2} = 441\) quadrilaterals.
There are 5 squares.
There are \({7 \choose 2}\) rectangles.
There are \({7 \choose 2} + ({7 \choose 2}-1) + ({7 \choose 2} - 3) + ({7 \choose 2} - 6) + ({7 \choose 2} - 10) + ({7 \choose 2} - 15) = 91\) parallelograms.
All of the quadrilaterals are trapezoids. To count the non-parallelogram trapezoids, compute \({7\choose 2}{7\choose 2} - \left[ {7 \choose 2} + ({7 \choose 2}-1) + ({7 \choose 2} - 3) + ({7 \choose 2} - 6) + ({7 \choose 2} - 10) + ({7 \choose 2} - 15) \right]\text{.}\)

1.3.6.

Solution.
120.

1.3.7.

Solution.
Since there are 12 different letters in “malnourished”, we have 12 choices for the first letter, 11 for the next, 10 for the next, and so on. Thus there are \(12!\) anagrams.

1.3.8.

Solution.
After the first letter (a), we must rearrange the remaining 7 letters. There are only two choices of letter now, so this is really just a bit-string question where one of the letters is 0, and the other letter is 1. Thus there are \({7 \choose 2} = {21}\) anagrams starting with “a”.

1.3.9.

Solution.
First, decide where to put the “i”s. There are 12 positions, and we must choose 3 of them to fill with an “i”. This can be done in \(\binom{12}{3}\) ways. The remaining 9 spots all get a different letter, so there are \(9!\) ways to finish off the anagram. This gives a total of \(\binom{12}{3}\cdot 9!\) anagrams. Strangely enough, this is 7.98336E+07, which is also equal to \(P(12,9)\text{.}\) To get the answer that way, start by picking one of the 12 positions to be filled by the first non-”i” letter, one of the remaining 7 positions to be filled by the next, and so on. Then put “i”s in the remaining 3 positions.

1.3.10.

Solution.
  1. \({36 \choose 4}\cdot {32 \choose 4} \cdot {28 \choose 4} \cdot \dots \cdot{4 \choose 4}\) ways. Pick 4 out of 36 people to be in the first foursome, then 4 of the remaining 32 for the second foursome, and so on (use the multiplicative principle to combine).
  2. \(9!{27 \choose 3}\cdot {24 \choose 3}\cdot {21 \choose 3} \cdot \dots \cdot {3 \choose 3}\) ways. First determine the tee time of the 9 board members, then select 3 of the 27 non board members to golf with the first board member, then 3 of the remaining 24 to golf with the second, and so on.

1.3.11.

Solution.
\(8!\text{.}\) There are 9 people seated around the table, but it does not matter where King Arthur sits, only who sits to his left, two seats to his left, and so on.

1.3.12.

Solution.
  1. \(17^{9}\) functions. There are 17 choices for the image of each element in the domain.
  2. \(P(17, 9)=17\cdot16\cdot15\cdot \dots \cdot 8\) injective functions. There are 17 choices for image of the first element of the domain, then only 16 choices for the second, 15 for the third, and so on.

1.3.13.

Solution.
  1. \(8^{6} = {262144}\) functions, since there are 8 choices of where to send each of the 6 elements of the domain.
  2. \(P(8, 6) = 8\cdot 7 \cdot \cdots \cdot 3 = {20160}\) functions, since outputs cannot be repeated.
  3. \({8 \choose 6} = {28}\) functions. Since the function must be injective and increasing, we just need to select the 6 distinct elements of the range from the 8 elements of the codomain. Once selected, we must put the smallest as the image of 1, the next smallest as the image of 2, and so on (doing this does not increase the number of functions, since there is one choice for how this event can occur).

1.4 Combinatorial Proofs

Exercises

1.4.1.

Solution.
Proof.
Question: How many 2-letter words start with a, b, or c and end with either y or z?
Answer 1: There are two words that start with a, two that start with b, two that start with c, for a total of \(2+2+2\text{.}\)
Answer 2: There are three choices for the first letter and two choices for the second letter, for a total of \(3 \cdot 2\text{.}\)
Since the two answers are both answers to the same question, they are equal. Thus \(2 + 2 + 2 = 3\cdot 2\text{.}\)

1.4.5.

Solution.
  1. She has \({15 \choose 6}\) ways to select the 6 bridesmaids, and then for each way, has 6 choices for the maid of honor. Thus she has \({15 \choose 6}6\) choices.
  2. She has 15 choices for who will be her maid of honor. Then she needs to select 5 of the remaining 14 friends to be bridesmaids, which she can do in \({14 \choose 5}\) ways. Thus she has \(15 {14 \choose 5}\) choices.
  3. We have answered the question (how many wedding parties can the bride choose from) in two ways. The first way gives the left-hand side of the identity and the second way gives the right-hand side of the identity. Therefore the identity holds.

1.4.7.

Solution.
Proof.
Question: You have a large container filled with ping-pong balls, all with a different number on them. You must select \(k\) of the balls, putting two of them in a jar and the others in a box. How many ways can you do this?
Answer 1: First select 2 of the \(n\) balls to put in the jar. Then select \(k-2\) of the remaining \(n-2\) balls to put in the box. The first task can be completed in \({n \choose 2}\) different ways, the second task in \({n-2 \choose k-2}\) ways. Thus there are \({n \choose 2}{n-2 \choose k-2}\) ways to select the balls.
Answer 2: First select \(k\) balls from the \(n\) in the container. Then pick 2 of the \(k\) balls you picked to put in the jar, placing the remaining \(k-2\) in the box. The first task can be completed in \({n \choose k}\) ways, the second task in \({k \choose 2}\) ways. Thus there are \({n \choose k}{k \choose 2}\) ways to select the balls.
Since both answers count the same thing, they must be equal and the identity is established.

1.5 Stars and Bars

Exercises

1.5.1.

Solution.
  1. \({10\choose 7}\) sets. We must select 7 of the 10 digits to put in the set.
  2. Use stars and bars: each star represents one of the 7 elements of the set, each bar represents a switch between digits. So there are 7 stars and 9 bars, giving us \({16 \choose 7}\) sets.

1.5.2.

Solution.
  1. There are \({7 \choose 4}\) numbers. We simply choose 4 of the 7 digits and once chosen put them in increasing order.
  2. This requires stars and bars. Use a star to represent each of the 4 digits in the number, and use their position relative to the bars to say what numeral fills that spot. So we will have 4 stars and 6 bars, giving \({10 \choose 6}\) numbers.

1.5.3.

Solution.
  1. You take 3 strawberry, 1 lime, 0 licorice, 2 blueberry and 0 bubblegum.
  2. This is backwards. We don’t want the stars to represent the kids because the kids are not identical, but the stars are. Instead we should use 5 stars (for the lollipops) and use 5 bars to switch between the 6 kids. For example,
    \begin{equation*} **||***||| \end{equation*}
    would represent the outcome with the first kid getting 2 lollipops, the third kid getting 3, and the rest of the kids getting none.
  3. This is the word AAAEOO.
  4. This doesn’t represent a solution. Each star should represent one of the 6 units that add up to 6, and the bars should switch between the different variables. We have one too many bars. An example of a correct diagram would be
    \begin{equation*} *|**||***\text{,} \end{equation*}
    representing that \(x_1 = 1\text{,}\) \(x_2 = 2\text{,}\) \(x_3 = 0\text{,}\) and \(x_4 = 3\text{.}\)

1.5.4.

Solution.
  1. \({36 \choose 28}\) ways. Each outcome can be represented by a sequence of 28 stars and 8 bars.
  2. \({27 \choose 19}\) ways. First put one ball in each bin. This leaves 19 stars and 8 bars.

1.5.5.

Solution.
  1. \({13 \choose 11}\) solutions. After each variable gets 1 star for free, we are left with 11 stars and 2 bars.
  2. \({16 \choose 14}\) solutions. We have 14 stars and 2 bars.
  3. \({25 \choose 2}\) solutions. This problem is equivalent to finding the number of solutions to \(x' + y' + z' = 23\) where \(x'\text{,}\) \(y'\) and \(z'\) are non-negative. (In fact, we really just do a substitution. Let \(x = x'- 3\text{,}\) \(y = y' - 3\) and \(z = z' - 3\)).

1.5.6.

Solution.
\({10 \choose 5}\) outcomes are possible in traditional Yahtzee. Each die is a star, its value is determined by where it is put relative to the bars.
For Super-Yahtzee, \({10 \choose 3}\) outcomes. We have 7 stars (the 7 dice) and 3 bars (the 3 switches between the numbers 1-4).

1.5.7.

Solution.
We must figure out how many different combinations of 5 coins are possible. Let a star represent each coin, and a bar represent switching between type of coin. For example, if we have 7 coins, \(**|*||****\) represents 2 pennies, one nickel, no dimes and 4 quarters. The number of such star and bar diagrams for 8 total stars and bars (with 5 stars and 3 bars) is \({8 \choose 5} = {0.0178571}\text{.}\) Thus you have a 1 in 0.0178571 chance of guessing correctly.

1.5.8.

Solution.
\({13 \choose 10}\) solutions. First we guarantee the restrictions on the variables by distributing 18 units to the variables. The we find all solutions to \(x_1' + x_2' + x_3' + x_4' = 10\) in non-negative integers.

1.5.10.

Solution.
  1. \({8\choose 4}= {70}\text{.}\) Note that a strictly increasing function is automatically injective. So the 4 outputs must all be different. So let’s first pick which 4 outputs we will use: there are \({8 \choose 4}\) ways to do this. Now how many ways are there to assign those outputs to the inputs \(1\) through 4? Only one way, since there is only one way to arrange numbers in increasing order.
  2. \({11 \choose 4}\text{.}\) This is in fact a stars and bars problem. The stars are the 4 inputs and the bars are the 7 spots between the 8 possible outputs. Think of it this way - we will specify \(f(1)\text{,}\) then \(f(2)\text{,}\) then \(f(3)\text{,}\) and so on in that order. Start with the possible output 0. We can use it as the output of \(f(1)\text{,}\) or we can switch to 1 as a potential output. Say we put \(f(1) = 1\text{.}\) Now we are at 1 (can’t go back to 0). Should \(f(2) = 1\text{?}\) If yes, then we are putting down another star. If no, put down a bar and switch to 2. Maybe you switch to 3, then assign \(f(2) = 3\) and \(f(3) = 3\) (two more stars) before switching to 4 as a possible output. And so on.

1.5.11.

Solution.
  1. \({22 \choose 6}\) sodas (order does not matter and repeats are not allowed).
  2. \(P(22, 6) = (22)\cdot (22-1)\cdot \dots \cdot 17\) sodas (order matters and repeats are not allowed).
  3. \({27 \choose 6}\) sodas (order does not matter and repeats are allowed; 6 stars and 21 bars).
  4. \(22^{6}\) sodas (order matters and repeats are allowed; 22 choices 6 times).

1.6 Advanced Counting Using PIE

Exercises

1.6.1.

Solution.
  1. \({14 \choose 6}\) meals. First spend $7 to buy one of each item, then use 8 stars to select items between 6 bars.
  2. \({21 \choose 6}\) meals. Here you have 15 stars and 6 bars (separating the 7 items). a. \({21 \choose 6} - \left[{7 \choose 1}{18 \choose 6} - {7 \choose 2}{15 \choose 6} + {7 \choose 3}{12 \choose 6}\cdots\right]\) meals. Use PIE to subtract all the meals in which you get 3 or more of a particular item.

1.6.2.

Solution.
  1. \({26 \choose 6} = {230230}\) - there are 20 stars and 6 bars.
  2. \({19 \choose 6}= {27132}\) - buy one of each item, using $7. This leaves you $13 to distribute to the 7 items, so 13 stars and 6 bars.
  3. \({26 \choose 6} - \left[{7 \choose 1}{21 \choose 6} - {7 \choose 2}{16 \choose 6} + \cdots\right]\) meals. Use PIE to subtract all the meals in which you get 5 or more of a particular item.

1.6.3.

Solution.
\({18 \choose 4} - \left[ {5 \choose 1}{11 \choose 4} - {5 \choose 2}{4 \choose 4}\right]\text{.}\)

1.6.4.

Solution.
The easiest way to solve this is to first distribute the minimum amount of units to each variable (3) and then count the solutions to \(y_1 + y_2 + y_3 + y_4 = 4\) with \(0 \le y_i \le 3\text{.}\) By taking \(x_i = y_i+3\text{,}\) each solution to this new equation corresponds to exactly one solution to the original equation.
Now all the ways to distribute the 4 units to the four \(y_i\) variables can be found using stars and bars, specifically 4 stars and 3 bars, so \({7 \choose 4}\) ways. But this includes the ways that one or more \(y_i\) variables can be assigned more than 3 units. So subtract using PIE to get \(\displaystyle{ {7 \choose 3} -\left( {4\choose 1} {3 \choose 3}-{4\choose 2} {-1 \choose 3} + \dots \right) }\)
The \({4 \choose 1}\) counts the number of ways to pick one variable to be over-assigned, the \({3 \choose 3}\) is the number of ways to assign the remaining units to the 4 variables, etc.

1.6.5.

Solution.
  1. \({23 \choose 15} = 490314\) This makes sense because if each student can receive at most one star, you must pick which 15 of the 23 kids will get one.
  2. Without any restriction, there would be \({37\choose 22}\) ways to distribute the stars. Now we must use PIE to eliminate all distributions in which one or more student gets more than one star:
\(\displaystyle{ {37 \choose 22} - \left[{23 \choose 1}{35 \choose 22} - {23\choose 2}{33 \choose 22} + {23\choose 3}{31 \choose 22} - \cdots \right] = 490314. }\)

1.6.7.

Solution.
The 9 derangements are: 2143, 2341, 2413, 3142, 3412, 3421, 4123, 4312, 4321.

1.6.8.

Solution.
First pick one of the 4 elements to be fixed. For each such choice, derange the remaining 3, using the standard advanced PIE formula. We get \({4 \choose 1}\left( 3! - \left[{3 \choose 1}2! - {3 \choose 2}1! + \dots {3 \choose 3}0! \right] \right)\) permutations.

1.6.9.

Solution.
\({9 \choose 7}\left(2! - \left[{2 \choose 1} 1! - {2 \choose 2}0! \dots + {2 \choose 2}0! \right]\right)={36}\) ways. We choose 7 of the 9 ladies to get their own hat, and then multiply by the number of ways the remaining hats can be deranged.

1.6.10.

Solution.
  1.  
    \(\displaystyle{ 7! - \left[{7 \choose 1}6! - {7 \choose 2}5! \dots {7 \choose 7}0! \right] = {1854} }\)
  2.  
    \(\displaystyle{ {7 \choose 3}\left(4! - \left[{4\choose 1}3! - {4 \choose 2}2! + \dots {4 \choose 4}0!\right]\right) = {315} }\)
  3. 0. Once 6 presents have their original label, there is only one present left and only one label left, so the 7th present must get its own label.

1.6.11.

Solution.
There are \(5 \cdot 6^{6}\) functions for which \(f(1) \ne c\) and another \(5 \cdot 6^{6}\) functions for which \(f(2) \ne f\text{.}\) There are \(5^2 \cdot 6^{5}\) functions for which both \(f(1) \ne c\) and \(f(2) \ne f\text{.}\) So the total number of functions for which \(f(1) \ne c\) or \(f(2) \ne f\) or both is
\(\displaystyle{ 5 \cdot 6^{6}+ 5 \cdot 6^{6} - 5^2 \cdot 6^{5} = {272160}. }\)

1.6.12.

Solution.
\(6^{8} - \left[{6 \choose 1}5^{8} - {6 \choose 2}4^{8} + {6 \choose 3}3^{8} - \dots +{6 \choose 5}1^{8}\right]\) functions. The \(6^{8}\) is all the functions from \(A\) to \(B\text{.}\) We subtract those that aren’t surjective. Pick one of the elements in \(B\) to not be in the range (in \({6 \choose 1}\) ways) and count all those functions (\(5^{8}\)). But this overcounts the functions where two elements from \(B\) are excluded from the range, so subtract those. And so on, using PIE.

1.6.13.

Solution.
1854 functions. This is a sneaky way to ask for the number of derangements on 7 elements.

1.7 Chapter Summary

Chapter Review

1.7.1.

Solution.
  1. \({13 \choose 9}\) ways, after giving one present to each kid, you are left with 9 presents (stars) which need to be divide among the 5 kids (giving 4 bars).
  2. \({18 \choose 14}={3060}\) ways. You have 14 stars and 4 bars.
  3. \(5^{14}\text{.}\) You have 5 choices for whom to give each present. This is like making a function from the set of presents to the set of kids.
  4. \(5^{14}- \left[{5 \choose 1}(5-1)^{14} - {5\choose 2}(5-2)^{14} + {5 \choose 3}(5-3)^{14} \dots \right]\) ways. Now the function from the set of presents to the set of kids must be surjective.

1.7.2.

Solution.
  1. Neither. \({14 \choose 4}\) paths.
  2. \({10\choose 4}\) bow ties.
  3. \(P(10,4)\text{,}\) since order is important.
  4. Neither. Assuming you will wear each of the 4 ties on just 4 of the 7 days, without repeats: \({10\choose 4}P(7,4)\text{.}\)
  5. \(P(10,4)\text{.}\)
  6. \({10\choose 4}\text{.}\)
  7. Neither. Since you could repeat letters: \(10^4\text{.}\) If no repeats are allowed, it would be \(P(10,4)\text{.}\)
  8. Neither. Actually, “k” is the 11th letter of the alphabet, so the answer is 0. If “k” was among the first 10 letters, there would only be 1 way - write it down.
  9. Neither. Either \({9\choose 3}\) (if every kid gets an apple) or \({13 \choose 3}\) (if appleless kids are allowed).
  10. Neither. Note that this could not be \({10 \choose 4}\) since the 10 things and 4 things are from different groups. \(4^{10}\text{,}\) assuming each kid eats one type of cerial.
  11. \({10 \choose 4}\) - don’t be fooled by the “arrange” in there - you are picking 4 out of 10 spots to put the 1’s.
  12. \({10 \choose 4}\) (assuming order is irrelevant).
  13. Neither. \(16^{10}\) (each kid chooses yes or no to 4 varieties).
  14. Neither. 0.
  15. Neither. \(4^{10} - [{4\choose 1}3^{10} - {4\choose 2}2^{10} + {4 \choose 3}1^{10}]\text{.}\)
  16. Neither. \(10\cdot 4\text{.}\)
  17. Neither. \(4^{10}\text{.}\)
  18. \({10 \choose 4}\) (which is the same as \({10 \choose 6}\)).
  19. Neither. If all the kids were identical, and you wanted no empty teams, it would be \({10 \choose 4}\text{.}\) Instead, this will be the same as the number of surjective functions from a set of size 11 to a set of size 5.
  20. \({10 \choose 4}\text{.}\)
  21. \({10 \choose 4}\text{.}\)
  22. Neither. \(4!\text{.}\)
  23. Neither. It’s \({10 \choose 4}\) if you won’t repeat any choices. If repetition is allowed, then this becomes \(x_1 + x_2 + \cdots +x_{10} = 4\text{,}\) which has \({13 \choose 9}\) solutions in non-negative integers.
  24. Neither. Since repetition of cookie type is allowed, the answer is \(10^4\text{.}\) Without repetition, you would have \(P(10,4)\text{.}\)
  25. \({10 \choose 4}\) since that is equal to \({9 \choose 4} + {9 \choose 3}\text{.}\)
  26. Neither. It will be a complicated (possibly PIE) counting problem.

1.7.3.

Solution.
  1. \(2^{14} = {16384}\) choices. You have two choices for each tie: wear it or don’t.
  2. You have 511 choices for regular ties (the \(2^{9}\) choices less the “no regular tie” option) and 31 choices for bow ties (\(2^{5}\) total minus the “no bow tie” option). Thus total you have \({511} \cdot {31} = {15841}\) choices.
  3. \({9\choose 3}{5\choose 2} = {840}\) choices.
  4. Select one of the 2 bow ties to go on top. There are then 4 choices for the next tie, 4-1 for the tie after that, and so on. Thus \(2\cdot 4! = {48}\) choices.

1.7.4.

Solution.
You own 8 purple bow ties, 3 red bow ties, 3 blue bow ties and 5 green bow ties. How many ways can you select one of each color bow tie to take with you on a trip? \(8 \cdot 3 \cdot 3 \cdot 5\) ways. How many choices do you have for a single bow tie to wear tomorrow? \(8 + 3 + 3 + 5\) choices.

1.7.5.

Solution.
  1. \(8^{9}\) numbers.
  2. \(8^{8} \cdot 4\) numbers (choose any digits for the first 8 digits - then pick either an even or an odd last digit to make the sum even).
  3. We need 5 or more even digits. 5 even digits: \({9 \choose 5}4^5 4^{9-5}\text{.}\) 5+1 even digits: \({9 \choose (5+1)}4^{5+1} *4^{9-5-1}\text{,}\) etc. By adding these together, we get the total number of ways to have 5 or more even digits.

1.7.6.

Solution.
46 passengers. We are asking for the size of the union of three non-disjoint sets. Using PIE, we have \(30+20+24-(11 +12 + 14) + 9 = {46}\text{.}\)

1.7.7.

Solution.
  1. \(2^9\) strings.
  2. \({9 \choose 5}\) strings.
  3. \({9 \choose 5}\) strings.

1.7.8.

Solution.
\(3^{5}\cdot{14 \choose 9} + 5^{15}\cdot{21 \choose 6}\text{.}\)

1.7.9.

Solution.
With repeated letters allowed, we select which 3 of the 9 letters will be vowels, then pick one of the 5 vowels for each spot, and finally pick one of the other 21 letters for each of the remaining 6 spots. Thus, \({9 \choose 3}5^3 21^{6}\) words.
Without repeats, we still pick the positions of the vowels, but now each time we place a vowel there, we have one fewer choice for the next one. Similarly, we cannot repeat the consonants. We get \({9 \choose 3}P(5,3) P(21, 6)\) words.

1.7.10.

Solution.
  1. \({6 \choose 2}{8 \choose 5}={840}\) paths.
  2. \({14 \choose 7} - {10 \choose 4}{4 \choose 3}={2592}\) paths.
  3. \({6 \choose 2}{8 \choose 5} + {10 \choose 4}{4 \choose 3} - {6 \choose 2}{4 \choose 2}{4 \choose 3}= {1320}\) paths.

1.7.11.

Solution.
\({27 \choose 14}\left({27 \choose 14} - 1\right)\) routes. For each of the \(\binom{27}{14}\) routes to work there is exactly one less route back.

1.7.12.

Solution.
\(2^{7} + 2^{8} - 2^{5}\) strings (using PIE).

1.7.13.

Solution.
\({11 \choose 3} + {12 \choose 4} - {9 \choose 2}\) strings.

1.7.14.

Solution.
There are 9 spots to start the word, and then there are \(8!\) ways to arrange the other letters in the remaining three spots. Thus the number of words avoiding the sub-word “bad” in consecutive letters is \(11! - 9\cdot 8!={3.95539\times 10^{7}}\text{.}\)
If we now need to avoid words that put “b” before “a” before “d”, we must choose which spots those letters go (in that order) and then arrange the remaining 8 letters. Thus, \(11! - {11 \choose 3}8!={3.3264\times 10^{7}}\) words.

1.7.15.

Solution.
\(2^n\) is the number of lattice paths which have length \(n\text{,}\) since for each step you can go up or right. Such a path would end along the line \(x + y = n\text{.}\) So you will end at \((0,n)\text{,}\) or \((1,n-1)\) or \((2, n-2)\) or … or \((n,0)\text{.}\) Counting the paths to each of these points separately, give \({n \choose 0}\text{,}\) \({n \choose 1}\text{,}\) \({n \choose 2}\text{,}\) …, \({n \choose n}\) (each time choosing which of the \(n\) steps to be to the right). These two methods count the same quantity, so are equal.

1.7.16.

Solution.
  1. \({14 \choose 9}={2002}\) ways.
  2. \({20 \choose 15}={15504}\) ways.
  3. \({14 \choose 9} - \left[{6 \choose 1}{8 \choose 5} - {6 \choose 2}{2 \choose 5} \dots \right]={1876}\) ways.

1.7.17.

Solution.
  1. \(9^8 + 9^8 - 9^7={8.13105\times 10^{7}}\) functions.
  2. \(8\cdot 9^8 + 9 \cdot 8 \cdot 9^7 - 8 \cdot 8 \cdot 9^7={3.82638\times 10^{8}}\) functions.
  3. \(9! - \left[ 8! + 8! - 7! \right]={287280}\) functions. Note we use factorials instead of powers because we are looking for injective functions.
  4. Note that being surjective here is the same as being injective, so we can start with all \(9!\) injective functions and subtract those which have one or more “fixed point”. We get \(9! - \left[{9 \choose 1}(9-1)! - {9 \choose 2}(9-2)! + {9 \choose 3}(9-3)! - \dots {9 \choose 9}0! \right]={133496}\) functions.

1.7.18.

Solution.
\(4^6 - \left[{4 \choose 1}3^6 - {4 \choose 2}2^6 + {4 \choose 3} 1^6 \right]\text{.}\)

1.7.19.

Solution.
  1. \({12 \choose 7}={792}\) combinations. You need to choose 7 of the 12 cookie types. Order doesn’t matter.
  2. \(P(12, 7) = 12 \cdot (12-1) \cdot (12-2) \cdot \dots \cdot (12-7+1)= {3.99168\times 10^{6}}\) ways. You are choosing and arranging 7 out of 12 cookies. Order matters now.
  3. \({31 \choose 20}={8.46723\times 10^{7}}\) choices. You must switch between cookie type 11 times as you make your 20 cookies. The cookies are the stars, the switches between cookie types are the bars.
  4. \(12^{20}\) choices. You have 12 choices for the “1” cookie, 12 choices for the “2” cookie, and so on.
  5. \(12^{20} - \left[{12 \choose 1}(12-1)^{20} - {12 \choose 2}(12-2)^{20} + \cdots - {12 \choose 12}0^{20} \right]={1.96878\times 10^{20}}\) choices. We must use PIE to remove all the ways in which one or more cookie type is not selected.

1.7.20.

Solution.
  1. You are giving your professor 4 types of cookies coming from 10 different types of cookies. This does not lend itself well to a function interpretation. We could say that the domain contains the 4 types you will give your professor and the codomain contains the 10 you can choose from, but then counting injections would be too much (it doesn’t matter if you pick type 3 first and type 2 second, or the other way around, just that you pick those two types).
  2. We want to consider injective functions from the set \(\{\)most, second most, second least, least\(\}\) to the set of 10 cookie types. We want injections because we cannot pick the same type of cookie to give most and least of (for example).
  3. This is not a good problem to interpret as a function. The problem is that the domain would have to be the 12 cookies you bake, but these elements are indistinguishable (there is not a first cookie, second cookie, etc.).
  4. The domain should be the 12 shapes, the codomain the 10 types of cookies. Since we can use the same type for different shapes, we are interested in counting all functions here.
  5. Here we insist that each type of cookie be given at least once, so now we are asking for the number of surjections of those functions counted in the previous part.

2 Sequences

2 Sequences
2.1 Describing Sequences

Exercises

2.1.3.

Solution.
  1. The recursive definition is \(a_n = a_{n-1} + 2\) with \(a_1 = 1\text{.}\) A closed formula is \(a_n = 2n-1\text{.}\)
  2. The sequence of partial sums is \(1, 4, 9, 16, 25, 36, \ldots\text{.}\) A recursive definition is (as always) \(b_n = b_{n-1} + a_n\) which in this case is \(b_n = b_{n-1} + 2n-1\text{.}\) It appears that the closed formula is \(b_n = n^2\)

2.1.4.

Solution.
  1. \(0, 1, 2, 4, 7, 12, 20, \ldots\text{.}\)
  2. \(F_0 + F_1 + \cdots + F_n = F_{n+2} - 1\text{.}\)

2.1.5.

Solution.
The sequences all have the same recurrence relation: \(a_n = a_{n-1} + a_{n-2}\) (the same as the Fibonacci numbers). The only difference is the initial conditions.

2.1.6.

Solution.
\(3, 10, 24, 52, 108,\ldots\text{.}\) The recursive definition for \(10, 24, 52, \ldots\) is \(a_n = 2a_{n-1} + 4\) with \(a_1 = 10\text{.}\)

2.1.7.

Solution.
\(-1, -1, 1, 5, 11, 19,\ldots\) Thus the sequence \(0, 2, 6, 12, 20,\ldots\) has closed formula \(a_n = (n+1)^2 - 3(n+1) + 2\text{.}\)

2.1.8.

Solution.
This closed formula would have \(a_{n-1} = 3\cdot 2^{n-1} + 7 \cdot 5^{n-1}\) and \(a_{n-2} = 3\cdot 2^{n-2} + 7 \cdot 5^{n-2}\text{.}\) Then we would have
\begin{align*} 7a_{n-1} - 10a_{n-2} = \amp 7(3\cdot 2^{n-1} + 7 \cdot 5^{n-1}) - 10(3\cdot 2^{n-2} + 7 \cdot 5^{n-2})\\ = \amp 21\cdot 2^{n-1} + 49 \cdot 5^{n-1} - 30\cdot 2^{n-2} - 70 \cdot 5^{n-2})\\ = \amp 21\cdot 2^{n-1} + 49 \cdot 5^{n-1} - 15\cdot 2^{n-1} - 14 \cdot 5^{n-1})\\ = \amp 6\cdot 2^{n-1} + 35 \cdot 5^{n-1}\\ = \amp 3\cdot 2^{n} + 7 \cdot 5^{n} = a_n\text{.} \end{align*}
So the closed formula agrees with the recurrence relation. The closed formula has initial terms \(a_0 = 10\) and \(a_1 = 41\text{.}\)

2.1.12.

Solution.
  1. \(\d\sum_{k=1}^n 2k\text{.}\)
  2. \(\d\sum_{k=1}^{107} (1 + 4(k-1))\text{.}\)
  3. \(\d\sum_{k=1}^{50} \frac{1}{k}\text{.}\)
  4. \(\d\prod_{k=1}^n 2k\text{.}\)
  5. \(\d\prod_{k=1}^{100} \frac{k}{k+1}\text{.}\)

2.1.13.

Solution.
  1. \(\d\sum_{k=1}^{100} (3+4k) = 7 + 11 + 15 + \cdots + 403\text{.}\)
  2. \(\d\sum_{k=0}^n 2^k = 1 + 2 + 4 + 8 + \cdots + 2^n\text{.}\)
  3. \(\d\sum_{k=2}^{50}\frac{1}{(k^2 - 1)} = 1 + \frac{1}{3} + \frac{1}{8} + \frac{1}{15} + \cdots + \frac{1}{2499}\text{.}\)
  4. \(\d\prod_{k=2}^{100}\frac{k^2}{(k^2-1)} = \frac{4}{3}\cdot\frac{9}{8}\cdot\frac{16}{15}\cdots\frac{10000}{9999}\text{.}\)
  5. \(\d\prod_{k=0}^n (2+3k) = (2)(5)(8)(11)(14)\cdots(2+3n)\text{.}\)

2.2 Arithmetic and Geometric Sequences

Exercises

2.2.1.

Solution.
This is an arithmetic sequence with initial term 8 and common difference 4.
For the last part, you are finding the sequence of partial sums, added to 5.

2.2.2.

Solution.
  1. \(57\text{,}\) which is \(45+12\text{.}\)
  2. The sequence is arithmetic, with \(a_0 = 9\) and constant difference 12, so \(a_n = 9 + 12n\text{.}\)
  3. \(60300\text{.}\) We want \(9 + 33 + \cdots + 1197\text{.}\) Reverse and add to get 100 sums of 1206, a total of 120600, which is twice the sum we are looking for.

2.2.3.

Solution.
  1. 47.
  2. \(\displaystyle \frac{434 \cdot 46}{2} = 10199\text{.}\)

2.2.4.

Solution.
  1. \({n-\left(-1\right)+1}\) terms, since to get -3 using the formula \(3n+0\) we must use \(n=-1\text{.}\)
  2. \(3n - 3\text{,}\) which is 3 less than \(3n+0\) (or plug in \(n-1\) for \(n\)).
  3. \(\frac{(3n - 3)*({n-\left(-1\right)+1})}{2}\text{.}\) Reverse and add. Each sum gives the constant \(3n - 3\) and there are \({n-\left(-1\right)+1}\) terms.

2.2.5.

Solution.
\(534612\text{.}\) If we take \(a_0 = 3\text{,}\) the terms of the sum are an arithmetic sequence with closed formula \(a_n = 3+11n\text{.}\) Then \(3424 = a_{311}\text{,}\) for a total of 312 terms in the sum. Reverse and add to get 312 identical 3427 terms, which is twice the total we seek. \(3427\cdot 312/2 = 534612\)

2.2.6.

Solution.
\(\frac{3\cdot 4^{16}-3}{3}\text{.}\) Let the sum be \(S\text{,}\) and compute \(4S - S = 3S\text{,}\) which causes terms except \(3\) and \(3\cdot 4^{16}\) to cancel. Then solve for \(S\text{.}\)

2.2.7.

Solution.
\(\frac{1 + (-1)^{33} \frac{3^{33}}{2^{33}}}{5/2}\text{.}\) Compute \(S + \frac{3}{2}S\text{.}\)

2.2.8.

Solution.
For arithmetic: \(x = 83.6666666666667\text{,}\) \(y = 42.3333333333333\text{.}\) For the arithmetic sequence, we know \(125 + d = x\text{,}\) \(x + d = y\text{,}\) and \(y + d = 1\text{.}\) In other words, \(125 + 3d = 1\) so \(d = (-41.3333333333333)/3\text{.}\) For geometric: \(x = {25}\) and \(y = {5}\text{.}\) Similarly we can find the common ratio for the geometric sequence by solving \(125\cdot r^3 = 1\) for \(r\text{.}\)

2.2.9.

Solution.
For arithmetic: \(x = 18 \text{,}\) \(y = 31 \text{.}\) We know that \(5 + d = x\text{,}\) \(x + d = y\text{,}\) and \(y + d = 44\text{.}\) In other words, \(5 + 3d = 44\) so \(d = (39)/3\text{.}\)
For geometric: \(x = {10.3228}\) and \(y = {21.312}\text{.}\) We can find the common ratio for the geometric sequence by solving \(5\cdot r^3 = 44\) for \(r\text{.}\)

2.2.11.

Solution.
We have \(2 = 2\text{,}\) \(7 = 2+5\text{,}\) \(15 = 2 + 5 + 8\text{,}\) \(26 = 2+5+8+11\text{,}\) and so on. The terms in the sums are given by the arithmetic sequence \(b_n = 2+3n\text{.}\) In other words, \(a_n = \sum_{k=0}^n (2+3k)\text{.}\) To find the closed formula, we reverse and add. We get \(a_n = \frac{(4+3n)(n+1)}{2}\) (we have \(n+1\) there because there are \(n+1\) terms in the sum for \(a_n\)).

2.3 Polynomial Fitting

Exercises

2.3.1.

Solution.
\(a_n = {3n^{2}-4n}\text{.}\) Here we know that we are looking for a quadratic because the second differences are constant. So \(a_n = an^2 + bn + c\text{.}\) Since \(a_0 = 0\text{,}\) we know \(c= 0\text{.}\) So just solve the system
\(\begin{aligned} {-1} \amp = a + b\\ {4} \amp = 4a + 2b \end{aligned}\)
to find \(a = 3\) and \(b = -4\text{.}\)

2.3.2.

Solution.
\(a_n = {3n^{2}+6n-4}\text{.}\) Here we know that we are looking for a quadratic because the second differences are constant. So \(a_n = an^2 + bn + c\text{.}\) Since \(a_0 = {-4}\) know \(c= {-4}\text{.}\) So just solve the system
\(\begin{aligned} {5} \amp = a + b + {-4}\\ {20} \amp = 4a + 2b + {-4} \end{aligned}\)
to find \(a = {3}\) and \(b = {6}\text{.}\)

2.3.3.

Solution.
\(a_n = {3n^{3}+2n+2}\text{.}\) Here we know that we are looking for a cubic because the third differences are constant. So \(a_n = an^3 + bn^2 + cn + d\text{.}\) Since \(a_0 = {2}\) know \(d= {2}\text{.}\) So just solve the system
\begin{equation*} \begin{aligned} {7} \amp = a + b + c + {2}\\ {30} \amp = 8a + 4b + 2c + {2}\\ {89} \amp = 27a + 9b + 3c + {2}\\ \end{aligned} \end{equation*}
to find \(a = {3}\text{,}\) \(b = 0\text{,}\) and \(c = {2}\text{.}\)

2.3.4.

Solution.
\(a_n = {n^{3}-4n^{2}+8n+1}\text{.}\) Here we know that we are looking for a cubic because the third differences are constant. So \(a_n = an^3 + bn^2 + cn + d\text{.}\) We can work backwards to find that \(a_0 = {1}\text{,}\) so we know \(d= {1}\text{.}\) Then solve the system,
\(\begin{aligned} {6} \amp = a + b + c + {1}\\ {9} \amp = 8a + 4b + 2c + {1}\\ {16} \amp = 27a + 9b + 3c + {1}\\ \end{aligned}\)
to find \(a = {1}\text{,}\) \(b = {-4}\text{,}\) and \(c = {8}\text{.}\)

2.3.6.

Solution.
\(a_n = n^2 - n + 1\text{.}\)

2.3.7.

Solution.
\(a_n = n^3 + n^2 - n + 1\)

2.3.8.

Solution.
\(a_{n-1} = (n-1)^2 + 5(n-1) - 3 = {n^{2}+3n-7}\text{.}\) Thus \(a_n - a_{n-1} = {2n+4}\text{.}\) Note that this is linear (arithmetic).

2.3.9.

Solution.
\(a_{n-1} = a(n-1)^2 + b(n-1) + c = an^2 - 2an + a + bn - b + c\text{.}\) Therefore \(a_n - a_{n-1} = 2an - a + b\text{,}\) which is arithmetic. Notice that this is not quite the derivative of \(a_n\text{,}\) which would be \(2an + b\text{,}\) but it is close.

2.3.10.

Solution.
No. The sequence of differences is the same as the original sequence so no differences will be constant.

2.3.11.

Solution.
No. The sequence is geometric, and in fact has closed formula \(2\cdot 3^n\text{.}\) This is an exponential function, which is not equal to any polynomial of any degree. If the \(n\)th sequence of differences was constant, then the closed formula for the original sequence would be a degree \(n\) polynomial.

2.3.13.

Solution.
\(a_n = {\left({\frac{1}{2}}\right)n^{3}-\left({\frac{1}{2}}\right)n^{2}+3n}\text{.}\) Here we know that we are looking for a cubic because the third differences are constant. So \(a_n = an^3 + bn^2 + cn + d\text{.}\) We can work backwards to find that \(a_0 = {0}\text{,}\) so we know \(d= {0}\text{.}\) Then solve the system,
\(\begin{aligned} {3} \amp = a + b + c\\ {8} \amp = 8a + 4b + 2c\\ {18} \amp = 27a + 9b + 3c\\ \end{aligned}\)
to find \(a = {{\frac{1}{2}}}\text{,}\) \(b = {-{\frac{1}{2}}}\text{,}\) and \(c = {3}\text{.}\)

2.4 Solving Recurrence Relations

Exercises

2.4.1.

Solution.
171 and 341. \(a_n = a_{n-1} + 2a_{n-2}\) with \(a_0 = 3\) and \(a_1 = 5\text{.}\) Closed formula: \(a_n = \frac{8}{3}2^n + \frac{1}{3}(-1)^n\text{.}\) To find this solve the characteristic equation, \(x^2 - x - 2 = 0\text{,}\) to get characteristic roots \(x = 2\) and \(x=-1\text{.}\) Then solve the system
\begin{align*} 3 \amp = a + b\\ 5 \amp = 2a - b \end{align*}

2.4.3.

Solution.
\(a_n = 0 + 2^{n+1}\text{.}\) We should use telescoping or iteration here. For example, telescoping gives
\(\displaystyle{\newcommand{\amp}{\amp }\begin{aligned} a_1 - a_0 \amp = 2^1\\ a_2 - a_1 \amp = 2^2\\ a_3 - a_2 \amp = 2^3\\ \vdots\amp \vdots \\ a_n - a_{n-1} \amp = 2^n \end{aligned}}\)
which sums to \(a_n - a_0 = 2^{n+1} - 2\) (using the multiply-shift-subtract technique for the geometric series on the right-hand side). Substituting \(a_0 = 2\) and solving for \(a_n\) completes the solution.

2.4.4.

Solution.
We claim \(a_n = 4^n\) works. Plug it in: \(4^n = 3(4^{n-1}) + 4(4^{n-2})\text{.}\) This works - just simplify the right-hand side.

2.4.5.

Solution.
By the Characteristic Root Technique. \(a_n = {2^{n}+\left(-3\right)^{n}}\text{.}\)

2.4.6.

Solution.
The characteristic roots for both sequences are -2 and 7 (since the two sequence have the same recurrence relation, they have the same characteristic roots). Solving the for coefficients in each case gives the closed formulas. We have \(a_n = {\left(-2\right)^{n}+7^{n}}\) and \(b_n = {\left({\frac{1}{3}}\right)\!\left(-2\right)^{n}+\left({\frac{5}{3}}\right)\cdot 7^{n}}\text{.}\)

2.4.7.

Solution.
By the Characteristic Root Technique. \(a_n = {\left({\frac{5}{7}}\right)\!\left(-1\right)^{n}+\left({\frac{16}{7}}\right)\cdot 6^{n}}\text{.}\)

2.4.10.

Solution.
  1. \(a_n = 4a_{n-1} + 5a_{n-2}\text{.}\)
  2. 4, 21, 104, 521, 2604, 13021
  3. \(a_n = \frac{5}{6} 5^n + \frac{1}{6}(-1)^n \text{.}\)

2.4.12.

Solution.
We have characteristic polynomial \(x^2 - 2x + 1\text{,}\) which has \(x = 1\) as the only repeated root. Thus using the characteristic root technique for repeated roots, the general solution is \(a_n = a + bn\) where \(a\) and \(b\) depend on the initial conditions.
  1. \(a_n = 1 + n\text{.}\)
  2. For example, we could have \(a_0 = 21\) and \(a_1 = 22\text{.}\)
  3. For every \(x\text{.}\) Take \(a_0 = x-9\) and \(a_1 = x-8\text{.}\)

2.5 Induction

Exercises

2.5.1.

Solution.
  1. If we have a number of beans ending in a 5 and we double it, we will get a number of beans ending in a 0 (since \(5\cdot 2 = 10\) ). Then if we subtract 5, we will once again get a number of beans ending in a 5. Thus if on any day we have a number ending in a 5, the next day will also have a number ending in a 5.
  2. If you don’t start with a number of beans ending in a 5 (on day 1), the above reasoning is still correct but not helpful. For example, if you start with a number ending in a 3, the next day you will have a number ending in a 1.
  3. Part (b) is the base case and part (a) is the inductive case. If on day 1 we have a number ending in a 5 (by part (b)), then on day 2 we will also have a number ending in a 5 (by part (a)). Then by part (a) again, we will have a number ending in a 5 on day 3. By part (a) again, this means we will have a number ending in a 5 on day 4
    The proof by induction would say that on every day we will have a number ending in a 5, and this works because we can start with the base case, then use the inductive case over and over until we get up to our desired \(n\text{.}\)

2.5.2.

Solution.
Proof.
We must prove that \(1 + 2 + 2^2 + 2^3 + \cdots +2^n = 2^{n+1} - 1\) for all \(n \in \N\text{.}\) Thus let \(P(n)\) be the statement \(1 + 2 + 2^2 + \cdots + 2^n = 2^{n+1} - 1\text{.}\) We will prove that \(P(n)\) is true for all \(n \in \N\text{.}\) First we establish the base case, \(P(0)\text{,}\) which claims that \(1 = 2^{0+1} -1\text{.}\) Since \(2^1 - 1 = 2 - 1 = 1\text{,}\) we see that \(P(0)\) is true. Now for the inductive case. Assume that \(P(k)\) is true for an arbitrary \(k \in \N\text{.}\) That is, \(1 + 2 + 2^2 + \cdots + 2^k = 2^{k+1} - 1\text{.}\) We must show that \(P(k+1)\) is true (i.e., that \(1 + 2 + 2^2 + \cdots + 2^{k+1} = 2^{k+2} - 1\)). To do this, we start with the left-hand side of \(P(k+1)\) and work to the right-hand side:
\begin{align*} 1 + 2 + 2^2 + \cdots + 2^k + 2^{k+1} = \amp ~ 2^{k+1} - 1 + 2^{k+1} \amp \text{by inductive hypothesis}\\ = \amp ~2\cdot 2^{k+1} - 1 \amp\\ = \amp ~ 2^{k+2} - 1 \amp \end{align*}
Thus \(P(k+1)\) is true so by the principle of mathematical induction, \(P(n)\) is true for all \(n \in \N\text{.}\)

2.5.3.

Solution.
Proof.
Let \(P(n)\) be the statement “\(7^n - 1\) is a multiple of 6.” We will show \(P(n)\) is true for all \(n \in \N\text{.}\) First we establish the base case, \(P(0)\text{.}\) Since \(7^0 - 1 = 0\text{,}\) and \(0\) is a multiple of 6, \(P(0)\) is true. Now for the inductive case. Assume \(P(k)\) holds for an arbitrary \(k \in \N\text{.}\) That is, \(7^k - 1\) is a multiple of 6, or in other words, \(7^k - 1 = 6j\) for some integer \(j\text{.}\) Now consider \(7^{k+1} - 1\text{:}\)
\begin{align*} 7^{k+1} - 1 ~ \amp = 7^{k+1} - 7 + 6 \amp \text{by cleverness:} -1 = -7 + 6\\ \amp = 7(7^k - 1) + 6 \amp \text{factor out a 7 from the first two terms}\\ \amp = 7(6j) + 6 \amp \text{by the inductive hypothesis}\\ \amp = 6(7j + 1) \amp \text{factor out a 6} \end{align*}
Therefore \(7^{k+1} - 1\) is a multiple of 6, or in other words, \(P(k+1)\) is true. Therefore by the principle of mathematical induction, \(P(n)\) is true for all \(n \in \N\text{.}\)

2.5.4.

Solution.
Proof.
Let \(P(n)\) be the statement \(1+3 +5 + \cdots + (2n-1) = n^2\text{.}\) We will prove that \(P(n)\) is true for all \(n \ge 1\text{.}\) First the base case, \(P(1)\text{.}\) We have \(1 = 1^2\) which is true, so \(P(1)\) is established. Now the inductive case. Assume that \(P(k)\) is true for some fixed arbitrary \(k \ge 1\text{.}\) That is, \(1 + 3 + 5 + \cdots + (2k-1) = k^2\text{.}\) We will now prove that \(P(k+1)\) is also true (i.e., that \(1 + 3 + 5 + \cdots + (2k+1) = (k+1)^2\)). We start with the left-hand side of \(P(k+1)\) and work to the right-hand side:
\begin{align*} 1 + 3 + 5 + \cdots + (2k-1) + (2k+1) ~ \amp = k^2 + (2k+1) \amp \text{by ind. hyp.}\\ \amp = (k+1)^2 \amp \text{by factoring} \end{align*}
Thus \(P(k+1)\) holds, so by the principle of mathematical induction, \(P(n)\) is true for all \(n \ge 1\text{.}\)

2.5.5.

Solution.
Proof.
Let \(P(n)\) be the statement \(F_0 + F_2 + F_4 + \cdots + F_{2n} = F_{2n+1} - 1\text{.}\) We will show that \(P(n)\) is true for all \(n \ge 0\text{.}\) First the base case is easy because \(F_0 = 0\) and \(F_1 = 1\) so \(F_0 = F_1 - 1\text{.}\) Now consider the inductive case. Assume \(P(k)\) is true, that is, assume \(F_0 + F_2 + F_4 + \cdots + F_{2k} = F_{2k+1} - 1\text{.}\) To establish \(P(k+1)\) we work from left to right:
\begin{align*} F_0 + F_2 + \cdots + F_{2k} + F_{2k+2} ~ \amp = F_{2k+1} - 1 + F_{2k+2} \amp \text{by ind. hyp.}\\ \amp = F_{2k+1} + F_{2k+2} - 1 \amp\\ \amp = F_{2k+3} - 1 \amp \text{by recursive def.} \end{align*}
Therefore \(F_0 + F_2 + F_4 + \cdots + F_{2k+2} = F_{2k+3} - 1\text{,}\) which is to say \(P(k+1)\) holds. Therefore by the principle of mathematical induction, \(P(n)\) is true for all \(n \ge 0\text{.}\)

2.5.6.

Solution.
Proof.
Let \(P(n)\) be the statement \(2^n \lt n!\text{.}\) We will show \(P(n)\) is true for all \(n \ge 4\text{.}\) First, we check the base case and see that yes, \(2^4 \lt 4!\) (as \(16 \lt 24\)) so \(P(4)\) is true. Now for the inductive case. Assume \(P(k)\) is true for an arbitrary \(k \ge 4\text{.}\) That is, \(2^k \lt k!\text{.}\) Now consider \(P(k+1)\text{:}\) \(2^{k+1} \lt (k+1)!\text{.}\) To prove this, we start with the left side and work to the right side.
\begin{align*} 2^{k+1}~ \amp = 2\cdot 2^k \amp\\ \amp \lt 2\cdot k! \amp \text{by the inductive hypothesis}\\ \amp \lt (k+1) \cdot k! \amp \text{ since } k+1 \gt 2\\ \amp = (k+1)! \amp \end{align*}
Therefore \(2^{k+1} \lt (k+1)!\) so we have established \(P(k+1)\text{.}\) Thus by the principle of mathematical induction \(P(n)\) is true for all \(n \ge 4\text{.}\)

2.5.12.

Solution.
The only problem is that we never established the base case. Of course, when \(n = 0\text{,}\) \(0+3 \ne 0+7\text{.}\)

2.5.13.

Solution.
Proof.
Let \(P(n)\) be the statement that \(n + 3 \lt n + 7\text{.}\) We will prove that \(P(n)\) is true for all \(n \in \N\text{.}\) First, note that the base case holds: \(0+3 \lt 0+7\text{.}\) Now assume for induction that \(P(k)\) is true. That is, \(k+3 \lt k+7\text{.}\) We must show that \(P(k+1)\) is true. Now since \(k + 3 \lt k + 7\text{,}\) add 1 to both sides. This gives \(k + 3 + 1 \lt k + 7 + 1\text{.}\) Regrouping \((k+1) + 3 \lt (k+1) + 7\text{.}\) But this is simply \(P(k+1)\text{.}\) Thus by the principle of mathematical induction \(P(n)\) is true for all \(n \in \N\text{.}\)

2.5.14.

Solution.
The problem here is that while \(P(0)\) is true, and while \(P(k) \imp P(k+1)\) for some values of \(k\text{,}\) there is at least one value of \(k\) (namely \(k = 99\)) when that implication fails. For a valid proof by induction, \(P(k) \imp P(k+1)\) must be true for all values of \(k\) greater than or equal to the base case.

2.5.16.

Solution.
We once again failed to establish the base case: when \(n = 0\text{,}\) \(n^2 + n = 0\) which is even, not odd.

2.5.19.

Solution.
The proof will be by strong induction.
Proof.
Let \(P(n)\) be the statement “\(n\) is either a power of 2 or can be written as the sum of distinct powers of 2.” We will show that \(P(n)\) is true for all \(n \ge 1\text{.}\)
Base case: \(1 = 2^0\) is a power of 2, so \(P(1)\) is true.
Inductive case: Suppose \(P(k)\) is true for all \(k \lt n\text{.}\) Now if \(n\) is a power of 2, we are done. If not, let \(2^x\) be the largest power of 2 strictly less than \(n\text{.}\) Consider \(n - 2^x\text{,}\) which is a smaller number, in fact smaller than both \(n\) and \(2^x\text{.}\) Thus \(n-2^x\) is either a power of 2 or can be written as the sum of distinct powers of 2, but none of them are going to be \(2^x\text{,}\) so the together with \(2^x\) we have written \(n\) as the sum of distinct powers of 2.
Therefore, by the principle of (strong) mathematical induction, \(P(n)\) is true for all \(n \ge 1\text{.}\)

2.5.25.

Solution.
The idea here is that if we take the logarithm of \(a^n\text{,}\) we can increase \(n\) by 1 if we multiply by another \(a\) (inside the logarithm). This results in adding 1 more \(\log(a)\) to the total.
Proof.
Let \(P(n)\) be the statement \(\log(a^n) = n \log(a)\text{.}\) The base case, \(P(2)\) is true, because \(\log(a^2) = \log(a\cdot a) = \log(a) + \log(a) = 2\log(a)\text{,}\) by the product rule for logarithms. Now assume, for induction, that \(P(k)\) is true. That is, \(\log(a^k) = k\log(a)\text{.}\) Consider \(\log(a^{k+1})\text{.}\) We have
\begin{equation*} \log(a^{k+1}) = \log(a^k\cdot a) = \log(a^k) + \log(a) = k\log(a) + \log(a)\text{,} \end{equation*}
with the last equality due to the inductive hypothesis. But this simplifies to \((k+1) \log(a)\text{,}\) establishing \(P(k+1)\text{.}\) Therefore by the principle of mathematical induction, \(P(n)\) is true for all \(n \ge 2\text{.}\)

2.6 Chapter Summary

Chapter Review

2.6.1.

Solution.
\(\frac{1964\cdot 278}{2} = {272996}\text{.}\)

2.6.2.

Solution.
  1. \({n-0}\) terms.
  2. \(\displaystyle {12n+\left(-11\right)}\text{.}\)
  3. \(\displaystyle \frac{(12n+2)*({n-0})}{2}\text{.}\)

2.6.3.

Solution.
  1. \(2, 10, 50, 250, \ldots\) The sequence is geometric.
  2. \(\displaystyle \frac{2\cdot5^{34}-2}{4}={2.91038\times 10^{23}}\text{.}\)

2.6.5.

Solution.
\(a_n = {n^{2}+6n+1}\text{.}\) Here we know that we are looking for a quadratic because the second differences are constant. So \(a_n = an^2 + bn + c\text{.}\) We can work backwards to find that \(a_0 = {1}\text{,}\) so we know \(c= {1}\text{.}\) Then solve the system,
\begin{equation*} \begin{aligned} {8} \amp = a + b + {1}\\ {17} \amp = 4a + 2b + {1} \end{aligned} \end{equation*}
to find \(a = {1}\) and \(b = {6}\text{.}\)

2.6.6.

Solution.
  1. The sequence of partial sums will be a degree 4 polynomial (its sequence of differences will be the original sequence).
  2. The sequence of second differences will be a degree 1 polynomial - an arithmetic sequence.

2.6.7.

Solution.
  1. \(4, 6, 10, 16, 26, 42, \ldots\text{.}\)
  2. No, taking differences gives the original sequence back, so the differences will never be constant.

2.6.8.

Solution.
\(b_n = (n+3)n\text{.}\)

2.6.10.

Solution.
The sequence is \(10, 12, {200}, {1168}, {8640}, \ldots\text{.}\) It has closed formula \(a_n = {\left({\frac{58}{9}}\right)\!\left(-2\right)^{n}+\left({\frac{32}{9}}\right)\cdot 7^{n}}\text{,}\) using the characteristic root technique.

2.6.11.

Solution.
The sequence is \(1, 2, {4}, {8}, {16}, \ldots\text{.}\) It has closed formula \(a_n = {2^{n}}\text{,}\) using the characteristic root technique.

2.6.12.

Solution.
  1. On the first day, your 2 mini bunnies become 2 large bunnies. On day 2, your two large bunnies produce 4 mini bunnies. On day 3, you have 4 mini bunnies (produced by your 2 large bunnies) plus 6 large bunnies (your original 2 plus the 4 newly matured bunnies). On day 4, you will have \(12\) mini bunnies (2 for each of the 6 large bunnies) plus 10 large bunnies (your previous 6 plus the 4 newly matured). The sequence of total bunnies is \(2, 2, 6, 10, 22, 42\ldots\) starting with \(a_0 = 2\) and \(a_1 = 2\text{.}\)
  2. \(a_n = a_{n-1} + 2a_{n-2}\text{.}\) This is because the number of bunnies is equal to the number of bunnies you had the previous day (both mini and large) plus 2 times the number you had the day before that (since all bunnies you had 2 days ago are now large and producing 2 new bunnies each).
  3. Using the characteristic root technique, we find \(a_n = a2^n + b(-1)^n\text{,}\) and we can find \(a\) and \(b\) to give \(a_n = \frac{4}{3}2^n + \frac{2}{3}(-1)^n\text{.}\)

2.6.17.

Solution.
Let \(P(n)\) be the statement, “every set containing \(n\) elements has \(2^n\) different subsets.” We will show \(P(n)\) is true for all \(n \ge 1\text{.}\) Base case: Any set with 1 element \(\{a\}\) has exactly 2 subsets: the empty set and the set itself. Thus the number of subsets is \(2= 2^1\text{.}\) Thus \(P(1)\) is true. Inductive case: Suppose \(P(k)\) is true for some arbitrary \(k \ge 1\text{.}\) Thus every set containing exactly \(k\) elements has \(2^k\) different subsets. Now consider a set containing \(k+1\) elements: \(A = \{a_1, a_2, \ldots, a_k, a_{k+1}\}\text{.}\) Any subset of \(A\) must either contain \(a_{k+1}\) or not. In other words, a subset of \(A\) is just a subset of \(\{a_1, a_2,\ldots, a_k\}\) with or without \(a_{k+1}\text{.}\) Thus there are \(2^k\) subsets of \(A\) which contain \(a_{k+1}\) and another \(2^{k+1}\) subsets of \(A\) which do not contain \(a^{k+1}\text{.}\) This gives a total of \(2^k + 2^k = 2\cdot 2^k = 2^{k+1}\) subsets of \(A\text{.}\) But our choice of \(A\) was arbitrary, so this works for any subset containing \(k+1\) elements, so \(P(k+1)\) is true. Therefore, by the principle of mathematical induction, \(P(n)\) is true for all \(n \ge 1\text{.}\)

3 Symbolic Logic and Proofs

3 Symbolic Logic and Proofs
3.1 Propositional Logic

Exercises

3.1.1.

Solution.
  1. \(P\text{:}\) it’s your birthday; \(Q\text{:}\) there will be cake. \((P \vee Q) \imp Q\)
  2. Hint: you should get three T’s and one F.
  3. Only that there will be cake.
  4. It’s NOT your birthday!
  5. It’s your birthday, but the cake is a lie.

3.1.2.

Solution.
If you think about what this statement is saying, it makes sense that it is a tautology (that it is true in every case). The complete truth table is:
\(P\) \(Q\) \(P \wedge Q\) \(P \vee Q\) \((P \wedge Q) \rightarrow (P \vee Q))\)
T T T T T
T F F T T
F T F T T
F F F F T

3.1.3.

Solution.
The complete truth table is:
\(P\) \(Q\) \(\neg Q\) \(Q \rightarrow P\) \(\neg Q \vee (Q \rightarrow P))\)
T T F T T
T F T T T
F T F F F
F F T T T
If this statement is false, we must be in the third row, making \(P\) false and \(Q\) true.

3.1.4.

Solution.
The complete truth table is:
\(P\) \(Q\) \(R\) \(\neg Q\) \(R \rightarrow \neg Q\) \(P \vee (R \rightarrow \neg Q)\)
T T T F F T
T T F F T T
T F T T T T
T F F T T T
F T T F F F
F T F F T T
F F T T T T
F F F T T T

3.1.6.

Solution.
Make a truth table for each and compare. The statements are logically equivalent.

3.1.7.

Solution.
The complete truth table is:
\(P\) \(Q\) \(R\) \(P \rightarrow (Q \vee R)\) \((P \rightarrow Q) \vee (P\rightarrow R)\)
T T T T T
T T F T T
T F T T T
T F F F F
F T T T T
F T F T T
F F T T T
F F F T T
Since the two columns are identical, the statements are logically equivalent.

3.1.8.

Solution.
  1. \(P \wedge Q\text{.}\)
  2. \((\neg P \vee \neg R) \imp (Q \vee \neg R)\) or, replacing the implication with a disjunction first: \((P \wedge Q) \vee (Q \vee \neg R)\text{.}\)
  3. \((P \wedge Q) \wedge (R \wedge \neg R)\text{.}\) This is necessarily false, so it is also equivalent to \(P \wedge \neg P\text{.}\)
  4. Either Sam is a woman and Chris is a man, or Chris is a woman.

3.1.12.

Solution.
The complete truth table is:
\(P\) \(Q\) \(P \rightarrow Q\) \(\neg Q\) \(\neg P\)
T T T F F
T F F T F
F T T F T
F F T T T
There is only one row in which both premises are true (row 4). In this row, the conclusion is also true. Thus the deduction rule is valid.

3.1.13.

Solution.
The complete truth table is:
\(P\) \(Q\) \(R\) \(P \rightarrow (Q \vee R)\) \(\neg(P \rightarrow Q)\)
T T T T F
T T F T F
T F T T T
T F F F T
F T T T F
F T F T F
F F T T F
F F F T F
There is only one row in which both premises are true (row 3). In this row, the conclusion is also true, so the deduction rule is valid.

3.1.14.

Solution.
The complete truth table is:
\(P\) \(Q\) \(R\) \((P \wedge Q) \rightarrow R\) \(\neg P \vee \neg Q\) \(\neg R\)
T T T T F F
T T F F F T
T F T T T F
T F F T T T
F T T T T F
F T F T T T
F F T T T F
F F F T T T
In rows 3, 5 and 7 both of the premesis are true, but the conclusion is false. Thus the deduction rule is not valid.

3.1.16.

Solution.
  1. \(\forall x \exists y (O(x) \wedge \neg E(y))\text{.}\)
  2. \(\exists x \forall y (x \ge y \vee \forall z (x \ge z \wedge y \ge z))\text{.}\)
  3. There is a number \(n\) for which every other number is strictly greater than \(n\text{.}\)
  4. There is a number \(n\) which is not between any other two numbers.

3.1.21.

Solution.
The complete truth table is:
\(P\) \(Q\) \(R\) \(P \rightarrow Q\) \(P \wedge \neg Q\)
T T T T F
T T F T F
T F T F T
T F F F T
F T T T F
F T F T F
F F T T F
F F F T F
There is no row in which both premises are true (indeed, these are contradictory premises; the second is the negation of the first). Thus every row in which both premises are true (i.e., no row), the conclusion is also true. Therefore the deduction rule is valid. (This is an example of how everything follows from a contradiction.)

3.2 Proofs

Exercises

3.2.1.

Solution.
  1. For all integers \(a\) and \(b\text{,}\) if \(a\) or \(b\) is not even, then \(a+b\) is not even.
  2. For all integers \(a\) and \(b\text{,}\) if \(a\) and \(b\) are even, then \(a+b\) is even.
  3. There are numbers \(a\) and \(b\) such that \(a+b\) is even but \(a\) and \(b\) are not both even.
  4. False. For example, \(a = 3\) and \(b = 5\text{.}\) \(a+b = 8\text{,}\) but neither \(a\) nor \(b\) are even.
  5. False, since it is equivalent to the original statement.
  6. True. Let \(a\) and \(b\) be integers. Assume both are even. Then \(a = 2k\) and \(b = 2j\) for some integers \(k\) and \(j\text{.}\) But then \(a+b = 2k + 2j = 2(k+j)\) which is even.
  7. True, since the statement is false.

3.2.2.

Solution.
  1. Proof by contradiction. Start of proof: Assume, for the sake of contradiction, that there are integers \(x\) and \(y\) such that \(x\) is a prime greater than 5 and \(x = 6y + 3\text{.}\) End of proof: … this is a contradiction, so there are no such integers.
  2. Direct proof. Start of proof: Let \(n\) be an integer. Assume \(n\) is a multiple of 3. End of proof: Therefore \(n\) can be written as the sum of consecutive integers.
  3. Proof by contrapositive. Start of proof: Let \(a\) and \(b\) be integers. Assume that \(a\) and \(b\) are even. End of proof: Therefore \(a^2 + b^2\) is even.

3.2.3.

Solution.
  1. Direct proof.
    Proof.
    Let \(n\) be an integer. Assume \(n\) is even. Then \(n = 2k\) for some integer \(k\text{.}\) Thus \(8n = 16k = 2(8k)\text{.}\) Therefore \(8n\) is even.
  2. The converse is false. That is, there is an integer \(n\) such that \(8n\) is even but \(n\) is odd. For example, consider \(n = 3\text{.}\) Then \(8n = 24\) which is even but \(n = 3\) is odd.

3.2.4.

Solution.
  1. This is an example of the pigeonhole principle. We can prove it by contrapositive.
    Proof.
    Suppose that each number only came up 6 or fewer times. So there are at most six 1’s, six 2’s, and so on. That’s a total of 36 dice, so you must not have rolled all 40 dice.
  2. We can have 9 dice without any four matching or any four being all different: three 1’s, three 2’s, three 3’s. We will prove that whenever you roll 10 dice, you will always get four matching or all being different.
    Proof.
    Suppose you roll 10 dice, but that there are NOT four matching rolls. This means at most, there are three of any given value. If we only had three different values, that would be only 9 dice, so there must be 4 different values, giving 4 dice that are all different.

3.3 Chapter Summary

Chapter Review

3.3.1.

Solution.
\(P\) \(Q\) \(R\) \(\neg P \imp (Q \wedge R)\)
T T T T
T T F T
T F T T
T F F T
F T T T
F T F F
F F T F
F F F F

3.3.2.

Solution.
Peter is not tall and Robert is not skinny. You must be in row 6 in the truth table above.

3.3.3.

Solution.
Yes. To see this, make a truth table for each statement and compare.

3.3.4.

Solution.
Make a truth table that includes all three statements in the argument:
\(P\) \(Q\) \(R\) \(P \imp Q\) \(P \imp R\) \(P \imp (Q \wedge R)\)
T T T T T T
T T F T F F
T F T F T F
T F F F F F
F T T T T T
F T F T T T
F F T T T T
F F F T T T
Notice that in every row for which both \(P \imp Q\) and \(P \imp R\) is true, so is \(P \imp (Q \wedge R)\text{.}\) Therefore, whenever the premises of the argument are true, so is the conclusion. In other words, the deduction rule is valid.

3.3.5.

Solution.
  1. Negation: The power goes off and the food does not spoil.
    Converse: If the food spoils, then the power went off.
    Contrapositive: If the food does not spoil, then the power did not go off.
  2. Negation: The door is closed and the light is on.
    Converse: If the light is off then the door is closed.
    Contrapositive: If the light is on then the door is open.
  3. Negation: \(\exists x (x \lt 1 \wedge x^2 \ge 1)\)
    Converse: \(\forall x( x^2 \lt 1 \imp x \lt 1)\)
    Contrapositive: \(\forall x (x^2 \ge 1 \imp x \ge 1)\text{.}\)
  4. Negation: There is a natural number \(n\) which is prime but not solitary.
    Converse: For all natural numbers \(n\text{,}\) if \(n\) is solitary, then \(n\) is prime.
    Contrapositive: For all natural numbers \(n\text{,}\) if \(n\) is not solitary then \(n\) is not prime.
  5. Negation: There is a function which is differentiable and not continuous.
    Converse: For all functions \(f\text{,}\) if \(f\) is continuous then \(f\) is differentiable.
    Contrapositive: For all functions \(f\text{,}\) if \(f\) is not continuous then \(f\) is not differentiable.
  6. Negation: There are integers \(a\) and \(b\) for which \(a\cdot b\) is even but \(a\) or \(b\) is odd.
    Converse: For all integers \(a\) and \(b\text{,}\) if \(a\) and \(b\) are even then \(ab\) is even.
    Contrapositive: For all integers \(a\) and \(b\text{,}\) if \(a\) or \(b\) is odd, then \(ab\) is odd.
  7. Negation: There are integers \(x\) and \(y\) such that for every integer \(n\text{,}\) \(x \gt 0\) and \(nx \le y\text{.}\)
    Converse: For every integer \(x\) and every integer \(y\) there is an integer \(n\) such that if \(nx > y\) then \(x > 0\text{.}\)
    Contrapositive: For every integer \(x\) and every integer \(y\) there is an integer \(n\) such that if \(nx \le y\) then \(x \le 0\text{.}\)
  8. Negation: There are real numbers \(x\) and \(y\) such that \(xy = 0\) but \(x \ne 0\) and \(y \ne 0\text{.}\)
    Converse: For all real numbers \(x\) and \(y\text{,}\) if \(x = 0\) or \(y = 0\) then \(xy = 0\)
    Contrapositive: For all real numbers \(x\) and \(y\text{,}\) if \(x \ne 0\) and \(y \ne 0\) then \(xy \ne 0\text{.}\)
  9. Negation: There is at least one student in Math 228 who does not understand implications but will still pass the exam.
    Converse: For every student in Math 228, if they fail the exam, then they did not understand implications.
    Contrapositive: For every student in Math 228, if they pass the exam, then they understood implications.

3.3.6.

Solution.
  1. The statement is true. If \(n\) is an even integer less than or equal to 7, then the only way it could not be negative is if \(n\) was equal to 0, 2, 4, or 6.
  2. There is an integer \(n\) such that \(n\) is even and \(n \le 7\) but \(n\) is not negative and \(n \not\in \{0,2,4,6\}\text{.}\) This is false, since the original statement is true.
  3. For all integers \(n\text{,}\) if \(n\) is not negative and \(n \not\in\{0,2,4,6\}\) then \(n\) is odd or \(n > 7\text{.}\) This is true, since the contrapositive is equivalent to the original statement (which is true).
  4. For all integers \(n\text{,}\) if \(n\) is negative or \(n \in \{0,2,4,6\}\) then \(n\) is even and \(n \le 7\text{.}\) This is false. \(n = -3\) is a counterexample.

3.3.7.

Solution.
  1. For any number \(x\text{,}\) if it is the case that adding any number to \(x\) gives that number back, then multiplying any number by \(x\) will give 0. This is true (of the integers or the reals). The “if” part only holds if \(x = 0\text{,}\) and in that case, anything times \(x\) will be 0.
  2. The converse in words is this: for any number \(x\text{,}\) if everything times \(x\) is zero, then everything added to \(x\) gives itself. Or in symbols: \(\forall x (\forall z (x \cdot z = 0) \imp \forall y (x + y = y))\text{.}\) The converse is true: the only number which when multiplied by any other number gives 0 is \(x = 0\text{.}\) And if \(x = 0\text{,}\) then \(x + y = y\text{.}\)
  3. The contrapositive in words is: for any number \(x\text{,}\) if there is some number which when multiplied by \(x\) does not give zero, then there is some number which when added to \(x\) does not give that number. In symbols: \(\forall x (\exists z (x\cdot z \ne 0) \imp \exists y (x + y \ne y))\text{.}\) We know the contrapositive must be true because the original implication is true.
  4. The negation: there is a number \(x\) such that any number added to \(x\) gives the number back again, but there is a number you can multiply \(x\) by and not get 0. In symbols: \(\exists x (\forall y (x + y = y) \wedge \exists z (x \cdot z \ne 0))\text{.}\) Of course since the original implication is true, the negation is false.

3.3.8.

Solution.
  1. \((\neg P \vee Q) \wedge (\neg R \vee (P \wedge \neg R))\text{.}\)
  2. \(\forall x \forall y \forall z (z = x+y \wedge \forall w (x-y \ne w))\text{.}\)

3.3.9.

Solution.
  1. Direct proof.
    Proof.
    Let \(n\) be an integer. Assume \(n\) is odd. So \(n = 2k+1\) for some integer \(k\text{.}\) Then
    \begin{equation*} 7n = 7(2k+1) = 14k + 7 = 2(7k +3) + 1\text{.} \end{equation*}
    Since \(7k + 3\) is an integer, we see that \(7n\) is odd.
  2. The converse is: for all integers \(n\text{,}\) if \(7n\) is odd, then \(n\) is odd. We will prove this by contrapositive.
    Proof.
    Let \(n\) be an integer. Assume \(n\) is not odd. Then \(n = 2k\) for some integer \(k\text{.}\) So \(7n = 14k = 2(7k)\) which is to say \(7n\) is even. Therefore \(7n\) is not odd.

3.3.10.

Solution.
  1. Suppose you only had 5 coins of each denomination. This means you have 5 pennies, 5 nickels, 5 dimes and 5 quarters. This is a total of 20 coins. But you have more than 20 coins, so you must have more than 5 of at least one type.
  2. Suppose you have 22 coins, including \(2k\) nickels, \(2j\) dimes, and \(2l\) quarters (so an even number of each of these three types of coins). The number of pennies you have will then be
    \begin{equation*} 22 - 2k - 2j - 2l = 2(11-k-j-l)\text{.} \end{equation*}
    But this says that the number of pennies is also even (it is 2 times an integer). Thus we have established the contrapositive of the statement, “If you have an odd number of pennies then you have an odd number of at least one other coin type.”
  3. You need 10 coins. You could have 3 pennies, 3 nickels, and 3 dimes. The 10th coin must either be a quarter, giving you 4 coins that are all different, or else a 4th penny, nickel or dime. To prove this, assume you don’t have 4 coins that are all the same or all different. In particular, this says that you only have 3 coin types, and each of those types can only contain 3 coins, for a total of 9 coins, which is less than 10.

4 Graph Theory

4 Graph Theory
4.1 Definitions

Exercises

4.1.1.

Solution.
This is asking for the number of edges in \(K_{10}\text{.}\) Each vertex (person) has degree (shook hands with) 9 (people). So the sum of the degrees is \(90\text{.}\) However, the degrees count each edge (handshake) twice, so there are 45 edges in the graph. That is how many handshakes took place.

4.1.2.

Solution.
It is possible for everyone to be friends with exactly 2 people. You could arrange the 5 people in a circle and say that everyone is friends with the two people on either side of them (so you get the graph \(C_5\)). However, it is not possible for everyone to be friends with 3 people. That would lead to a graph with an odd number of odd degree vertices which is impossible since the sum of the degrees must be even.

4.1.4.

Solution.
The graphs are not equal. For example, graph 1 has an edge \(\{a,b\}\) but graph 2 does not have that edge. They are isomorphic. One possible isomorphism is \(f:G_1 \to G_2\) defined by \(f(a) = d\text{,}\) \(f(b) = c\text{,}\) \(f(c) = e\text{,}\) \(f(d) = b\text{,}\) \(f(e) = a\text{.}\)

4.1.9.

Solution.
  1. For example:
    A graph consisting of a vertex with three edges connecting it to three vertices in a row above it.
    A graph consisting of four vertices arranged in a V.  The left point of the V connects to the bottom corner of the V.  That vertex is connected to a vertex half way up the right side of the V, which is then connected to the vertex at the right point of the V.
  2. This is not possible if we require the graphs to be connected. If not, we could take \(C_8\) as one graph and two copies of \(C_4\) as the other.
  3. Not possible. If you have a graph with 5 vertices all of degree 4, then every vertex must be adjacent to every other vertex. This is the graph \(K_5\text{.}\)
  4. This is not possible. In fact, there is not even one graph with this property (such a graph would have \(5\cdot 3/2 = 7.5\) edges).

4.1.10.

Solution.
  1. False.
  2. True.
  3. True.
  4. False.

4.2 Trees

Exercises

4.2.1.

Solution.
  1. This is not a tree since it contains a cycle. Note also that there are too many edges to be a tree, since we know that all trees with \(v\) vertices have \(v-1\) edges.
  2. This is a tree since it is connected and contains no cycles (which you can see by drawing the graph). All paths are trees.
  3. This is a tree since it is connected and contains no cycles (draw the graph). All stars are trees.
  4. This is a not a tree since it is not connected. Note that there are not enough edges to be a tree.

4.2.2.

Solution.
  1. This must be the degree sequence for a tree. This is because the vertex of degree 4 must be adjacent to the four vertices of degree 1 (there are no other vertices for it to be adjacent to), and thus we get a star.
  2. This cannot be a tree. Each degree 3 vertex is adjacent to all but one of the vertices in the graph. Thus each must be adjacent to one of the degree 1 vertices (and not the other). That means both degree 3 vertices are adjacent to the degree 2 vertex, and to each other, so that means there is a cycle.
    Alternatively, count how many edges there are!
  3. This might or might not be a tree. The length 4 path has this degree sequence (this is a tree), but so does the union of a 3-cycle and a length 1 path (which is not connected, so not a tree).
  4. This cannot be a tree. The sum of the degrees is 28, so there are 14 edges. But there are 14 vertices as well, so we don’t have \(v = e+1\text{,}\) meaning this cannot be a tree.

4.2.6.

Solution.
Yes. We will prove the contrapositive. Assume \(G\) does not contain a cycle. Then \(G\) is a tree, so would have \(v = e+1\text{,}\) contrary to stipulation.

4.2.12.

Solution.
  1. No, although there are graphs for which this is true. For example, \(K_4\) has a spanning tree that is a path (of three edges) and also a spanning tree that is a star (with center vertex of degree 3).
  2. Yes. For a fixed graph, we have a fixed number \(v\) of vertices. Any spanning tree of the graph will also have \(v\) vertices, and since it is a tree, must have \(v-1\) edges.
  3. No, although there are graph for which this is true (note that if all spanning trees are isomorphic, then all spanning trees will have the same number of leaves). Again, \(K_4\) is a counterexample. One spanning tree is a path, with only two leaves, another spanning tree is a star with 3 leaves.

4.3 Planar Graphs

Exercises

4.3.1.

Solution.
No. A (connected) planar graph must satisfy Euler’s formula: \(v - e + f = 2\text{.}\) Here \(v - e + f = 6 - 10 + 5 = 1\text{.}\)

4.3.2.

Solution.
\(G\) has 10 edges, since \(10 = \frac{2+2+3+4+4+5}{2}\text{.}\) It could be planar, and then it would have 6 faces, using Euler’s formula: \(6-10+f = 2\) means \(f = 6\text{.}\) To make sure that it is actually planar though, we would need to draw a graph with those vertex degrees without edges crossing. This can be done by trial and error (and is possible).

4.3.6.

Solution.
Say the last polyhedron has \(n\) edges, and also \(n\) vertices. The total number of edges the polyhedron has then is \((7 \cdot 3 + 4 \cdot 4 + n)/2 = (37 + n)/2\text{.}\) In particular, we know the last face must have an odd number of edges. We also have that \(v = 11 \text{.}\) By Euler’s formula, we have \(11 - (37+n)/2 + 12 = 2\text{,}\) and solving for \(n\) we get \(n = 5\text{,}\) so the last face is a pentagon.

4.3.8.

Solution.
Proof.
Let \(P(n)\) be the statement, “every connected planar graph containing \(n\) edges satisfies \(v - n + f = 2\text{.}\)” We will show \(P(n)\) is true for all \(n \ge 0\text{.}\)
Base case: there is only one graph with zero edges, namely a single isolated vertex. In this case \(v = 1\text{,}\) \(f = 1\) and \(e = 0\text{,}\) so Euler’s formula holds.
Inductive case: Suppose \(P(k)\) is true for some arbitrary \(k \ge 0\text{.}\) Now consider an arbitrary graph containing \(k+1\) edges (and \(v\) vertices and \(f\) faces). No matter what this graph looks like, we can remove a single edge to get a graph with \(k\) edges which we can apply the inductive hypothesis to.
There are two cases: either the graph contains a cycle or it does not. If the graph contains a cycle, then pick an edge that is part of this cycle, and remove it. This will not disconnect the graph, and will decrease the number of faces by 1 (since the edge was bordering two distinct faces). So by the inductive hypothesis we will have \(v - k + f-1 = 2\text{.}\) Adding the edge back will give \(v - (k+1) + f = 2\) as needed.
If the graph does not contain a cycle, then it is a tree, so has a vertex of degree 1. Then we can pick the edge to remove to be incident to such a degree 1 vertex. In this case, also remove that vertex. The smaller graph will now satisfy \(v-1 - k + f = 2\) by the induction hypothesis (removing the edge and vertex did not reduce the number of faces). Adding the edge and vertex back gives \(v - (k+1) + f = 2\text{,}\) as required.
Therefore, by the principle of mathematical induction, Euler’s formula holds for all planar graphs.

4.3.12.

Solution.
Proof.
We know in any planar graph the number of faces \(f\) satisfies \(3f \le 2e\) since each face is bounded by at least three edges, but each edge borders two faces. Combine this with Euler’s formula:
\begin{equation*} v - e + f = 2 \end{equation*}
\begin{equation*} v - e + \frac{2e}{3} \ge 2 \end{equation*}
\begin{equation*} 3v - e \ge 6 \end{equation*}
\begin{equation*} 3v - 6 \ge e\text{.} \end{equation*}

4.4 Coloring

Exercises

4.4.1.

Solution.
2, since the graph is bipartite. One color for the top set of vertices, another color for the bottom set of vertices.

4.4.2.

Solution.
For example, \(K_6\text{.}\) If the chromatic number is 6, then the graph is not planar; the 4-color theorem states that all planar graphs can be colored with 4 or fewer colors.

4.4.3.

Solution.
The chromatic numbers are 2, 3, 4, 5, and 3 respectively from left to right.

4.4.5.

Solution.
The cube can be represented as a planar graph and colored with two colors as follows:
Eight vertices forming a inner and outer square (with edges forming the sides of each square), with edges connecting each inner vertex to its closest outer vertex neighbor.  The outer vertices are labeled R, B, R, B (starting at the top left and moving clockwise).  The inner vertices are labeled B, R, B, R (starting at the top left and moving clockwise).
Since it would be impossible to color the vertices with a single color, we see that the cube has chromatic number 2 (it is bipartite).

4.4.9.

Solution.
The wheel graph below has this property. The outside of the wheel forms an odd cycle, so requires 3 colors, the center of the wheel must be different than all the outside vertices.
Five vertices in a pentagon with a sixth vertex in the center.  Edges form the outside of the pentagon, and the center vertex is adjacent to each outside vertex.

4.4.12.

Solution.
If we drew a graph with each letter representing a vertex, and each edge connecting two letters that were consecutive in the alphabet, we would have a graph containing two vertices of degree 1 (A and Z) and the remaining 24 vertices all of degree 2 (for example, \(D\) would be adjacent to both \(C\) and \(E\)). By Brooks’ theorem, this graph has chromatic number at most 2, as that is the maximal degree in the graph and the graph is not a complete graph or odd cycle. Thus only two boxes are needed.

4.4.13.

Solution.

4.5 Euler Paths and Circuits

Exercises

4.5.1.

Solution.
This is a question about finding Euler paths. Draw a graph with a vertex in each state, and connect vertices if their states share a border. Exactly two vertices will have odd degree: the vertices for Nevada and Utah. Thus you must start your road trip at in one of those states and end it in the other.

4.5.2.

Solution.
  1. \(K_4\) does not have an Euler path or circuit.
  2. \(K_5\) has an Euler circuit (so also an Euler path).
  3. \(K_{5,7}\) does not have an Euler path or circuit.
  4. \(K_{2,7}\) has an Euler path but not an Euler circuit.
  5. \(C_7\) has an Euler circuit (it is a circuit graph!)
  6. \(P_7\) has an Euler path but no Euler circuit.

4.5.8.

Solution.
If we build one bridge, we can have an Euler path. Two bridges must be built for an Euler circuit.
Three dots aligned in a vertical column left of a single dot on the right.  Lines connect the dot on the right to each dot on the left.  Among the dots on the left, two arced lines connect the bottom dot to the center dot, and two more connect the center dot to the top dot.  An additional dashed edge connects the right dot to the top dot and another dashed edge connects the bottom dot to the middle dot in the vertical column.

4.6 Matching in Bipartite Graphs

Exercises

4.6.1.

Solution.
The first and third graphs have a matching, shown in bold (there are other matchings as well). The middle graph does not have a matching. If you look at the three circled vertices, you see that they only have two neighbors, which violates the matching condition \(\card{N(S)} \ge \card{S}\) (the three circled vertices form the set \(S\)).
A bipartite graph with six vertices, in two sets of three.  If we call the top vertices a,b,c, and the bottom vertices 1, 2, 3 (left to right), then the graph has the following edges: (a,1), (a,2), (b,1), (b,3), (c,1), (c,3).  The edges (a,2), (b,3), and (c,1) are highlighted bold.
A bipartite graph with eight vertices, in two sets of four.  If we call the top vertices a,b,c,d and the bottom vertices 1, 2, 3,4 (left to right), then the graph has the following edges: (a,1), (a,3), (a,4) (b,2), (c,1), (c,2), (c,3), (c,4), (d,2).  The vertices 1, 3, and 4 are circled.
A bipartite graph with ten vertices, in two sets of five.  If we call the top vertices a,b,c,d,e and the bottom vertices 1, 2, 3,4,5 (left to right), then the graph has the following edges: (a,1), (a,2), (a,3), (b,1), (b,3), (c,2), (c,4), (d,3), (d,5), (e,3), (e,4), (e,5).  Of these, the following edges are highlighted bold: (a,1), (b,3), (c,2), (d,5), (e,4).

4.7 Chapter Summary

Chapter Review

4.7.1.

Solution.
The first and the third graphs are the same (try dragging vertices around to make the pictures match up), but the middle graph is different (which you can see, for example, by noting that the middle graph has only one vertex of degree 2, while the others have two such vertices).

4.7.2.

Solution.
The first (and third) graphs contain an Euler path. All the graphs are planar.

4.7.3.

Solution.
For example, \(K_5\text{.}\)

4.7.4.

Solution.
For example, \(K_{3,3}\text{.}\)

4.7.5.

Solution.
  1. Yes, the graphs are isomorphic, which you can see by drawing them. One isomorphism is:
    \begin{equation*} f = \begin{pmatrix} a \amp b \amp c \amp d \amp e \amp f \amp g \\ u \amp z \amp v \amp x \amp w \amp y \amp t \end{pmatrix}\text{.} \end{equation*}
  2. This is easy to do if you draw the picture. Here is such a graph:
    A tree with a bottom vertex adjacent to each of three vertices in a row above it.  Each of these is adjacent to another vertex directly above them.
    Any labeling of this graph will be not isomorphic to \(G\text{.}\) For example, we could take \(V'' = \{a,b,c,d,e,f,g\}\) and \(E'' = \{ab, ac, ad, be, cf, dg\} \text{.}\)
  3. The degree sequence for \(G\) is \((3, 3, 2, 1, 1, 1, 1)\text{.}\)
  4. In general this should be possible: the degree sequence does not determine the graph’s isomorphism class. However, in this case, I was almost certain this was not possible. That is, until I stumbled up this:
    A tree with a center bottom vertex adjacent to two vertices above it.  Each of these are adjacent to two vertices above them.
  5. \(G\) is a tree (there are no cycles) and as such also bipartite.
  6. Yes, all trees are planar. You can draw them in the plane without edges crossing.
  7. The chromatic number of \(G\) is 2. It shouldn’t be hard to give a 2-coloring (for example, color \(a, d, e, g\) red and \(b, c, f\) blue), but we know that all bipartite graphs have chromatic number 2.
  8. It is clear from the drawing that there is no Euler path, let alone an Euler circuit. Also, since there are more than 2 vertices of odd degree, we know for sure there is no Euler path.

4.7.6.

Solution.
Yes. According to Euler’s formula it would have 2 faces. It does. The only such graph is \(C_{10}\text{.}\)

4.7.7.

Solution.
  1. Only if \(n \ge 6\) and is even.
  2. None.
  3. 12. Such a graph would have \(\frac{5n}{2}\) edges. If the graph is planar, then \(n - \frac{5n}{2} + f = 2\) so there would be \(\frac{4+3n}{2}\) faces. Also, we must have \(3f \le 2e\text{,}\) since the graph is simple. So we must have \(3\left(\frac{4 + 3n}{2}\right) \le 5n\text{.}\) Solving for \(n\) gives \(n \ge 12\text{.}\)

4.7.8.

Solution.
  1. There were 24 couples: 6 choices for the girl and 4 choices for the boy.
  2. There were 45 couples: \({10 \choose 2}\) since we must choose two of the 10 people to dance together.
  3. For part (a), we are counting the number of edges in \(K_{4,6}\text{.}\) In part (b) we count the edges of \(K_{10}\text{.}\)

4.7.9.

Solution.
Yes, as long as \(n\) is even. If \(n\) were odd, then corresponding graph would have an odd number of odd degree vertices, which is impossible.

4.7.10.

Solution.
  1. No. The 9 triangles each contribute 3 edges, and the 6 pentagons contribute 5 edges. This gives a total of 57, which is exactly twice the number of edges, since each edge borders exactly 2 faces. But 57 is odd, so this is impossible.
  2. Now adding up all the edges of all the 16 polygons gives a total of 64, meaning there would be 32 edges in the polyhedron. We can then use Euler’s formula \(v - e + f = 2\) to deduce that there must be 18 vertices.
  3. If you add up all the vertices from each polygon separately, we get a total of 64. This is not divisible by 3, so it cannot be that each vertex belongs to exactly 3 faces. Could they all belong to 4 faces? That would mean there were \(64/4 = 16\) vertices, but we know from Euler’s formula that there must be 18 vertices. We can write \(64 = 3x + 4y\) and solve for \(x\) and \(y\) (as integers). We get that there must be 10 vertices with degree 4 and 8 with degree 3. (Note the number of faces joined at a vertex is equal to its degree in graph theoretic terms.)

4.7.11.

Solution.
No. Every polyhedron can be represented as a planar graph, and the Four Color Theorem says that every planar graph has chromatic number at most 4.

4.7.12.

Solution.
\(K_{n,n}\) has \(n^2\) edges. The graph will have an Euler circuit when \(n\) is even. The graph will be planar only when \(n \lt 3\text{.}\)

4.7.13.

Solution.
\(G\) has 8 edges (since the sum of the degrees is 16). If \(G\) is planar, then it will have 4 faces (since \(6 - 8 + 4 = 2\)). \(G\) does not have an Euler path since there are more than 2 vertices of odd degree.

4.7.14.

Solution.
\(7\) colors. Thus \(K_7\) is not planar (by the contrapositive of the Four Color Theorem).

4.7.15.

Solution.
The chromatic number of \(K_{3,4}\) is 2, since the graph is bipartite. You cannot say whether the graph is planar based on this coloring (the converse of the Four Color Theorem is not true). In fact, the graph is not planar, since it contains \(K_{3,3}\) as a subgraph.

4.7.16.

Solution.
We have that \(K_{3,4}\) has 7 vertices and 12 edges (each vertex in the group of 3 has degree 4). Then by Euler’s formula we have that \(7 - 12 + f = 2\) so if the graph were planar, it would have \(f = 7\) faces. However, since the girth of the graph is 4 (there are no cycles of length 3) we get that \(4f \le 2e\text{.}\) But this would mean that \(28 \le 24\text{,}\) a contradiction.

4.7.17.

Solution.
For all these questions, we are really coloring the vertices of a graph. You get the graph by first drawing a planar representation of the polyhedron and then taking its planar dual: put a vertex in the center of each face (including the outside) and connect two vertices if their faces share an edge.
  1. Since the planar dual of a dodecahedron contains a 5-wheel, it’s chromatic number is at least 4. Alternatively, suppose you could color the faces using 3 colors without any two adjacent faces colored the same. Take any face and color it blue. The 5 pentagons bordering this blue pentagon cannot be colored blue. Color the first one red. Its two neighbors (adjacent to the blue pentagon) get colored green. The remaining 2 cannot be blue or green, but also cannot both be red since they are adjacent to each other. Thus a 4th color is needed.
  2. The planar dual of the dodecahedron is itself a planar graph. Thus by the 4-color theorem, it can be colored using only 4 colors without two adjacent vertices (corresponding to the faces of the polyhedron) being colored identically.
  3. The cube can be properly 3-colored. Color the “top” and “bottom” red, the “front” and “back” blue, and the “left” and “right” green.

4.7.18.

Solution.
  1. False. To prove this, we can give an example of a pair of graphs with the same chromatic number that are not isomorphic. For example, \(K_{3,3}\) and \(K_{3,4}\) both have chromatic number 2, but are not isomorphic.
  2. False. The previous example does not work, but you can easily draw two trees that have the same number of vertices and edges but are not isomorphic. Since all trees have chromatic number 2, this is a counterexample.
  3. True. If there is an isomorphism from \(G_1\) to \(G_2\text{,}\) then we have a bijection that tells us how to match up vertices between the graph. Any proper vertex coloring of \(G_1\) will tell us how to properly color \(G_2\text{,}\) simply by coloring \(f(v_i)\) the same color as \(v_i\text{,}\) for each vertex \(v_i \in V\text{.}\) That is, color the vertices in \(G_2\) exactly how you color the corresponding vertices in \(G_1\text{.}\) Similarly, any proper vertex coloring of \(G_2\) corresponds to a proper vertex coloring of \(G_1\text{.}\) Thus the smallest number of colors needed to properly color \(G_1\) cannot be smaller than the smallest number of colors needed to properly color \(G_2\text{,}\) and vice-versa, so the chromatic numbers must be equal.

4.7.19.

Solution.
\(G\) has \(13\) edges, since we need \(7 - e + 8 = 2\text{.}\)

4.7.20.

Solution.
  1. The graph does have an Euler path, but not an Euler circuit. There are exactly two vertices with odd degree. The path starts at one and ends at the other.
  2. The graph is planar. Even though as it is drawn edges cross, it is easy to redraw it without edges crossing.
  3. The graph is not bipartite (there is an odd cycle), nor complete.
  4. The chromatic number of the graph is 3.

4.7.21.

Solution.
  1. False. For example, \(K_{3,3}\) is not planar.
  2. True. The graph is bipartite so it is possible to divide the vertices into two groups with no edges between vertices in the same group. Thus we can color all the vertices of one group red and the other group blue.
  3. False. \(K_{3,3}\) has 6 vertices with degree 3, so contains no Euler path.
  4. False. \(K_{3,3}\) again.
  5. False. The sum of the degrees of all vertices is even for all graphs so this property does not imply that the graph is bipartite.

4.7.22.

Solution.
  1. If a graph has an Euler path, then it is planar.
  2. If a graph does not have an Euler path, then it is not planar.
  3. There is a graph which is planar and does not have an Euler path.
  4. Yes. In fact, in this case it is because the original statement is false.
  5. False. \(K_4\) is planar but does not have an Euler path.
  6. False. \(K_5\) has an Euler path but is not planar.

5 Additional Topics

5 Additional Topics
5.1 Generating Functions

Exercises

5.1.1.

Solution.
  1. \(\dfrac{4}{1-x}\text{.}\)
  2. \(\dfrac{2}{(1-x)^2}\text{.}\)
  3. \(\dfrac{2x^3}{(1-x)^2}\text{.}\)
  4. \(\dfrac{1}{1-5x}\text{.}\)
  5. \(\dfrac{1}{1+3x}\text{.}\)
  6. \(\dfrac{1}{1-5x^2}\text{.}\)
  7. \(\dfrac{x}{(1-x^3)^2}\text{.}\)

5.1.2.

Solution.
  1. \(0, 4, 4, 4, 4, 4, \ldots\text{.}\)
  2. \(1, 4, 16, 64, 256, \ldots\text{.}\)
  3. \(0, 1, -1, 1, -1, 1, -1, \ldots\text{.}\)
  4. \(0, 3, -6, 9, -12, 15, -18, \ldots\text{.}\)
  5. \(1, 3, 6, 9, 12, 15, \ldots\text{.}\)

5.1.4.

Solution.
Call the generating function \(A\text{.}\) Compute \(A - xA = 4 + x + 2x^2 + 3x^3 + 4x^4 + \cdots\text{.}\) Thus \(A - xA = 4 + \dfrac{x}{(1-x)^2}\text{.}\) Solving for \(A\) gives \(\d\frac{4}{1-x} + \frac{x}{(1-x)^3}\text{.}\)

5.1.5.

Solution.
\(\dfrac{1+2x}{1-3x + x^2}\text{.}\)

5.1.6.

Solution.
Compute \(A - xA - x^2A\) and the solve for \(A\text{.}\) The generating function will be \(\dfrac{x}{1-x-x^2}\text{.}\)

5.1.7.

Solution.
\(\dfrac{x}{(1-x)(1-x-x^2)}\text{.}\)

5.1.8.

Solution.
\(\dfrac{2}{1-5x} + \dfrac{7}{1+3x}\text{.}\)

5.1.9.

Solution.
\(a_n = 3\cdot 4^{n-1} + 1\text{.}\)

5.1.12.

Solution.
  1. \(\frac{1}{(1-x^2)^2}\text{.}\)
  2. \(\frac{1}{(1+x)^2}\text{.}\)
  3. \(\frac{3x}{(1-x)^2}\text{.}\)
  4. \(\frac{3x}{(1-x)^3}\text{.}\) (partial sums).

5.1.13.

Solution.
  1. \(0,0,1,1,2,3,5,8, \ldots\text{.}\)
  2. \(1, 0, 1, 0, 2, 0, 3, 0, 5, 0, 8, 0, \ldots\text{.}\)
  3. \(1, 3, 18, 81, 405, \ldots\text{.}\)
  4. \(1, 2, 4, 7, 12, 20, \ldots\text{.}\)

5.1.15.

Solution.
\(\frac{x^3}{(1-x)^2} + \frac{1}{1-x}\text{.}\)

5.2 Introduction to Number Theory

Exercises

5.2.1.

Solution.
Proof.
Suppose \(a \mid b\text{.}\) Then \(b\) is a multiple of \(a\text{,}\) or in other words, \(b = ak\) for some \(k\text{.}\) But then \(bc = akc\text{,}\) and since \(kc\) is an integer, this says \(bc\) is a multiple of \(a\text{.}\) In other words, \(a \mid bc\text{.}\)

5.2.3.

Solution.
\(\{\ldots, -8, -4, 0, 4, 8, 12, \ldots\}\text{,}\) \(\{\ldots, -7, -3, 1, 5, 9, 13, \ldots\}\text{,}\)
\(\{\ldots, -6, -2, 2, 6, 10, 14, \ldots\}\text{,}\) and \(\{\ldots, -5, -1, 3, 7, 11, 15, \ldots\}\text{.}\)

5.2.5.

Solution.
Proof.
Assume \(a \equiv b \pmod n\) and \(c \equiv d \pmod n\text{.}\) This means \(a = b + kn\) and \(c = d + jn\) for some integers \(k\) and \(j\text{.}\) Consider \(a-c\text{.}\) We have:
\begin{equation*} a-c = b+kn - (d+jn) = b-d + (k-j)n\text{.} \end{equation*}
In other words, \(a-c\) is \(b-d\) more than some multiple of \(n\text{,}\) so \(a-c \equiv b-d \pmod n\text{.}\)

5.2.6.

Solution.
  1. \(3^{456} \equiv 1^{456} = 1 \pmod 2\text{.}\)
  2. \(3^{456} = 9^{228} \equiv (-1)^{228} = 1 \pmod{5}\text{.}\)
  3. \(3^{456} = 9^{228} \equiv 2^{228} = 8^{76} \equiv 1^{76} = 1 \pmod 7\text{.}\)
  4. \(3^{456} = 9^{228} \equiv 0^{228} = 0 \pmod{9}\text{.}\)

5.2.8.

Solution.
For all of these, just plug in all integers between 0 and the modulus to see which, if any, work.
  1. No solutions.
  2. \(x = 2\text{,}\) \(x = 5\text{,}\) \(x = 8\text{.}\)
  3. No solutions.

5.2.10.

Solution.
\(x = 5+22k\) for \(k \in \Z\text{.}\)

5.2.12.

Solution.
\(x = 6 + 15k\) for \(k \in \Z\text{.}\)

5.2.14.

Solution.
We must solve \(7x + 5 \equiv 2 \pmod{11}\text{.}\) This gives \(x \equiv 9 \pmod{11}\text{.}\) In general, \(x = 9 + 11k\text{,}\) but when you divide any such \(x\) by 11, the remainder will be 9.

5.2.15.

Solution.
Divide through by 2: \(3x + 5y = 16\text{.}\) Convert to a congruence, modulo 3: \(5y \equiv 16 \pmod 3\text{,}\) which reduces to \(2y \equiv 1 \pmod 3\text{.}\) So \(y \equiv 2 \pmod 3\) or \(y = 2 + 3k\text{.}\) Plug this back into \(3x + 5y = 16\) and solve for \(x\text{,}\) to get \(x = 2-5k\text{.}\) So the general solution is \(x = 2-5k\) and \(y = 2+3k\) for \(k \in \Z\text{.}\)