LOGIC
Statements
• Logic is the tool for reasoning about
the truth or falsity of statements.
– Propositional logic is the study ...
Arithmetic vs. Logic
Arithmetic Logic
0 false
1 true
Boolean variable statement variable
form of function statement form
v...
Notation
Word Symbol
and v
or w
implies 6
equivalent ]
not ~
not 5
parentheses ( ) used for grouping terms
Notation Examples
English Symbolic
A and B A v B
A or B A w B
A implies B A 6 B
A is equivalent to B A ] B
not A ~A
not A ...
Statement Forms
• (p v q) and (q v p) are different as statement
forms. They look different.
• (p v q) and (q v p) are log...
Truth Tables - NOT
P 5P
T F
F T
Truth Tables - AND
P Q PvQ
T T T
T F F
F T F
F F F
Truth Tables - OR
P Q PwQ
T T T
T F T
F T T
F F F
Truth Tables - EQUIVALENT
P Q P]Q
T T T
T F F
F T F
F F T
Truth Tables - IMPLICATION
P Q P6Q
T T T
T F F
F T T
F F T
Truth Tables - Example
P true means rain
P false means no rain
Q true means clouds
Q false means no clouds
Truth Tables - Example
P Q P6Q P6Q
rain clouds rainclouds T
rain no clouds rainno clouds F
no rain clouds no rainclouds...
Algebraic rules for statement forms
• Associative rules:
(p v q) v r ] p v (q v r)
(p w q) w r ] p w (q w r)
• Distributiv...
Rules (continued)
• Double Negation:
55p ] p
• DeMorgan’s Rules:
5(p v q) ] 5p w 5q
5(p w q) ] 5p v 5q
• Commutative Rules...
Rules (continued)
• Absorption Rules:
p w (p v q) ] p
p v (p w q) ] p
• Bound Rules:
p v 0 ] 0
p v 1 ] p
p w 0 ] p
p w 1 ]...
A Simple Tautology
P  Q is the same as 5Q 5P
This is the same as asking: PQ ] 5Q  5P
How can we prove this true?
By cr...
A Simple Tautology (continued)
Add appropriate columns
P Q 5P 5Q
T T F F
T F F T
F T T F
F F T T
A Simple Tautology (continued)
Remember your implication table!
P Q 5P 5Q PQ
T T F F T
T F F T F
F T T F T
F F T T T
A Simple Tautology (continued)
Remember your implication table!
P Q 5P 5Q PQ 5Q5P
T T F F T T
T F F T F F
F T T F T T
F ...
A Simple Tautology (continued)
Remember your implication table!
P Q 5P 5Q PQ 5Q5P PQ ] 5Q5P
T T F F T T T
T F F T F F ...
Translation of English
If P then Q: PQ
P only if Q: 5Q5P or
PQ
P if and only if Q: P ] Q
also written as P iff Q
Translation of English
P is sufficient for Q: PQ
P is necessary for Q: 5P5Q or
QP
P is necessary and sufficient for Q:
...
Predicate Logic
• Consider the statement: x2
> 1
• Is it true or false?
• Depends upon the value of x!
• What values can x...
Example
• S(0.9) = 0.92
> 1 is a false statement!
• S(3.2) = 3.22
> 1 is a true statement!
• The function S is an example ...
Note
• The codomain is a set of statements
• The codomain is not the truth value of the
statements
• The domain of predica...
Quantifiers
• The phrase “for all” is called a universal
quantifier and is symbolically written as œ
• The phrase “for som...
Goldbach’s conjecture
• Every even number greater than or equal
to 4 can be written as the sum of two
primes
• Express it ...
Negating Quantifiers
• Let D be a set and let P(x) be a predicate
that is defined for x ε D, then
5(œ(x ε D), P(x)) ] (›(x...
Upcoming SlideShare
Loading in …5
×

Logic

364 views
341 views

Published on

Published in: Technology, Spiritual
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
364
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
8
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Logic

  1. 1. LOGIC
  2. 2. Statements • Logic is the tool for reasoning about the truth or falsity of statements. – Propositional logic is the study of Boolean functions – Predicate logic is the study of quantified Boolean functions (first order predicate logic)
  3. 3. Arithmetic vs. Logic Arithmetic Logic 0 false 1 true Boolean variable statement variable form of function statement form value of function truth value of statement equality of function equivalence of statements
  4. 4. Notation Word Symbol and v or w implies 6 equivalent ] not ~ not 5 parentheses ( ) used for grouping terms
  5. 5. Notation Examples English Symbolic A and B A v B A or B A w B A implies B A 6 B A is equivalent to B A ] B not A ~A not A 5A
  6. 6. Statement Forms • (p v q) and (q v p) are different as statement forms. They look different. • (p v q) and (q v p) are logically equivalent. They have the same truth table. • A statement form that represents the constant 1 function is called a tautology. It is true for all truth values of the statement variables. • A statement form that represents the constant 0 function is called a contradiction. It is false for all truth values of the statement variables.
  7. 7. Truth Tables - NOT P 5P T F F T
  8. 8. Truth Tables - AND P Q PvQ T T T T F F F T F F F F
  9. 9. Truth Tables - OR P Q PwQ T T T T F T F T T F F F
  10. 10. Truth Tables - EQUIVALENT P Q P]Q T T T T F F F T F F F T
  11. 11. Truth Tables - IMPLICATION P Q P6Q T T T T F F F T T F F T
  12. 12. Truth Tables - Example P true means rain P false means no rain Q true means clouds Q false means no clouds
  13. 13. Truth Tables - Example P Q P6Q P6Q rain clouds rainclouds T rain no clouds rainno clouds F no rain clouds no rainclouds T no rain no clouds no rainno clouds T
  14. 14. Algebraic rules for statement forms • Associative rules: (p v q) v r ] p v (q v r) (p w q) w r ] p w (q w r) • Distributive rules: p v (q w r) ] (p v q) w (p v r) p w (q v r) ] (p w q) v (p w r) • Idempotent rules: p v p ] p p w p ] p
  15. 15. Rules (continued) • Double Negation: 55p ] p • DeMorgan’s Rules: 5(p v q) ] 5p w 5q 5(p w q) ] 5p v 5q • Commutative Rules: p v q ] q v p p w q ] q w p
  16. 16. Rules (continued) • Absorption Rules: p w (p v q) ] p p v (p w q) ] p • Bound Rules: p v 0 ] 0 p v 1 ] p p w 0 ] p p w 1 ] 1 • Negation Rules: p v 5p ] 0 p w 5p ] 1
  17. 17. A Simple Tautology P  Q is the same as 5Q 5P This is the same as asking: PQ ] 5Q  5P How can we prove this true? By creating a truth table! P Q T T T F F T F F
  18. 18. A Simple Tautology (continued) Add appropriate columns P Q 5P 5Q T T F F T F F T F T T F F F T T
  19. 19. A Simple Tautology (continued) Remember your implication table! P Q 5P 5Q PQ T T F F T T F F T F F T T F T F F T T T
  20. 20. A Simple Tautology (continued) Remember your implication table! P Q 5P 5Q PQ 5Q5P T T F F T T T F F T F F F T T F T T F F T T T T
  21. 21. A Simple Tautology (continued) Remember your implication table! P Q 5P 5Q PQ 5Q5P PQ ] 5Q5P T T F F T T T T F F T F F T F T T F T T T F F T T T T T Since the last column is all true, then the original statement: PQ ] 5Q5P is a tautology Note: 5Q5P is the contrapositive of PQ
  22. 22. Translation of English If P then Q: PQ P only if Q: 5Q5P or PQ P if and only if Q: P ] Q also written as P iff Q
  23. 23. Translation of English P is sufficient for Q: PQ P is necessary for Q: 5P5Q or QP P is necessary and sufficient for Q: P ] Q P unless Q: 5QP or 5PQ
  24. 24. Predicate Logic • Consider the statement: x2 > 1 • Is it true or false? • Depends upon the value of x! • What values can x take on (what is the domain of x)? • Express this as a function: S(x) = x2 > 1 • Suppose the domain is the set of reals. • The codomain (range) of S is a set of statements that are either true or false.
  25. 25. Example • S(0.9) = 0.92 > 1 is a false statement! • S(3.2) = 3.22 > 1 is a true statement! • The function S is an example of a predicate. • A predicate is any function whose codomain is a set of statements that are either true or false.
  26. 26. Note • The codomain is a set of statements • The codomain is not the truth value of the statements • The domain of predicate is arbitrary • Different predicates can have different domains • The truth set of a predicate S with domain D is the set of the x ε D for which S(x) is true: {x ε D | S(x) is true} • Or simply: {x | S(x)}
  27. 27. Quantifiers • The phrase “for all” is called a universal quantifier and is symbolically written as œ • The phrase “for some” is called an existential quantifier and is written as › Notations for set of numbers: Reals Integers Rationals Primes Naturals (nonnegative integers)
  28. 28. Goldbach’s conjecture • Every even number greater than or equal to 4 can be written as the sum of two primes • Express it as a quantified predicate • It is unknown whether or not Goldbach’s conjecture is true. You are only asked to make the assertion • Another example: Every sufficiently large odd number is the sum of three primes.
  29. 29. Negating Quantifiers • Let D be a set and let P(x) be a predicate that is defined for x ε D, then 5(œ(x ε D), P(x)) ] (›(x ε D), 5P(x)) and 5(›(x ε D), P(x)) ] (œ(x ε D), 5P(x))

×