CSE 215– Foundations of Computer Science Sample Solutions for ...

22 downloads 191 Views 40KB Size Report
CSE 215– Foundations of Computer Science. Sample Solutions for the ... Let A be the set {{},2}, B the set {1,2,{1,2}}, and C the set {1,2}. Then. (a) A ∩ B ∩ C ...
CSE 215– Foundations of Computer Science Sample Solutions for the Second Midterm Exam The following sample solutions cover most of the questions on the different versions of the exam. 1. For each statement determine whether it is true or false. (a) True

False

The empty relation is symmetric.

(b) True

False

All universal relations A × A are symmetric.

(c) True

False

All universal relations A × A are transitive.

(d) True

False

The empty relation is transitive.

(e) True False irreflexive.

Some nonempty relations are both reflexive and

(f) True False reflexive.

No nonempty relation is both reflexive and ir-

(g) True

False

No relation is both symmetric and antisymmetric.

(h) True False Some relations are both symmetric and antisymmetric. (i) True

False Some relations are neither reflexive nor irreflexive.

False (j) True symmetric.

Some relations are neither symmetric nor anti-

2. Let A be the set {{}, 2}, B the set {1, 2, {1, 2}}, and C the set {1, 2}. Then (a) A ∩ B ∩ C = {2} (b) A × B = {({}, 1), ({}, 2), ({}, {1, 2}), (2, 1), (2, 2), (2, {1, 2})} (c) C − B = ∅ (d) P(A) = {∅, {∅}, {2}, A} (e) A ∩ P(C) = {∅} 3. Let A be the set {1, 2, 3}. Find a smallest binary relation on A with the stated properties. (a) Reflexive, symmetric, and transitive: {(1, 1), (2, 2), (3, 3)} (b) Symmetric and transitive but not reflexive: ∅

(c) Reflexive and transitive but not symmetric: The relation {(1, 1), (2, 2), (3, 3), (1, 2)} or any relation with the pair (1, 2) replaced by any other (suitable) pair with different first and second components. (d) Reflexive and symmetric but not transitive: {(1, 1), (2, 2), (3, 3), (1, 2), (1, 3), (2, 1), (3, 2)} 4. For each of the following statements give either a proof or a counterexample. (a) For all sets A and B, P(A ∩ B) = P(A) ∩ P(B). This statement is true. Let A and B be arbitrary sets. Then x ∈ P(A ∩ B) iff x ⊆ A ∩ B iff x ⊆ A and x ⊆ B iff x ∈ P(A) and x ∈ P(B) iff x ∈ P(A) ∩ P(B) Thus, P(A ∩ B) = P(A) ∩ P(B). (b) For all sets A and B, P(A × B) = P(A) × P(B). This statement is false. For instance, if A = B = ∅ then A × B = ∅ and P(A × B) = {∅} = 6 {(∅, ∅)} = P(A) × P(B). (c) For all sets A and B, P(A) ∪ P(B) ⊆ P(A ∪ B). This statement is true; see the solution to Exercise 5.3.15 in the textbook. 5. Consider the following binary relations on the integers, R1 = {(x, y) : xy ≥ 1}, R2 = {(x, y) : x ≥ y 2 }, and R3 = {(x, y) : x2 ≥ y}. The relation R1 is transitive and symmetric. It is neither reflexive nor irreflexive and is also not antisymmetric. The relation R2 is transitive and antisymmetric. It is neither reflexive nor irreflexive and is also not symmetric. The relation R3 is reflexive, but does not satisfy any of the other four properties.

6. Let α be the set identity (A ∩ B) ∪ C = A ∩ (B ∪ C). (a) Let A be the empty set and C be any nonempty set. Then (A ∩ B) ∪ C = C 6= ∅ = A ∩ (B ∪ C) which shows that α is not true for all sets A, B, and C. (b) The answer to part (a) also indicates that the subset relation (A ∩ B) ∪ C ⊆ A ∩ (B ∪ C) does not hold for all sets A, B, and C. But we have A ∩ (B ∪ C) ⊆ (A ∪ C) ∩ (B ∪ C) = (A ∩ B) ∪ C for all sets A, B, and C. (c) If C ⊆ A, then A = A ∪ C and hence A ∩ (B ∪ C) = (A ∪ C) ∩ (B ∪ C) = (A ∩ B) ∪ C Moreover, if C 6⊆ A, then there is some element x such that x ∈ C and X 6∈ A. We have x ∈ (A ∩ B) ∪ C but x 6∈ A ∩ (B ∪ C), which shows that α is not true in this case. In sum, α is true if and only if C ⊆ A.

Suggest Documents