23
Logic 1 Statements and Logical Operators

Logic 1 Statements and Logical Operators. Logic Propositional Calculus – Using statements to build arguments – Arguments are based on statements or propositions

  • View
    222

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Logic 1 Statements and Logical Operators. Logic Propositional Calculus – Using statements to build arguments – Arguments are based on statements or propositions

Logic 1Statements and Logical Operators

Page 2: Logic 1 Statements and Logical Operators. Logic Propositional Calculus – Using statements to build arguments – Arguments are based on statements or propositions

Logic• Propositional Calculus– Using statements to build arguments– Arguments are based on statements or propositions

• Statement or Proposition– A declarative statement– Can be either true or false, but must be one

• Examples (are they propositions?)– The sky is blue– It will rain tomorrow– 2+2=4– Solve the following equation for x

Page 3: Logic 1 Statements and Logical Operators. Logic Propositional Calculus – Using statements to build arguments – Arguments are based on statements or propositions

“Famous” propositions• “If I am Buddha, then I am not Buddha”– Equivalent to the statement “I am not Buddha”. How?

• “This statement is false”– If true, it must be false. If false, it must be true.– If a statement is a logical contradiction, it is

considered not a statement.• The following two are not considered statements.

Why?• “I am lying”• “This statement is true”– Both are self-referential, which are considered not

statements.

Page 4: Logic 1 Statements and Logical Operators. Logic Propositional Calculus – Using statements to build arguments – Arguments are based on statements or propositions

Notation• Propositions are denoted by letters; p, q, r , s– p: “the moon is round” means p is the statements “the moon is round”

• The negation of a proposition, “not p” is denoted p. is a logical operator

• A truth table relates the truth of a proposition and its negation:

Page 5: Logic 1 Statements and Logical Operators. Logic Propositional Calculus – Using statements to build arguments – Arguments are based on statements or propositions

Statement2+2=410All economists are liberal

Negation2+241=0

All economists are not liberalNot all economists are liberal

Examples

If p is true then p is false. But if q is false then q is true.

Be wary of quantifiers like “all” or “some” which can be tricky.

Page 6: Logic 1 Statements and Logical Operators. Logic Propositional Calculus – Using statements to build arguments – Arguments are based on statements or propositions

Form new propositions from old by combining them.• A conjunction of two propositions p and q, denoted pq

requires both p and q to be true to be true.

• Find a conjunction for the statements “All economists are liberal” and “2+2=4”.

• Exercise – find the truth table for the conjunction pq.• Exercise – show pq is equivalent to pq using a truth

table

Page 7: Logic 1 Statements and Logical Operators. Logic Propositional Calculus – Using statements to build arguments – Arguments are based on statements or propositions

More exercises1. p: This chapter is interesting

q: logic is an interesting subjectExpress the statement “This chapter is not interesting even though logic is an interesting subject” using symbolic logic.p: This chapter is not interesting.Hence: (p)q

2. r: Life is interesting Express the statement “This chapter is interesting

even though logic is not an interesting subject, but life is interesting too” using symbolic logic. (p (q))r “but” is considered an emphatic “and”

Page 8: Logic 1 Statements and Logical Operators. Logic Propositional Calculus – Using statements to build arguments – Arguments are based on statements or propositions

3. For example 2, state p ((q)r) in words.This chapter is interesting, but logic is not an interesting

subject even though life is interesting too”Different ways of expressing a conjunction In English• And• But• YetAll the following say the same thing:

Page 9: Logic 1 Statements and Logical Operators. Logic Propositional Calculus – Using statements to build arguments – Arguments are based on statements or propositions

Disjunction• The disjunction of p and q, which we read “p or q” is

denoted pq.• It is inclusive, so it is true if p or q or both are true.

• The only way for a disjunction to be false is if both p and q are false.

Page 10: Logic 1 Statements and Logical Operators. Logic Propositional Calculus – Using statements to build arguments – Arguments are based on statements or propositions

Examplesp: the sun is luminescent (emits light without heat)q: LEDs are luminescent.pq: The sun is luminescent or LEDs are luminescent.This statement is true.Exercise:State pq and pq. Are they true?pq: The sun is luminescent orLEDs are not.False: Both parts are falsepq: The sun is not luminescent orLEDs are.True: The “or both” is implied.

Page 11: Logic 1 Statements and Logical Operators. Logic Propositional Calculus – Using statements to build arguments – Arguments are based on statements or propositions

An exclusive statement says p or q but not both.(pq) (p q)

Exercise: Using the statements from the last example/exercises, state

(p q) (pq) and (p q)(pq)(p q) (pq): The sun is luminescent or LEDs are

luminescent but both are not. (p q) (pq): The sun is luminescent or LEDs are

luminescent but it is not the case that both are not luminescent.

Page 12: Logic 1 Statements and Logical Operators. Logic Propositional Calculus – Using statements to build arguments – Arguments are based on statements or propositions

ExercisesDo truth tables for the exclusive statements in the previous exercises:

(p q) (pq)

p q pq pq (pq) (pq) (pq)

T T T T F F

T F T F T T

F T T F T T

F F F F T F

Page 13: Logic 1 Statements and Logical Operators. Logic Propositional Calculus – Using statements to build arguments – Arguments are based on statements or propositions

(pq) (pq)Notice it is the same as (pq)

p q pq p q pq (pq) (pq) (pq)T T T F F F T T

T F T F T F T T

F T T T F F T T

F F F T T T F F

Page 14: Logic 1 Statements and Logical Operators. Logic Propositional Calculus – Using statements to build arguments – Arguments are based on statements or propositions

Equivalence, Tautologies and Contradictions • In the previous exercise you found that the truth

table for (pq) (pq) is the same as (pq). • When truth tables are equivalent, we say they have

“logical equivalence.”•We will also find certain statements are self-evident

(called “tautologies”) meaning they are always true•And other statements which are evidently false

(always false) called “contradictions.”

Page 15: Logic 1 Statements and Logical Operators. Logic Propositional Calculus – Using statements to build arguments – Arguments are based on statements or propositions

Logical Equivalence• Statements that are the same• Construct the Truth Tables:– p(p)

– p(pq)

Page 16: Logic 1 Statements and Logical Operators. Logic Propositional Calculus – Using statements to build arguments – Arguments are based on statements or propositions

Logical equivalence (continued)• We see from the first example, a double negation is

always an equivalent statement to the original.– “I am a graduate student” is equivalent to “I am

not not a graduate student”.– “It is not true that I am not a male” is equivalent

to saying “I am a male.”

Page 17: Logic 1 Statements and Logical Operators. Logic Propositional Calculus – Using statements to build arguments – Arguments are based on statements or propositions

DeMorgan’s Law• Expressed in words: “The statement (pq) means “it

is not the case that both p and q are true” or more simply “p and q are not both true.”

• This is equivalent to saying that Either p is false or q is false (or the implied “or both”).

• Notice, this is different from say either p or q (pq).• Exercise: Show that (pq) is not the same as (pq)

Page 18: Logic 1 Statements and Logical Operators. Logic Propositional Calculus – Using statements to build arguments – Arguments are based on statements or propositions

DeMorgan’s Law: (pq)(p)(q)Exercise, construct the truth table

Page 19: Logic 1 Statements and Logical Operators. Logic Propositional Calculus – Using statements to build arguments – Arguments are based on statements or propositions

This leads us to DeMorgan’s Law• If we distribute a negation sign, it reverses and

and the negation applies to both parts.

If p and q are statements then(pq)(p)(q)(pq)(p)(q)

exercise: Come up with some verbal examples of DeMorgan’s Law.exercise: Show DeMorgan’s Law holds in both constructs.

Page 20: Logic 1 Statements and Logical Operators. Logic Propositional Calculus – Using statements to build arguments – Arguments are based on statements or propositions
Page 21: Logic 1 Statements and Logical Operators. Logic Propositional Calculus – Using statements to build arguments – Arguments are based on statements or propositions

• Logical Equivalences relate two statements• Tautologies and Contradictions are about single statements– Tautologies are always true, and the truth value is

independent of the value of the statementExample: p(p)

– Contradictions are always false, again the truth value is independent of the value of the statement

Example: p(p)In common usage, sometimes we say two statements are

contradictory, in that they can’t both be true, but in Logic that means they are exclusive (see above)

Page 22: Logic 1 Statements and Logical Operators. Logic Propositional Calculus – Using statements to build arguments – Arguments are based on statements or propositions

Common Logical EquivalencesThe double negative (p)pThe Commutative Law for conjunction pqqpThe Commutative Law for disjunction pqqpThe Associative Law for conjunction (pq)r p(qr)The Associative Law for disjunction (pq)r p(qr)The Distributive Lawsp(qr) (pq)(pr)

p(qr) (pq)(pr)The Absorption Laws ppp

ppp DeMorgan’s Laws (pq)(p)(q)

(pq)(p)(q)

Page 23: Logic 1 Statements and Logical Operators. Logic Propositional Calculus – Using statements to build arguments – Arguments are based on statements or propositions

Simplifying• Using logical equivalences to find a simpler

statement:– Example: The double negative can be expressed

as a positive. “2+24 is false” is equivalent to saying “2+2=4”.

Proofs show two statements are logical equivalences.– Example: Prove 2+2=6-22+2=46-2=44=4 hence 2+2=6-2More on proofs later.