Discrete Mathematics – Propositional Logic


What is Logic?
“Computer science is continuation of logic by other means” Georg Gottlob

Propositional Logic Introduction

“Contrariwise”, continued weedledee, “if it was so, it might be! and if it were so, it would be! but as it isn"t, it ain"t# hat"s logic” $ewis Carroll, Through the Looking Glass

Discrete Mathematics Andrei Bulatov

“$ogic celebrates the unity of a pathological masculine self%identity that cannot listen and recogni&es only negation but not difference” Andrea 'ye, Words of Power

Discrete Mathematics – Propositional Logic


Discrete Mathematics – Propositional Logic


Use of Logic
(n mathematics and rhetoric) Give precise meaning to statements# Distinguish between valid and invalid arguments# *rovide rules of +correct" reasoning# 'atural language can be very ambiguous +(f you do your homewor,, then you"ll get to watch the game#" +(f you don"t do your homewor,, then you will not get to watch ###" +-ou do your homewor,, or you"ll fail the e.am#" +(f you don"t do your homewor,, then you"ll fail the e.am#"

Use of Logic (cntd)
(n computing) Derive new data 0 ,nowledge from e.isting facts Design of computer circuits# Construction of computer programs# 1erification of correctness of programs and circuit design# 2pecification

Discrete Mathematics – Propositional Logic

Statements (propositions)
*ropositional logic deals with statements and their truth values A statement is a declarative sentence that can be true or false ruth values are 56 4 7 or 89 and :A$2; 7: or <9# ;.amples) % 1 + 1 = 2 7statement, 9 % he moon is made of cheese 7statement, :9 % Go home= 7not statement, imperative9 % 3hat a beautiful garden= 7not statement, e.clamation9 % y+1=2 7not statement, uncertain9 % he God e.ists 7statement, >9

≈ /

3hat the customer really needed

4ow the *rogrammer understood it

3hat the customer got

Discrete Mathematics – Propositional Logic


Compound Statements
2implest statement are called primitive statement 3e cannot decide the truth value of a primitive statement# his is not what logic does# 3e shall use propositional variables to denote primitive statements, p, q, r, ? (nstead we combine primitive statements by means of logic connectives into compound statements or formulas and loo, how the truth value of a compound statement depends on the truth values of the primitive statements it includes# 3e will denote compound statements by Φ, Ψ, ?


then *aris is in :rance#" 2 .am#" + oday is :riday or 2aturday" Discrete Mathematics – Propositional Logic 2-11 Discrete Mathematics – Propositional Logic 2-12 Truth Tables of Connectives (exclusive or) .e this course" +2tudents who have ta.e this course" +2tudents who have ta. ↔ 9 + here is a lady in this room if and only if there is a tiger in the other room" Truth tables ruth table is a way to specify the e.en calculus ⇒ can ta.act dependence of the truth value of a compound statement through the values of primitive statements involved truth values of primitive statements 7propositional variables9 truth value of compound statements 7formulas9 p < < … A < 8 … Φ < 8 … Discrete Mathematics – Propositional Logic 2-9 Discrete Mathematics – Propositional Logic 2-10 Truth Tables of Connectives (negation and conjunction) 'egation p : 7<9 789 Truth Tables of Connectives (disjunction) Dis@unction B inclusive +or" p < < A < 8 < 8 p∨A < 8 8 8 +2tudents who have ta. ∧ 9 +(n this room there is a lady. is white.. or you"ll fail the e. or a lady" biconditional 7eAuivalence9 7if and only if. ¬ 9 +(t is not true that at least one politician was honest" con@unction 7and.en calculus or computing can ta. or ?.e this course" ¬p 789 : 7<9 unary connective + oday is :riday" ⇒ + oday is not :riday" Con@unction p < < 8 8 A < 8 < 8 p∧A < < < 8 binary connective + oday is :riday" ⇒ +(t is raining" + oday is :riday and it is raining" 8 8 Be careful with +or" constructions in natural languages= +-ou do your homewor. then we live in Antarctic#" "!f pigs fly. and in the other room there is a tiger" dis@unction 7or. then?. ∨ 9 +Margaret Mitchell wrote +Gone with the 3ind or ( am going home" implication 7if?. ⊕ 9 + here is either a tiger in this room.Discrete Mathematics – Propositional Logic 2-7 Discrete Mathematics – Propositional Logic 2-8 Logic Connectives negation 7not. then there is no lady there" e..clusive +or" Cne of the statements is true but not both p < < 8 8 A < 8 < 8 p⊕A < 8 8 < Truth Tables of Connectives (implication) (mplication p < < 8 8 A < 8 < 8 p→A 8 8 < 8 +-ou can follow the rules or be disAualified#" +'atalie will arrive today or 'atalie will not arrive at all#" 'ote that logical 7material9 implication does not assume any causal connection# !f blac. → 9 +(f there is a tiger in this room.clusive or 7either ?.en computing can ta.

then A" +if p. A" +p is sufficient for A" +A if p" +A %hen p" conclusion conseAuence +A unless ¬p" +p implies A" +p onl$ if A" +A %henever p" +A follo%s from p" +a sufficient con& dition for A is p" +a necessar$ con& dition for p is A" % 4e is elected.et#" +(f it is not raining.Discrete Mathematics – Propositional Logic 2-13 Discrete Mathematics – Propositional Logic 2-14 !mplication as a promise (mplication can be thought of as a promise.e the flight if and only if you buy a tic. and it is true if the promise is . then it is not raining" → ¬A +-ou can ta. but 7/and9 ta. then ( will lower ta. then the home team does not win" Discrete Mathematics – Propositional Logic 2-17 Discrete Mathematics – Propositional Logic 2-18 'xample +-ou can access the (nternet from campus if you are a computer science ma@or or if you are not a freshman#" Tautologies autology is a compound statement 7formula9 that is true for all combinations of truth values of its propositional variables 7p → A9 ∨ 7A → p9 p % +you can access the (nternet from campus" A % +you are a computer science ma@or" r % +you are a freshman" p < < 8 8 A < 8 < 8 7p → A9 ∨ 7A → p9 8 8 8 8 3 .es are lowered % 4e is elected and ta. contrapositive. and inverse Truth Tables of Connectives (biconditional) Biconditional or .Auivalence Cne of the statements is true if and only if the other is true p < < 8 8 A < 8 < 8 p↔A 8 < < 8 p → A Converse + he home team wins whenever it is raining" 7+(f it is raining then the home team wins"9 A → p +(f the home team wins.es are not lowered % 4e is not elected and ta. then it is raining" ¬A Contrapositive (nverse ¬p → ¬p +(f the home team does not win.ept +!f ( am elected.es" % 4e is not elected and ta.ept= promise .ept= #la$ing %ith !mplication *arts of implication p → A hypothesis antecedent premise +if p.en= Discrete Mathematics – Propositional Logic 2-15 Discrete Mathematics – Propositional Logic 2-16 #la$ing %ith !mplication (cntd) Converse.es are lowered promise .es are not lowered promise bro.ept= promise .

Fc 7page GE9 < < < < 4 . Fa.Discrete Mathematics – Propositional Logic 2-19 Discrete Mathematics – Propositional Logic 2-20 Contradictions Contradiction is a compound statement 7formula9 that is false for all combinations of truth values of its propositional variables 7p ⊕ A9 ∧ 7p ⊕ ¬A9 p < < 8 8 A < 8 < 8 7p ⊕ A9 ∧ 7p ⊕ ¬A9 (ome%or) .) 'o# 8 . E.D.ercises from the Boo..

Sign up to vote on this title
UsefulNot useful