Download Document 8475296

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
CS 1800
Exam #2 (Feb. 29)
Name _________________________________ Section (circle one)
Spring 2016
noon class
2:00PM class
Instructions:
 This exam follows the procedures spelled out in your syllabus. That is, this exam is closed
book, closed internet, closed fellow students. However, you may use any handwritten notes
(of your creation) in your notebook.
 The rule about “closed fellow students” applies between noon and 3:00 PM on the date of the
exam. Thus, you should not discuss the exam with members of EITHER section until after the
second section has completed the exam.
 The exam consists of 10 questions on six pages. Be sure that you have all of these items and that
they are all legible.
 Points will be awarded based on your explicit answers. Partial credit will be given where
possible, so show work where appropriate.
 Each proof is worth 10 points. The exam is worth 100 points. There is a 50 minute time limit.
Use this ratio as a guideline.
 If you need more room than is provided please ask for additional paper, clearly write your name
and the question number on this page, and attach to your exam.
1. Prove that 4n  n4 for integers 2  n  4. (Proof by Exhaustion).
Proof:
Let n =2:
4n = 42 = 16
n4 = 24 = 16
n
Thus 4  n4
Let n=3:
4n = 43 = 64
n4 = 34 = 81
Thus 4n  n4
Let n=4:
4n = 44 = 256
n4 = 44 = 256
n
Thus 4  n4
We have demonstrated for all integers 2  n  4 that 4n  n4 . Thus, through proof by exhaustion we
have proved this theorem.
2. Prove that if integer p is even then so is p+4. (Direct Proof).
Proof:
Assume that p is an even integer.
Thus, p =2k for integer k by the definition of an even number.
p+4
= 2k + 4 (substitution)
= 2k + 2*2 (refactoring)
= 2(k + 2) (distributive property)
Let m =k+2. Since the sum of two integers is also an integer, m is an integer.
Therefore, p + 4 = 2m for integer m and p+4 is an even number (via definition of an even number).
3. Prove that the sum of any four consecutive integers is an even number. (Direct Proof).
Proof:
Let a, b, c, and d be our four integers and let a be the “smallest” of the integers.
Since the four integers are consecutive this means that
b=a+1
c=a+2
d=a+3
a + b + c + d = a + a+1 + a+2 + a+3 (substitution)
= a + a + a + a + 1 + 2 + 3 (commutative property)
= 4*a + 6
(algebraic regrouping)
= 2*2*a + 2*3
(algebraic regrouping)
= 2 (2a + 3)
(distributive property)
Let m = 2a+3. Since a is an integer and both the sum and product of integers results in an integer, m is
also an integer.
Therefore, a+b+c+d = 2m for integer m and the sum of four consecutive integers is an even number (via
definition of an even number).
4.
Prove that for all integers m and n, if m+n is even then m and n are either both even or both odd.
(Proof by contrapositive).
Proof:
The contrapositive of this theorem is :
If m and n have differing parity (are not both even and are not both odd), then m+n is odd (is not
even).
Without loss in generality assume that m is even and n is odd.
Thus,
m =2k for integer k (definition of an even number)
n = 2w+1 for integer w (definition of an odd number)
m + n = 2k + 2w + 1
= 2(k+w) + 1
(substitution)
(distributive property)
Let b = k + w. Since the sum of two integers is always an integer, b is an integer.
Thus, m+n = 2b for integer b and m+n is an even number (by definition of an even number).
Since we have proven the contrapositive of the original theorem to be true we have proven the theorem to
be true.
5. Prove that if x2 is an odd number than x is an odd number. (Proof by contrapositive).
Proof:
The contrapositive of this theorem is:
If x is not an odd number (is an even number) then if x2 is not an odd number (is an even
number).
Let x be an even number such that x=2y for integer y (definition of an even number).
x2
= (2y)2
= 4y2
= 2 (2y2 )
(substitution)
(factoring)
(refactoring)
Let z=2y2
Since the product of integers is an integer, z is an integer.
Thus, x2 = 2(z) for integer z and x2 is an even number (by definition of an even number.
Since we have proven the contrapositive of the original theorem to be true we have proven the theorem to
be true.
6. Prove that if a number added to itself is itself than the number is zero. (Proof by contradiction).
Proof:
The negation of this theorem is:
There exists a number such that, when added to itself it is itself and the number is not zero.
Assume that x is that number.
Thus,
X+x=x
2x = x
2x/x = x/x
2 = 1
(by theorem)
(addition)
(dividing both sides by the same value)
(division)
This is a contradiction since 2 can not equal 1.
By finding a contradiction we have proven that the negation is false and, similarly, that the original
theorem must be true.
7. Prove that when 5n+4 is even, n is even. (Proof by contradiction).
Proof:
The negation of this theorem is:
There exists a number n such that 5n +4 is even and n is odd.
Since n is odd we know
n = 2k + 1 for integer k (by definition of an odd number)
5n + 4 = 5(2k+1) + 4
= 10k + 5 + 4
= 10k + 9
= 10k + 8 + 1
= 2*5k + 2*4 + 1
= 2(5k+4) + 1
(substitution)
(distributive property)
(addition)
(refactoring)
(refactoring)
(distributive property)
Let x=5k+4. We know that x is an integer since the sum and product of integers always produces an
integer.
Thus,
5n+4 = 2x + 1
for integer x and 5n+4 is an odd number by definition of an odd number.
This is a contradiction since we previously indicated 5n+4 is even.
By finding a contradiction we have proven that the negation is false and, similarly, that the original
theorem must be true.
8. Prove that the expression 2m2 – 1 is odd for all integers m. (Proof by cases).
Note, the definition of an odd number is one in the form 2x+1. NOT, 2x-1.
Proof:
Case 1: m is even
Case 2: m is odd
Case 1:
Since m is even m=2k for integer k (definition of an integer)
2m2 – 1
= 2(2k)2 – 1
= 2(4k2 ) – 1
= 2(4k2 ) – 1
= 2(4k2 ) – 1
= 2(4k2 ) – 2
= 2(4k2 – 1)
+ (1-1)
- 1 +1
+1
+1
(substitution)
(refactoring)
(adding zero does not change the results)
(refactoring)
(refactoring)
(distributive property)
Let j = 4k2 – 1. Since addition, subtraction, and multiplication of integers produces integers j must be
an integer.
2m2 – 1 = 2j + 1 for integer j (substitution)
Thus, 2m2 – 1 is an odd number.
Case 2:
Since m is odd m=2a+1
2m2 – 1
for integer a (definition of an integer)
= 2(2a+1)2 – 1
= 2(4a2 +4a + 1) – 1
= 2(4a2 +4a) + 2 – 1
= 2(4a2 +4a ) + 1
(substitution)
(refactoring)
(partial distributive property)
(refactoring)
Let b = 4a2 +4a. Since addition, subtraction, and multiplication of integers produces integers b must be
an integer.
2m2 – 1 = 2b + 1 for integer b (substitution)
Thus, 2m2 – 1 is an odd number.
We have shown that 2m2 – 1 is an odd number for both possible cases and the theorem is proven.
9. Prove that if n is an even integer then n = 4j or n = 4j – 2 (Proof by cases).
Proof:
Since n is an even integer:
n = 2k for integer k
There are two possibilities for k.
Case 1 – k is even
Case 2 – k is odd
Case 1:
Since k is even, k=2x for integer x.
n
=2k
= 2(2x)
= 4x for integer x.
(definition)
(substitution)
(associative property)
Thus, n = 4j where j equals integer x. This is one of the two possible outcomes in our theorem.
Case 2:
Since k is odd, k = 2y+1 for integer y.
n
= 2k
= 2(2y+1)
= 4y + 2
= 4y + 4 – 4 + 2
= 4 (y + 1 ) – 2
Thus, n = 4j – 2
(substitution)
(distributive property)
(addition of zero)
(distributive property and refactoring
where j = y+1. This is one of the two possible outcomes in our theorem
We have shown that if n is an even integer then n = 4j or n = 4j – 2 for both possible cases for n. Thus,
we have proved the theorem.
10. Prove that the sum of any three consecutive integers is odd is not a valid theorem (Proof by
counterexample).
Let 1, 2, and 3 be the three consecutive integers.
1+2+3 = 6 which is an even number.
Thus, we have shown by counterexample that it is NOT valid that the sum of any three consecutive
integers is odd.
Related documents