Professional Documents
Culture Documents
SectionSummary
Propositions
Section1.1
HWp.1216:139,4244
Connectives
Negation
Conjunction
Disjunction
Implication;contrapositive,inverse,converse
Biconditional
TruthTables
Handin:4ac
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
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
p q
Example:Ifp denotesIamatschooland
q denotesItisFridaythen
InEnglishorhastwodistinctmeanings.
InclusiveOr
weassumethatstudentsneedtohavetakenoneoftheprerequisites,but
mayhavetakenboth.Thisisthemeaningofdisjunction.
ExclusiveOr
Ex.Souporsaladcomeswiththisentre
wedonotexpecttobeabletogetbothsoupandsalad.Thisisthe
meaningofExclusiveOr(Xor).
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
p q
9 (def.7,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.
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
p q
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
Tautologies,Contradictions,and
Contingencies
Atautology isapropositionwhichisalwaystrue.
Example:
Acontradiction isapropositionwhichisalways
false.
Example:
Acontingency isapropositionwhichisneithera
tautologynoracontradiction,
LogicallyEquivalent
2015/9/17
DeMorgansLaws
Notation
ThistruthtableshowsthatDeMorgansSecondLawholds.
DeMorgansLawsextendtomorethantwopropositions:
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:,
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
??
walk to work.
EquivalenceProofs w/otruthtables
AnExampleProblem
Showthefollowingisatautology. (hw#14,15,29,30p.35)
Example:Showthatisatautology
usingsymbolicderivation
Solution:
(p q) (p q)
(p q) (p q)
To show
Implication
Proposition
is a tautology, we can
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)
or show that
impossible.
is True and
is false is
49
49
PropositionalSatisfiability
Moreexampleonsatisfiability
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)
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}
xAB xA xB
A B and B A
xA xA (xA)
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)
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