- Answer the problems on the exam pages.
- There are four problems for 100 total points. Actual scale was A = 90, C = 60.
- If you need extra space use the back of a page.
- No books, notes, calculators, or collaboration.

Q1: 20 points Q2: 15 points Q3: 20 points Q4: 20 points Q5: 25 points Total: 100 points

Question text is in black, solutions in blue.

- (a) the
**Pigeonhole Principle**The Pigeonhole Principle says that if a set of mn + 1 or more items is divided into n groups, at least one group has at least m + 1 items.

- (b) an
**odd number**An odd number is an integer that can be written as 2k + 1, where k is another integer.

- (c) the
**Division Theorem**The Division Theorem says that if n is an integer and m a positive integer, there exist integers q and r such that n = qm + r and 0 ≤ r < m.

- (d) the
**mod**operationThe mod operation, written "n mod m" in the textbook but (mostly) written "n % m" in Java, returns the number r from the Division Theorem above. It returns the remainder when n is divided by m. (When n is negative, the textbook's mod operation returns r such that 0 ≤ r < m, while Java's % operation returns a negative number.)

- (e) a
**perfect square**A perfect square is an integer that can be written as k

^{2}for some integer k.

- (a) The binary representation of the decimal number 36 is
100010.
FALSE. The correct binary for 36 is 100100.

- (b) If S is a set of eleven different positive integers,
there
exist two elements x and y of S, with x ≠ y, such that x and
y have the same last digit in decimal notation.
TRUE. If we divide the 11 numbers into 10 groups based on their last digit, the Pigeonhole Principle says that at least one group must have at least two elements.

- (c) The sum of any two rational numbers is rational.
TRUE. If x and y are arbitrary rational numbers, then they can be written as x = a/b and y = c/d, where a and c are integers and b and d are nonzero integers. Then x + y = (ad + bc)/bd, which is an integer divided by a nonzero integer and thus a rational number.

- (d) Every number that is divisible by 6 is also
divisible by 12.
FALSE. The number 6 is divisible by 6 but not by 12. The converse of this statement is true.

- (e) If n is an odd number, then (n-3)
^{3}+ 6 must be an even number.TRUE. If n is odd, then n - 3 is even, its square is also even, and we get another even number when we add the even number 6 to it.

Following the hint, we write n as 4q + r and consider the four cases for the four possible values of r.

- If n = 4q, it is divisible by 4 and we have nothing to prove.
- If n = 4q + 1, n
^{3}+ 2 = 64q^{3}+ 48q^{2}+ 12q + 3, which is not divisible by 4. - If n = 4q + 2, n
^{3}+ 2 = 64q^{3}+ 96q^{2}+ 48q + 10, which is not divisible by 4. - If n = 4q + 3, n
^{3}+ 2 = 64q^{3}+ 144q^{2}+ 108q + 29, which is not divisible by 4.

Our P(n) is the statement "a_{n} = n^{3} + 2".

Our base case P(1) = "a_{1} = 1^{3} + 2",
which is true because a_{1} is defined to be 3 and the
right-hand side evaluates to 3.

For the inductive step, we assume a_{n-1} =
(n-1)^{2} + 2 and try to prove that a_{n} =
n^{3} + 2.

Using the rule for the sequence, a_{n} is equal to
a_{n-1} + 3n^{2} - 3n + 1 which is equal to
(n-1)^{3} + 2 + 3n^{2} - 3n + 1. Expanding
the first term, this is n^{3} - 3n^{2} + 3n - 1 + 2
+ 3n^{2} - 3n + 1, which simplifies to n^{3} + 2.

We have completed the base case and the inductive step, and thus proved that P(n) is true for all positive integers n.

- (a, 5)
Compute T
_{k}for all k such that 1 ≤ k ≤ 7.T

_{1}, T_{2}, and T_{3}are all 1 as given. T_{4}= 1 + 1 + 1 = 3, T_{5}= 1 + 1 + 3 = 5, T_{6}= 1 + 3 + 5 = 9, and T_{7}= 3 + 5 + 9 = 17. - (b, 20) Prove by induction that for all positive
integers n, T(n) is odd. You will need separate base cases
for n = 1, n = 2, and n = 3.
Our statement P(n) is "T

_{n}is odd".For the three base cases, we just need to observe that T

_{1}, T_{2}, and T_{3}are each odd numbers since they are each 1.For the inductive case, we assume that P(i) is true for all i with 1 ≤ i ≤ n - 1 and use that assumption to prove P(n).

If n > 3, then n - 1, n - 2, and n - 3 are each positive integers and we may assume that T

_{n-1}, T_{n-2}, and T_{n-3}are each odd numbers. If we write them as 2a + 1, 2b + 1, and 2c + 1 respectively, we can see that T_{n}= 2(a + b + c) + 3 and is thus an odd number itself.Some people said that each of the three odd numbers was equal to the same number 2k + 1, whereas all we may assume about them is that each is odd.

One person had an interesting alternate approach, expanding T

_{n-1}to get that T_{n}= (T_{2}+ T_{3}+ T_{4}) + T_{2}+ T_{3}, which is 2(T_{2}+ T_{3}) + T_{4}and thus a multiple of two plus a number assumed to be odd, and hence an odd number. This is a correct proof except for one problem. It asssumes that T_{n-4}is odd, which we only know if n - 4 is a positive integer, which is only true for n ≥ 5. Since we have only assumed that n ≥ 4, to use this approach we have to deal with the case of n = 4 separately, referring to part (a) and observing that 3 is odd.

Last modified 25 October 2015