# CMPSCI 190DM: A Mathematical Foundation for Informatics

# Practice for First Second Exam

#### David Mix Barrington

#### 17 October 2015

### Directions:

- 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.

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

Corrections in green made on 20 October 2015.

**Question 1 (15):**
Briefly identify the following terms or concepts (3 points each):
- (a) for x to be a
**multiple** of y
- (b) a
**proof by contradiction**
- (c) a
**rational number**
- (d) the
**base case** of a proof by induction
- (e) a
**predicate on the positive integers**

**Question 2 (15):**
Determine whether each of these five statements is true or false. No
explanation
is needed or wanted, and there is no penalty for guessing.
- (a) 91 is not 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.)
- (c) The binary representation of the decimal number "19"
is "10101".
- (d) Every perfect square can be written as either "4k" or "4k+1"
for some integer k.
- (e) The square of every irrational number is irrational.

**Question 3 (20):**
Prove that if k is any integer, the number 7k + 5 is not a
perfect square. (Hint: Argue the contrapositive, and apply the
Division Theorem with m = 7 to the number you are squaring.)
**Question 4 (20):**
Define a number sequence so that a_{1} = 3 and for all k
with k > 1, a_{k} = a_{k-1} + 4k - 7. Prove
by
induction that for any positive integer n, a_{n} =
2n^{2} - 5n + 6.
**Question 5 (30):**
Define a number sequence so that b_{1} = 2,
b_{2} = 3, and for all k with k > 2, b_{k} =
b_{k-1} - b_{k-2} + 1.
- (a, 5) Calculate b
_{i} for all integers i from i
through 10.
- (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).)
- (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.)

Last modified 20 October 2015