22
Discrete Structures Abdur Rehman Usmani 03419019922

Truth table

Embed Size (px)

Citation preview

Page 1: Truth table

Discrete Structures

Abdur Rehman Usmani

03419019922

Page 2: Truth table

Truth TableoThe truth value of the compound proposition depends only on the truth value of the component propositions. Such a list is a called a truth table.

Page 3: Truth table

Example

p q pq pq ¬(pq)

(pq) ¬(pq)

T T T T F FT F T F T TF T T F T TF F F F T F

o (pq) ¬(pq)

Page 4: Truth table

Example

p q r pq ¬r (pq)¬rT T TT T FT F TT F FF T TF T FF F T

o (p q) ¬r

Page 5: Truth table

Implication (if - then) oThe conditional statement p → q is the proposition “if p, then q.” oThe conditional statement p → q is false when p is true and q is false, and true otherwise.o p is called the hypothesis and q is called the conclusion.

Page 6: Truth table

Implication (if - then)

P Q PQT T TT F FF T TF F T

p = “You study hard.” q = “You will get a good grade.” p → q = “If you study hard, then you will get a good grade.”

Page 7: Truth table

Biconditionals (if and Only If) p = “Sharif wins the 2012 election.” q = “Sharif will be prime minister for five years.” p ↔ q = “If, and only if, Sharif wins the 2012 election, Sharif will be prime minister for five years.”

p ↔ q does not imply that p and q are true, or thateither of them causes the other, or that they have acommon cause.

Page 8: Truth table

Precedence of Logical Connectives

o~ highest

oɅ second

highest

oV third highest

o→ fourth highest

o↔ fifth highest

Page 9: Truth table

Logical Equivalence1. 6 is greater than 2 2. 2 is less than 6 two different ways of saying the same thing. both be true or both be false. logical form of the statements is important.

p ∧ q is true when, and only when, q ∧ p is true.The statement forms are called logically equivalent

Page 10: Truth table

Logical EquivalenceoTwo statement forms are called logically equivalent if, and only if, they have identical truth values for each possible substitution of statements for their statement variables.o P ≡ Q.

Page 11: Truth table

Logical EquivalenceoNegation of the negation of a statement is logically equivalent to the statement.o ∼(∼p) ≡ p

Page 12: Truth table

Logical Equivalenceo∼(p ∧ q) and ∼p ∧ ∼q are not logically equivalent

p =“0 < 1” and let q =“1 < 0.”

Page 13: Truth table

Logical Equivalence

Page 14: Truth table

De Morgan’s LawsoThe negation of the conjunction of two statements is logically equivalent to the disjunction of their negations.o ∼(p ∧ q) and ∼p ∨ ∼q are logically equivalent i.e. ∼(p ∧ q) ≡

∼p ∨ ∼q.

Page 15: Truth table

De Morgan’s LawsoNegation of the disjunction of two statements is logically equivalent to the conjunction of their negations:

qpqpqpqp

)()(

Page 16: Truth table

qpqpqpqp

)()(

De Morgan’s LawsoWrite negations for each of the following statements:o John is 6 feet tall and he weighs at least 200 pounds.o The bus was late or Tom’s watch was slow.

oNegation of these statementso John is not 6 feet tall or he weighs less than 200 pounds.o The bus was not late and Tom’s watch was not

slow(/“Neither was the bus late nor was Tom’s watch slow.”)

Page 17: Truth table

qpqpqpqp

)()(

De Morgan’s Lawso Negation of a disjunction is formed by taking the conjunction of

the negations of the component propositions.o Negation of a conjunction is formed by taking the disjunction of

the negations of the component propositions.

Page 18: Truth table

qpqpqpqp

)()(De Morgan’s Laws

o Frequently used in writing computer programs. o For instance, suppose you want your program to delete all files

modified outside a certain range of dates, say from date 1 through date 2 inclusive.

o ∼(date1 ≤ file_modification_date ≤ date2)

o is equivalent to o ( file_modification_date < date1) or (date2 < file_modification_date).

Page 19: Truth table

qpqpqpqp

)()(

De Morgan’s Laws

Page 20: Truth table

Tautologies and Contradictions A tautology is a statement that is always true. Examples: R(R) (PQ) (P)( Q) A contradiction is a statement that is always false. Examples: R(R) ((P Q) (P) (Q)) The negation of any tautology is a contradiction, and the negation of any contradiction is a tautology.

20

Page 21: Truth table

Equivalence Definition: two propositional statements S1 and S2 are said to be (logically) equivalent, denoted S1 S2 if

They have the same truth table, or S1 S2 is a tautology

Equivalence can be established by Constructing truth tables Using equivalence laws (Table 5 in Section 1.2)

21

Page 22: Truth table

Equivalence Equivalence laws

Identity laws, P T P, Domination laws, P F F, Idempotent laws, P P P, Double negation law, ( P) P Commutative laws, P Q Q P, Associative laws, P (Q R) (P Q) R, Distributive laws, P (Q R) (P Q) (P R), De Morgan’s laws, (PQ) ( P) ( Q) Law with implication P Q P Q

22