9
Q1. Use an appropriate truth tree to answer each of the following questions: i. Is the set a ^ (b ! c),a $ ¬(d ^ e), ¬ (a _ ¬d) _ (b $ c) consistent? If so, give all truth assignments that justify your claim. ii. Is X :(p ! r) _ (q $ ¬s) logically equivalent to Y :(p ^ ¬r) ! ¬(q _ s) ? If not, give all counterexamples (that is, give all truth assignments that certify that X is not logically equivalent to Y ). iii. Is ¬ ( ¬(a _ b) ! (x _ y) ) ! ¬(¬x ^ y) a tautology, contradiction, or contingency? Q2. Strolling along on The Island of Knights and Knaves, we meet an inhabitant called A (whom is a knight or a knave). A says: “There is gold on The Island of Knights and Knaves if and only if I am a knight.” Is there gold on The Island of Knights and Knaves? hint: break the problem down into two cases based on A’s type. (proof by cases) Q3. Prove the following theorem in two ways: i. By Contradiction. ii. With an Indirect Proof (by Contraposition). Theorem. Let n be an integer. If n 3 +5 is odd, then n +2 is even. Q4. Consider the following propositions: P : You pass 1348. S : You study for 1348. L : You learn. C : You get confused. H : You get 100% on the final exam. A : You get at least 40% on the final exam. 4.i). Using the above propositional variables, translate the following argument into proposi- tional logic: You study for 1348, but you get confused. You learn whenever you study for 1348. Getting at least 40% on the final is a necessary condition for you to pass 1348. Getting 100% on the final is a sufficient condition for you to pass 1348. Therefore, You pass 1348 and get confused if and only if you study 1348 and get at least 40% on the final. 4.ii). Using a truth tree, determine whether the above argument is valid. If it is not valid, give all counterexamples. 1 Translation as L P A H→p FEAT

ISCRETE MATHEMATICS FOR COMPUTING DGD 3mysite.science.uottawa.ca/.../exercise_5_solutions.pdf · MAT1348 DISCRETEMATHEMATICS FOR COMPUTING DGD 3 Q1. Use an appropriate truth tree

  • Upload
    hahanh

  • View
    220

  • Download
    0

Embed Size (px)

Citation preview

MAT1348 DISCRETE MATHEMATICS FOR COMPUTING DGD 3

Q1. Use an appropriate truth tree to answer each of the following questions:

i. Is the set�a ^ (b ! c), a $ ¬(d ^ e), ¬

⇥(a _ ¬d) _ (b $ c)

⇤ consistent?

If so, give all truth assignments that justify your claim.

ii. Is X : (p ! r) _ (q $ ¬s) logically equivalent to Y : (p ^ ¬r) ! ¬(q _ s) ?If not, give all counterexamples (that is, give all truth assignments that certify that Xis not logically equivalent to Y ).

iii. Is ¬�¬(a _ b) ! (x _ y)

�! ¬(¬x ^ y) a tautology, contradiction, or contingency?

Q2. Strolling along on The Island of Knights and Knaves, we meet an inhabitant called A(whom is a knight or a knave).

A says: “There is gold on The Island of Knights and Knaves if and only if I am a knight.”

Is there gold on The Island of Knights and Knaves?

hint: break the problem down into two cases based on A’s type. (proof by cases)

Q3. Prove the following theorem in two ways:

i. By Contradiction.

ii. With an Indirect Proof (by Contraposition).

Theorem. Let n be an integer. If n3 + 5 is odd, then n+ 2 is even.

Q4. Consider the following propositions:P : You pass 1348.S : You study for 1348.L : You learn.C : You get confused.H : You get 100% on the final exam.A : You get at least 40% on the final exam.

4.i). Using the above propositional variables, translate the following argument into proposi-tional logic:

You study for 1348, but you get confused.You learn whenever you study for 1348.Getting at least 40% on the final is a necessary condition for you to pass 1348.Getting 100% on the final is a sufficient condition for you to pass 1348.Therefore,

⇥You pass 1348 and get confused

⇤if and only if

⇥you study 1348 and get at

least 40% on the final.⇤

4.ii). Using a truth tree, determine whether the above argument is valid. If it is not valid, giveall counterexamples.

1

Translation

as→ L

P → A

H→p

FEAT

Q1 .i )

an ( b → c)

taintedas→c✓m7 A

7 (dnejr%1and )7 ( bbc )

HC

mdTe 7d ie

*:&"¥ "¥ "¥

since all paths are dead ( closed ),

the root can never be True.

°o° there is no truth assignment that makes all three propositions True

% the set is inconsistent .

ii. Is X : (p ! r) _ (q $ ¬s) logically equivalent to Y : (p ^ ¬r) ! ¬(q _ s) ?If not, give all counterexamples

5

root

:n(×@✓

( X)(¥q←,§v\Gx)7[(p→rN(qc→sDr

(4) (

pmrtncqvsjv

Hh¢pmr)→(qvsDr|

/ |7(porkpfrrgas

'

7(q←ns)✓

Pmrvplnrv/ \

77(qvs)✓

7

,(qvsj✓7(pmrtVqvsjvK!!:?÷: IiYri]]✓7qqv7q✓P P | | 7% .7s✓7757s✓7r 7r p .pv11 /\ I I

* * 7r'7h7p

77rr7p77N7,9g 7,9g"

Iix.

ix:|

Sr r * op@

qvsqvsv1 %

/ \ I r '

7# ← His Trueq s s

# when p=Top@ # / ) q=F

/ q S r=F7(X←Y ) is True % op@ s=F

when p=T ( which means # ' list )

q=T7¥←Y) is Truer=Fs=T When p=T

(which means X←YisF) q=Fr=F ConclusionS=T

@hichmeansxcsyisfj¥11 ogicallyequivalenttoy .

Counterexamples

:X←oYisFlhenanotatautology )

wnenya;E¥yrCjt¥¥)orC¥I¥t

iii. Is ¬�¬(a _ b) ! (x _ y)

�! ¬(¬x ^ y) a tautology, contradiction, or contingency?

6

c_ipropohnorshort.ro#7fi(avbtKvyDt7GxnY@77f(avbtKvyDrTGXAY)1 :

7(avb)→Kvy)✓ giventhat there is already at

/ \ least one complete open path , we

77(avb)vXVY

' Know the proposition at the root ( p )

1 / \ Can be True . ( which means we don't

avbvxvyr needtocompletetherestofthetreej/ \

OcanaabrCamped

rg0pt7[f(avbj→KvyD→7G×nY#7[7(!vb)→(xvy)]✓77G×^y)✓I

avb

)✓7(My)✓7Xfy✓¥

b

Yy sinaallpathsconlyonepathinthiscase)1 are dead

, the root 7 Pcanneverbet.

% :o7Pisa contradiction

X iopisatautology

Q5. Strolling along on The Island of Knights and Knaves, we meet an inhabitant called A(whom is a knight or a knave).

A says: “There is gold on The Island of Knights and Knaves if and only if I am a knight.”

Is there gold on The Island of Knights and Knaves?

hint: break the problem down into two cases based on A’s type. (proof by cases)

7

.

Either A is a Knight or A is a Knave

Cad .Assume A is a Knight .

Then A 's statement must be T since Knights never lie.

A says : (There is gold) a (A is a Knight). -

? T in this case

↳ to make A 's statement T, (There is gold ) must be T

. ( because (T←T) is T ) .

80 IF A is a Knight,then there is gold on The Island .

Cast . Assume A is a Knave.

Then ( in this case ) ,A 's statement must be F since Knaves always lie

A says : (There is gold) a (A is a Knight). -

? F in this case

↳ to make A 's statement F, (There is gold ) must be T

. ( because ( To F) is F)80 IF A is a

Knave,

then there is gold on The Island .

In both possible cases,

it follows that there is gold oh The Island OF K&K .

so there is gold on the Island .

MAT1348C DISCRETE MATHEMATICS FOR COMPUTING T.A. ANDREW WAGNER

DGD 4 ( February 14 )

Q1. Prove the following theorem in two ways:

Theorem. Let n be an integer. If n3 + 5 is odd, then n+ 2 is even.

1i. By Contradiction.

1

Effeteness

Madam speeders

Hk

T #To prove P→Q

To prove P→Q by contradiction ,we assume 7(P→Q) is True

.

Since 7(p→Q)=PmQ ,we start by assuming PMQIST .

Assume P :" n3t5 is odd

"

is true and assume 7Q : "ht2isodd " is True . (goalistoshow contradiction)

since n3t5isodd,

there exists an

|

Since nt2 is odd', there exists an integer

integer k such thatl such that

n3t5=2h+|.

n+2=2l+1

Consequently , 5=2k+1-n3 and n=2lH-2=2tl

Thus

5t2kHf2l-D3-2kHt@eP-3Hej2t3HltD-2kHf8l3-l2l2t6l-D-2kH-8l3t12l2-6lH-2k-8l3H2l2-6lt2-2fr-4l3t6l2-3ltD-2mwherem-k-4l3t6l2-3ltt.ThusmErZ.BydeF.thismeansthat5isevenBThisisacontradictionsinaweKnow5-2tHHisodd.Thereforeassuming7PsQ.isTrue1eadstocontradiction8o7CPsQ1mustberalseInotherwords.P

→ Q( thetheoremjistrue

-

Theorem. Let n be an integer. If n3 + 5 is odd, then n+ 2 is even.

1ii. With an Indirect Proof (by Contraposition).

2

npn-

To prove P→Q.

Q

To prove P→Q with an indirect proof ,we prove 7Q→7P( the contrapositive 7Q→7Pis=P→Q )

7Q : nt2 is odd. 7p:n3+5 is even

.

Assume ) Q is True .ie Assume ht2 is odd. (goal is to prove 7p : n3t5 is even)

Then nt2=2mH for some integer m .

⇒ n=2mtl -2

=2m -1

Consequently , n3+5=(2m - 1)3+5

=(GmP - 3(2m)2t3(2m) - 1) +5

=8m3 - 12m2+6mt4

=2[4m3-6m2t3m+2]

=2j for j=4m3-6m2t3mt2 . thus je 'Z

Thus, bydef.

n3t5 is even . ie 7P is True .

Therefore,

we proved 7Q→7P is true .

=p→÷

2.ii). Using a truth tree, determine whether the above argument is valid. If it is not valid, giveall counterexamples.

2

Q4Donpage1 .

Hoppa

✓root

.mg#qpy&gFIpyan@cgEuasinnereisa+uastone

1 openpalh ,it means the rootSv( which is the negation OF thecvargument) can be True

.

/ \ Thus,the argument itself can bet

.

75 L ✓ which means the argument is

.%#./\ invalidIFA

1 , nP TH P

'HuHE\ \\f¥si¥nge¥I'HEgangs,

at

F*¥ 7¥*k¥¥:*k ¥¥l¥*

Af@# Ago /|1 K¥ ;Y# + ⇒

ax

rootcnegationof arguments root ¥0. ;#i

is True when (negation of arguments

S=T is True when

A=TS=T

p=FA=T

H= F

p=FL=T

H=FC= T

L=T* Both the open paths happen to

C=Tgive the same counterexample