truth table

Post on 20-Jan-2017

273 Views

Category:

Education

3 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Discrete Structures

Abdur Rehman Usmani

03419019922

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.

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)

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

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.

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.”

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.

Precedence of Logical Connectives

o~ highest

oɅ second

highest

oV third highest

o→ fourth highest

o↔ fifth highest

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

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.

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

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

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

Logical Equivalence

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.

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

qpqpqpqp

)()(

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.”)

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.

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).

qpqpqpqp

)()(

De Morgan’s Laws

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

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

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

top related