You are on page 1of 15

2015/9/17

SectionSummary
Propositions

Section1.1

HWp.1216:139,4244

Connectives
Negation
Conjunction
Disjunction
Implication;contrapositive,inverse,converse
Biconditional
TruthTables

Handin:4ac

10cegh 14a-d 24adfgh 26b


28bc 32e 38 42ce 44bc

Propositions
Aproposition isadeclarativesentencethatiseithertrue

orfalse.(cannotbeboth,cannotbeneither

Examplesofpropositions:
a) TheMoonismadeofbluecheese.
b) Pigcanfly.
c
1 +0 =1
d
0 +0 =2
Examplesthatarenot propositions.
a) Sitdown!
b) Whattimeisit?
c) x +1=2
d) x +y=z
e
1 +0
f
2n 3n 1

PropositionalLogic
ConstructingPropositions
PropositionalVariables(atomic propositions):p,q,r,s,
ThepropositionthatisalwaystrueisdenotedbyT and
thepropositionthatisalwaysfalseisdenotedbyF.
CompoundPropositions:constructedfromlogical
connectives andotherpropositions

Negation
Conjunction
Disjunction

Implication

Biconditional

2015/9/17

Remember: points up like an A, and it means ND

CompoundPropositions:Negation
Thenegation ofapropositionp isdenotedby p and

hasthistruthtable:

Conjunction
Theconjunction ofpropositionsp andq isdenoted
byp q andhasthistruthtable:

p q

Example:Ifp denotesTheearthisround,then

p denotes Itisnotthecasethattheearthisround,
orsimplyTheearthisnot round.
Ifq denotesI have less than 10 dollars in my pocket.

Disjunction

Example:Ifp denotesIamatschool.and
q denotesItisFridaythen

p q denotesIamatschooland itisFriday.

TheConnectiveOr inEnglish

Thedisjunction ofpropositionsp andq isdenoted


byp q andhasthistruthtable:
p

p q

Example:Ifp denotesIamatschooland
q denotesItisFridaythen

InEnglishorhastwodistinctmeanings.
InclusiveOr

Ex.StudentswhohavetakenDM orLogic maytakethisclass

For p q to be true, either one or both of p and q must be true.

weassumethatstudentsneedtohavetakenoneoftheprerequisites,but
mayhavetakenboth.Thisisthemeaningofdisjunction.

ExclusiveOr
Ex.Souporsaladcomeswiththisentre

wedonotexpecttobeabletogetbothsoupandsalad.Thisisthe
meaningofExclusiveOr(Xor).

Inp q , one ofp andq mustbetrue, but not both.

p q denotesIamatschoolor itisFriday.

2015/9/17

BitOperations

ExclusiveOr(XOR)
The truth table for is
p

p q

Truthvalue

Bit

T
F

1
0

bitwiseOR
bitwiseAND
bitwiseXOR

010101011isabitstringoflength
Note the difference
from OR.

zeroonematrices(Section2.6)

Implication
Antecedent

consequent

Ifp andq arepropositions,thenp q isaconditionalstatementor

implication whichisreadasifp,thenq andhasthistruthtable:


p

p q

Example:Ifp denotesIamathome.andq denotesItis

raining.thenp q denotesIf Iamathomethen itisraining.


Inp q ,p isthehypothesis (antecedent orpremise)andq is
theconclusion (orconsequence).

9 (def.7,p.12)

Evaluate(01111 11001) (11101 00101)


BooleanProduct,,oftwo

ReadDefinitions1 4andExamples1 6(pp.1 6)

Check the Table 9 p.12.

1 0
0 1 1

1 0 0 0 1


1 1

UnderstandingImplication
The meaning of p q dependsonlyonthetruth
valuesofp andq.
Inp q theredoesnotneedtobeanyconnectionbetween
theantecedentortheconsequent.

Ex.TheseimplicationsarenotbeusedinordinaryEnglish,although
theyarecorrectinlogic

Ifthemoonismadeofgreencheese,thenIhave

moremoneythanBillGates.
If1+1=3,thenmygrandmawearsaprettypink

skirt.

Ifp istrue,thenq istrue.

2015/9/17

DifferentWaysofExpressing p q
ifp,thenq

p impliesq

ifp,q

p onlyifq
when p, q

q if p

q when p

q whenever p
q followsfromp
q unless

q isimpliedbyp

p issufficientforq
asufficient conditionforq is p

q isnecessaryforp

Examples
Writethesestatementsintheformifp,thenq
Yourguaranteeisgoodonlyif youboughtyourCD
playerlessthan90daysago.
Itsnowswhenever thewindblowsfromthenortheast.
Onecan'tlearnaforeignlanguage unless hestudies
hard.
Itisnecessarytowashthebossscartogetpromoted.
Washing the bosss car is necessary
for getting promoted.

anecessary conditionforp is q

Homeworkexample(ex.8p.8;hw#42p.16)

Converse,Contrapositive,andInverse

Whatisthevalueofxafterthestatementis
encounteredinacomputerprogram?Assumex=0
beforethestatementisencountered.

Fromp q wecanformnewconditionalstatements.
q p
istheconverse ofp q

q p isthecontrapositive ofp q
p q istheinverse ofp q
Ex. Findtheconverse,inverse,andcontrapositive of
ThatthePistonswinthechampionshipimpliesthat
theybeattheLakers.

(a)ifx+2=2thenx:=x+1
(b)if(2+2=4)XOR (1+2=3)thenx:=x+1

2015/9/17

ThatthePistonswinthechampionshipimplies
thattheybeattheLakers.

Converse,Contrapositive,andInverse
Fromp q wecanformnewconditionalstatements.
converse: q p
contrapositive: q p
inverse: p q

Biconditional
Ifp andq arepropositions,thenwecanformthe

biconditional propositionp q ,readasp ifandonlyifq .


Thebiconditional p q denotesthepropositionwiththistruth
table:
p

p q

Ifp denotesIamathome.andq denotesItisraining.then

p q denotesIamathomeifandonlyifitisraining.

ExpressingtheBiconditional
Somealternativewaysp ifandonlyifqisexpressed
inEnglish:

Terminologies
Propositions
Atomic propositionsCompound propositions

p isnecessaryandsufficientforq
if p then q ,andconversely
p iff q

Example. p q r
What is the truth value if
p is T, q is F, and r is F?

2015/9/17

PrecedenceofLogicalOperators
Operator

Precedence

2
3

4
5

p q r

ExampleTruthTable
Constructatruthtablefor p q r

isequivalentto p q r

Iftheintendedmeaningis
p q r or p q r
thenparenthesesmustbeused.

EquivalentPropositions

Problem

Twopropositionsareequivalent iftheyalwayshave
thesametruthvalue.

Howmanyrowsarethereinatruthtablewithn
atomicpropositions?

Example:Showusingatruthtablethatthe
implication isequivalenttothecontrapositive.

Solution:
Notethatthismeansthatwithn atomicpropositions,
wecanconstruct
distinct i.e., not equivalent
propositions.

2015/9/17

Translating EnglishSentences
Englishaswellaseveryotherhumanlanguagesare
oftenambiguous.
TranslatingsentencesfromEnglishintological
expressionscanremovetheambiguity.

HWp.22:112,33 35
Handin:2,4,10,12,34

Translating EnglishSentences
StepstoconvertanEnglishsentencetoastatementin
propositionallogic
Identifyatomicpropositionsandrepresentusing
propositionalvariables.
Determineappropriatelogicalconnectives
Ex.IfIgotoHarrys ortothecountry,
Iwillnotgoshopping.

Translating EnglishSentences
Identifyatomic propositions
Representthemusingpropositionalvariables
Determineappropriatelogicalconnectives

Example. YoucanaccesstheInternetfromcampus
onlyifyouareacomputersciencemajororyouarenot
afreshman.

h : I go to Harrys
c: I go to the country
s: I will go shopping

2015/9/17

Example
Problem: Translatethefollowingsentenceinto
propositionallogic:
Itiseitherbelowfreezingoritissnowing,but itisnot
snowingifitisbelowfreezing.
Problem: Translatethefollowingsentenceinto
propositionallogic:

SystemSpecifications
SystemandSoftwareengineerstakerequirementsin
Englishandexpresstheminaprecisespecification
languagebasedonlogic.

Example:Expressinpropositionallogic:
Theautomatedreplycannotbesentwhenthefile
systemisfull

Janewillswimunless thewateristoocold.

ConsistentSystemSpecifications
Given alist ofrelatedpropositions,expressin
propositionallogic:
Thediagnosticmessageisstoredinthebufferoritis

retransmitted.
Thediagnosticmessageisnotstoredinthebuffer.

Consistent SystemSpecifications
Definition:Alistofpropositionsisconsistent ifitis
possibletoassigntruthvaluestotheproposition
variablessothateachpropositionistrue.
Exercise:Arethesespecificationsconsistent?
p q, p , p q.

Ifthediagnosticmessageisstoredinthebuffer,thenitis

retransmitted.
WhatifThediagnosticmessageisnotretransmittedisadded?

2015/9/17

Example
Istheset{pq, qr, pr} consistent?Giveyour
reason.

Section1.3

HWp.3436:1 15,18 27,2933,61,62


Handin:8bd,10b,12(do10b),14,18,20,24,30,32,62
Dohomeworkproblems#9 12(p.22)ofyourown

Tautologies,Contradictions,and
Contingencies
Atautology isapropositionwhichisalwaystrue.
Example:
Acontradiction isapropositionwhichisalways
false.
Example:
Acontingency isapropositionwhichisneithera
tautologynoracontradiction,

LogicallyEquivalent

Twocompoundpropositionsp andq arelogicallyequivalentif


pq isatautology.
Wewritethisasp q orasp q wherep andq arecompound
propositions.
Twocompoundpropositionsp andq areequivalentifandonlyifthe
columnsinatruthtablegivingtheirtruthvaluesagree.
Example.Show p q isequivalenttop q.

2015/9/17

DeMorgansLaws

Notation

ThistruthtableshowsthatDeMorgansSecondLawholds.

DeMorgansLawsextendtomorethantwopropositions:

( nj1 p j ) ( p1 p2 ... pn ) p1 p1 ... p1


( nj 1 p j ) ( p1 p2 ... pn ) p1 p1 ... p1

Example

KeyLogicalEquivalencesTable 6 p.27

Writethenegationof
Miawalksortakesthebustoschool.

IdentityLaws:,
DominationLaws:,
Idempotentlaws:,
DoubleNegationLaw:

TryHw#7 8,p.35

NegationLaws:,

10

2015/9/17

KeyLogicalEquivalences(cont)
CommutativeLaws:,
AssociativeLaws:
DistributiveLaws:

p (q r ) ( p q) ( p r )
p (q r ) ( p q) ( p r )

ConstructingNewLogical
Equivalences
Wecanshowthattwoexpressionsarelogically
equivalentbydevelopingaseriesoflogically
equivalentstatements.
Toprovethatweproduceaseriesof
equivalencesbeginningwithAandendingwithB.

AbsorptionLaws:,

Observe that these laws all refer to , , only.

ConstructingNewLogical
Equivalences
Wecanshowthattwoexpressionsarelogicallyequivalent

bydevelopingaseriesoflogicallyequivalentstatements.
Toprovethatweproduceaseriesofequivalences
beginningwithAandendingwithB.

EquivalenceProofs
Example:Showthat
without usingthetruthtable.
Solution:

Keepinmindthatwheneveraproposition(representedbya

propositionalvariable)occursintheequivalenceslisted
earlier,itmaybereplacedbyanarbitrarilycomplex
compoundproposition.

11

2015/9/17

MoreLogicalEquivalences

MoreExamples

DefiningOperators , , viaLogicalEquivalences

pq
(pq)

pq

pq

Writethenegation ofIf it rains today, I will not

??

walk to work.

EquivalenceProofs w/otruthtables

AnExampleProblem
Showthefollowingisatautology. (hw#14,15,29,30p.35)

Example:Showthatisatautology
usingsymbolicderivation

(pq) (qr) (pr)

Solution:

(p q) (p q)
(p q) (p q)

(do not write it as it is not true that ..)

To show

Implication
Proposition

is a tautology, we can

from (pq) (pq)

T
ReadEx.6,7,8onp.29&30.
AlsodoHw#11&12usingsymbolicderivation.

48

48

12

2015/9/17

AnExampleProblem

MoreExamples

Showthefollowingisatautology. (hw#912,p.35)
(pq) (qr) (pr)

Aretheylogicallyequivalent?Justifyyouranswer.

OR

(p q) (r s)
(p r) (q s)

We can show is a tautology via


assumption that
must be false too)
is false (and show
or is true (and show must be true too)

or show that
impossible.

is True and

is false is

49

49

PropositionalSatisfiability

Moreexampleonsatisfiability

Istheset{pq, qr, pr} consistent?

Hw#62,p.36

Determinewhether(pq)(qr)(pr) issatisfiable.
Determinewhetherthepropositionissatisfiable:

( p q ) (q r ) (r p ) ( p q r ) (p q r )

ReadEx.9p.31:Whatdoestheproblemmean?

( p q r
)
( p q
s )
q r s )
(
r s)
( p
s )
( p q
( p q r
)
s)
( p q
( p

r s )

Dohomeworkproblems#61 62(p.36)

13

2015/9/17

EquivalenceLaws Table6(p.27)

Set Identities

Table 1

p.130

Identity:pT ppF p

AU = ppF
A A=A
Identity:pT
p

Domination:pT TpF F

Domination:pT
F
AU =TpF
U A=

Idempotent:pp ppp p

Idempotent:pp
p
AA =ppp
A AA=A

Doublenegation:p p

Doublenegation:p p
Complementation:
A

Commutative:pq qppq qp

Commutative:pq qppq qp

Associative:(pq)r p(qr)

Associative:(pq)r p(qr)


T U F
p, q, A, B,

(pq)r p(qr)


T U F
p, q, A, B,

(pq)r p(qr)

53

MoreSetIdentitiesTable1 p.130

54

SetDifferenceAB(2.2,Def.4, p.

Distributive:p(qr) (pq)(pr)

Def.AB={x|xA xB}
={x |xA xB}=AB.

p(qr) (pq)(pr)
DeMorgans:

(pq) p q
(pq) p q
Complement Laws
NegationLaws:
p p T
p p=
AA
U F AA=
AbsorptionLaws
p (pq) pp (pq) p

55

128)

Show A (B-A) = with reasons

A (B-A) = A (B A)
= A (A B)
= (A A) B
=B
=
56

14

2015/9/17

SetIdentities(2.2Ex.10,11on p.130,131)

SetIdentities(2.2Ex.10,11on p.130,131)

Prove A B A B

Prove A B A B

(DeMorgans Law)

Definitions (p.127-129)

AB = {x | xA xB}
A - B = {x | xA xB}

(DeMorgans Law)

Definitions (p.121-123)

AB = {x | xA xB}
A = Ac = {x | xA}

AB = {x | xA xB}
A - B = {x | xA xB}

AB = {x | xA xB}
A = Ac = {x | xA}

To prove two sets are equivalent, i.e. A = B,

xAB xA xB

Method 1. Show each side is a subset of the other side, i.e.

A B and B A

xA xA (xA)

(Ex.10 & 12 p.130, 131)

Method 2. Use logical equivalences with reasons (Ex.11 & 14 p.131, 132)
Method 3. Use membership table (Ex. 13 p.131)
57

SetIdentities(2.2Ex.10,11on p.130,131)
Prove

A B A B

SetIdentities(2.2Ex.11on p.131)

A B

A B A B (DeMorgans Law)
usingmembership table.

Prove

(DeMorgans Law)

usinglogical equivalences. with reasons

58

(x A B )

Def. of complement

(xA xB)

Def. of intersection

(xA xB)

DeMorgans Law

(x A x B )

Def. of complement

x A B

Def. of union
59

60

15

You might also like