reading: ec 1.3 peter j. haas info 150 fall semester 2019

Post on 08-Nov-2021

4 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Truth Tellers, Liars, and Propositional Logic

Reading: EC 1.3

Peter J. Haas

INFO 150Fall Semester 2019

Lecture 2 1/ 16

Truth Tellers, Liars, and Propositional LogicSmullyan’s IslandPropositional LogicTruth Tables for Formal PropositionsLogical EquivalenceThe Big Honking Theorem

Lecture 2 2/ 16

Smullyan’s Island

You meet two inhabitants of Smullyan’s Island. A says “exactly oneof us is lying”. B says “at least one of us is telling the truth”. Who(if anyone) is telling the truth?

Strategy: Focus on the statements, not on who said them

Lecture 2 3/ 16

Truth Table Analysis

Notation

I p = “A is truthful”

I q = “B is truthful”

Statement 1: Statement 2:p q Exactly one is lying At least one is truthful

T T F TT F T TF T T T

*F F F F

Answer: Both A and B are liars

Lecture 2 4/ 16

Another Smullyan’s Island Example

The statements

I A: “Exactly one of use is telling the truth”

I B : “We are all lying”

I C : “The other two are lying

Statement 1: Statement 2: Statement 3:p q r Exactly one truthful All lying A & B lying

T T T F F FT T F F F FT F T F F F

*T F F T F FF T T F F FF T F T F FF F T T F TF F F F T T

Answer: A is truthful; B and C are liars

Lecture 2 5/ 16

Inconclusive or a Paradox

Statement 1:p I am telling the truth

*T T*F F

Inconclusive

Statement 1:p I am lying

T FF T

A paradox

Lecture 2 6/ 16

Propositional Logic Notation

Definitions

Proposition: A sentence that is unambiguously true or falsePropositional variable: Represents a proposition (= T or F)Formal proposition: Proposition written in formal logic notation

Rules of formal propositions (FPs)

1. Any propositional variable is an FP

2. p and q are FPs ) p ^ q is an FP (p and q are true)

3. p and q are FPs ) p _ q is an FP (p or q or both are true)

4. p is an FP ) ¬p is an FP (not p)

Example: (p _ q) ^ ¬(p _ q) is a formal proposition

Precedence: ¬ highest, then ^, then _ (like �, ⇥, and +)

I Ex: ¬p ^ ¬q _ p =�(¬p) ^ (¬q)

�_ p

Lecture 2 7/ 16

Propositional Logic Notation

Definitions

Proposition: A sentence that is unambiguously true or falsePropositional variable: Represents a proposition (= T or F)Formal proposition: Proposition written in formal logic notation

Rules of formal propositions (FPs)

1. Any propositional variable is an FP

2. p and q are FPs ) p ^ q is an FP (p and q are true)

3. p and q are FPs ) p _ q is an FP (p or q or both are true)

4. p is an FP ) ¬p is an FP (not p)

Example: (p _ q) ^ ¬(p _ q) is a formal proposition

Precedence: ¬ highest, then ^, then _ (like �, ⇥, and +)

I Ex: ¬p ^ ¬q _ p =�(¬p) ^ (¬q)

�_ p

Lecture 2 7/ 16

Propositional Logic Notation

Definitions

Proposition: A sentence that is unambiguously true or falsePropositional variable: Represents a proposition (= T or F)Formal proposition: Proposition written in formal logic notation

Rules of formal propositions (FPs)

1. Any propositional variable is an FP

2. p and q are FPs ) p ^ q is an FP (p and q are true)

3. p and q are FPs ) p _ q is an FP (p or q or both are true)

4. p is an FP ) ¬p is an FP (not p)

Example: (p _ q) ^ ¬(p _ q) is a formal proposition

Precedence: ¬ highest, then ^, then _ (like �, ⇥, and +)

I Ex: ¬p ^ ¬q _ p =�(¬p) ^ (¬q)

�_ p

Lecture 2 7/ 16

Logic Notation: Examples

Example 1: p = “A is truthful” and q = “B is truthful”

I A is lying:

I At least one of us is truthful:

I Either B is lying or A is:

I Exactly one of us is lying (exclusive or):

Example 2: e = “Sue is an English major” and j = “Sue is aJunior”

I Sue is a Junior English major:

I Sue is either an English major or she is a Junior:

I Sue is a Junior, but she is not an English major:

I Sue is exactly one of the following: an English major or a Junior:

Lecture 2 8/ 16

tip

pvq7 p V 7g

( '

pry ) Vpn -

q )

en 's

evjj a Te

Len- j ) vcjn - e)

Truth Tables for Formal Propositions

p q p ^ q

T T TT F FF T FF F F

p q p _ q

T T TT F TF T TF F F

p ¬p

T FF T

Lecture 2 9/ 16

Truth Table Examples: Complex Formulas

Example 1: p ^ ¬q

p q ¬q p ^ ¬q

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

Example 2: (p _ q) ^ ¬(p ^ q)

p q p ^ q ¬(p ^ q) p _ q (p _ q) ^ ¬(p ^ q)

T TT FF TF F

Lecture 2 10/ 16

T f T ff T T

TF T T

TF T F f

Negation and Inequalities

Example

I p = “Tammy has more than two children”

I ¬p =:

I If c = number of children, then, mathematically, p =

Lecture 2 11/ 16

Tammy has two or fewer childrenC > 2

Negation and Logical Equivalence

Definition

Two statements are logically equivalent if they have the same truthvalue for for every row of the truth table

Example: Sue is neither an English major nor a Junior

j e j _ e ¬(j _ e)

T TT FF TF F

j e ¬j ¬e ¬j ^ ¬e

T TT FF TF F

Lecture 2 12/ 16

T f if f f

T f f T fT F T f f

F T T T T

4- the same#

DeMorgan’s Laws and Negation

Proposition (DeMorgan’s Laws)

Let p and q be any propositions. Then

1. ¬(p _ q) is logically equivalent to ¬p ^ ¬q2. ¬(p ^ q) is logically equivalent to ¬p _ ¬q

Proof: Via truth tables

Example 1:

I “Sue is not both a Junior and an English major”: ¬(j ^ e)

I Use DeMorgan’s laws to given an equivalent statement:

Example 2: “John got a B’ on the test” = (g � 80) ^ (g < 90) [where g = Johnsscore]

I Write the negation in math and English:

Lecture 2 13/ 16

7 j v - e

Sue is not a Junior ourSue is not an English major

71cg ? so ) rig ago ))=

t ( g 380 ) V 7 ( g 290 ) = C g e 80 ) V ( g > go )

John got less than B or greater than B

Tautology and Contradiction

Definition

1. A tautology is a proposition where every row of the truth table is true

2. A contradiction is a proposition where every row of the truth table is false

p q ¬p ¬q p _ ¬q ¬p _ q (p _ ¬q) _ (¬p _ q)

T TT FF TF F

p ¬p p ^ ¬p

T FT FF TF T

Lecture 2 14/ 16

+ to

f F T T Tf T T f T

T F F T T

T T T T T

I

ff

f

The Big Honking Theorem (BHT) of Propositions

Theorem

Let p, q and r stand for any propositions. Let t indicate a tautology and c indicate acontradiction. Then:

(a) Commutive p ^ q ⌘ q ^ p p _ q ⌘ q _ p(b) Associative (p ^ q) ^ r ⌘ p ^ (q ^ r) (p _ q) _ r ⌘ p _ (q _ r)(c) Distributive p ^ (q _ r) ⌘ (p ^ q) _ (p ^ r) p _ (q ^ r) ⌘ (p _ q) ^ (p _ r)(d) Identity p ^ t ⌘ p p _ c ⌘ p(e) Negation p _ ¬p ⌘ t p ^ ¬p ⌘ c(f) Double negative ¬(¬p) ⌘ p(g) Idempotent p ^ p ⌘ p p _ p ⌘ p(h) DeMorgan’s laws ¬(p ^ q) ⌘ ¬p _ ¬q ¬(p _ q) ⌘ ¬p ^ ¬q(i) Universal bound p _ t ⌘ t p ^ c ⌘ c(j) Absorption p ^ (p _ q) ⌘ p p _ (p ^ q) ⌘ p(k) Negations of t and c ¬t ⌘ c ¬c ⌘ t

Does this look familiar?

Substitution Rule: You can replace a formula with a logically equivalent one

Lecture 2 15/ 16

similar to algebra,with he X

,V it

,

6 it,

c = o

( Not identical , c. g. ,It venson of distributive law )

Proving Logical Equivalences

Ex: Use BHT plus substitution to prove that p _ (¬p ^ q) ⌘ p _ q

p _ (¬p ^ q) = (p _ ¬p) ^ (p _ q) (c) Distributive

= t ^ (p _ q) (e) Negation

= (p _ q) ^ t (a) Commutative

= p _ q (d) Identity

Lecture 2 16/ 16

top related