Logic Practice Answers
Logic Practice Answers
1. T/F:
a. ( A B ) C entails ( A C ) ( B C ) True,actuallyequivalent usetruth
tablesorconverttoCNF
b. ( P R ) ( Q R ) canbeconvertedintoaHornclause. True usinglogical
equivalences: P Q R
c. ( "x P ( x) ) ( "x P ( x)) is avalidsentence. False P couldbetruesometimesbutnot
always
d. "x x = x issatisfiable. True(alsovalid)
2. Consider ( A B ) ( A C ) ( B D ) ( C G ) ( D G )
Useresolutiontoprovethatthesentenceentails G.
clauses1and2resolveto ( B C )thisresolveswithclause4togive ( B G )thisresolves
5. Showthatthesentences:
a. "x ( "y P ( x, y ) ) Q( x)
= "x ( "y P( x, y ) ) Q( x)
= "x ( $y P( x, y ) )Q( x)
= P ( x, f ( x)) Q ( x)
b. "x $y ( P ( x, y ) Q( x))
= "x$y ( P( x, y ) Q ( x ))
= P ( x, f ( x)) Q ( x)
are logicallyequivalentbyconvertingthemtoCNF.GiveEnglishsentencesthatinterpret
P and Q tomakethesentencestrueintherealworld.
P couldbe hatesand Q couldbemisanthrope,or P couldbelovesand Q could
bephilanthrope
6. Assumethefollowingpropositions: BatteryDead, RadioWorks,OutOfGas, and CarStarts.
a. Whatisthetotalnumberofmodels? 24 =16models
b. Howmanymodelsarethereinwhichthefollowingsentenceisfalse?
( RadioWorks CarStarts ) ( OutOfGas BatteryDead )
R C istruein4 models, ( O B )= O B isfalseinthreeofthefourmodels
c. IsthesentenceaboveequivalenttoasetofHornclauses?
Yes, R C O and R C B
d. Showthatthesentenceaboveisnotentailedbythesentence
RadioWorks BatteryDead
Findamodelinwhichsentence 2 istrueandsentence1 isfalse,i.e.R,C,Oaretrue,B
isfalse
7. Let M(x) betrueifxisamailcarrier, B(x) istrueifxlivesinBerkeley,and K(x,y) betrueifx
knowsy.TranslatethefollowingintoFOL:
a. ThereareatleasttwomailcarrierswholiveinBerkeley.
$x, y M ( x) M ( y ) B( x) B( y ) ( x = y )
b. AllthemailcarrierswholiveinBerkeleyknoweachother.
"x, y M ( x) M ( y ) B ( x) B ( y ) K ( x, y )
8. Considerthefollowingsentence:
( ( Food Party) ( Drinks Party) ) ( ( Food Drinks) Party )
a. Determine,usingenumeration,whetherthesentenceisvalid,satisfiableor
unsatisfiable. Valid
b. ConverttheleftandrighthandsidesofthemainimplicationtoCNFandverifyyour
answertoa.
F D P forLHS andsameforRHS.Thusthisislike Q Q whichisvalid
c. Useresolutiontoprovea.
NegateandconverttoCNF:
( ( Food Party ) ( Drinks Party ) ( ( Food Drinks)Party ) )
= (( F P ) ( D P )) ( F D P )
= ( F D P ) ( F ) ( D ) ( P ) whichresolvestoemptyclause,thusthe
originalsentenceisvalid
9. CorrectthefollowingFOLtranslationsasnecessary:
a. AnyapartmentinBerkeleyhaslowerrentthansomeapartmentsinPaloAlto.
"x ( Apt ( x ) In( x, Berkeley ) $y ( ( Apt ( y ) In( x, PaloAlto)) <( Rnt ( x ), Rnt ( y )))
Incorrect,shouldbe
"x ( Apt ( x ) In( x, Berkeley ) $y ( ( Apt ( y ) In( y, PaloAlto)) <( Rnt ( x), Rnt ( y )))
b. ThereisexactlyoneapartmentinPaloAltowithrentbelow$1000.
$x Apt ( x) In( x, PaloAlto) "y ( Apt ( y ) In( y, PaloAlto) < ( Rnt ( y ), Dollars (1000)) ) y = x
Incorrect,shouldbe
(
$x Apt ( x) In( x, PaloAlto) < ( Rnt ( x), Dollars (1000)) "y ( Apt ( y ) In( y, PaloAlto) < ( Rnt (
c. IfanapartmentismoreexpensivethanallapartmentsinBerkeley,itmustbeinSan
Francisco
"x Apt ( x) ( "y Apt ( y ) In( y, Berkeley ) > ( Rnt ( x ), Rnt ( y ) ) ) In( x, SanFrancisco)
Incorrect,shouldbe
"x Apt ( x) ( "y Apt ( y ) In( y, Berkeley ) > ( Rnt ( x), Rnt ( y ) ) ) In( x, SanFrancisco)