Docsity

CS 1050C Practice Test Solutions: Proofs and Relations - Prof. Edyta Szymanska, Exams of Computer Science

Toggle sidebar
bg1
Practice test 1 – CS 1050C – solutions
1. Assume aand bare maxima. Then,
∀x∈Ax¹a.
In particular, b¹a. Similarly, since bis a maximum,
∀x∈Ax¹b.
In particular, a¹b.
Since a¹band b¹a,a=bby antisymmetry. 2
2. We’ll do a proof. Assume ≡is an equivalence relation as described in the
problem. We have:
(i) a≡b
(ii) b≡z
(iii) y≡zso, by symmetry, also z≡y
(iv) By (i), (ii) and transitivity, a≡z
(v) By (iv) and (iii) and transitivity, a≡y
(vi) By (v) and symmetry, y≡a.
2
3. (i) Yes. Take (a, b)∈A. Then (a, b)R(a, b)⇐⇒ ab ≤ab, which is
obviously true.
(ii) No. For example, (1,2)R(2,4) and (2,4)R(1,2) but (1,2) 6= (2,4).
(iii) Yes. Take any (a, b),(a0, b0),(a00, b00)∈Asuch that (a, b)R(a0, b0)
and (a0, b0)R(a00, b00). Then, ab0≤a0band a0b00 ≤a00b0. Multiply
the first inequality by b00 and the second one by bto get ab0b00 ≤
a0bb00 and a0bb00 ≤a00bb0. Putting the two together: ab0b00 ≤a00 bb0
and, dividing by b0,ab00 ≤a00b, i.e. (a, b)R(a00, b00 ).
(iv) No. For example, (2,1)R(3,1) but it’s not true that (3,1)R(2,1).
(v) No. Lacks antisymmetry.
(vi) No. Lacks symmetry.
4. The first step should be to draw the Venn diagram to figure out whether
you need a proof or a counterexample. However, we do not regard Venn
diagam as a proof (or counterexample). In this case, Venn diagram will
tell you that you need a proof. So let’s do a proof.
x∈A∩(B\C)⇐⇒
x∈A∧x∈B\C⇐⇒
x∈A∧x∈B∧x6∈ C.
1
pf2

Partial preview of the text

Download CS 1050C Practice Test Solutions: Proofs and Relations - Prof. Edyta Szymanska and more Exams Computer Science in PDF only on Docsity!

Practice test 1 – CS 1050C – solutions

  1. Assume a and b are maxima. Then,

∀x∈Ax ¹ a.

In particular, b ¹ a. Similarly, since b is a maximum,

∀x∈Ax ¹ b.

In particular, a ¹ b. Since a ¹ b and b ¹ a, a = b by antisymmetry. 2

  1. We’ll do a proof. Assume ≡ is an equivalence relation as described in the problem. We have:

(i) a ≡ b (ii) b ≡ z (iii) y ≡ z so, by symmetry, also z ≡ y (iv) By (i), (ii) and transitivity, a ≡ z (v) By (iv) and (iii) and transitivity, a ≡ y (vi) By (v) and symmetry, y ≡ a.

2

  1. (i) Yes. Take (a, b) ∈ A. Then (a, b)R(a, b) ⇐⇒ ab ≤ ab, which is obviously true. (ii) No. For example, (1, 2)R(2, 4) and (2, 4)R(1, 2) but (1, 2) 6 = (2, 4). (iii) Yes. Take any (a, b), (a′, b′), (a′′, b′′) ∈ A such that (a, b)R(a′, b′) and (a′, b′)R(a′′, b′′). Then, ab′^ ≤ a′b and a′b′′^ ≤ a′′b′. Multiply the first inequality by b′′^ and the second one by b to get ab′b′′^ ≤ a′bb′′^ and a′bb′′^ ≤ a′′bb′. Putting the two together: ab′b′′^ ≤ a′′bb′ and, dividing by b′, ab′′^ ≤ a′′b, i.e. (a, b)R(a′′, b′′). (iv) No. For example, (2, 1)R(3, 1) but it’s not true that (3, 1)R(2, 1). (v) No. Lacks antisymmetry. (vi) No. Lacks symmetry.
  2. The first step should be to draw the Venn diagram to figure out whether you need a proof or a counterexample. However, we do not regard Venn diagam as a proof (or counterexample). In this case, Venn diagram will tell you that you need a proof. So let’s do a proof.

x ∈ A ∩ (B \ C) ⇐⇒ x ∈ A ∧ x ∈ B \ C ⇐⇒ x ∈ A ∧ x ∈ B ∧ x 6 ∈ C.

Also,

x ∈ (A ∩ B) \ (A ∩ C) ⇐⇒ x ∈ A ∩ B ∧ ¬(x ∈ A ∩ C) ⇐⇒ x ∈ A ∧ x ∈ B ∧ ¬(x ∈ A ∧ x ∈ C) ⇐⇒ x ∈ B ∧ [x ∈ A ∧ (x 6 ∈ A ∨ x 6 ∈ C)] ⇐⇒ x ∈ B ∧ [(x ∈ A ∧ x 6 ∈ A) ∨ (x ∈ A ∧ x 6 ∈ C)] ⇐⇒ x ∈ B ∧ [ 0 ∨ (x ∈ A ∧ x 6 ∈ C)] ⇐⇒ x ∈ B ∧ x ∈ A ∧ x 6 ∈ C ⇐⇒ x ∈ A ∧ x ∈ B ∧ x 6 ∈ C

Putting things together:

x ∈ A ∩ (B \ C) ⇐⇒ x ∈ (A ∩ B) \ (A ∩ C).

Which means that A ∩ (B \ C) = (A ∩ B) \ (A ∩ C). 2

  1. Yes. It’s best to use truth tables here, but I am showing proof by algebra of propositions for your enjoyment.

[((p ∨ r) ∧ (q ∨ (¬r))) → (p ∨ q)] ⇐⇒ ¬((p ∨ r) ∧ (q ∨ (¬r))) ∨ p ∨ q ⇐⇒ (¬(p ∨ r) ∨ (¬(q ∨ (¬r)))) ∨ p ∨ q ⇐⇒ (¬p ∧ ¬r) ∨ (¬q ∧ r) ∨ p ∨ q ⇐⇒ (p ∨ (¬p ∧ ¬r)) ∨ (q ∨ (¬q ∧ r)) ⇐⇒ ((p ∨ ¬p) ∧ (p ∨ ¬r)) ∨ ((q ∨ ¬q) ∧ (q ∨ r)) ⇐⇒ ( 1 ∧ (p ∨ ¬r)) ∨ ( 1 ∧ (q ∨ r)) ⇐⇒ p ∨ ¬r ∨ q ∨ r ⇐⇒ (¬r ∨ r) ∨ p ∨ q ⇐⇒ 1 ∨ p ∨ q ⇐⇒ 1