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

2.2 Exercises

1.Translate the following expressions into propositional logic. Use the following proposition letters:

p = \Jones told the truth." q = \The butler did it."

r = \I'll eat my hat."

s = \The moon is made of green cheese."

t = \If water is heated to 100 C, it turns to vapor."

(a)If Jones told the truth, then if the butler did it, I'll eat my hat.

(b)If the butler did it, then either Jones told the truth or the moon is made of green cheese, but not both.

(c)It is not the case that both Jones told the truth and the moon is made of green cheese.

(d)Jones did not tell the truth, and the moon is not made of green cheese, and I'll not eat my hat.

(e)If Jones told the truth implies I'll eat my hat, then if the butler did it, the moon is made of green cheese.

(f)Jones told the truth, and if water is heated to 100 C, it turns to vapor. 1. (a) p ! (q ! r)

1.(b) q ! ((p _ s) ^ :(p ^ s))

1.(c) :(p ^ s)

1.(d) :p ^ :s ^ :r

1.(e) (p ! r) ! (q ! s)

1.(f) p ^ t

3.Let p denote the proposition \Jill plays basketball" and q denote the proposition \Jim plays soccer." Write out{in the clearest way you can{ what the following propositions mean:

(a):p

(b)p ^ q

(c)p _ q

(d):p ^ q

(e)p ! q

(f)p $ q

(g):q ! p

3. (a) Jill does not play basketball.

3. (b) Jill plays basketball and Jim plays soccer.

3. (c) Jill plays basketball or Jim plays soccer.

3. (d) Jill does not play basketball and Jim plays soccer. 3. (e) If Jill plays basketball then Jim plays soccer.

3. (f) Jill plays basketball if and only if Jim plays soccer. 3. (g) If Jim does not play soccer then Jill plays basketball.

5.Jim, George, and Sue belong to an outdoor club. Every club member is either a skier or a mountain climber, but no member is both. No mountain climber likes rain, and all skiers like snow. George dislikes whatever Jim likes and likes whatever Sue dislikes. Jim and Sue both like rain and snow. Is there a member of the outdoor club who is a mountain climber?

5.

 

Member

 

Mt. Climb.

Skier

Like rain

Like snow

 

 

 

 

 

 

 

 

Jim

 

No

Yes

Yes

Yes

 

George

 

Yes

No

No

No

 

Sue

 

No

Yes

Yes

Yes

 

 

 

 

 

 

 

Yes, by George! We do not assume here that a club member dislikes a sport if he or she does not participate in that sport.

7.Let proposition p be T, proposition q be F, and proposition r be T. Find the truth values for the following:

(a)p _ q _ r

(b)p _ (:q ^ :r)

(c)p ! (q _ r)

(d)(q ^ :p) $ r

(e):r ! (p ^ q)

(f)(p ! q) ! :r

(g)((p ^ r) ! (:q _ p)) ! (q _ r)

7. (a) T

7. (b) T

7. (c) T

7. (d) F

7. (e) T

7. (f) T

7.(g) T

9.Find the expression tree for the following formulas:

(a):p ^ (:q _ r)

(b)p _ (:q ^ :r)

(c)((p _ q) $ r) $ p

(d)(:q ^ :r) $ (p ! (q _ r))

9.(a)

p

v

(

q v r )

p

 

 

q v r

 

 

 

q

p

 

 

r

q

9. (b)

p

v

( q

v

r )

 

 

 

 

 

 

q

v

r

p

 

 

 

q

 

 

 

 

 

 

 

r

 

 

 

 

 

 

 

 

 

q

 

 

r

9. (c)

(( p

( p v q) vv

r

p v q

p

q

v q)

r

v

v

r )

v

v

p

p

9. (d)

p

v

p p

(

p

v

 

q

q

q )

v

v

( p

v

(q v r ) )

p

p

v

(q v r )

q v r

p

q

q

r

11. Find the expression tree for the formula

((:(p ^ q)) _ (:(q ^ r))) ^ ((:(p $ (:(:s)))) _ (((r ^ s) _ (:q))))

( (p

v

.11

( (

 

(

p

v

q )) v (

 

( q

v

r ) ))

v

(( (

p

vv

(

 

( )

) ))

 

(((r

v

 

 

 

(

 

 

q ))))

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

s

 

 

 

 

v

 

 

 

s) v

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(

 

(

p

vv

(

 

 

(

 

)

) ))

v

(((r

v

 

(

 

q )))

q )) v ( ( q

v

 

r ) )

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

s

 

 

 

 

s) v

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(p

v

q )

p

v

q

p q

(q

q

v

(

p

vv

(

 

( )

) )

 

 

 

 

 

 

s

 

r )

q

v

r

p

vv

(

( )

 

 

 

 

 

s

( s )

r

p

s

s

(( r

r

v

s

)

r s

v

s) v ( q ))

q

q

13.Find a boolean expression to represent the following combinatorial circuits:

(a)A

B

C

(b)A

B

A

B

C

D

13. (a) A ^ (:(B _ C))

13.(b) ((A _ :B) ^ (:((B ^ C) ^ A))) _ D

15.Find a boolean expression to represent each of the following combinatorial networks shown.

(a)

x y

z

(b)

x y

x z

(c) Can you interpret this combinatorial network in terms of a decision making process for three individuals?

x y x z

y z

15. (a) (x ^ y) ^ :z

15. (b) :(:x _ y) _ (x ^ z)

15.(c) A simple majority of the three voters will cause a vote of yes.

17.(a) What is the relationship between the number of propositional connectives in a formula and the number of parentheses? Prove your answer.

(b)What is the relationship between the number of ^'s, _'s, !'s, and $'s in a formula and the number of proposition letters in the formula? Prove your answer.

(c)What is the relationship between the number of :'s in a formula and the number of proposition letters in the formula? Prove your answer.

(d)How many left parentheses may a formula contain? Prove your answer.

(e)How many total symbols may a formula contain? (Count each occurrence of each proposition letter as one symbol. So (p123 ^ p123) contains

5 symbols: (, p123, ^, p123, and ). For example, can a formula contain exactly 2 symbols? Or exactly 17 symbols? Prove your answer.

17. (a) The number of propositional connectives, the number of left parentheses, and the number of right parentheses are all equal | and thus the total number of parentheses is twice the number of operators.

Proof: For any formula , let o( ) be the number of operators in ; l( ), the number of left parentheses, and r( ), the number of right parentheses. We prove the result by induction on formulas.

(case for atomic formulas:) If is a proposition letter, T , or F , then o( ) = l( ) = r( ) = 0.

(Inductive step, case 1:) Assume = (: ), where the result is true of. Now just count the symbols in string : contains one operator, :, plus the operators in , i.e., o( ) = 1 + o( ). Similarly, l( ) = 1 + l( ), and r( ) = 1 + r( ). By assumption, o( ) = l( ) = r( ), so o( ) = l( ) = r( ).

(Inductive step, case 2:) Assume = ( ^ ), where the result is true of ; . So

o( ) = o( ) + 1 + o( )

=l( ) + 1 + l( ) (by ind. hyp.)

=l( )

and, similarly, o( ) = r( ).

(Inductive step, cases for _, !, and $:) all analogous to case 2.

17. (b) The number of binary operators | ^'s, _'s, !'s, and $'s | is one less than the number of proposition letters, T 's and F 's.

Proof by induction on formulas. (Base step) The base case is clear:

T , F , and proposition letters contain one proposition letter or constant and no binary operators.

(Inductive step for :) If contains one one fewer binary operator then proposition letters, T 's, and F 's, then so does (: ), since no binary operators, proposition letters, T 's, or F 's were added in forming (: ).

(Inductive steps for the binary operators) We shall do only the case for ^, since the cases for the other binary operators are completely analogous. Consider a formula = ( ^ ), where the result is true for and . Let a (resp., a , a ) be the number of occurrences of proposition letters, T , and F in (resp., , ), and let b (resp., b , b ) be the number of occurrences of binary operators in (resp., , ). Every occurrence of a proposition letter, T , or F in occurs in either or | and not in both, since and are disjoint substrings of . Every occurrence of a binary operator except the ^ explicitly shown occurs in either or | and not both. Thus

a =

a + 1 + a

=

(b 1) + 1 + (b 1) (by ind. hyp.)

=

b + b 1

=

b 1:

There is no relationship between the number of binary operators and the number of proposition letters alone | one can construct examples as in

(c) below.

17.(c) There is no relationship between the number of proposition letters and the number of :'s in a formula. A formula (: : :T ) ^(F _x _x _ x _ _ x) is well-formed, and we can put in as many :'s and as many _x's as we choose. Similarly, there is no relationship between the number of :'s and the number of proposition letters, T 's, and F 's, save that a formula must contain at least one proposition letter, T , or F .

17.(d) A formula may contain any number of left parentheses. T , (:T ), (:(:T )), (:(:(:T ))), . . . are all well-formed.

17. (e) The lengths of formulas are 1; 4; 5 and all integers greater than or equal to 7.

Proof: Let L be the set of all lengths of well-formed formulas. To the recursive de nition of formula we correspond a recursive de nition of L:

Recursion on L

Corresponding formula formation rule

1 2 L

T , F , and proposition letters are formulas.

If n 2 L then n + 3 2 L

If is a formula, so is (: )

If m; n 2 L, m + n + 3 2 L

If ; are formulas, so are ( ^ ), ( _ ), . . .

For the proof that L = f1; 4; 5; 7; 8; 9; : : :g, compare Example 3, Section 1.4.

2.4 Exercises

1.A restaurant displays the sign \Good food is not cheap" and a competing restaurant displays the sign \Cheap food is not good." Are the two restaurants saying the same thing?

1. Yes, construct the truth table and show the two propositions are a tautology. Let G represent good food and C represent cheap food. The statements are G ! :C and C ! :G:

 

G

C

 

:G

X = :C

G ! :C

Y = C ! :G

X $ Y

 

 

 

 

 

 

 

 

 

 

T

T

 

F

F

T

T

T

 

 

 

 

 

 

 

 

 

 

T

F

 

F

T

T

T

T

 

F

T

 

T

F

T

T

T

 

 

 

 

 

 

 

 

 

 

F

F

 

T

T

F

F

T

 

 

 

 

 

 

 

 

 

3. Find the expression tree for the formula

p ! ((:p) ! q)

Evaluate the expression tree if proposition p is T and proposition q is F. 3.

( p ( ( p ) q ) ) T

p

T

 

 

p

 

q

T

 

 

 

 

 

 

 

 

 

 

 

 

 

 

p F

q

F

 

 

 

 

 

p T

5. Find the expression tree for the formula

((((:(:p)) ^ (:q)) ^ r) _ (((:(:q)) ^ (:r)) ^ s)) $ (s ! p)

Evaluate the expression tree if proposition p is T, proposition q is T, proposition r is F, and proposition s is F.

5.

((((( (

p))

v

 

 

 

q))v

 

 

 

 

 

 

q))v

 

 

r))v

 

 

 

F

 

 

 

r)v (((

 

 

 

 

 

 

 

 

 

(

 

 

(

 

(

s))

 

(s

p))

 

 

 

 

 

 

 

 

 

 

 

 

 

p))v

 

 

q))v

v

 

 

 

 

 

q))v

 

 

 

r))v

 

s

p

 

(((((

 

(

 

(

r)

(((

(

 

(

s))F

 

 

T

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

s F

s F

 

p T

(((

 

(

 

p))v

(

q))v

r)v

(((

(

 

q))v

(

 

 

r)) T

 

 

 

 

((( ( p))

p

v

p T

p F

p T

v

 

 

q))v

F

(

r)

q

F

r F

 

q

F

 

 

 

 

 

 

 

 

 

 

q

T

 

((( (

q T

q F

q T

q))

v

 

 

r)) T

(

 

 

 

r T

r F

7. Find the expression tree for the formula

:(p ^ q) $ (:p _ :q)

Evaluate the expression tree for all possible pairs of truth values for p and q. Use these evaluations to prove this formula is a tautology.

7.

( p

v

q )

p

v

q

p

q

T

 

T

 

( p

v

q )

p

v

q

p

q

F

 

T

 

( p

v

q )

p

v

q

p

q

T

 

F

 

( p

v

q )

p

v

q

p

q

F

 

F

 

( p

( p

( p

( p

v

v

v

v

q )

q )

q )

q )

v

v

v

v

v

v

v

v

(

(

(

(

p v q )

p

p T

p v q )

p

p T

p v q )

p

p F

p v q )

p

p F

p v q

q

q T

p v q

q

q F

p v q

q

q T

p v q

q

q F

9.Let = \The home team is ahead;" = \The fans are happy;" and = \The visiting team is losing." For inference rules (a), (g), and (i) in Table 2.6, write out the hypothesis and the conclusion for ; ; and :

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