- Answer the problems on the exam pages.
- There are four problems for 100 total points. Scale will be determined after the exam but a good guess is A = 90, C = 60.
- If you need extra space use the back of a page.
- No books, notes, calculators, or collaboration.

Question text is in black, solutions in blue.

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

- (a) for x to be a
**multiple**of yAn integer x is a multiple of y if it equals yz for some integer z.

- (b) a
**proof by contradiction**A proof by contradiction is where you prove a proposition p by first assuming "not p", then using that and other true facts and valid proof methods to derive a contradiction. You have then proved "not p → 0", which is equivalent to p.

- (c) a
**rational number**A rational number is a real number that can be written in the form x/y, where x and y are integers and y ≠ 0.

- (d) the
**base case**of a proof by inductionWhen we use induction to prove a statement P(n) for all positive integers n, the base case is to prove the proposition P(1).

- (e) a
**predicate on the positive integers**A predicate on the positive integers is some statement that contains one free variable of type "positive integer". If P(x) is such a statement, then P(1), P(2), P(3), etc. are propositions obtained by substituting each number for n in the definition of P(n).

- (a) 91 is not divisible by 7.
FALSE. Since 91 = 7 times 13, 91 is divisible by 7.

- (b) (31 mod 6) = (25 mod 4) (Remember that E&C's "mod"
is the same as Java's "%" on non-negative integers.)
TRUE. Both divisions have remainder 1.

- (c) The binary representation of the decimal number "19"
is "10101".
FALSE. 10101 is the binary for 16 + 4 + 1 = 21.

- (d) Every perfect square can be written as either "4k" or "4k+1"
for some integer k.
TRUE. If n = 2m, then n

^{2}= 4m^{2}which is divisible by 4. If n = 2m + 1, then n^{2}= 4m^{2}+ 4m + 1 which is a multiple of 4, plus 1. By the Division Theorem these are the only two possible cases. - (e) The square of every irrational number is irrational.
FALSE. We proved in lecture that the square root of 2 is irrational. So it is an irrational number whose square is rational.

We will show that if n is any integer, then n^{2} is not of
the form 7k + 5 because it has a remainder mod 7 of other than
5.
Any integer n can be written as 7q + r where r is 0, 1, 2, 3, 4,
5, or 6. If r = 0, n^{2} = 49q^{2} which is a
multiple of 7 and hence not of the form 7k + 5. If r = 1,
m^{2} = 49q^{2} + 14q + 1, which has remainder 1,
not 5, when divided by 7. In each of the other five cases,
n^{2} = 49q^{2} + 14qr + r^{2}. This
number, when divided by 7, has the same remainder as does
r^{2} because the other two terms are divisible by 7.
With r = 2 this remainder is 4, with r = 3 it is 2 because (9
mod 7) = 2, with r = 4 it is (16 mod 7) = 2, with r = 5 it is
(25 mod 7) = 4, and with r = 6 it is (36 mod 7) = 1. So it is
never 5 for any perfect square.

For our base case, we must prove P(1), which says that a_{1} =
2(1)^{2} - 5(1) + 6. Since 2 - 5 + 6 = 3, this matches
the given value of a_{1}.

For the inductive case, we assume that a_{k-1} =
2(n-1)^{2} -5(n-1) + 6, which is 2n^{2} - 4n + 2
- 5n + 5 + 6 = 2n^{2} -9n + 13. Then, by the rule,
a_{n}
= a_{n-1} + 4n - 7 = 2n^{2} -9n + 13 + 4n - 7 =
2n^{2} -5n + 6. This is exactly what the statement P(n)
says that it should be.

- (a, 5) Calculate b
_{i}for all integers i from i through 10.b

_{3}= 3 - 2 = 1, b_{4}= 1 - 3 = -2, b_{5}= -2 - 1 = -3, b_{6}= -3 - (-2) = -1, b_{7}= -1 - (-3) = 2, b_{8}= 2 - (-1) = 3, b_{9}= 3 - 2 = 1, and b_{10}= 1 = 3 = -2. - (b, 5) Determine the value of b
_{100}. (Hint: I don't expect you to determine all the intermediate values -- find a pattern in part (a) or use the result of part (c).)By the result of part (c), b

_{100}= b_{94}= b_{88}, and so on removing 6 at a time until we reach b_{4}= -2. - (c, 20) Prove by induction that for any n with n >
6, b
_{n}= b_{n-6}. (Hint: Prove the base cases of n = 7 and n = 8, then use the sequence definition in your inductive case.)First base case: We observe that b

_{7}and b_{1}are both 2.Second base case: We observe that b

_{8}and b2 are both 3.Inductive case: Let n be any number with n > 8. We assume that b

_{n-1}= b_{n-7}, and that b_{n-2}= b_{n-8}. We can do this because n-1 and n-2 are each greater than 6. Now the rule says that b_{n}= b_{n-1}- b_{n-2}, and by our two assumptions this equals b_{n-7}- b_{n-8}. But by the rule again, this latter expression equals b_{n-6}, so we have proved that b_{n}= b_{n-6}.

Last modified 20 October 2015