logic parti

26
LOGIC

Upload: von-adam-martinez

Post on 06-May-2015

93 views

Category:

Education


2 download

TRANSCRIPT

Page 1: Logic parti

LOGIC

Page 2: Logic parti

PROPOSITIONAL LOGIC

l Proposition

l declarative statement that is either true or false, but not both

l the following statements are propositions:

l The square root of 2 is irrational.

l In the year 2010, more Filipinos will go to Canada.

l -5 < 75

l the following statements are NOT propositions:

l What did you say?

l This sentence is false.

l x = 6

Page 3: Logic parti

PROPOSITIONAL LOGIC

l Notation

l atomic propositions

l capital letters

l compound propositions

l atomic propositions with logical connectives

l defined via truth tables

l truth values of propositions

l 1 or T (true)

l 0 or F (false)

Page 4: Logic parti

LOGICAL CONNECTIVES

Operator Symbol Usage

Negation ¬ not

Conjunction ∧ and

Disjunction ∨ or

Conditional → if, then

Biconditional ↔ iff

Page 5: Logic parti

NEGATION

l turns a false proposition to true and turns a true proposition to false

l truth table

P ¬ P

1 0

0 1

l examplel P: 10 is divisible by 2.

l ¬ P: 10 is not divisible by 2.

Page 6: Logic parti

CONJUNCTION

l truth table

P Q P ∧ Q

1 1 1

1 0 0

0 1 0

0 0 0

Page 7: Logic parti

CONJUNCTION

l examples

l 6 < 7 and 7 < 8

l 2*4 = 16 and a quart is larger than a liter.

l P: Barrack Obama is the American president.

Q: Benigno Aquino III is the Filipino president.

R: Corazon Aquino was an American president.

P ∧ Q P ∧ R R ∧ Q

Page 8: Logic parti

DISJUNCTION

l truth table

P Q P ∨ Q

1 1 1

1 0 1

0 1 1

0 0 0

Page 9: Logic parti

DISJUNCTION

l examples

l 6 < 7 or Venus is smaller than earth.

l 2*4 = 16 or a quart is larger than a liter.

l P: Slater Young is a millionaire.

Q: Lucio Tan is a billionaire

R: Steve Jobs was a billionaire.

P ∨ Q P ∨ R R ∨ Q

Page 10: Logic parti

CONDITIONAL/IMPLICATION

l P is the hypothesis or premise

l Q is the conclusion

l truth table

P Q P → Q

1 1 1

1 0 0

0 1 1

0 0 1

Page 11: Logic parti

CONDITIONAL/IMPLICATION

l other ways to express P → Q:

l If P then Q

l P only if Q

l P is sufficient for Q

l Q if P

l Q whenever P

l Q is necessary for P

Page 12: Logic parti

CONDITIONAL/IMPLICATION

l examples:

l If triangle ABC is isosceles, then the base angles A and B are equal.

l 1+2 = 3 implies that 1 < 0.

l If the sun shines tomorrow, I will play basketball.

l If you get 100 in the final exam, then you will pass the course.

l If 0 = 1, then 3 = 9.

Page 13: Logic parti

BICONDITIONAL

l logically equivalent to P → Q ∧ Q → P

l truth table

P Q P ↔ Q

1 1 1

1 0 0

0 1 0

0 0 1

Page 14: Logic parti

BICONDITIONAL

l examples

l A rectangle is a square if and only if its diagonals are perpendicular.

l 5 + 6 = 6 if and only if 7 + 1 = 10.

Page 15: Logic parti

OTHER CONCEPTS

l contrapositive

l ¬ Q → ¬ P contrapositive of P → Q

l ¬ Q → ¬ P is equivalent to P → Q

l inverse

l ¬ P → ¬ Q is the inverse of P → Q

l P → Q is not equivalent to its inverse

l converse

l Q → P is the converse of P → Q

Page 16: Logic parti

OTHER CONCEPTS

l types of propositional forms

l tautology – a proposition that is always true under all possible combinations of truth values for all component propositions

l contradiction – a proposition that is always false under all possible combinations of truth values for all component propositions

l contingency – a proposition that is neither a tautology nor a contradiction

Page 17: Logic parti

SAMPLE TRUTH TABLES

P Q P ∧ Q (P ∧ Q) → P

1 1 1 1

1 0 0 1

0 1 0 1

0 0 0 1

(P ∧ Q) → P

Page 18: Logic parti

SAMPLE TRUTH TABLES

P ¬ P P ∧ ¬ P

1 0 0

0 1 0

P ∧ ¬ P

Page 19: Logic parti

SAMPLE TRUTH TABLES

P Q P ∨ Q (P ∨ Q )→ P

1 1 1 1

1 0 1 1

0 1 1 0

0 0 0 1

(P ∨ Q) → P

Page 20: Logic parti

SAMPLE TRUTH TABLES

P Q P ↔ Q P ∧ Q ¬ P ∧¬ Q (P ∧ Q) ∨(¬ P ∧¬ Q)

1 1 1 1 0 1

1 0 0 0 0 0

0 1 0 0 0 0

0 0 1 0 1 1

Show that (P ↔ Q) ↔(( P ∧ Q) ∨ (¬ P ∧¬ Q))

Page 21: Logic parti

Equivalent Propositions (Logical Equivalence)

l When are two propositions equivalent?

Suppose P and Q are compound propostions, P and Q are equivalent if the truth value of P is always equal to the truth value of Q for all the permutation of truth values to the component propositions

Page 22: Logic parti

Equivalent Propositions(Logical Equivalence)

l Suppose P is equivalent to Q. P may be used to replace Q or vice versa.

l The Rules of Replacement are equivalent propositions(Logically equivalent propositions)

l The Rules of Replacement are used to simplify a proposition (Deriving a proposition equivalent to a given proposition)

Page 23: Logic parti

Rules of Replacement

1. Idempotence

P ≡ ( P ∨ P ) , P ≡ ( P ∧ P )

2. Commutativity

( P ∨ Q ) ≡ ( Q ∨ P ), ( P ∧ Q ) ≡ ( Q ∧ P )

3. Associativity,

( P ∨ Q ) ∨ R ≡ P ∨ ( Q ∨ R ),

( P ∧ Q ) ∧ R ≡ P ∧ ( Q ∧ R )

4. De Morgan’s Laws

¬ ( P ∨ Q ) ≡ ¬P ∧ ¬Q,

¬ ( P ∧ Q ) ≡ ¬P ∨ ¬Q

Page 24: Logic parti

Rules of Replacement

5. Distributivity of ∧ over ∨

P ∧ ( Q ∨ R ) ≡ ( P ∧ Q ) ∨ ( P ∧ R )

6. Distributivity of ∨ over ∧

P ∨ ( Q ∧ R ) ≡ ( P ∨ Q ) ∧ ( P ∨ R )

7. Double Negation

¬ (¬ P) ≡ P

8. Material Implication

( P ⇒ Q ) ≡ (¬ P ∨ Q )

9. Material Equivalence

( P ⇔ Q ) ≡ ( P ⇒ Q ) ∧ ( Q⇒P )

Page 25: Logic parti

Rules of Replacement

10. Exportation

[ ( P ∧ Q ) ⇒ R ] ≡ [ P ⇒ ( Q ⇒ R ) ]

11. Absurdity

[ ( P ⇒ Q ) ∧ ( P ⇒ ¬ Q )] ≡ ¬ P

12. Contrapositive

( P ⇒ Q ) ≡ (¬ Q ⇒ ¬P )

Page 26: Logic parti

Rules of Replacement

13. Identities

P ∨ 1 ≡ 1 P ∧ 1 ≡ P

P ∨ 0 ≡ P P ∧ 0 ≡ 0

P ∨ ¬P ≡ 1 P ∧ ¬P ≡ 0

¬0 ≡ 1 ¬1 ≡ 0