bu-cmpe 220 discrete mathematics midterm i questions

27
BU-CmpE 220 Discrete Mathematics Midterm I Questions Read me. Answer n should go to page n. Be clear, precise, short, necessary and sufficient in your answers. Otherwise prepare to lose points. Open textbook, course handouts and your own handwritten notes, only. ”Rosen 85/8” means the question 8 on page 85 of the textbook (Rosen 6e). Keep the question sheet. Show your own work. No questions. No exchange of information, books, notes, pencils etc. No photocopied material. No phones. Good luck. 2011-1 midterm1/Q1 a) Express each of these statements using quantifiers and the following pred- icates where the domain consists of all people. S(x): x is a student in this class. M (x): x is a mathematician L(x): x likes discrete mathematics course. C(x, y): x and y are colleagues K(x, y): x knows y i) There are exactly two students in this class who like discrete mathe- matics course. ii) Every student in this class knows Kurt G¨ odel or knows a mathemati- cian who is a colleague of Kurt G¨ odel. iii) There is no student in this class who knows everybody else in this class b) Using rules of inference provide a formal proof for If x[S(x)Q(x)], and x[(¬S(x)Q(x)) P (x)] are true then x[¬P (x) S(x)] is also true where the domains of all quantifiers are the same. Solution a) i) xy [x 6= y S(x) S(y) L(x) L(y) ∧∀z (S(z) L(z) z = xz = y)] ii) x [S(x) [K(x, Godel) ∨∃y (M (y) C(y, Godel) K(x, y))]] iii) ¬∃xy [S(x) ((S(y) x 6= y) K(x, y))] b) 1. x [S(x) Q(x)] Premise 2. x [(¬S(x) Q(x)) P (x)] Premise 3. S(a) Q(a) (1) universal instantiation 4. (¬S(a) Q(a)) P (a) (2) universal instantiation 5. ¬(¬S(a) Q(a)) P (a) (4) logical equivalence p q ≡¬p q 6. (S(a) ∨¬Q(a)) P (a) (5) De Morgan 7. (P (a) S(a)) ∨¬Q(a) (6) Commutativity and associativity of 8. (P (a) S(a)) S(a) (7) and (3) resolution 9. P (a) S(a) (8) Idempotent law 10. ¬P (a) S(a) (9) logical equivalence p q ≡¬p q 11. x (¬P (x) S(x)) Universal generalization (a was arbitrary) 2011-1 midterm1/Q2 Let a, b Z + . Prove that if a and b are relatively prime and a>b, then 1

Upload: others

Post on 24-Mar-2022

9 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: BU-CmpE 220 Discrete Mathematics Midterm I Questions

BU-CmpE 220 Discrete MathematicsMidterm I Questions

Read me. Answer n should go to page n. Be clear, precise, short, necessary and

sufficient in your answers. Otherwise prepare to lose points. Open textbook, course

handouts and your own handwritten notes, only. ”Rosen 85/8” means the question 8

on page 85 of the textbook (Rosen 6e). Keep the question sheet. Show your own work.

No questions. No exchange of information, books, notes, pencils etc. No photocopied

material. No phones. Good luck.

2011-1 midterm1/Q1

a) Express each of these statements using quantifiers and the following pred-icates where the domain consists of all people.S(x) : x is a student in this class. M(x) : x is a mathematicianL(x) : x likes discrete mathematics course. C(x, y) : x and y are colleaguesK(x, y) : x knows y

i) There are exactly two students in this class who like discrete mathe-matics course.ii) Every student in this class knows Kurt Godel or knows a mathemati-cian who is a colleague of Kurt Godel.iii) There is no student in this class who knows everybody else in this class

b) Using rules of inference provide a formal proof forIf ∀x[S(x)∨Q(x)], and ∀x[(¬S(x)∧Q(x))→ P (x)] are true then ∀x[¬P (x)→S(x)] is also true where the domains of all quantifiers are the same.

Solution

a)i) ∃x∃y [x 6= y∧S(x)∧S(y)∧L(x)∧L(y)∧∀z (S(z)∧L(z)→ z = x∨z = y)]ii) ∀x [S(x)→ [K(x,Godel) ∨ ∃y (M(y) ∧ C(y,Godel) ∧K(x, y))]]iii) ¬∃x∀y [S(x) ∧ ((S(y) ∧ x 6= y)→ K(x, y))]

b)1. ∀x [S(x) ∨Q(x)] Premise2. ∀x [(¬S(x) ∧Q(x))→ P (x)] Premise3. S(a) ∨Q(a) (1) universal instantiation4. (¬S(a) ∧Q(a))→ P (a) (2) universal instantiation5. ¬(¬S(a) ∧Q(a)) ∨ P (a) (4) logical equivalence p→ q ≡ ¬p ∨ q6. (S(a) ∨ ¬Q(a)) ∨ P (a) (5) De Morgan7. (P (a) ∨ S(a)) ∨ ¬Q(a) (6) Commutativity and associativity of ∨8. (P (a) ∨ S(a)) ∨ S(a) (7) and (3) resolution9. P (a) ∨ S(a) (8) Idempotent law10. ¬P (a)→ S(a) (9) logical equivalence p→ q ≡ ¬p ∨ q11. ∀x (¬P (x)→ S(x)) Universal generalization (a was arbitrary)

2011-1 midterm1/Q2Let a, b ∈ Z+. Prove that if a and b are relatively prime and a > b, then

1

Page 2: BU-CmpE 220 Discrete Mathematics Midterm I Questions

gcd(a− b, a+ b) = 1 or 2.Solution.Let gcd(a, b) = 1 and assume gcd(a− b, a+ b) = d⇒ d|a+ b ∧ d|a− b⇒ a+ b = d.k1 ∧ a− b = d.k2 for some k1, k2 ∈ NAdding these equations and subtracting one from the other yields⇒ 2a = d(k1 + k2) ∧ 2b = d(k1 − k2)⇒ d|2a ∧ d|2bgcd(a, b) = 1⇒ ∃x, y ∈ Z such that 1 = ax+ by⇒ 2 = 2ax+ 2byd|2a→ d|2ax and d|2b→ d|2abd|2ax and d|2by → d|2ax+ 2byd|2ax+ 2by → d|2 since 2 = 2ax+ 2byd|2 → d = 2 or d = 2.Hence, gcd(a− b, a+ b) = 1 or gcd(a− b, a+ b) = 2.

2011-1 midterm1/Q3Determine whether the following relations defined on the group [Z,+] of integersunder addition are equivalence relations. Justify your answer.

a) aRb if and only if a− b is a prime

b) aSb if and only if a− b is even

Solution.

a) aRb if and only if a− b is a primeTo be an equivalence relation, S should be reflexive, symmetric and tran-sitive. Note that a − a = 0, and 0 is not a prime number. Hence,∀a ∈ Z (a, a) /∈ R. So, R is not reflexive, which means it is not anequivalence relation.

b) S if and only if a− b is evenReflexivity:∀a ∈ Z a− a = 0 which is an even number. Hence, ∀a ∈ Z (a, a) ∈ S. So,S is reflexive.Symmetry:Let (a, b) ∈ S. Then a− b is even.⇒ a− b = 2k for some k ∈ Z⇒ b− a = 2(−k)⇒ b− a is even⇒ (b, a) ∈ S⇒ S is symmetricTransitivity:Let (a, b) ∈ S ∧ (b, c) ∈ S⇒ a− b = 2k1 ∧ b− c = 2k2 for some k1, k2 ∈ Z⇒ (a− b)− (b− c) = 2(k1 − k2)⇒ (a− c) = 2(k1 − k2)⇒ (a, c) is even⇒ (a, c) ∈ S⇒ S is transitiveHence, S is an equivalence relation.

2

Page 3: BU-CmpE 220 Discrete Mathematics Midterm I Questions

2011-1 midterm1/Q4Let G1 = [S, ∗] and G2 = [T, ◦] be two groups. Define the direct product of G1

and G2, denoted by G1 ×G2, as the structure [S × T,∆], where

(s1, t1)∆(s2, t2) = (s1 ∗ s2, t1 ◦ t2)

Show that G1∆G2 is a group.Solution.Let G1 = [S, ∗] and G2 = [T, ◦] be two groups.

� Closure:Let s1, s2 ∈ S and t1, t2 ∈ T .⇒ (s1, t1)∆(s2, t2) = (s1 ∗ s2, t1 ◦ t2) ∈ S × T because G1 and G2 aregroups and the binary operations ∗ and ◦ are closed on S and T respec-tively. Hence, ∆ is closed on S × T

� Associativity:Let (s1, t1), (s2, t2), (s3, t3) ∈ S × T .

[(s1, t1)∆(s2, t2)]∆(s3, t3) = (s1 ∗ s2, t1 ◦ t2)∆(s3, t3) defn. of ∆= ((s1 ∗ s2) ∗ s3, (t1 ◦ t2) ◦ t3) defn. of ∆= (s1 ∗ (s2 ∗ s3), t1 ◦ (t2 ◦ t3)) associativity of ∗ and ◦

since G1 and G2 are groups.= (s1, t1)∆(s2 ∗ s3, t2 ◦ t3) defn. of ∆= (s1, t1)∆[(s2, t2)∆(s3, t3)] defn. of ∆

Hence, ∆ is associative on S × T .

� Identity element:Since G1 and G2 are groups, there exist identity elements e1 and e2 suchthat ∀s ∈ S e1 ∗ s = s ∗ e1 = s and ∀t ∈ T e2 ◦ t = t ◦ e2 = t∀s ∈ S ∀t ∈ T (s, t)∆(e1, e2) = (s ∗ e1, t ◦ e2 = (s, t), and∀s ∈ S ∀t ∈ T (e1, e2)∆(s, t) = (e1 ∗ s, e2 ◦ t = (s, t)Hence, (e1, e2) ∈ S × T is the identity element of G1∆G2

� Inverse elements:Let (s, t) ∈ S×T . Since G1, G2 are groups, s and t have inverses s−1 ∈ Sand t−1 ∈ T such that s ∗ s−1 = s−1 ∗ s = e1 and t ◦ t−1 = t−1 ◦ t = e2

(s, t)∆(s−1, t−1) = (s ∗ s−1, t ◦ t−1) = (e1, e2), and(s−1, t−1)∆(s, t) = (s−1 ∗ s, t−1 ◦ t) = (e1, e2)Hence, (s−1, t−1) is the inverse of (s, t).

So, [S × T,∆] is a group.

2011-1 midterm1/Q5

a) Prove or disprove that set difference distributes over union. i.e.A− (B ∪ C) = (A−B) ∪ (A− C).

b) Given a nonempty set A, let f : A→ A and g : A→ A where

∀a ∈ A f(a) = g(f(f(a))) and g(a) = f(g(f(a)))

3

Page 4: BU-CmpE 220 Discrete Mathematics Midterm I Questions

Prove that f = g.

Solution.

a) A− (B ∪ C) = (A−B) ∪ (A− C)Consider the following example which disproves the statement.Let A = {1, 2, 4, 5}, B = {2, 3, 5, 6} and C = {4, 5, 6, 7}.A− (B ∪ C) = {1, 2, 4, 5} − {2, 3, 4, 5, 6, 7} = {1}(A−B)∪ (A−C) = ({1, 2, 4, 5}−{2, 3, 5, 6})∪ ({1, 2, 4, 5}−{4, 5, 6, 7}) ={1, 2, 4}Hence, A− (B ∪ C) 6= (A−B) ∪ (A− C)

b) Proof by contradiction: Let f : A→ A and g : A→ A and∀a ∈ A f(a) = g(f(f(a))) (I), and g(a) = f(g(f(a))) (II), but f 6= gThen ∃s ∈ A f(s) 6= g(s).

f(s) 6= g(s)⇔ g(f(f(s))) 6= g(s) since f = g(f(f))⇔ f(g(f(f(f(s))))) 6= g(s) since g = f(g(f))⇔ f(g(f(f︸ ︷︷ ︸

f

(f(s))))) 6= g(s)

⇔ f(f(f(s))) 6= g(s) since f = g(f(f))⇔ f(f( f︸︷︷︸

g(f(f(s)))

))) 6= g(s)

⇔ f(f(g(f(f(s))))) 6= g(s) since f = g(f(f))⇔ f(f(g(f︸ ︷︷ ︸

g

(f(s))))) 6= g(s)

⇔ f(g(f(s))) 6= g(s) since g = f(g(f))⇔ g(s) 6= g(s) since g = f(g(f)) Contradiction!

Hence, f = g

2010-3 midterm1/Q1Prove or disprove that:

a) (∀x P (x, x)) −→ (∀x∃y P (x, y)).b) (∀x∃yP (x, y)) −→ (∀zP (z, z))

Solutiona) Proof by contradiction. Assume ¬(∀x∃y P (x, y)) is true. ¬(∀x∃y P (x, y)) =

∃x∀y¬P (x, y). Pick x0 for x. ∀y¬P (x0, y). Now pick y = x0. ¬p(x0, x0). Con-tradiction since we had ∀x P (x, x).

b) Disprove by counter example. Consider the predicate P (p, q) defined onthe domain S = {a, b} as:

p q P(p,q)a a Fa b Tb a Tb b F

For x = a, there exists b ∈ S where P (a, b) is true and for x = b, there existsa ∈ S where P (b, a) is true. Hence ∀x∃yP (x, y) is true. But ∀x P (x, x) is falsesince P (a, a) is false.

4

Page 5: BU-CmpE 220 Discrete Mathematics Midterm I Questions

2010-3 midterm1/Q2Express each of the following predicates and propositions in formal logic nota-tion. The domain of discourse is the nonnegative integers, N. In addition to thepropositional operators, variables and quantifiers, you may define predicates us-ing addition, multiplication, equality and comparison symbols, but no constants(like 0, 1, . . . ). For example, the proposition “n is an even number” could bewritten as ∃m (m+m = n).

a) Define the predicate One(n) which is only true for n = 1.b) n is the sum of three perfect squares.c) x > 1.d) Define the predicate isPrime(n) which is only true when n is a prime

number.e) n is a product of two distinct primes.f) There is no largest prime number.

Solution.a) One(n)

∆= ∀y (n · y = y).

b) ∃x∃y∃z (x · x+ y · y + z · z = n).c) ∃y (One(y) ∧ x > y).

d) IsPrime(n)∆= (n > a) ∧ ¬(∃x (x > a) ∧ (y > a) ∧ (x · y = n)) ∧One(a).

e) ∃x∃y ¬(x = y) ∧ (n = x · y) ∧ IsPrime(x) ∧ IsPrime(y).f) ¬(∃a IsPrime(a) ∧ (∀b IsPrime(b)→ a ≥ b)).

2010-3 midterm1/Q3a) Give an example where the following result fails:

Theorem 0.1 (WRONG). For sets A, B, C, and D, let

L = (A ∪ C)× (B ∪D))

R = (A×B) ∪ (C ×D).

Then L = R.

b) Fix the theorem by showing that R ⊆ L.

Solution.a) If A = D = ∅ and both B and C are nonempty, then L = C×B 6= ∅, but

R = ∅.

5

Page 6: BU-CmpE 220 Discrete Mathematics Midterm I Questions

b) Let (x, y) ∈ R. Then

(x, y) ∈ R→ (x, y) ∈ (A×B) ∪ (C ×D)

→ (x, y) ∈ A×B ∨ (x, y) ∈ C ×D→ (x ∈ A ∧ y ∈ B) ∨ (x ∈ C ∧ y ∈ D)

→ (x ∈ A ∨ x ∈ C) ∧ (x ∈ A ∨ y ∈ D) ∧ (y ∈ B ∨ x ∈ C) ∧ (y ∈ B ∨ y ∈ D)

→ (x ∈ A ∨ x ∈ C) ∧ (y ∈ B ∨ y ∈ D)

→ (x ∈ A ∪ C) ∧ (y ∈ B ∪D)

→ (x, y) ∈ (A ∪ C)× (B ∪D)

→ (x, y) ∈ L

Hence R ⊆ L.

2010-3 midterm1/Q4Consider the relation D on R (i.e. D ⊂ R × R) such that xDy ⇔ x · y ∈ QProve or disprove:

a) D is reflexive.b) D is symmetric.c) D is transitive.

Solution.a) D is reflexive.

False. Consider x = 4√

2.x · x = 4

√2 · 4√

2 =√

2 which is not a rational number. (Proof is given in thetextbook pg. 80 ). Hence ( 4

√2, 4√

2) /∈ D. So D is not reflexive.

b) D is symmetric.True. Proof:We need to show that ∀x, y ∈ R (xDy =⇒ yDx)

xDy =⇒ x · y ∈ Q=⇒ y · x ∈ Q since multiplication is commutative on R and x · y = y · x=⇒ y · x ∈ Q

Hence D is symmetric.

c) D is transitive.False. Counter example:Consider the following example: a = 4

√2, b = 1

4√2and c = 4

√2.

a · b =√

42 · 1√42

= 1 ∈ Q −→ a · b ∈ Q −→ aDb

b · c = 14√2· 4√

2 = 1 ∈ Q −→ b · c ∈ Q −→ bDc

Hence, for D to be transitive aDc must be true. But,a · b = 4

√2 · 4√

2 =√

2 /∈ Q −→ a 6Dc. Hence D is not transitive.

6

Page 7: BU-CmpE 220 Discrete Mathematics Midterm I Questions

2010-3 midterm1/Q5

a) Let 3Z = {n ∈ Z | n = 3k for some k ∈ Z}. Prove or disprove: [3Z,+] isa subgroup of [Z,+].

b) Let 2Z = {n ∈ Z | n = 2k for some k ∈ Z} and 3Z defined as above.Prove or disprove: [2Z ∪ 3Z,+] is a subgroup of [Z,+].c)Prove or disprove: [2Z ∩ 3Z,+] is a subgroup of [Z,+] where 2Z and 3Z

defined as above.d) Generalizing the result in part (a),(b) and (c) determine subgroups of Z.

You don’t need to prove your conjecture.

Solution.a) Let 3Z = {n ∈ Z | n = 3k for some k ∈ Z}.

Prove or disprove: [3Z,+] is a subgroup of [Z,+].Proof:Using Theorem 2.5 in the handouts, it suffices to show that ∀a, b ∈ 3Z (a+b−1 ∈3Z). Let a, b ∈ 3Z. Then ∃ k1, k2 such that a = 3k1 and b = 3k2.

a+ b−1 = a+ (−b) since b+ (−b) = 0, b−1 = −b= 3k1 + (−3k2)

= 3 (k1 − k2)︸ ︷︷ ︸∈Z

∈ 3Z

−→ a+ b−1 ∈ 3Z−→ [3Z,+] is a subgroup of [Z,+]

b) Let 2Z = {n ∈ Z | n = 2k for some k ∈ Z} and 3Z defined as above.Prove or disprove: [2Z ∪ 3Z,+] is a subgroup of [Z,+].Not correct. To be a subgroup, [2Z ∪ 3Z,+] must be closed. Consider 2 ∈ 2Zand 3 ∈ 3Z. 2 + 3 = 5 /∈ 2Z ∪ 3Z, since ¬∃k ∈ Z(5 = 2k ∨ 5 = 3k). Hence[2Z ∪ 3Z,+] is not closed and can not be a subgroup of [Z,+]

c)Prove or disprove: [2Z ∩ 3Z,+] is a subgroup of [Z,+] where 2Z and 3Zdefined as above.Proof:Again using Theorem 2.5 in the handouts, it suffices to show that ∀a, b ∈ 2Z ∩3Z (a+ b−1 ∈ 2Z∩ 3Z)Let a ∈ 2Z and 3Z. Then ∃ k1, k2 such that a = 3k1 anda = 2k2. This is possible only if a = 6k for some k ∈ Z. Similarly, if b ∈ 2Z and3Z, then a = 6l for some l ∈ Z.

a+ b−1 = a+ (−b) since b+ (−b) = 0, b−1 = −b= 6k + 6l

= 6(k + l)

= 2 (3(k + l)︸ ︷︷ ︸∈Z

) ∈ 2Z

= 3 (2(k + l)︸ ︷︷ ︸∈Z

) ∈ 3Z

−→ a+ b−1 ∈ 2Z ∩ 3Z−→ [2Z ∩ 3Z,+] is a subgroup of [Z,+]

7

Page 8: BU-CmpE 220 Discrete Mathematics Midterm I Questions

d) Generalizing the result in part (a),(b) and (c) determine subgroups of Z.Note that, in part (c), 2Z ∩ 3Z = 6Z. Hence, we can conjecture that foraZ = {n ∈ Z | n = ak for some k ∈ Z}, [aZ,+] is a subgroup of [Z,+] forevery a ∈ Z.

2010-1 midterm1/Q1 (due to Lewis Carroll)i) Animals, that do not kick, are not excitable.ii) Donkeys do not have horns.iii) Buffalos can toss one over a gate.iv) No animals that kick are easy to swallow.v) Animals that don’t have horns can toss one over a gate.vi) The only animals that aren’t excitable are buffalos.

a) Express each of these sentences using predicate calculus. The domain isthe set of animals. Use the following predicates:K(x): x kicksE(x): x is excitableH(x): x has hornsS(x): x is easy to swallowT (x): x can toss one over a gate

b) Give a formal proof for the statement ”Donkeys are not easy to swallow.”Show the steps clearly and state the reasoning you are using. e.g. contr-positive, modus ponens, existential instantition etc.

Solution

a) i) ∀x (∼ K(x)→∼ E(x))ii) ∼ H(Donkeys)iii) T (Buffalos)iv) ∀x (K(x)→∼ S(x)) ≡ ∀x ∼ (K(x) ∧ S(x))v) ∀x (∼ H(x)→ T (x))vi) ∀x (∼ E(x)↔ x = Buffalos)

b) Donkeys are not easy to swallow: ∼ S(Donkeys)

(1) ∀x (∼ E(x)↔ x = Buffalos) Premise(2) Donkeys 6= Buffalos→ E(Donkeys) (1) universal instantiation and contrapositive(3) ∀x (∼ K(x)→∼ E(x)) Premise(4) ∼ K(Donkeys)→∼ E(Donkeys) (3) universal instatiation(5) E(Donkeys)→ K(Donkeys) (4) contrapositive(6) ∀x (K(x)→∼ S(x)) Premise(7) K(Donkeys)→∼ S(Donkeys) (6) universal instantiation(8) Donkeys 6= Buffalos tautology(9) E(Donkeys) (2) and (8) modus ponens(10) K(Donkeys) (4) and (9) modus ponens(11) ∼ S(Donkeys) (7) and (10) modus ponens

8

Page 9: BU-CmpE 220 Discrete Mathematics Midterm I Questions

2010-1 midterm1/Q2Prove or disprove: For sets A,B,C and D,

A×B ⊆ C ×D ⇔ A ⊆ C ∧B ⊆ D

Solution.(⇒) A×B ⊆ C ×D ⇒ A ⊆ C ∧B ⊆ D

Let A×B ⊆ C ×D.⇒ ∀(x, y) ∈ (A×B) ⇒ (x, y) ∈ (C ×D)

let x ∈ A ∧ y ∈ B ⇒ (x, y) ∈ A×B⇒ (x, y) ∈ C ×D Since (A×B ⊆ C ×D)⇒ x ∈ C ∧ y ∈ D⇒ A ⊆ C ∧ B ⊆ D

(⇐) A ⊆ C ∧B ⊆ D ⇒ A×B ⊆ C ×D

Let A ⊆ C ∧ B ⊆ D⇒ ∀x ∈ A , x ∈ C ∧ ∀y ∈ B , y ∈ D

let (x, y) ∈ A×B ⇒ x ∈ A ∧ y ∈ B⇒ x ∈ C ∧ y ∈ D Since A ⊆ C ∧ B ⊆ D⇒ (x, y) ∈ (B ×D)⇒ A×B ⊆ C ×D

2010-1 midterm1/Q3Prove: For functions f : A→ B and g : B → A,

g ◦ f = iA ∧ f ◦ g = iB ⇒ g = f−1

where iS denotes the identity function on the set S .

Solution.Proof by contradiction:Assume g ◦ f = iA ∧ f ◦ g = iB , but g 6= f−1

f 6= g ⇒ ∃x ∈ A 3 g(x) 6= f−1(x)⇒ f(g(x)) 6= f(f−1(x))⇒ (f ◦ g)(x) 6= (f ◦ f−1)(x)⇒ iB(x) 6= iA(x) Since f ◦ f=iA by defn. of inverse function⇒ x 6= x Contradiction.

Therefore, g = f−1 must be true.

2010-1 midterm1/Q4In social networks it is usually the case that if x is connected to y and z, theny and z are connected to each other too. We can formally express this propertywith the following definition on relations.def. A relation R on a set A is called social iff

xRy ∧ xRz ⇒ yRz ∀x, y, z ∈ A

Let R be a social relation which is also reflexive. Is R an equivalence relation?If so, give a proof. If not, give a counter example.

9

Page 10: BU-CmpE 220 Discrete Mathematics Midterm I Questions

Solution.Let R be a social relation which is also reflexive. To show that R is an equiva-lence relation we must show that R is symmetric and transitive too.

i) Symmetry: (∀x, y ∈ A xRy ⇒ yRx)Let x, y ∈ A and xRy. Since R is reflexive xRx holds.xRy ∧ xRx ⇒ yRx.Hence, R is symmetric.

ii) Transitivity: (∀x, y, z ∈ A (xRy ∧ yRx ⇒ xRz))Let x, y, z ∈ A and xRy ∧ yRxxRy ⇒ yRx Since R is symmetric as shown in part (i).yRx ∧ yRz ⇒ xRz Since R is social.Hence, R is transitive.

2010-1 midterm1/Q5def. Ln×n is the set of n× n lower triangular matrices over R where∀A ∈ Ln×n,∀i ∈ {1, 2, ..., n},∀j ∈ {1, 2, ..., n}, i < j ⇒ aij = 0.i.e. in a lower triangular matrix all the entries above the main diagonal are zero.Prove or disprove:

a) [Ln×n,+] is a monoid where ” + ” is matrix addition operator.

b) [Ln×n, ·] is a monoid where ” · ” is matrix multiplication operator.

Solution.

a) [Ln×n,+] : To show that [Ln×n,+] is a monoid we must show that it isclosed, associative and has identity element.

i) Closure: Let A,B ∈ Ln×n. We must show that C = A+B ∈ Ln×na11 0 ... 0a21 a22 ... 0... ... ... 0an1 an2 ... ann

︸ ︷︷ ︸

A

+

b11 0 ... 0b21 b22 ... 0... ... ... 0bn1 bn2 ... bnn

︸ ︷︷ ︸

B

=

c11 0 ... 0c21 c22 ... 0... ... ... 0cn1 cn2 ... cnn

︸ ︷︷ ︸

C=A+B

cij = aij + bij 1 ≤ i, j ≤ n= 0 + 0 i < j and 1 ≤ i, j ≤ n= 0 i < j and 1 ≤ i, j ≤ n

(1)

Hence, C ∈ Ln×n. [Ln×n,+] is closed.

ii) Associativity:We must show that (A+B) + C = A+ (B + C) ∀A,B,C ∈ Ln×nLet A,B,C ∈ Ln×n. Let L = (A+B) + C and R = A+ (B + C).

10

Page 11: BU-CmpE 220 Discrete Mathematics Midterm I Questions

lij = (aij + bij) + cij 1 ≤ i, j ≤ nrij = aij + (bij + cij) 1 ≤ i, j ≤ n

⇒ lij = rij Since + is associative on R.⇒ (A+B) + C = A+ (B + C)⇒ [Ln×n,+] is associative.

iii) Identity element:

0n×n =

0 0 ... 00 0 ... 0... ... ... 00 0 ... 0

∈ Ln×n.

∀A ∈ Ln×n 0n×n +A = A+0n×n = A since 0 is the identity elementin [R,+]. Hence, 0n×n is the identity element in [Ln×n,+]

As shown in parts (i), (ii) and (iii), [Ln×n,+] ia a monoid.

a) [Ln×n, ·] : To show that [Ln×n, ·] is a monoid we must again show that itis closed, associative and has identity element.

i) Closure:Let A,B ∈ Ln×n. We must show that C = A ·B ∈ Ln×n

cij =

n∑k=1

aik · bkj 1 ≤ i, j ≤ n

=

i∑k=1

aik · bkj +

n∑k=i+1

aik · bkj 1 ≤ i, j ≤ n

=

i∑k=1

aik · bkj︸ ︷︷ ︸bkj=0 since k<j for k=1,...i

+

n∑k=i+1

aik · bkj︸ ︷︷ ︸aik=0 since k>i for k=i+1,...n

1 ≤ i, j ≤ n

=

i∑k=1

aik · 0 +

n∑k=i+1

0 · bkj 1 ≤ i, j ≤ n, i < j

= 0 1 ≤ i, j ≤ n, i < j

Hence, C = A ·B ∈ Ln×n.

ii) Associativity: Rosen p255/13We must show that (A ·B) · C = A · (B · C) ∀A,B,C ∈ Ln×n

11

Page 12: BU-CmpE 220 Discrete Mathematics Midterm I Questions

Let A,B,C ∈ Ln×n

(A ·B) · C =

n∑q=1

aiq(

n∑r=1

bqr · crl)

=

n∑q=1

n∑r=1

aiq · bqr · crl Since [R, ·] is associative

=

n∑r=1

n∑q=1

aiq · bqr · crl

=

n∑r=1

(

n∑q=1

aiq · bqr) · crl

= A · (B · C)

Hence, [Ln×n, ·] is associative.

iii) Identity element:

In×n =

1 0 ... 00 1 ... 0... ... ... 00 0 ... 1

∈ Ln×n.

∀A ∈ Ln×n In×n · A = A · In×n = A since In×n is the identity ele-ment for matrix multiplication. (Rosen pp 251) Hence, In×n is theidentity element in [Ln×n, ·]

As shown in parts (i), (ii) and (iii), [Ln×n, ·] ia a monoid.

2009-3 midterm1/Q1

Prove the following theorem.

Theorem 0.2. Let G be a group and let a ∈ G. Then

H = {an|n ∈ Z}

is a subgroup of G and is the smallest subgroup of G which contains a.

Solution

Proof. Let an, am ∈ H. Then (am)−1 = a−m ∈ H. So an(am)−1 = ana−m =an−m ∈ H. Therefore H is a subgroup of G.Let K be a subgroup of G with a ∈ K. Let an ∈ H. Then an ∈ K since∀n ∈ Z [an ∈ K]. Hence H ⊆ K.

12

Page 13: BU-CmpE 220 Discrete Mathematics Midterm I Questions

2009-3 midterm1/Q2 (Ali Nesin)Let [A1,≤1 ] and [A2,≤2 ] be two partially ordered sets. Prove or disprove thatthe following relation ≤ on A1 ×A2, called the lexicographic order , is a partialorder relation.(x1, y1) ≤ (x2, y2)

∆←→ x1 ≤1 x2 ∨ (x1 = x2 ∧ y1 ≤2 y2).Solution

The statement is not correct. The following counter example disproves it.Let {A1,≤1} = {(1, 1))} defined onA1 = [ 1 ] . and [A2,≤2 ] = {(a, a), (b, b), (a, b)}defined on A2 = {a, b}.Then [A1 × A2,≤] = {((1, a), (1, a)), ((1, b), (1, b)), ((1, a), (1, b)), ((1, b), (1, a))}and [A1 ×A2,≤] is not antisymmetric.

2009-3 midterm1/Q3 Ali NesinLet f : A → B and g : B → C be two functions. Let h = g ◦ f : A → C.Show thata) If f and g are injections, so is h.b) If f and g are surjections, so is h.c) If f and g are bijective, so is h.d) Let f and g be bijective. Show that the inverse functions f−1, g−1, h−1 verify:h−1 = f−1 ◦ g−1.

Solution

a) Assume that f, g are injections. We will show that h is also an injection.Let x, y ∈ A be such that h(x) = h(y). Then g(f(x)) = g(f(y)). Since g is aninjection, we have f(x) = f(y). From the injectivity of f it follows that x = y.b) Assume that f, g are surjections. Let c ∈ C. Surjectivity of g implies thatthere is b ∈ B such that g(b) = c. Now surjectivity of f implies that there isa ∈ A such that f(a) = b. Hence h(a) = g(f(a)) = c.c) Assume that f and g are bijections. From (a),(b) above, it follows that h isa bijection too.d) We have to show that h−1(c) = f−1(g−1(c)) for all c ∈ C. Take any c ∈ C.Let a ∈ A be the image of c under h−1 that is h(a) = c. Then applying f−1◦g−1

to c, we get f−1(g−1(c)) = f−1(g1(h(a))) = f−1(g−1(g(f(a)))) = a.

2009-3 midterm1/Q4Show that a transitive, symmetric relation R on a set X is not necessarilyreflexive.

Solution

Let A = { 1, 2 } and relation R = { (2, 2) } defined on A. Clearly R is tran-sitive and symmetric but not reflexive.

2009-3 midterm1/Q5Let f : A→ B and g : B → C be two functions and let h = g ◦ f : A→ C.Show thata) If h is an injection, so is f .

13

Page 14: BU-CmpE 220 Discrete Mathematics Midterm I Questions

b) If h is a surjection, so is g.c) If h is bijective, f and g are not necessarily bijective. Give a counter examplealso.

Solutiona) Assume that h is an injection. Let us show that f is an injection as well.Assume f is not an injection. Then there are x, y ∈ A such that x 6= y ∧ f(x) =f(y). Applying g now we get h(x) = g(f(x)) = g(f(y)) = h(y). A contradiction.

b) Assume that h is surjective. Let us show that g is surjective. Assume gis not surjective. Then there exists some c ∈ C such that there is no b ∈ B withg(b) = c. Since h is surjective, there is some a ∈ A be such that h(a) = c. Thusg sends f(a) to c. A contradiction.

c) Assume that h is a bijection. Then by (a),(b) we have f injection andg surjection. But f can be not surjective and g can be not injective as well.Consider the following example: Take A = { 1 }, B = { 2, 3 }, Z = { 4 }. Letf : A→ B, g : B → C, h : A→ C. Define f as 1 7→ 2, g as 2 7→ 4 and 3 7→ 4.Then clearly, h = g◦f is bijective while f is not surjective and g is not injective.

2009-1 midterm1/Q1Using letters for the component statements, translate the following compoundstatements into symbolic notation.a) If prices go up, then housing will be plentiful and expensive; but if housingis not expensive, then it will still be plentiful.b) Either going to bed or going to swimming is a sufficient condition for changingclothes; however, changing clothes does not mean going to swimming.c) If Janet wins or if she loses, she will be tired.d) Either Janet will win or, if she loses, she will be tired.

Solution.

2009-1 midterm1/Q2Using predicate logic,prove that the following argument is valid.Use the predicate symbols: M(x), I(x), G(x), L(x), F (x), j.

1. Every member of the board comes from industry or government.

2. Everyone from government who has a law degree is favor of the motion

3. John is not from industry, but he does have a law degree.

4. Therefore, if John is a member of the board, he is in favor of the motion.

Solution.

M(x) = x is a member of the boardI(x) = x is from industryG(x) = x is from governmentL(x) = x has a law degreeF (x) = x is favor of the motionj = John

14

Page 15: BU-CmpE 220 Discrete Mathematics Midterm I Questions

Then the argument is∀x[M(x)→ I(x) ∨G(x)]

∧ ∀x[G(x) ∧ L(x)→ F (x)]∧ ¬I(j) ∧ L(j)→ [M(j)→ F (j)]

A proof sequence

1. ∀x[M(x)→ I(x) ∨G(x)] hyp

2. ∀x[G(x) ∧ L(x)→ F (x)] hyp

3. M(j)→ I(j) ∨G(j) (1) and u.i.

4. G(j) ∧ L(j)→ F (j) (2) and u.i.

5. M(j) hyp

6. I(j) ∨G(j) (3),(5)

hyp = hypothesisu.i. = universal instantiation

2009-1 midterm1/Q3Let A and B be sets R ⊆ A x B. Describe the followings in plain English. Ifthere is a special term, state it.

a) The set a(R) = {u | ∃v(u, v)εR}

b) The set b(R) = {v | ∃u(u, v)εR}

c) The element y if (x, y)εR and (x, z)εR implies y = z

d) The relation R if it satisfies both part (c) and a(R) = A.

e) The relation R if it satisfies both part (d) and b(R) = B.

f) The relation R if it satisfies both part (d) and (x, y)εR and (y, z)εR impliesx = y.

g) Let R satisfies part (d) and, p ⊆ R ,and X ⊆ A.The relation p is definedas p = {(x, y)εR | xεX}

h) Let R satisfies part (d) and, R ⊆ θ, and A ⊆ X. The relation θ is definedas if ∀xεa(R)(x, y)εR and (x, y)εθ.

Solution.

a) domain of R

b) range of R

c) value of R at x

d) function

15

Page 16: BU-CmpE 220 Discrete Mathematics Midterm I Questions

e) surjection

f) injection

g) restriction

h) extension

2009-1 midterm1/Q4Let S be defined as ∅ ∈ S ∧ [∀x ∈ S x ∪ {x} ∈ S]. Give first 5 elements of S.

Solution.

S = {Φ,Φ ∪ {Φ},Φ ∪ {Φ} ∪ {Φ ∪ {Φ}},Φ ∪ {Φ} ∪ {Φ ∪ {Φ}} ∪ {Φ ∪ {Φ} ∪ {Φ ∪ {Φ}}},Φ ∪ {Φ} ∪ {Φ ∪ {Φ}} ∪ {Φ ∪ {Φ} ∪ {Φ ∪ {Φ}}} ∪ {Φ ∪ {Φ} ∪ {Φ ∪ {Φ}} ∪ {Φ ∪{Φ} ∪ {Φ ∪ {Φ}}}}....}

2009-1 midterm1/Q5 (Rosen 566/63).Let R ⊆ A2. Let Rr, Rs, Rt denote the reflexive, symmetric and transitive clo-sures of R, respectively. Then prove the following theorem.

Theorem 0.3. ((Rr)s)t is an equivalence relation.

Note 1. Actually, ((Rr)s)t is the smallest equivalence relation containing R butyou do not need to prove this.

Solution.

We need to show that ((Rr)s)t is reflexive, symmetric and transitive.

1. Rr is by definition reflexive.Then so are ((Rr)s) and ((Rr)s)t.Since ∀xεA (x, x)εRr, (x, x)ε((Rr)s) and (x, x)ε((Rr)s)t

2. ((Rr)s) is by definition symmetric.Suppose (a, b)ε ((Rr)s)t.Then there is a path from a to b in the digraphof ((Rr)s) .But for any arc (xi, xi+1) ε ((Rr)s) in the path,there is a correspondingopposite arc (xi+1, xi) ε ((Rr)s) since ((Rr)s) is symmetric.So we can traceback the path to obtain (b, a) ε ((Rr)s)t.So ((Rr)s)t is symmetric.

3. ((Rr)s)t is by definition transitive.

Therefore ((Rr)s)t is an equivalence relation.

16

Page 17: BU-CmpE 220 Discrete Mathematics Midterm I Questions

2008-3 midterm1/Q1Let A, B, C and D be sets, D ⊆ A, R ⊆ A×B, f ∈ BA.Describe the followings in plain English. If there is a special term, state it.a) ∀A ∃B ∀C (C ∈ B ↔ C ⊆ A)b) KR = {u | ∃v (u, v) ∈ R}c) fD = {(d, b) ∈ f | d ∈ D}

Solution.a) power setb) domain of Rc) restriction of f to D

2008-3 midterm1/Q2Let (P,≤) be a partial ordering, X ⊆ P , X 6= ∅, and a ∈ P .What is a ∈ P called ifa) ∀x ∈ X a 6< x and a ∈ X.b) ∀x ∈ X x 6< a and a ∈ X.c) ∀x ∈ X x ≤ a and a ∈ X.d) ∀x ∈ X a ≤ x and a ∈ X.e) ∀x ∈ X x ≤ a.f) ∀x ∈ X a ≤ x.

Solution.a) a maximal element of Xb) a minimal element of Xc) the greatest element of Xd) the least element of Xe) an upper bound of Xf) an lower bound of X

2008-3 midterm1/Q3Prove or disprove the following:For any group G = [G, ◦], G is commutative iff ∀a, b ∈ G (a◦ b)2 = a2 ◦ b2 wherex2 denotes x ◦ x.

Solution.=⇒ PartG is commutative. Let a, b ∈ G

(a ◦ b)2

= (a ◦ b) ◦ (a ◦ b) [def x2

= a ◦ [b ◦ (a ◦ b)] [associavity= a ◦ [(a ◦ b) ◦ b] [commutativty= a ◦ [a ◦ (b ◦ b)] [associativity= (a ◦ a) ◦ (b ◦ b) [associativity= a2 ◦ b2 [def x2

⇐= Part

17

Page 18: BU-CmpE 220 Discrete Mathematics Midterm I Questions

∀a, b ∈ G (a ◦ b)2 = a2 ◦ b2=⇒ (ab)(ab) = (aa)(bb)=⇒ abab = aabb=⇒ a−1abab = a−1aabb [ multiply by a−1 from the left=⇒ ebabb−1 = eabbb−1 [ multiply by b−1 from the right=⇒ bae = abe=⇒ ba = ab=⇒ ∀a, b ∈ G a ◦ b = b ◦ a

2008-3 midterm1/Q4def. A relation R is said to be cute iff ∀x, y (xRy ∨ yRx).

Prove or disprove:a) Every cute relation is reflexive.b) Every cute relation is symmetric.c) Every cute relation is transitive.

Solution.a) Every cute relation is reflexive.R is cute =⇒ ∀x, y ∈ A (xRy). Take x = a and y = a for any a ∈ A. Then(aRa ∨ aRa) =⇒ aRa. So ∀a ∈ AaRa. Therefore R is reflexive.b) Every cute relation R is not symmetric.A counter example would be sufficent. Consider a relation R1 with matrix whoselower triangle is all 1, upper triangle is all 0 and diagonal is all 1.R1 is cute but clearly not symmetric.

MR1=

1 0

. . .

1 1

c) Every cute relation is R is not transitive.Following is a counter example: Consider the relation R1 given above.

Let a1, a2, a3 ∈ A. Then (a3, a2), (a2, a1) ∈ R1. Also (a3, a1) ∈ R1.

MR2 =

a1 a2 a3

a1

a2

a3

. . ◦• . .• • .

Now define R2 = R1 r { (a3, a1) } ∪ { (a1, a3) }

Clearly R2 is a cute relation. (a3, a2), (a2, a1) ∈ R2 but (a3, a1) /∈ R2. So R2 isnot transitive.

2008-3 midterm1/Q5Decide which conclusions can be proved from the given premises after writingeach statement symbolically using the suggested letters. Give a proof for thosethat can be proven and a counterexample for those that cannot.

Premises: If Bob majors in physics (m), then he must pass all the calculus

18

Page 19: BU-CmpE 220 Discrete Mathematics Midterm I Questions

courses (p). If Bob passes all the calculus courses, then he can explain the meanvalue theorem (e). Bob has passed all the calculus courses.a) Conclusion: Bob can explain the mean value theorem.b) Conclusion: Bob is physics major.

Solution.

2008-1 midterm1/Q1Let f : A→ B and g : B → C. If f and g are injective, then g ◦ f is injective.

Solution.Let f : A→ B and g : B → C be functions.a)If f and g are injective, then g ◦ f is injective.←→Suppose x, y ∈ A with x 6= yWe must show that (g ◦ f)(x) 6= (g ◦ f)(y).Since f is injective and x, y ∈ A, f(x) 6= f(y).Since g is injective, f(x) 6= f(y),f(x),f(y)∈ B, g(f(x)) 6= g(f(y)).Hence (g ◦ f)(x) 6= (g ◦ f)(y).

2008-1 midterm1/Q2Prove the following:Let A and B be sets. A ⊆ B iff A−B = ∅.

Solution.

A ⊆ B ⇐⇒ ∀x(x ∈ A→ x ∈ B)

⇐⇒ ∀x(x /∈ A ∨ x ∈ B)

⇐⇒ ¬[∃x(x ∈ A ∧ x /∈ B)]

⇐⇒ ¬[∃x(x ∈ ArB)]

⇐⇒ ArB = ∅.

Note that iff proofs should be done in two steps: A ⊆ B =⇒ ArB = ∅and ArB = ∅ =⇒ A ⊆ B

2008-1 midterm1/Q3

Prove the following:If m and n are integers and mn is even, then m is even or n is even.

Solution.

Assume that m and n are both odd. Then m = 2k + 1 and n = 2l + 1 fork ∈ Z and l ∈ Z

19

Page 20: BU-CmpE 220 Discrete Mathematics Midterm I Questions

m.n = (2k + 1)(2l + 1) (2)

= 4kl + 2k + 2l + 1 (3)

= 2 (2kl + k + l)︸ ︷︷ ︸a

+1 (4)

= 2a+ 1 for a ∈ Z (5)

Hence, we find that m.n is odd. However, this is a contradiction since weknow that m.n is even. Our assumption was wrong.So: Not both m and n are odd.≡m is even or n is even.

2008-1 midterm1/Q4def. Let ρ be a relation on a set S. Then the relation ρ−1, defined by xρ−1y ←→yρx, is called the inverse of ρ.

Prove that if ρ is transitive, then ρ−1 is transitive.Solution.Let ρ be a relation on S. ρ−1, defined by, xρ−1y ←→ yρx is the inverse relationof ρ. Prove that if ρ is transitive, then so is ρ−1.

←→ρ is transitive:For a, b, c ε S and (a, b), (b, c) ε ρ → (a, c) ε ρ .

The inverse relation ρ−1 contains (b, a), (c, b) and (c, a) as elements. Its straight-forward to verify that:

For a, b, c ε S and (c, b), (b, a) ε ρ−1 → (c, a) ε ρ−1. Hence, ρ−1 is transitive.

2008-1 midterm1/Q5Show that the following is a tautology without using truth tables:[(p ∨ q) ∧ (p −→ q) ∧ (q −→ r)] −→ r

Solution.[(p ∨ q) ∧ (¬p ∨ q) ∧ (¬q ∨ r)]⇒ r =[((p ∨ q) ∧ ¬p) ∨ ((p ∨ q) ∧ q)] ∧ (¬q ∨ r)⇒ r =[(p ∧ ¬p)︸ ︷︷ ︸

F

∨(¬p ∧ q) ∨ (p ∧ q) ∨ q] ∧ (¬q ∨ r)⇒ r =

[(¬p ∧ q) ∨ (p ∧ q) ∨ q] ∧ (¬q ∨ r)⇒ r =[(q ∧ (p ∨ ¬p)) ∨ q︸ ︷︷ ︸

q

] ∧ (¬q ∨ r)⇒ r =

[q ∧ (¬q ∨ r)]⇒ r =[(q ∧ ¬q)︸ ︷︷ ︸

F

∨(q ∧ r)]⇒ r =

[q ∧ r]⇒ r = ¬(q ∧ r) ∨ r= ¬q ∨ ¬r ∨ r︸ ︷︷ ︸

T

= T

TAUTOLOGY

20

Page 21: BU-CmpE 220 Discrete Mathematics Midterm I Questions

2007-3 midterm1/Q1Let [G, ◦] be a group and let x, y ∈ G. Define a relation ρ on G by xρy ↔g ◦ x ◦ g−1 = y for some g ∈ G.

1. Show that ρ is an equivalence relation on G.

2. Prove that for each x ∈ G, [x] = {x} if and only if G is commutative.

Solution.

2007-3 midterm1/Q2def. Let f : S → T be a function. If there exists a function g : T → S suchthat g ◦ f = iS where iS is the identity function on S, then g is called a leftinverse of f .Prove the following theorem:thm. f has a left inverse if and only if f is injective.

Solution.

⇒ partf has a left inverse g : T → SNeed to show that ∀a, b ∈ S , a 6= b⇒ f(a) 6= f(b).Suppose a 6= b and f(a) = f(b).f(a) = f(b)⇒ g(f(a)) = g(f(b))⇒ (g ◦ f)(a) = (g ◦ f)(b)⇒ is(a) = is(b)⇒ a = bSo f(a) 6= f(b). Therefore f is an injection.

⇐ partf is injectionDefine relation g = (f(a), a) ∈ T × SLet (f(a), a), (f(a), a′) ∈ g). Since f is an injection , a = a′.Then g is a function.Consider g ◦ f(g ◦ f)(a) = g(f(a)) = a⇒ (g ◦ f = is)Therefore g is a left inverse of f .Note that f−1 is not defined

Example:S=a,bT=1,2,3Define f on S

s f(s)a 1b 2

Define g on S

21

Page 22: BU-CmpE 220 Discrete Mathematics Midterm I Questions

t f(t)1 a2 b3 b

The g ◦ f = is.

2007-3 midterm1/Q3Let A = Z+ × Z+ and β be the relation on A defined by (a, b)β(c, d) iffa + d = b + c. Show that β is reflexive, symmetric and transitive but notanti-symmetric.Solution.

i.)reflexivity ∀ a, bε Z+ a+b=a+b ⇒ a+b=a+b ⇒ (a, b)β(a, b)So β is reflexive.ii.)Symmetry(a, b)β(c, d) ⇒ a+d=b+c ⇒ d+a=c+b ⇒ c+b=d+a ⇒ (c, d)β(a, b)So β is symmetric.iii.)transitivity(a, b)β(c, d) and (c, d)β(e, f)⇒ a+d=b+c and c+f=d+e⇒(a+d)+(c+f)=(b+c)+(d+e)⇒ a+f=b+eSo β is transitive.iv.)anti-symmetryNeed to find a counter example.(1, 2)β(2, 3) since 1+3=2+2(2, 3)β(1, 2) since 2+2=1+3but (1, 2) 6= (2, 3)So β is not anti-symmetric.

2007-3 midterm1/Q4Let S(x) and C(x) represent “x shouts” and “x cries”, respectively. Show thatthe following is a valid argument:“Everyone shouts or cries. Not everyone cries. So some people shout and don’tcry.”Solution.

1. ∀x[S(x) ∨ C(x)] Everyone shouts or cries

2. ∃x¬C(x) Not everyone cries

3. ¬C(x) Existential spesification

4. S(a) ∨ C(n) Universal spesification

5. C(a) ∨ S(a) from 4 and commutativity

6. S(a) from 3 and 5 andpp∨qq

22

Page 23: BU-CmpE 220 Discrete Mathematics Midterm I Questions

7. S(a) ∧ ¬C(a) from 3 and 6

8. ∃x[S(x) ∧ ¬C(x)] Existential generalization

2007-3 midterm1/Q5Prove the following:thm. Let f : A→ B be a function between finite sets.

1. If f is injective then |A| ≤ |B|.

2. If f is surjective then |A| ≥ |B|.

Solution.

Let A = {a1, a2, ..., an} and B = {b1, b2, ..., bm}.

� F is an injection.Then f(a1), f(a2), ...., f(an) are all differentSo B contains at least n elements.. . . |A| ≤ |B|

� f is surjectionThen the list of elements f(a1), f(a2), ..., f(an) mustinclude every element of B at least once (but may contain repeats). . . |A| ≥ |B|

� f is bijection⇒ f is an injection and a surjection⇒ |A| ≤ |B| ∧ |A| ≥ |B|⇒ |A| = |B|

2007-1 midterm1/Q1A relation R on a set A is called circular if aRb and bRc implies cRa. Showthat R is reflexive and circular iff R is an equivalence relation.

Solution.

R ⊆ A2

Definition R is circular ⇔ (aRb ∧ bRc⇒ cRa)R is circular and reflexive ⇔ R is an equivalance relation

⇒ part

1. R is reflexive. Given.

2. Let aRb. Need to show bRaaRa, bRb [R is reflexive.]aRb⇒ aRa ∧ aRb⇒ bRa. R is symmetric.

23

Page 24: BU-CmpE 220 Discrete Mathematics Midterm I Questions

3. Let aRb, bRc. Need to show aRc.aRb ∧ bRc⇒ cRa [ R is circular ]aRc [ R is symmetric ]R is an equivalence relation.

⇐ part

Need to show that R is circular and reflexive.

1. R is reflexive [R is an equivalence relation.]

2. ∀a, b, c ∈ A aRb ∧ bRc⇒ aRc [R is transitive]⇒ cRa [R is symmetric]R is circular.

2007-1 midterm1/Q2Let H be a subgroup of [G, ?] and a ∈ G. Let Ha = {aha−1 | h ∈ H}. Showthat [Ha, ?] is a subgroup of [G, ?].Solution.

i) Show that * is a binary operation on Ha. Show all b, c ∈ Ha,⇒ ∃hb, hc ∈ H b=ahba

−1 c=ahca−1

b*c=(ahba−1)(ahca

−1)= ahb(a

−1a)hca−1

= ahb e hca−1

= ahbhca−1 Let hd = hbhc

= ahda−1

⇒ b ∗ c ∈ Ha

ii) Use thm ∀ c, b ∈ Ha cb−1 ∈ Hc. Let b = ahba

−1 , c = ahca−1

b−1=(ahba−1)−1=(a(hba

−1))−1=(hba−1)−1a−1=(ah−1

b )a−1)=ah−1b a−1

check bb−1 = (ahba−1)(ah−1

b a−1) = ahb(aa−1)h−1

b a−1 = a(hbh−1b )a−1 = aa−1 =

eSo cb−1 = (ahca

−1)(ah−1b a−1) = ahc(a

−1a)h−1b a−1 = ahch

−1b a−1 = ahda

−1 ∈Hc [hd = hch

−1b

2007-1 midterm1/Q3Translate the following into symbolic form using one-place predicates. Definepredicates used and, where necessary, define the universe of discourse.i) All babies cry a lot.ii) There are people who have had a university education and live in poverty.iii) Somebody set off the fire alarm and everybody left the building.iv) Not all rats are dirty and carry disease.v) A set is a subset of its powerset.Solution.

i. ∀x[B(x)→ C(x)]B(x) : x is baby,C(x) : x cries a lot.

ii. ∃x[U(x) ∧ P (x)]UD: people,

24

Page 25: BU-CmpE 220 Discrete Mathematics Midterm I Questions

U(x) : x has had a university education,P (x) : x lives in poverty.

iii. ∃x[F (x) ∧ ∀xB(x)]UD: people in the building,F (x)= x set off the fire alarm,B(x)= x left the building.

iv. ¬∀x[D(x) ∧ C(x)]UD: cats,D(x)=x is dirty,C(x)=x carries disease.

v. ∀A[A ⊆ 2A]UD: sets.

2007-1 midterm1/Q4Def. ∀(a, b), (c, d) ∈ N× N [(a, b) ≡ (c, d)⇔ a+ d = c+ b].

Show that ≡ is an equivalence relation.

Note By defining (a, 0) = a and (0, a) = −a this equivalence relation canbe used to construct Z using N.Solution.Let (a,b),(c,d),(e,f) εN× Ni) reflexivitya+b=b+a → (a, b) ≡ (a, b)ii) symmetry(a,b) ≡ (c,d) → a+d=c+b [def of ≡⇒ c+b=a+d [smymetry of = in N⇒ (c,d) ≡ (a,b) [def of ≡iii) transivity(a,b) ≡ (c,d) ∧ (c,d) ≡ (e,f) Need to show (a,b) ≡ (e,f) or a+f=e+b⇒ a+d=c+b ∧ c+f=e+d [def of ≡⇒ (a+d)+(c+f)=(c+b)+(e+d) [add left and right of =⇒ a+d+c+f=c+b+e+d [assoc.⇒ a+d+f+c=(b+e+d)+c [comm.⇒ a+d+f=b+e+d [thmA⇒ a+f+d=b+e+d [comm⇒ a+f=b+e [thmA⇒ a+f=e+b [commthmA ∀ a,b,c εN a+b=c+b ⇒ a=c

2007-1 midterm1/Q5Prove the following:

Thm. There is no surjection from a set to its power set. That is,¬∃f : A→ 2A f is surjection.

Solution.Suppose f : A→ 2A is a surjection.Consider B = {a ∈ A|a /∈ f(a)}Clearly B ⊆ A⇒ B ∈ 2A

25

Page 26: BU-CmpE 220 Discrete Mathematics Midterm I Questions

Since f is a surjection, ∃a ∈ A such that f(a) = B ∈ 2A

Check if a ∈ Ba ∈ B ⇔ a /∈ f(a) [def. of B

⇔ a /∈ B [f(a) = BContradiction.

2006-3 midterm1/Q1Translate the following to plane English.Let A and B be sets. Let ∅ be the empty set and P be a property of sets.

i) ∀x(x ∈ A⇔ x ∈ B)⇔ A = Bii) ∃∅(∀x(x /∈ ∅))iii) ∃B∀y(y ∈ B ⇔ y ∈ A ∧ P (y))iv) ∃C∀u(u ∈ C ⇔ u = A ∨ u = B)

Solution. These are Zermelo-Fraenkel Axioms:i) Two sets are equal if and only if they have the same elements.ii) There exists a set that has no elements.iii) For each set A and every property P of sets, there exists a set consistingprecisely of those elements of A which have property P .iv) For any sets A and B, there exits a set C whose elements are precisely Aand B.

2006-3 midterm1/Q2Let A be any set. Let R = AxA and S = ∅.

1. Find R−1 and S−1

2. Find R ◦R and S ◦ S

3. What is R ◦ S

Solution.

1. R−1 = R S−1 = S

2. R ◦R = R S ◦ S = S

3. R ◦ S = S

2006-3 midterm1/Q3Prove or disprove the following.Let f : A→ B and g : B → C. If f and g are surjections, then g◦f is a surjection.

Solution.Need to show that each c ∈ C∀c ∈ C,∃a ∈ A such that (g ◦ f)(a) = c.

Since g is surjective,∀c ∈ C,∃b ∈ B such that g(b) = c.

26

Page 27: BU-CmpE 220 Discrete Mathematics Midterm I Questions

Since f is surjective∃a ∈ A such that f(a) = b.

Then (g ◦ f)(a) = c

2006-3 midterm1/Q4

Suppose f :A→ B is a function. Let {Bi | i ∈ In} be a partition of B, whereIn = {1, 2, ...., n} for some n ∈ Z. Prove that {f−1(Bi) | i ∈ In} is a partitionof A.

Solution.Suppose f : A→ B is a function.Let {Bi|i ∈ In} be a partition of B.Prove {f−1(Bi)|i ∈ In} is a partition of Awhere In = {1, 2, ..., n} for some n ∈ Z.

We need to show

1. f−1(Bi) ∩ f−1(Bj) = ∅ for i 6= j

2. Ui∈I f−1(Bi) = A

f−1(Bi) = {a ∈ A|f(a) ∈ Bi}1. Suppose f−1(Bi)∩ f−1(Bj) = ∅ for i 6= j. Then ∃a ∈ f−1(Bi)∩ f−1(Bj).∃a ∈ f−1(Bi) ∩ f−1(Bj)⇒ a ∈ f−1(Bi) ∧ a ∈ f−1(Bj)⇒ f(a) ∈ Bi ∧ f(a) ∈ Bj

but Bi ∩Bj = ∅ since i 6= j and {Bi|i ∈ In} is a partition of B.⇒ f(a) has two images; one in Bi, one in Bj .Contradiction ⇒ f−1(Bi) ∩ f−1(Bj) = ∅ for i 6= j

2. ∀a ∈ A, f(a) ∈ B since f is a function.f(c) ∈ B ⇒ ∃Bi ∈ {Bi} f(a) ∈ Bi for some i ∈ In since {Bi} is a partitionof B.Then a ∈ f−1(Bi). Hence a ∈ Ui∈In f

−1(Bi). So A ⊆ Ui∈In f−1(Bi).

Let a ∈ Ui∈In f−1(Bi). Then ∃i ∈ In a ∈ f−1(Bi).

⇒ f(a) ∈ Bi ⇒ f(a) ∈ B ⇒ a ∈ f−1(B) = A since f is a function.Hence Uf−1(B) ⊆ A. A = Uf−1(Bi)

2006-3 midterm1/Q5 (Preparata 148/7)Let G be a group. If ∀x ∈ G x2 = 1, then G is an abelian group.

Solution.Let G be a group.If ∀x ε G x2 = 1, then G is an abelian group.Need to show that ∀a, b ε G ab = ba.(ab)(ab) = 1 given.(ab)(ba) = ((ab)b)a = (a(bb))a = (a1)a = aa = 1Then (ab)(ab) = (ab)(ba) = 1By cancellation theorem ab = ba.∀a, b ε G ab = ba

27