Outline Properties of Propositions Logical Equivalences Practice with Boolean Operators and Algebra Implication Summary Equivalence and Implication Alice E. Fischer CSCI 1166 Discrete Mathematics for Computing February 14, 2018 Alice E. Fischer Laws of Logic. . . 1/34
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
OutlineProperties of Propositions
Logical EquivalencesPractice with Boolean Operators and Algebra
ImplicationSummary
Equivalence and Implication
Alice E. Fischer
CSCI 1166 Discrete Mathematics for ComputingFebruary 14, 2018
Alice E. Fischer Laws of Logic. . . 1/34
OutlineProperties of Propositions
Logical EquivalencesPractice with Boolean Operators and Algebra
ImplicationSummary
1 Properties of PropositionsLogical EquivalenceContradictions and Tautologies
2 Logical Equivalences
3 Practice with Boolean Operators and Algebra
4 ImplicationNecessary and Sufficient ConditionsInside out and Backwards
5 Summary
Alice E. Fischer Laws of Logic. . . 2/34
OutlineProperties of Propositions
Logical EquivalencesPractice with Boolean Operators and Algebra
ImplicationSummary
Logical EquivalenceContradictions and Tautologies
Properties of Propositions
Logical EquivalenceContradictions and Tautologies
Alice E. Fischer Laws of Logic. . . 3/34
OutlineProperties of Propositions
Logical EquivalencesPractice with Boolean Operators and Algebra
ImplicationSummary
Logical EquivalenceContradictions and Tautologies
Logical Equivalence: ≡Two propositions are logically equivalent (≡) if they have thesame outcomes under all input conditions.
We can determine whether two propositions are equivalent (≡) bycomparing the last column in the truth tables for the twostatements.
P Q P ∨ Q Q ∨ P
T T T TT F T TF T T TF F F F
For example, The column for P ∨ Q is the same as the column forQ ∨ P, so the two propositions are equivalent .
Alice E. Fischer Laws of Logic. . . 4/34
OutlineProperties of Propositions
Logical EquivalencesPractice with Boolean Operators and Algebra
ImplicationSummary
Logical EquivalenceContradictions and Tautologies
Example: The Supervisor’s Critique
Do you remember John and his elevator design from last time?John’s supervisor looked at his logic and told him “It’s toocomplex, O is just the opposite of M”. Simplify! So John thoughta bit and added a column with a simpler formula to his truth table.
(O ∧ ∼M)∨
O M ∼O ∼M O ∧ ∼M ∼O ∧M (∼O ∧M) O ⊕MT T F F F F F FT F F T T F T TF T T F F T T TF F T T F F F F
Indeed, the boss was right. They are equivalent!
Alice E. Fischer Laws of Logic. . . 5/34
OutlineProperties of Propositions
Logical EquivalencesPractice with Boolean Operators and Algebra
ImplicationSummary
Logical EquivalenceContradictions and Tautologies
Contradictions
A contradiction is a proposition that is always false, no matterwhat the input truth values are.
For example, this is a contradiction:An odd number, X, equals 2 * some even number, Y.
And this is a contradiction: P ∧ ∼PLet P be All dogs are black.All dogs are black and not (all dogs are black).
A contradiction can be symbolized by c.
Alice E. Fischer Laws of Logic. . . 6/34
OutlineProperties of Propositions
Logical EquivalencesPractice with Boolean Operators and Algebra
ImplicationSummary
Logical EquivalenceContradictions and Tautologies
Tautologies
A tautology is a proposition that is always true, no matter whatthe input truth values are.
For example:Let Q be the proposition Today is Tuesday.
Then this is a tautology: Q ∨ ∼QToday is Tuesday or today is not Tuesday.
A tautology can be symbolized by t.
Alice E. Fischer Laws of Logic. . . 7/34
OutlineProperties of Propositions
Logical EquivalencesPractice with Boolean Operators and Algebra
ImplicationSummary
Logical Equivalences
A set of rules for logical calculation can be proven from thedefinitions using truth tables. They will be presented in thefollowing slides.
These laws are analogs of the laws for algebra and for sets that youalready know. They are essential in making logical proofs andseveral are also important in programming.
The following slides define the laws for symbolic logic. Thecorresponding set-theory law(s) will be given at the bottom of eachslide.
Alice E. Fischer Laws of Logic. . . 8/34
OutlineProperties of Propositions
Logical EquivalencesPractice with Boolean Operators and Algebra
ImplicationSummary
1. Commutative Laws
Both and and or are commutative, that is, the left and right sidescan be reversed without changing the meaning of the proposition.
P ∧ Q ≡ Q ∧ P
P ∨ Q ≡ Q ∨ P
This is important in programming.
Set theory: ∩ and ∪ are commutative. Given sets A and B,A ∩ B ≡ B ∩ AA ∪ B ≡ B ∪ A
Alice E. Fischer Laws of Logic. . . 9/34
OutlineProperties of Propositions
Logical EquivalencesPractice with Boolean Operators and Algebra
ImplicationSummary
2. Associative Laws
Both and and or are associative operators, that is, you mayparenthesize the expression any way you wish without changing itsmeaning.
(P ∧ Q) ∧ R ≡ P ∧ (Q ∧ R)
(P ∨ Q) ∨ R ≡ P ∨ (Q ∨ R)
This is important in programming.
Set theory: ∩ and ∪ are associative. Given sets P, Q, and R,(P ∩ Q) ∩ R ≡ P ∩ (Q ∩ R)(P ∪ Q) ∪ R ≡ P ∪ (Q ∪ R)
Alice E. Fischer Laws of Logic. . . 10/34
OutlineProperties of Propositions
Logical EquivalencesPractice with Boolean Operators and Algebra
ImplicationSummary
3. Distributive Laws
Both and and or can be distributed over the other operator.
P ∧ (Q ∨ R) ≡ (P ∧ Q) ∨ (P ∧ R)
P ∨ (Q ∧ R) ≡ (P ∨ Q) ∧ (P ∨ R)
This is important in programming.
Set theory: ∩ and ∪ can be distributed over each other.Given sets P, Q, and R,
Logical EquivalencesPractice with Boolean Operators and Algebra
ImplicationSummary
Necessary and Sufficient ConditionsInside out and Backwards
Implication
→ and its Truth TableNecessary and Sufficient Conditions
Inside out and Backwards
Alice E. Fischer Laws of Logic. . . 24/34
OutlineProperties of Propositions
Logical EquivalencesPractice with Boolean Operators and Algebra
ImplicationSummary
Necessary and Sufficient ConditionsInside out and Backwards
→ and its Truth Table
The symbol → is called if. . . then in the textbook.
It is more traditional to call it implies.
The proposition P → Q is read P implies Q or if P, then Q
We say that P is the premise and Q is the conclusion.
The truth table for P → Q is:
P Q P → Q ∼ P ∼ P ∨ Q
T T T F TT F F F FF T T T TF F T T T
It is also true that P → Q ≡ ∼ P ∨ Q
Alice E. Fischer Laws of Logic. . . 25/34
OutlineProperties of Propositions
Logical EquivalencesPractice with Boolean Operators and Algebra
ImplicationSummary
Necessary and Sufficient ConditionsInside out and Backwards
Implication Can be Confusing.
Sometimes, but not always, P → Q means that P causes Q:I didn’t increment my loop variable so my program had aninfinite loop.
Sometimes P → Q is used to define a term:If a creature is bipedal, it has two feet.
The conclusion can be true independently of the premise: Ifthe moon is made of green cheese then UNH is a university.This is often called a vacuous truth.
The implication is true when both the premise and theconclusion are false. if 0 = 1 then 1 = 2.
A truth table is the most reliable way to figure out the correctinterpretation of an implication.
Alice E. Fischer Laws of Logic. . . 26/34
OutlineProperties of Propositions
Logical EquivalencesPractice with Boolean Operators and Algebra
ImplicationSummary
Necessary and Sufficient ConditionsInside out and Backwards
If and Only If ↔
P → Q is a conditional statement that can be read if P then Q.
Now suppose that P → Q and also Q → P.
Then we write P ↔ Q, which can be read P if and only if Q.
This statement is called a biconditional.
P Q P → Q Q → P P ↔ Q
T T T T TT F F T FF T T F FF F T T T
Alice E. Fischer Laws of Logic. . . 27/34
OutlineProperties of Propositions
Logical EquivalencesPractice with Boolean Operators and Algebra
ImplicationSummary
Necessary and Sufficient ConditionsInside out and Backwards
Necessary and Sufficient Conditions ↔
A sufficient condition is a premise or set of premises that areenough, without any more premises, to prove the conclusion.
If C is a sufficient condition for S , then C → S .
A necessary condition is a premise that must be true in orderfor the conclusion to be true.
If C is a necessary condition for S , then ∼C → ∼S .
If a condition C is both necessary and sufficient for S , thenC ↔ S .
Alice E. Fischer Laws of Logic. . . 28/34
OutlineProperties of Propositions
Logical EquivalencesPractice with Boolean Operators and Algebra
ImplicationSummary
Necessary and Sufficient ConditionsInside out and Backwards
Inside Out and Backwards
There are four ways to “reverse” the proposition P → Q:
The contrapositive is ∼ Q → ∼P.
The converse is Q → P.
The inverse is ∼P → ∼Q.
The negation is ∼(P → Q), which is equivalent to P ∧ ∼Q.
A proposition and its contrapositive are equivalent.
A proposition is not equivalent to its converse, inverse, ornegation. For example,“If it is a bee, it can fly” is not ≡ to “If it can fly, it is a bee”.
Alice E. Fischer Laws of Logic. . . 29/34
OutlineProperties of Propositions
Logical EquivalencesPractice with Boolean Operators and Algebra
ImplicationSummary
Necessary and Sufficient ConditionsInside out and Backwards
The four “opposites” of P → Q:
A conditional is equivalent to its contrapositive.
The inverse is equivalent to the converse and has the oppositetruth value of the proposition.
Conditional ConverseP → Q Q → P
Inverse Contrapositive∼P → ∼Q ∼Q → ∼P
P Q ∼P ∼Q P → Q ∼Q → ∼P Q → P ∼P → ∼QT T F F T T T TT F F T F F T TF T T F T T F FF F T T T T T T
Alice E. Fischer Laws of Logic. . . 30/34
OutlineProperties of Propositions
Logical EquivalencesPractice with Boolean Operators and Algebra
ImplicationSummary
Necessary and Sufficient ConditionsInside out and Backwards
The Negation of P → Q:
When you need to negate an implication, it is usually best to workwith the form on the right.
∼(P → Q) ≡ ∼Q ∧ P
P Q ∼Q P → Q ∼(P → Q) ∼Q ∧ PT T F T F FT F T F T TF T F T F FF F T T F F
Alice E. Fischer Laws of Logic. . . 31/34
OutlineProperties of Propositions
Logical EquivalencesPractice with Boolean Operators and Algebra
ImplicationSummary
/enddocument
Alice E. Fischer Laws of Logic. . . 32/34
OutlineProperties of Propositions
Logical EquivalencesPractice with Boolean Operators and Algebra
ImplicationSummary
Summary
Alice E. Fischer Laws of Logic. . . 32/34
OutlineProperties of Propositions
Logical EquivalencesPractice with Boolean Operators and Algebra
ImplicationSummary
Summary of Terminology
A conjunction is two propositions joined by ∧.
A disjunction is two propositions joined by ∨.
A negation is ∼ applied to a proposition.
Two propositions are equivalent (≡) if the results in the lastcolumn of their truth tables are identical.
An implication is two propositions joined by →.
A biconditional is two propositions joined by ↔.
Alice E. Fischer Laws of Logic. . . 33/34
OutlineProperties of Propositions
Logical EquivalencesPractice with Boolean Operators and Algebra
ImplicationSummary
More Terminology
A proposition that is always true is called a tautology.
A proposition that is always false is called a contradiction.
Given a proposition P → Q,
The contrapositive is ∼Q → ∼P (equivalent to proposition)