Download Final Exam 1 with Answer Key - Discrete Mathematics for Computer Science | CSCI 2610 and more Exams Discrete Mathematics in PDF only on Docsity!
CSCI 2610 โ Discrete Mathematics
for Computer Science
Spring, 2014
Thursday, February 13
Exam 1
(100 points)
Time: 75 minutes
Please PRINT your name:
Last Name:__________________
First Name:__________________
1. (12 points) Determine the truth value of each these statements if the domain consists of all integers:
Circle T for True or F for False, the truth value for each of the following statements.
T F (1) โ๐ (๐ + 1 > ๐)
T F (2) โ๐ ( 2 ๐ = 3 ๐)
T F (3) โ๐ (๐ = โ๐)
T F (4) โ๐ (๐!^ < 0 )
T F (5) โ๐ (๐ < 0 โ |๐| = โ๐)
T F (6) โ๐ (๐ > 0 โ ๐!^ > 0 )
2. (18 points) Determine the truth value of each of these statements if the domain of each variable consists of all real numbers:
Circle T for True or F for False, the truth value for each of the following statements.
T F (1) โ๐ฅโ๐ฆ (๐ฅ!^ = ๐ฆ)
T F (2) โ๐ฅโ๐ฆ (๐ฅ = ๐ฆ!)
T F (3) โ๐ฅโ๐ฆ (๐ฅ + ๐ฆ โ ๐ฆ + ๐ฅ)
T F (4) โ๐ฅ (๐ฅ โ 0 โ โ๐ฆ (๐ฅ๐ฆ = 1 ))
T F (5) โ๐ฅโ๐ฆ (๐ฆ โ 0 โ ๐ฅ๐ฆ = 1 )
T F (6) โ๐ฅโ๐ฆ (๐ฅ + 2 ๐ฆ = 2 โง 2 ๐ฅ + 4 ๐ฆ = 5 )
T F (7) โ๐ฅโ๐ฆ (๐ฅ + ๐ฆ = 2 โง 2 ๐ฅ โ ๐ฆ = 1 )
T F (8) โ๐ฅโ๐ฆโ๐ง (๐ง = (๐ฅ + ๐ฆ) โ 2 )
6. (5 points) Determine whether the following argument is valid, and prove your result is correct. She is a Math Major or a Computer Science Major. If she does not know discrete math, she is not a Math Major. If she knows discrete math, she is smart. She is not a computer Science Major. Therefore, she is smart. Valid. Let p denote โShe is a Math Majorโ, q denote โshe is a Computer Science Majorโ, r denote โshe knows discrete mathโ, s denote โShe is smartโ. Then the premises of the argument form are: ๐ โจ ๐, ยฌ๐ โ ยฌ๐, ๐ โ ๐ , ยฌ๐ and the conclusion is s. This argument form is valid, because:
- ๐ โจ ๐ Premise
- ยฌ๐ โ ๐ Logical equivalences
- ยฌ๐ Premise
- ๐ Modus Tollens from 2 and 3
- ยฌ๐ โ ยฌ๐ Premise
- ๐ Modus Tollens from 4 and 5
- ๐ โ ๐ Premise
- ๐ Modus Pollens from 6 and 7 7. (5 points) Identify the error or errors in this argument that supposedly shows that if โ๐๐ท(๐) โง โ๐๐ธ(๐)) is true then โ๐ (๐ท(๐) โง ๐ธ(๐)) i. โ๐๐ท(๐) โง โ๐๐ธ(๐) Premise ii. โ๐๐ท(๐) Simplification from i. iii. ๐ท(๐) Existential instantiation from ii. iv. โ๐๐ธ(๐) Simplification from i. v. ๐ธ(๐) Existential instantiation from iv. vi. ๐ท(๐) โง ๐ธ(๐) Conjunction from iii. and v. vii. โ๐(๐ท(๐) โง ๐ธ(๐)) Existential generalization from vi. The error occurs in step v, because we cannot assume, as is being done here, that the c that makes P(x) true is the same as the c that makes Q(x) true.
8. (10 points) Show that ยฌ๐ โง (๐ โ ๐) and ยฌ(๐ โจ ๐) are equivalent (a) using a truth table (b) using logical equivalences ๐ ๐ ยฌ๐ ๐ โ ๐ ยฌ๐ โง (๐ โ ๐) ๐ โจ ๐ ยฌ(๐ โจ ๐) F F T T T F T F T F T F T F T F T F F T F T T F T F T F
- ยฌ๐ โง (๐ โ ๐)
- ยฌ๐ โง (ยฌ๐ โจ ๐) Logical equivalences from 1
- (ยฌ๐ โง ยฌ๐) โจ (ยฌ๐ โง ๐) Distributed Law from 2
- (ยฌ๐ โง ยฌ๐) โจ ๐น Negation Law from 3
- ยฌ๐ โง ยฌ๐ Identity Law from 4
- ยฌ(๐ โจ ๐) De Morganโs Law from 5
10. (15 points) Prove the following theorems: (1) if m and n are integers and mn is even, then m is even or n is even. (2) ๐ โค |๐| for all real numbers ๐. (give a proof by cases)
Section 1.7 Introduction to Proofs 29
- This is true. Suppose that a/b is a nonzero rational number and that x is an irrational number. We must prove that the product xa/b is also irrational. We give a proof by contradiction. Suppose that xa/b were rational. Since a/b != 0 , we know that a != 0 , so b/a is also a rational number. Let us multiply this rational number b/a by the assumed rational number xa/b. By Exercise 26, the product is rational. But the product is (b/a)(xa/b) = x, which is irrational by hypothesis. This is a contradiction, so in fact xa/b must be irrational, as desired.
- If x is rational and not zero, then by definition we can write x = p/q , where p and q are nonzero integers. Since 1 /x is then q/p and p != 0 , we can conclude that 1 /x is rational.
- We give a proof by contraposition. If it is not true than m is even or n is even, then m and n are both odd. By Exercise 6, this tells us that mn is odd, and our proof is complete.
- a) We must prove the contrapositive: If n is odd, then 3 n + 2 is odd. Assume that n is odd. Then we can write n = 2 k + 1 for some integer k. Then 3 n + 2 = 3(2k + 1 ) + 2 = 6 k + 5 = 2(3k + 2 ) + 1. Thus 3 n + 2 is two times some integer plus 1, so it is odd. b) Suppose that 3 n + 2 is even and that n is odd. Since 3 n + 2 is even, so is 3 n. If we add subtract an odd number from an even number, we get an odd number, so 3 n โ n = 2 n is odd. But this is obviously not true. Therefore our supposition was wrong, and the proof by contradiction is complete.
- We need to prove the proposition โIf 1 is a positive integer, then 12 โฅ 1 .โ The conclusion is the true statement 1 โฅ 1. Therefore the conditional statement is true. This is an example of a trivial proof, since we merely showed that the conclusion was true.
- We give a proof by contradiction. Suppose that we donโt get a pair of blue socks or a pair of black socks. Then we drew at most one of each color. This accounts for only two socks. But we are drawing three socks. Therefore our supposition that we did not get a pair of blue socks or a pair of black socks is incorrect, and our proof is complete.
- We give a proof by contradiction. If there were at most two days falling in the same month, then we could have at most 2 ยท 12 = 24 days, since there are 12 months. Since we have chosen 25 days, at least three of them must fall in the same month.
- We need to prove two things, since this is an โif and only ifโ statement. First let us prove directly that if n is even then 7 n + 4 is even. Since n is even, it can be written as 2 k for some integer k. Then 7 n + 4 = 14 k + 4 = 2(7k + 2 ). This is 2 times an integer, so it is even, as desired. Next we give a proof by contraposition that if 7 n + 4 is even then n is even. So suppose that n is not even, i.e., that n is odd. Then n can be written as 2 k + 1 for some integer k. Thus 7 n + 4 = 14 k + 11 = 2(7k + 5 ) + 1. This is 1 more than 2 times an integer, so it is odd. That completes the proof by contraposition.
- There are two things to prove. For the โifโ part, there are two cases. If m = n, then of course m^2 = n^2 ; if m = โn, then m^2 = (โn)^2 = (โ1)^2 n^2 = n^2. For the โonly ifโ part, we suppose that m^2 = n^2. Putting everything on the left and factoring, we have (m + n)(m โ n) = 0. Now the only way that a product of two numbers can be zero is if one of them is zero. Therefore we conclude that either m + n = 0 (in which case m = โn), or else m โ n = 0 (in which case m = n), and our proof is complete.
- We write these in symbols: a < b, (a + b)/ 2 > a, and (a + b)/ 2 < b. The latter two are equivalent to a + b > 2 a and a + b < 2 b, respectively, and these are in turn equivalent to b > a and a < b, respectively. It is now clear that all three statements are equivalent. 480 Test Bank Questions and Answers
- Suppose x is odd but x + 2 is even. Therefore x = 2 k + 1 and x + 2 = 2 l. Hence (2k + 1 ) + 2 = 2 l. Therefore 2(k + 1 โ l) = โ 1 (even = odd), a contradiction.
- Let n = 2 k. Therefore n + 1 = 2 k + 1 , which is odd.
- Suppose n + 1 is even. Therefore n + 1 = 2 k. Therefore n = 2 k โ 1 = 2 (k โ 1) + 1 , which is odd.
- Suppose n = 2 k but n + 1 = 2 l. Therefore 2 k + 1 = 2 l (even = odd), which is a contradiction.
- If n is even, then n = 2 k. Therefore 3 n^2 + 8 = 3(2k)^2 + 8 = 12 k^2 + 8 = 2(6k^2 + 4), which is even. If n is odd, then n = 2 k + 1. Therefore 3 n^2 + 8 = 3(2k + 1 )^2 + 8 = 12 k^2 + 12 k + 11 = 2(6k^2 + 6 k + 5 ) + 1 , which is odd.
- If n is even, then n^2 = ( 2 k)^2 = 2(2k^2 ), which is even. If n is odd, then n^2 = ( 2 k + 1 )^2 = 2(2k^2 + 2 k) + 1 , which is odd.
- If m = 2 k and n = 2 l, then mn = 4 kl. Hence mn is a multiple of 4.
- False: x = 2 y = 1 /2.
- False: x = 1 /2.
- False: x = 3 /2, y = 3 /2.
- Case 1, x โฅ 0: then x = |x|, so x โค |x|. Case 2, x < 0: here x < 0 and 0 < |x|, so x < |x|.
- It is easier to give a contraposition proof; it is usually easier to proceed from a simple expression (such as n) to a more complex expression (such as 3 n + 5 is even). Begin by supposing that n is not odd. Therefore n is even and hence n = 2 k for some integer k. Therefore 3 n + 5 = 3(2k) + 5 = 6 k + 5 = 2(3k + 2 ) + 1, which is not even. If we try a direct proof, we assume that 3 n + 5 is even; that is, 3 n + 5 = 2 k for some integer k. From this we obtain n = ( 2 k โ 5)/3, and it it not obvious from this form that n is even.
- Prove that (a) and (b) are equivalent and that (a) and (c) are equivalent.
- If at most three people were born in each of the 12 months of the year, there would be at most 36 people.
- Give a proof by cases. There are only six cases that need to be considered: x = y = 1 ; x = 1 , y = 2 ; x = 1 , y = 3 ; x = 2 , y = 1 ; x = y = 2 ; x = 2 , y = 3.
- The steps in the โproofโ cannot be reversed. Knowing that the squares of two numbers, โ 3 and 3, are equal does not allow us to infer that the two numbers are equal. Questions for Chapter 2 For each of the pairs of sets in 1-3 determine whether the first is a subset of the second, the second is a subset of the first, or neither is a subset of the other.
- The set of people who were born in the U.S., the set of people who are U.S. citizens.
- The set of students studying a programming language, the set of students studying Java.
- The set of animals living in the ocean, the set of fish.
- Prove or disprove: A โ (B โฉ C) = (A โ B) โช (A โ C).
- Prove that A โฉ B = A โช B by giving a containment proof (that is, prove that the left side is a subset of the right side and that the right side is a subset of the left side).
- Prove that A โฉ B = A โช B by giving an element table proof.
- Prove that A โฉ B = A โช B by giving a proof using logical equivalence.