4/15/2003 (c)2001-2003, Michael P. Frank 1
Module #1 - Logic University of Florida
- Dept. of Computer & Information Science & Engineering
COT 3100
Applications of Discrete Structures
- Dr. Michael P. Frank
COT 3100 Applications of Discrete Structures Dr. Michael P. Frank - - PowerPoint PPT Presentation
Module #1 - Logic University of Florida Dept. of Computer & Information Science & Engineering COT 3100 Applications of Discrete Structures Dr. Michael P. Frank Slides for a Course Based on the Text Discrete Mathematics & Its
4/15/2003 (c)2001-2003, Michael P. Frank 1
Module #1 - Logic University of Florida
4/15/2003 (c)2001-2003, Michael P. Frank 2
Module #1 - Logic
4/15/2003 (c)2001-2003, Michael P. Frank 3
Module #1 - Logic
4/15/2003 (c)2001-2003, Michael P. Frank 4
Module #1 - Logic
4/15/2003 (c)2001-2003, Michael P. Frank 5
Module #1 - Logic
Topic #1 – Propositional Logic
George Boole (1815-1864) Chrysippus of Soli (ca. 281 B.C. – 205 B.C.)
4/15/2003 (c)2001-2003, Michael P. Frank 6
Module #1 - Logic
[Later we will study probability theory, in which we assign degrees of certainty to propositions. But for now: think True/False only!]
Topic #1 – Propositional Logic
4/15/2003 (c)2001-2003, Michael P. Frank 7
Module #1 - Logic
Topic #1 – Propositional Logic
4/15/2003 (c)2001-2003, Michael P. Frank 8
Module #1 - Logic
Topic #1.0 – Propositional Logic: Operators
4/15/2003 (c)2001-2003, Michael P. Frank 9
Module #1 - Logic
4/15/2003 (c)2001-2003, Michael P. Frank 10
Module #1 - Logic
T :≡ True; F :≡ False “:≡” means “is defined as” Operand column Result column
Topic #1.0 – Propositional Logic: Operators
4/15/2003 (c)2001-2003, Michael P. Frank 11
Module #1 - Logic
Remember: “∧” points up like an “A”, and it means “∧ND”
Topic #1.0 – Propositional Logic: Operators
4/15/2003 (c)2001-2003, Michael P. Frank 12
Module #1 - Logic
Operand columns
Topic #1.0 – Propositional Logic: Operators
4/15/2003 (c)2001-2003, Michael P. Frank 13
Module #1 - Logic
After the downward- pointing “axe” of “∨” splits the wood, you can take 1 piece OR the other, or both.
Topic #1.0 – Propositional Logic: Operators
Meaning is like “and/or” in English.
4/15/2003 (c)2001-2003, Michael P. Frank 14
Module #1 - Logic
Note difference from AND
Topic #1.0 – Propositional Logic: Operators
4/15/2003 (c)2001-2003, Michael P. Frank 15
Module #1 - Logic
Topic #1.0 – Propositional Logic: Operators
4/15/2003 (c)2001-2003, Michael P. Frank 16
Module #1 - Logic
“The lawn was wet this morning, and it didn’t rain last night.” “Either the lawn wasn’t wet this morning, or it rained last night, or the sprinklers came on last night.”
Topic #1.0 – Propositional Logic: Operators
4/15/2003 (c)2001-2003, Michael P. Frank 17
Module #1 - Logic
Topic #1.0 – Propositional Logic: Operators
4/15/2003 (c)2001-2003, Michael P. Frank 18
Module #1 - Logic
Note difference from OR.
Topic #1.0 – Propositional Logic: Operators
4/15/2003 (c)2001-2003, Michael P. Frank 19
Module #1 - Logic
Topic #1.0 – Propositional Logic: Operators
4/15/2003 (c)2001-2003, Michael P. Frank 20
Module #1 - Logic
Topic #1.0 – Propositional Logic: Operators
antecedent consequent
4/15/2003 (c)2001-2003, Michael P. Frank 21
Module #1 - Logic
The
False case!
Topic #1.0 – Propositional Logic: Operators
4/15/2003 (c)2001-2003, Michael P. Frank 22
Module #1 - Logic
Topic #1.0 – Propositional Logic: Operators
4/15/2003 (c)2001-2003, Michael P. Frank 23
Module #1 - Logic
– “If I wear a red shirt tomorrow, then the U.S. will attack Iraq the same day.”
– Why this discrepancy between logic & language?
4/15/2003 (c)2001-2003, Michael P. Frank 24
Module #1 - Logic
– “In all possible situations, if p then q.”
– “For all situations s, if p is true in situation s, then q is also true in situation s” – Formally, we could write: ∀s, P(s) → Q(s)
– Natural language and logic then agree with each other.
4/15/2003 (c)2001-2003, Michael P. Frank 25
Module #1 - Logic
We will see some equivalent logic expressions later.
Topic #1.0 – Propositional Logic: Operators
4/15/2003 (c)2001-2003, Michael P. Frank 26
Module #1 - Logic
Topic #1.0 – Propositional Logic: Operators
4/15/2003 (c)2001-2003, Michael P. Frank 27
Module #1 - Logic
Topic #1.0 – Propositional Logic: Operators
4/15/2003 (c)2001-2003, Michael P. Frank 28
Module #1 - Logic
Topic #1.0 – Propositional Logic: Operators 2004 I ’m st ill here! 2005
4/15/2003 (c)2001-2003, Michael P. Frank 29
Module #1 - Logic
Topic #1.0 – Propositional Logic: Operators
4/15/2003 (c)2001-2003, Michael P. Frank 30
Module #1 - Logic
Topic #1.0 – Propositional Logic: Operators
4/15/2003 (c)2001-2003, Michael P. Frank 31
Module #1 - Logic
Name:
Propositional logic:
Boolean algebra:
C/C++/Java (wordwise): !
C/C++/Java (bitwise):
Logic gates:
Topic #1.0 – Propositional Logic: Operators
4/15/2003 (c)2001-2003, Michael P. Frank 32
Module #1 - Logic
Topic #2 – Bits
John Tukey (1915-2000)
4/15/2003 (c)2001-2003, Michael P. Frank 33
Module #1 - Logic
Topic #2 – Bits
4/15/2003 (c)2001-2003, Michael P. Frank 34
Module #1 - Logic
– How? Count in binary!
– If it changes 1→0, then also flip the next bit to the left,
Topic #2 – Bits
4/15/2003 (c)2001-2003, Michael P. Frank 35
Module #1 - Logic
Topic #2 – Bits
4/15/2003 (c)2001-2003, Michael P. Frank 36
Module #1 - Logic
– Symbolic notations. – English equivalents. – Logical meaning. – Truth tables.
– Propositional equivalences. – How to prove them.
4/15/2003 (c)2001-2003, Michael P. Frank 37
Module #1 - Logic
Topic #1.1 – Propositional Logic: Equivalences
4/15/2003 (c)2001-2003, Michael P. Frank 38
Module #1 - Logic
Topic #1.1 – Propositional Logic: Equivalences
4/15/2003 (c)2001-2003, Michael P. Frank 39
Module #1 - Logic
Topic #1.1 – Propositional Logic: Equivalences
4/15/2003 (c)2001-2003, Michael P. Frank 40
Module #1 - Logic
Topic #1.1 – Propositional Logic: Equivalences
4/15/2003 (c)2001-2003, Michael P. Frank 41
Module #1 - Logic
Topic #1.1 – Propositional Logic: Equivalences
4/15/2003 (c)2001-2003, Michael P. Frank 42
Module #1 - Logic
Topic #1.1 – Propositional Logic: Equivalences
4/15/2003 (c)2001-2003, Michael P. Frank 43
Module #1 - Logic
Topic #1.1 – Propositional Logic: Equivalences
Augustus De Morgan (1806-1871)
4/15/2003 (c)2001-2003, Michael P. Frank 44
Module #1 - Logic
Topic #1.1 – Propositional Logic: Equivalences
4/15/2003 (c)2001-2003, Michael P. Frank 45
Module #1 - Logic
Topic #1.1 – Propositional Logic: Equivalences
4/15/2003 (c)2001-2003, Michael P. Frank 46
Module #1 - Logic
Topic #1.1 – Propositional Logic: Equivalences
4/15/2003 (c)2001-2003, Michael P. Frank 47
Module #1 - Logic
Topic #1.1 – Propositional Logic: Equivalences
(Which was to be shown.)
4/15/2003 (c)2001-2003, Michael P. Frank 48
Module #1 - Logic
Topic #1 – Propositional Logic
4/15/2003 (c)2001-2003, Michael P. Frank 49
Module #1 - Logic
Topic #3 – Predicate Logic
4/15/2003 (c)2001-2003, Michael P. Frank 50
Module #1 - Logic
Predicate logic with function symbols, the “=” operator, and a few proof-building rules is sufficient for defining any conceivable mathematical system, and for proving anything that can be proved within that system!
Topic #3 – Predicate Logic
4/15/2003 (c)2001-2003, Michael P. Frank 51
Module #1 - Logic
Topic #3 – Predicate Logic
Kurt Gödel 1906-1978
4/15/2003 (c)2001-2003, Michael P. Frank 52
Module #1 - Logic
Topic #3 – Predicate Logic
4/15/2003 (c)2001-2003, Michael P. Frank 53
Module #1 - Logic
Topic #3 – Predicate Logic
4/15/2003 (c)2001-2003, Michael P. Frank 54
Module #1 - Logic
– E.g. if P(x) = “x is a prime number”, P(3) is the proposition “3 is a prime number.”
Topic #3 – Predicate Logic
4/15/2003 (c)2001-2003, Michael P. Frank 55
Module #1 - Logic
Topic #3 – Predicate Logic
4/15/2003 (c)2001-2003, Michael P. Frank 56
Module #1 - Logic
Topic #3 – Predicate Logic
4/15/2003 (c)2001-2003, Michael P. Frank 57
Module #1 - Logic
Topic #3 – Predicate Logic
4/15/2003 (c)2001-2003, Michael P. Frank 58
Module #1 - Logic
– i.e., “For each parking space at UF, that space is full.” Topic #3 – Predicate Logic
4/15/2003 (c)2001-2003, Michael P. Frank 59
Module #1 - Logic
Topic #3 – Predicate Logic
4/15/2003 (c)2001-2003, Michael P. Frank 60
Module #1 - Logic
Topic #3 – Predicate Logic
4/15/2003 (c)2001-2003, Michael P. Frank 61
Module #1 - Logic
Topic #3 – Predicate Logic
4/15/2003 (c)2001-2003, Michael P. Frank 62
Module #1 - Logic
Topic #3 – Predicate Logic
4/15/2003 (c)2001-2003, Michael P. Frank 63
Module #1 - Logic
4/15/2003 (c)2001-2003, Michael P. Frank 64
Module #1 - Logic
4/15/2003 (c)2001-2003, Michael P. Frank 65
Module #1 - Logic
Everyone has someone to rely on. There’s a poor overburdened soul whom everyone relies upon (including himself)! There’s some needy person who relies upon everybody (including himself). Everyone has someone who relies upon them. Everyone relies upon everybody, (including themselves)!
Topic #3 – Predicate Logic
4/15/2003 (c)2001-2003, Michael P. Frank 66
Module #1 - Logic
[Probably more likely.]
Topic #3 – Predicate Logic
4/15/2003 (c)2001-2003, Michael P. Frank 67
Module #1 - Logic
whether a proposition with nested quantifiers is true.
– Verifier: Wants to demonstrate that the proposition is true. – Falsifier: Wants to demonstrate that the proposition is false.
– Read the quantifiers from left to right, picking values of variables. – When you see “∀”, the falsifier gets to select the value. – When you see “∃”, the verifier gets to select the value.
Topic #3 – Predicate Logic
4/15/2003 (c)2001-2003, Michael P. Frank 68
Module #1 - Logic
Let B(x,y) :≡ “x’s birthday is followed within 7 days by y’s birthday.” Suppose I claim that among you: ∀x ∃y B(x,y)
Your turn, as falsifier: You pick any x → (so-and-so)
∃y B(so-and-so,y)
My turn, as verifier: I pick any y → (such-and-such)
B(so-and-so,such-and-such)
quantifiers, and I claimed that ∃y ∀x B(x,y)? Who wins in that case?
Topic #3 – Predicate Logic
4/15/2003 (c)2001-2003, Michael P. Frank 69
Module #1 - Logic
Topic #3 – Predicate Logic
4/15/2003 (c)2001-2003, Michael P. Frank 70
Module #1 - Logic
Topic #3 – Predicate Logic
4/15/2003 (c)2001-2003, Michael P. Frank 71
Module #1 - Logic
Topic #3 – Predicate Logic
4/15/2003 (c)2001-2003, Michael P. Frank 72
Module #1 - Logic
Topic #3 – Predicate Logic
4/15/2003 (c)2001-2003, Michael P. Frank 73
Module #1 - Logic
Topic #3 – Predicate Logic
4/15/2003 (c)2001-2003, Michael P. Frank 74
Module #1 - Logic
Topic #3 – Predicate Logic
4/15/2003 (c)2001-2003, Michael P. Frank 75
Module #1 - Logic
Topic #3 – Predicate Logic
4/15/2003 (c)2001-2003, Michael P. Frank 76
Module #1 - Logic
Topic #3 – Predicate Logic
4/15/2003 (c)2001-2003, Michael P. Frank 77
Module #1 - Logic
4/15/2003 (c)2001-2003, Michael P. Frank 78
Module #1 - Logic
Topic #3 – Predicate Logic
4/15/2003 (c)2001-2003, Michael P. Frank 79
Module #1 - Logic
Topic #3 – Predicate Logic
4/15/2003 (c)2001-2003, Michael P. Frank 80
Module #1 - Logic
H(s)→M(s) [Instantiate universal.] If Socrates is human then he is mortal. ¬H(s) ∨ M(s) Socrates is inhuman or mortal. H(s) ∧ (¬H(s) ∨ M(s)) Socrates is human, and also either inhuman or mortal. (H(s) ∧ ¬H(s)) ∨ (H(s) ∧ M(s)) [Apply distributive law.] F ∨ (H(s) ∧ M(s)) [Trivial contradiction.] H(s) ∧ M(s) [Use identity law.] M(s) Socrates is mortal.
Topic #3 – Predicate Logic
4/15/2003 (c)2001-2003, Michael P. Frank 81
Module #1 - Logic
Topic #3 – Predicate Logic
4/15/2003 (c)2001-2003, Michael P. Frank 82
Module #1 - Logic
Topic #3 – Predicate Logic
4/15/2003 (c)2001-2003, Michael P. Frank 83
Module #1 - Logic
– Predicate logic notation & conventions – Conversions: predicate logic ↔ clear English – Meaning of quantifiers, equivalences – Simple reasoning with quantifiers
– Introduction to proof-writing. – Then: Set theory –
Topic #3 – Predicate Logic