Three Logicians Walk Into A Bar (Or Why Logic Is Not So Scary)
Three Logicians Walk Into A Bar (Or Why Logic Is Not So Scary)
Fall 2013
Nov. 7, 2013
What is Logic?
Nurit Haspel Three Logicians Walk into a Bar (or why logic is not so scary)
Logic in Computer Science
Nurit Haspel Three Logicians Walk into a Bar (or why logic is not so scary)
Propositional Logic
Nurit Haspel Three Logicians Walk into a Bar (or why logic is not so scary)
Sets
A set an unordered,
Disjoint (no cats Intersecting (some
non-redundant bunch
have 4 legs) cats have 4 legs)
of elements
Examples: 4 legs
Cats
Cats 4 legs
{11, 13, 17, 19}, all
cats, the letters in the
alphabet, the people
A ⊆ B (all 4 legged B ⊆ A (all cats
in this room...
creatures are cats) have 4 legs)
Logic defines relations
between sets 4 legs Cats
Cats 4 legs
Nurit Haspel Three Logicians Walk into a Bar (or why logic is not so scary)
Syllogism
Nurit Haspel Three Logicians Walk into a Bar (or why logic is not so scary)
Syllogism – A Common Pitfall
Nurit Haspel Three Logicians Walk into a Bar (or why logic is not so scary)
Syllogism – A Common Pitfall
Cats
1 All cats have four legs
A→B 4 legs
Nurit Haspel Three Logicians Walk into a Bar (or why logic is not so scary)
Syllogism – Another Common Pitfall
Nurit Haspel Three Logicians Walk into a Bar (or why logic is not so scary)
Venn Diagrams
Nurit Haspel Three Logicians Walk into a Bar (or why logic is not so scary)
Venn Diagrams
Nurit Haspel Three Logicians Walk into a Bar (or why logic is not so scary)
Truth Values and Boolean Logic
Nurit Haspel Three Logicians Walk into a Bar (or why logic is not so scary)
Truth Tables – ”NOT”,”AND”, ”OR”, ”XOR”
A B A∧B
A ¬A T T T
T F T F F
F T F T F
F F F
A B A∨B
T T T A B A⊕B
T F T T T F
F T T T F T
F F F F T T
F F F
Nurit Haspel Three Logicians Walk into a Bar (or why logic is not so scary)
Three Logicians Walk into a Bar
Nurit Haspel Three Logicians Walk into a Bar (or why logic is not so scary)
Three Logicians are Wearing Hats
Nurit Haspel Three Logicians Walk into a Bar (or why logic is not so scary)
Three Logicians are Wearing Hats
Nurit Haspel Three Logicians Walk into a Bar (or why logic is not so scary)
Puzzle: Where is the Money?
Three doors: Rules:
An iPod The $1M door tells the truth
A million dollars The popsicle door lies
A melting popsicle The iPod door can go either
way