* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download Document
Survey
Document related concepts
Fuzzy logic wikipedia , lookup
Willard Van Orman Quine wikipedia , lookup
Jesús Mosterín wikipedia , lookup
Modal logic wikipedia , lookup
Propositional calculus wikipedia , lookup
Quantum logic wikipedia , lookup
Combinatory logic wikipedia , lookup
History of logic wikipedia , lookup
Natural deduction wikipedia , lookup
Law of thought wikipedia , lookup
Mathematical proof wikipedia , lookup
Intuitionistic logic wikipedia , lookup
Curry–Howard correspondence wikipedia , lookup
Mathematical logic wikipedia , lookup
Transcript
Announcements • Homework1isdueToday • Quiz1isWednesday • ReadSec:on1.8(ProofMethodsandStrategy)by Wednesday Networking Platform 1 Extensible - CSE 240 – Logic and Discrete Mathematics 1 ValidArguments • Wewillshowhowtoconstructvalidarguments intwostages;firstforproposi:onallogicand thenforpredicatelogic.Therulesofinference aretheessen:albuildingblockinthe construc:onofvalidarguments. 1. Proposi*onalLogic InferenceRules 2. PredicateLogic Inferencerulesforproposi*onallogicplusaddi*onal inferencerulestohandlevariablesandquan*fiers. Networking Platform 2 Extensible - CSE 240 – Logic and Discrete Mathematics 2 ArgumentsinProposi:onalLogic • Aargumentinproposi:onallogicisasequenceof proposi:ons.Allbutthefinalproposi:onarecalled premises.Thelaststatementistheconclusion. • Theargumentisvalidifthepremisesimplythe conclusion.Anargumentformisanargumentthatis validnomaMerwhatproposi:onsaresubs:tutedintoits proposi:onalvariables. • Ifthepremisesarep1 ,p2, …,pn andtheconclusionisq then (p1 ∧ p2 ∧ … ∧ pn)→ q isatautology. • Inferencerulesareallargumentsinsimpleargument formsthatwillbeusedtoconstructmorecomplex argumentforms. Networking Platform 3 Extensible - CSE 240 – Logic and Discrete Mathematics 3 SocratesExample • Wehavethetwopremises: – “Allmenaremortal.” – “Socratesisaman.” • Andtheconclusion: – “Socratesismortal.” • Howdowegettheconclusionfromthepremises? Networking Platform 4 Extensible - CSE 240 – Logic and Discrete Mathematics 4 TheArgument • Wecanexpressthepremises(abovetheline)and theconclusion(belowtheline)inpredicatelogic asanargument: Networking Platform 5 Extensible - CSE 240 – Logic and Discrete Mathematics 5 ModusPonens • Corresponding Tautology: • (p ∧ (p →q)) → q • Example: • Let p be “It is snowing.” • Let q be “I will study discrete math.” • “If it is snowing, then I will study discrete math.” • “It is snowing.” • “Therefore , I will study discrete Networking Platform 6 Extensible - CSE 240 – Logic and Discrete Mathematics 6 ModusTollens • Corresponding Tautology: • (¬q∧(p →q))→¬p • Example: • Let p be “it is snowing.” • Let q be “I will study discrete math.” • “If it is snowing, then I will study discrete math.” • “I will not study discrete math.” • “Therefore , it is not snowing.” Networking Platform 7 Extensible - CSE 240 – Logic and Discrete Mathematics 7 Hypothe:calSyllogism • Corresponding Tautology: • ((p →q) ∧ (q→r))→(p→ r) • • Example: • Let p be “it snows.” • Let q be “I will study discrete math.” • Let r be “I will get an A.” • “If it snows, then I will study discrete math.” • “If I study discrete math, I will get an A.” • “Therefore , If it snows, I will get an A.” Networking Platform 8 Extensible - CSE 240 – Logic and Discrete Mathematics 8 Disjunc:veSyllogism • Corresponding Tautology: • (¬p∧(p ∨q))→q • Example: • Let p be “I will study discrete math.” • Let q be “I will study English literature.” • “I will study discrete math or I will study English literature.” • “I will not study discrete math.” • “Therefore , I will study English literature.” Networking Platform 9 Extensible - CSE 240 – Logic and Discrete Mathematics 9 Addi:on • Corresponding Tautology: • p →(p ∨q) • Example: • Let p be “I will study discrete math.” • Let q be “I will visit Las Vegas.” • “I will study discrete math.” • “Therefore, I will study discrete math or I will visit • Las Vegas.” Extensible Networking Platform 10 - CSE 240 – Logic and Discrete Mathematics 10 Simplifica:on • Corresponding Tautology: • (p∧q) →p • Example: • Let p be “I will study discrete math.” • Let q be “I will study English literature.” • “I will study discrete math and English literature” • “Therefore, I will study discrete math.” Networking Platform 11Extensible - CSE 240 – Logic and Discrete Mathematics 11 Conjunc:on • Corresponding Tautology: • ((p) ∧ (q)) →(p ∧ q) • Example: • Let p be “I will study discrete math.” • Let q be “I will study English literature.” • “I will study discrete math.” • “I will study English literature.” • “Therefore, I will study discrete math and I will study English literature.” Extensible Networking Platform 12 - CSE 240 – Logic and Discrete Mathematics 12 ProofTechniques–directproofs Here’swhatyouknow: PatisamathmajororaCSmajor. IfPatdoesnotlikediscretemath,PatisnotaCSmajor. IfPatlikesdiscretemath,Patissmart. Patisnotamathmajor. CanyouconcludePatissmart? M∨C ((M∨C)∧(¬D→¬C)∧(D→S)∧(¬M))→S? Extensible Networking Platform 13 - CSE 240 – Logic and Discrete Mathematics ¬D→¬C D→S ¬M 13 ProofTechniques-directproofs Ingeneral,toprovep→q,assumepand showthatqfollows. ((M∨C)∧(¬D→¬C)∧(D→S)∧(¬M))→S? Extensible Networking Platform 14 - CSE 240 – Logic and Discrete Mathematics 14 ProofTechniques-directproofs 1.M∨C 2.¬D→¬C 3.D→S 4.¬M 5.C 6.D 7.S Given Given Given Given DS(1,4) MT(2,5) MP(3,6) Patissmart! Extensible Networking Platform 15 - CSE 240 – Logic and Discrete Mathematics 15 ProofTechniques-directproofs Atotallydifferentexample: Provethatifnisodd,then5n+3iseven. Beforeweproveit,weneedtodefineevenandodd. Howcanwedefineanevennumber? Theintegernisevenifthereexistsaninteger ksuchthatn=2k Howcanwedefineanoddnumber? Theintegernisoddifthereexistsaninteger ksuchthatn=2k+1 Extensible Networking Platform 16 - CSE 240 – Logic and Discrete Mathematics 16 ProofTechniques-directproofs Provethatifnisodd,then5n+3iseven. Supposenisodd, Thereforen=2k+1forsomeintegerk. Therefore5n+3= 5(2k+1)+3 = 10k+5+3=10k+8 = 2(5k+4)or2(k’) Extensible Networking Platform 17 - CSE 240 – Logic and Discrete Mathematics 17 ProofTechniques-directproofs Example: Provethatifnisodd,thenn2isodd. Extensible Networking Platform 18 - CSE 240 – Logic and Discrete Mathematics 18 ProofTechniques-vacuousproofs Ingeneral,toprovep→q,assumepandshow thatqfollows. Butp→qisalsoTRUEifpisFALSE. Ex. p:xisodd q:x+1iseven ∀x,xodd→x+1iseven whataboutwhenxis4? SincepisFALSE,p→qisTRUE (butwedon’tknowathingaboutq) Extensible Networking Platform 19 - CSE 240 – Logic and Discrete Mathematics 19 ProofTechniques-trivialproofs Ingeneral,toprovep→q,assumepandshowthat qfollows. Butp→qisalsoTRUEifqisTRUE. Suggestsprovingp→qbyprovingq. Ex. p:ThereisaLionintheroom q:2+2=4 SinceqisTRUE,p→qisTRUE (thetruthorfalsityofpisirrelevant) Extensible Networking Platform 20 - CSE 240 – Logic and Discrete Mathematics 20 Indirectproofs–Proofbycontraposi:on Recallthatp→q≡¬q→¬p(thecontraposi:ve) So,wecanprovetheimplica:onp→qbyfirst assuming¬q,andshowingthat¬pfollows. Example:Giventhataandbareintegers, Prove:ifa+b≥15,thena≥8orb≥8. (a+b≥15)→(a≥8)v(b≥8) (Assume¬q)Suppose(a<8)∧(b<8). (Show¬p) Then(a≤7)∧(b≤7), and(a+b)≤14, and(a+b)<15.(¬p) Extensible Networking Platform 21 - CSE 240 – Logic and Discrete Mathematics 21 ProofTechniques-proofbycontradic:on Toproveaproposi:onp,assumenotpandshowa contradic:on. (Provethattheskyisblue…Assumethatthesky isnotblue) Supposetheproposi:onisoftheforma→b,and recallthata→b≡¬avb≡¬(a∧¬b).So assumingtheoppositeistoassumea∧¬b. • Foracondi:onal,weassumeaandprove¬b • IfIstudyhard,thenIwillearnanA – AssumeIstudyhardandIwillNotearnanA Extensible Networking Platform 22 - CSE 240 – Logic and Discrete Mathematics 22 ProofTechniques-proofbycontradic:on Example: Rainydaysmakegardensgrow. Gardensdon’tgrowifitisnothot. Whenitiscoldoutside,itrains. Provethatit’s(always)hot. Given: R→G ¬H→¬G ¬H→R Show:H ((R→G)∧(¬H→¬G)∧(¬H→R))→H? Extensible Networking Platform 23 - CSE 240 – Logic and Discrete Mathematics 23 ProofTechniques-proofbycontradic:on Given:R→G ¬H→¬G ¬H→R Show:H 1.R→G Given 2.¬H→¬G Given 3.¬H→R Given 4.¬H assumetothecontrary 5.R MP(3,4) 6.G MP(1,5) 7.¬G MP(2,4) 8.G∧¬G contradic*on ∴H Extensible Networking Platform 24 - CSE 240 – Logic and Discrete Mathematics 24 ProofTechniques-proofbycontradic:on Classicproofthat√2isirra:onal – Irra*onalnumbersarethosethatcannotberepresentedasasimplefrac*on Suppose√2isra:onal.Then√2=a/bforsomeintegersaandb(rela:velyprime) Defini:on:aandbarerela:velyprimeiftheyhavenocommonfactorotherthan1 √2=a/bimplies 2=a2/b2 2b2=a2 Butifaandbareboth even,thentheyarenot rela*velyprime! Contradic*on! a2iseven,andsoaiseven(a=2kforsomek) 2b2=(2k)2=4k2 b2=2k2 b2iseven,andsobiseven(b=2mforsomem) Extensible Networking Platform 25 - CSE 240 – Logic and Discrete Mathematics 25 ProofTechniques–switchingbacktocontraposi:on Iclaimedthatifa2iseven,thenaiseven,too. Tobecomplete,weshouldprovethat,too. Remember,toshowp→qbycontraposi*onshow¬q→¬p Showthatifaisodd,thena2isodd Thena=2k+1forsomeintegerk Thena2=(2k+1)(2k+1)=4k2+4k+1=2(j)+1 forsomeintegerjanda2isodd Thereforeifa2iseven,thenaiseven Extensible Networking Platform 26 - CSE 240 – Logic and Discrete Mathematics 26 Sameideawithproofbycontradic:on Iclaimedthatifa2iseven,thenaiseven,too. Tobecomplete,weshouldprovethat,too. Remember,toshowp→qbycontradic*onassumepand¬qtobetrue Supposetothecontrarya2iseven,butaisnot Thena=2k+1forsomeintegerk Thena2=(2k+1)(2k+1)=4k2+4k+1=2(j)+1 forsomeintegerjanda2isodd Butweknowthata2iseven. contradic*on Soareallyiseven. Extensible Networking Platform 27 - CSE 240 – Logic and Discrete Mathematics 27 GroupProblem • Therearetwentycoinssiingonthetable,tenare currentlyheadsandtensarecurrentlytails.Youare siingatthetablewithablindfoldandgloveson. Youareabletofeelwherethecoinsare,butare unabletoseeorfeeliftheyheadsortails. • Youmustcreatetwosetsofcoins.Eachsetmust havethesamenumberofheadsandtailsasthe othergroup.Youcanonlymoveorflipthecoins,you areunabletodeterminetheircurrentstate. • Howdoyoucreatetwoevengroupsofcoinswiththe samenumberofheadsandtailsineachgroup? Extensible Networking Platform 28 - CSE 240 – Logic and Discrete Mathematics 28