Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
73
Добавлен:
20.03.2016
Размер:
629.47 Кб
Скачать

Review Questions

1.Prove or nd a counterexample to the following conjectures about relations

R1 and R2:

(a)If R1 and R2 are re exive, then R1 R2 is re exive.

(b)If R1 and R2 are irre exive, then R1 R2 is irre exive.

(c)If R1 and R2 are symmetric, then R1 R2 is symmetric.

(d)If R1 and R2 are antisymmetric, then R1 R2 is antisymmetric.

(e)If R1 and R2 are transitive, then R1 R2 is transitive.

1. (a) True since (x; x) 2 R1 and (x; x) 2 R2, we can use x itself as the \z" element to show that (x; x) 2 R1 R2:

1. (b) False. A = f1, 2, 3g, R1 = f(1, 3)g, R2 = f(3, 1)g, then (3; 3) 2

R1 R2:

1. (c) False. R1 = f(1, 2), (2, 1)g and R2 = f(2, 3), (3, 2)g give (3; 1) 2 R1 R2 but (1; 3) 62R1 R2:

1. (d) False. R1 = f(2, 3), (4, 1)g and R2 = f(1, 2), (3, 4)g. Now (1; 3) 2 R1 R2 and (3; 1) 2 R1 R2:

1. (e) False. R1 = f(1, 3), (4, 5)g and R2 = f(2, 1), (3, 4)g. Now (2; 3); (3; 5) 2 R1 R2 but (2; 5) 62R1 R2:

3. Let R be a relation de ned on fa, b, c, dg such that

R = f(a; a); (b; b); (c; a); (d; d); (a; b); (b; d); (a; d)g

Find the symmetric closure of R:

3.f(a; a); (b; b); (c; c); (d; d); (c; a); (a; c); (a; b); (b; a); (b; d); (d; b); (a; d); (d; a)g

5.De ne the relation R on R R such that for any (x; y); (u; v) 2 R R, we have (x; y)R(u; v) if and only if y = v: Prove that R is an equivalence relation.

5.Let (x; y) 2 R: Now (x; y)R(x; y) since y = y. Therefore, R is re exive.

Let (x; y); (z; t) 2 R R such that (x; y)R(z; t).

It follows that

y =

t, so, (z; y)R(x; y) by de nition of R. Therefore,

R is symmetric.

Let

(x; y); (r; s); (t; u) 2 R R such that (x; y)R(r; s) and (r; s)R(t; u): Then y = s = u. It follows that (x; y)R(t; y) and so R is transitive. Therefore, R is an equivalence relation because it has been shown to be re exive, symmetric, and transitive.

7.The oddness or evenness of an integer is called its parity. Prove that the relation \have the same parity" is an equivalence relation. Find the distinct equivalence classes of this equivalence relation.

7. (re exive) Clearly an integer n has the same parity as the integer n!

(symmetric) If n and m have the same parity, then m and n have the same parity. Thus the relation is symmetric.

(transitive) If m and n have the same parity and n and q have the same parity, we must prove that m and q have the same parity. Since n and q both have the same parity as m, they have the same parity as each other. Therefore, n and q are related and parity is transitive.

There are two equivalence classes, fn : n is eveng and fn : n is oddg.

9.Let R be a re exive relation on a set A: R is an equivalence relation if and only if (a; b); (a; c) 2 R implies that (b; c) 2 R:

9. First assume that R is an equivalence relation, and let a; b); (a; c) 2 R. Since R is symmetric (c; a) 2 R and (a; b) 2 R. Since R is transitive, (c; b) 2 R. Thus, (a; b); (a; c) 2 R implies that (b; c) 2 R. Now assume that (a; b); (a; c) 2 R implies that (b; c) 2 R. Suppose (x; y) 2 R.

Since R is re exive, (x; x) 2 R. Therefore, (x; y); (x; x) 2 R so it follows that (y; x) 2 R. Therefore, R is symmetric.

Now suppose (x; y); (y; z) 2 R: Since R is re exive, (x; x); (z; z) 2 R. Therefore, (x; y); (x; x) 2 R so (y; x) 2 R. Now (y; x); (y; z) 2 R implies that (x; z) 2 R. Therefore, R is transitive.

11.Let R1 be a partial order on S and R2 a partial order on T . For (s1; t1); (s2; t2) 2 S T , de ne (s1; t1)R3(s2; t2) if and only if s1R1s2 and t1R2t2: Prove that R3 is a partial order.

11. (re exive) Let (x1; x2) 2 S T . Since S and T are re exive, we have x1R1x1 and x2R2x2. This implies (x1; x2)R3(x1; x2). Hence, R3 is re exive.

(antisymmetric) Suppose that (x1; x2)R3(x3; x4) and (x3; x4)R3(x1; x2). By de nition of R3, we have x1R1x3 and x3R1x1. Since R1 is antisym-

metric, x1 = x3. Similarly, we have x2R2x4 and x4R2x2, whence x2 = x4 by the antisymmetric property of R2. So, (x1; x2) = (x3; x4) and consequently, R3 is antisymmetric. This implies that (x3; x4) = (x1; x2). Therefore, R3 is antisymmetric.

(transitive) Let (x1; x2)R3(x3; x4) and (x3; x4)R3(x5; x6): Then x1R1x3 and x3R1x5, so x1R1x5 by transitivity of R1. Similarly, x2R2x4 and x4R2x6 implies that x2R2x6. Thus, (x1; x2)R3(x5; x6) by de nition of R3. So, R3 is transitive.

Using Discrete Mathematics in Computer Science

De nition. An upper bound of two elements in a partial order is an element that is greater than both the elements. A least upper bound is an upper bound that is smaller than any other upper bound. A lower bound of two elements in a partial order is an element that is less than both of the elements. A greatest lower bound is a lower bound that is larger than any other lower bound.

1.Find the least upper bound and the greatest lower bound of each pair of elements in the partial order represented by the following diagram:

 

 

 

 

 

 

 

 

 

 

h

 

 

 

 

 

 

 

 

 

 

 

 

 

f

 

g

 

 

 

 

 

 

 

 

 

 

 

 

e

 

 

 

 

 

 

 

 

 

 

 

 

 

 

d

 

 

 

 

 

 

 

 

 

 

 

 

 

b

 

c

 

 

 

 

 

 

 

 

 

 

 

 

a

 

 

 

 

1.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Elements

 

lub

glb

 

 

Elements

 

lub

glb

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

a

b

 

a

b

 

 

c

g

 

c

g

 

 

a

c

 

a

c

 

 

c

h

 

c

h

 

 

a

d

 

a

d

 

 

d

e

 

d

e

 

 

a

e

 

a

e

 

 

d

f

 

d

f

 

 

a

f

 

a

f

 

 

d

g

 

d

g

 

 

a

g

 

a

g

 

 

d

h

 

d

h

 

 

a

h

 

a

h

 

 

e

f

 

e

f

 

 

b

c

 

a

d

 

 

e

g

 

e

g

 

 

b

d

 

b

d

 

 

e

h

 

e

h

 

 

b

e

 

b

e

 

 

f

g

 

e

h

 

 

b

f

 

b

f

 

 

f

h

 

f

h

 

 

b

g

 

b

g

 

 

g

h

 

g

h

 

 

b

h

 

b

h

 

 

 

 

 

 

 

 

 

 

c

d

 

c

d

 

 

 

 

 

 

 

 

 

 

c

e

 

c

e

 

 

 

 

 

 

 

 

 

 

c

f

 

c

f

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3. De ne the relation D on N so that n D m if and only if n j m: An upper bound of two natural numbers is a natural number that both divide. The smallest such natural number is called the least upper bound and is denoted as lub(; ): For example, 6 is the least upper bound of 2 and 3. A lower bound of two natural numbers is a natural number that divides both numbers. The largest such natural number is called the greatest lower bound and is denoted as glb(; ): For example, the greatest lower bound of 4 and 6 is 2. Find

(a)lub(13; 29)

(b)lub(12; 60)

(c)glb(37; 12)

(d)glb(48; 60):

3. (a) 13 29

3.(b) 60

3.(c) 1

3.(d) 6

5.Carry out a selection sort (de ned in Section 1.7.1) on the words: able, cane, bell, after, stick, and belt. Explain how lexicographical ordering is used for each comparison.

 

START

 

able

cane

bell

after

stick

belt

 

 

 

 

 

 

 

 

 

 

Pass 1

 

able

cane

bell

after

stick

belt

 

Pass 2

 

able

after

bell

cane

stick

belt

 

 

 

 

 

 

 

 

 

 

Pass 3

 

able

after

bell

cane

stick

belt

 

Pass 4

 

able

after

bell

belt

stick

cane

 

 

 

 

 

 

 

 

 

 

Pass 5

 

able

after

bell

belt

cane

stick

 

 

 

 

 

 

 

 

 

7.(a) Prove that logical equivalence is an equivalence relation on the set of all formulas of propositional logic.

(b)Show that as long as we have in nitely many proposition letters, there are in nitely many equivalence classes. (Hint: Once you see the idea, this is pretty trivial.)

(c)Show that for logical equivalence on the set of all formulas in which

the only proposition letters are p ; p ; : : : ; p , there are 22n equivalence

1 2 n

classes.

7. (a) The de nition of logical equivalence states that two formulas, and , are logically equivalent if I( ) = I( ) for every interpretation I. Clearly, I( ) = I( ) for every interpretation I so the relation is re exive. For symmetry the result follows because equality is symmetric. Transitivity follows from the transitivity of equality.

7. (b) Let p1; p2; : : : be in nitely many proposition letters. The interpretations Ipi that is T for pi and F for every other proposition is a set of interpretations for which Ipi (pi) 6= Ipi (pj ) for any j 6= i. Thus, each of the pi is in a separate equivalence class.

7. (c) The conjunction of each di erent nonempty subset of the proposition letters, each possible clause, will be in a di erent equivalence class. Now any subset of the clauses formed from the nonempty subsets of the propositions will lead to a di erent equivalence class. There are 2n subsets of the proposition letters and 22n clauses formed from these 2n subsets.

Соседние файлы в папке Student Solutions Manual