RYS DSGT Lect2 Revised
RYS DSGT Lect2 Revised
Theory
Connectives
1. Negation (Not)
2. Conjunction (and)
3. Disjunction (or)
4. Conditional (if…then) /implication
5. Bi-conditional (if and only if)
Negation (NOT)
• Statements Formed by introducing “not” word
• “P” is Statement then negation of p is written as “not p“ or
It is not case that P.
• ┐p
• Unary Connective
• If P is true then ┐p is false and vice versa.
P ┐P
T F
F T
P:London is a city.
Then
┐p: London is not a city.
OR
┐p: It is not the case that London is a city.
P ∧Q
Disjunction (OR)
• Statements Formed by introducing “OR” word
• Binary Connective
• Denote by ∨
• If one statement is true then p ∨ Q is true otherwise false.
P Q P∨Q
T T T
T F T
F T T
F F F
P:London is a capital of India.
Q: India is country.
P∨Q
Conditional (if..then)
• Statements Formed by introducing “if…then ” word
• Binary Connective
• Denote by →
• If First statement is true and second statement is false then p
→ Q is false otherwise true.
P Q P→Q
T T T
T F F
F T T
F F T
“If elephants were red, then they could hide in
cherry trees.”.
P →Q
P is known as Antecedent
Q is known as consequent
P Q P↔Q
T T T
T F F
F T F
F F T
“x < y if and only if y > x.”
P↔Q
EX-OR (Either-Or)
• Statement formed by “Either Or” word.
• Exclusive Or
• P x Q proposition will be true, if exactly one
of two propositions of both is true.
Otherwise false
P Q Pc Q
T T v F
T F T
F T T
F F F
Inclusive or OR Exclusive or
• In order to get a job in this multinational
company , experience with C++ or Java is
mandatory.
Inclusive or OR Exclusive or
• In order to get a job in this multinational
company , experience with C++ or Java is
mandatory.
Inclusive OR
Disjunction
Inclusive or OR Exclusive or
• “When you buy a mobile of xyz company,
you get Rs.500 cashback or a mobile cover
of worth Rs.500.”
Inclusive or OR Exclusive or
• “When you buy a mobile of xyz company,
you get Rs.500 cashback or a mobile cover
of worth Rs.500.”
Exclusive OR
Statement Formula and Truth Table
• Atomic statements/proposition
• Compound statements/proposition
¬(P∧Q)↔(¬P)∨(¬Q), ¬(P∧Q) , ¬(P∧Q)
• Statement formula
•Truth Table
n
•2 where n is number of distinct statement variable
•P∧ ┐P
1
2 rows, n=1, 2
•(P∧Q)
2
4 rows, n=2, 2
• Statements and operators (Connectives and parenthesis) can be
combined in any way to form new statements.
• (¬P)∨(¬Q)
P Q
T T
T F
F T
F F
• Statements and operators can be combined in any way to
form new statements.
• (¬P)∨(¬Q)
P Q ¬P
T T F
T F F
F T T
F F T
• Statements and operators can be combined in any way to
form new statements.
• (¬P)∨(¬Q)
P Q ¬P ¬Q
T T F F
T F F T
F T T F
F F T T
• Statements and operators can be combined in any way to
form new statements.
• (¬P)∨(¬Q)
P Q ¬P ¬Q (¬P)∨(¬Q)
T T F F
T F F T
F T T F
F F T T
• Statements and operators can be combined in any way to
form new statements.
• (¬P)∨(¬Q)
P Q ¬P ¬Q (¬P)∨(¬Q)
T T F F F
T F F T T
F T T F T
F F T T T
¬(P∧Q)↔(¬P)∨(¬Q)
P Q
T T
T F
F T
F F
¬(P∧Q)↔(¬P)∨(¬Q)
P Q ¬P ¬Q
T T F F
T F F T
F T T F
F F T T
¬(P∧Q)↔(¬P)∨(¬Q)
P Q ¬P ¬Q
T T F F
T F F T
F T T F
F F T T
(P∧Q)
T
T
T
F
¬(P∧Q)↔(¬P)∨(¬Q)
P Q ¬P ¬Q
T T F F
T F F T
F T T F
F F T T
(P∧Q) ¬(P∧Q)
T F
T F
T F
F T
¬(P∧Q)↔(¬P)∨(¬Q)
P Q ¬P ¬Q
T T F F
T F F T
F T T F
F F T T
(P∧Q) ¬(P∧Q) (¬P)∨(¬Q)
T F F
T F T
T F T
F T T
¬(P∧Q)↔(¬P)∨(¬Q)
P Q ¬P ¬Q
T T F F
T F F T
F T T F
F F T T
(P∧Q) ¬(P∧Q) (¬P)∨(¬Q) ¬(P∧Q)↔(¬P)∨(¬Q)
T F F T
F T T T
F T T T
F T T T
¬(P∧Q)↔(¬P)∨(¬Q)
P Q ¬P ¬Q
T T F F
T F F T
F T T F
F F T T
(P∧Q) ¬(P∧Q) (¬P)∨(¬Q) ¬(P∧Q)↔(¬P)∨(¬Q)
T F F T
F T T T
F T T T
F T T T
Example
• Using the statements:
R:Mark is Rich.
H:Mark is happy
• Write the following statements in symbolic form:
• (a) Mark is poor but happy.
¬R∧H
• (b) Mark is rich or unhappy;
R∨¬H
• (c) Mark is neither rich nor happy.
¬R∧¬H
• (d) Mark is poor or he is both rich and unhappy.
¬ R ∨ (R ∧ ¬ H )
Example
• Let p be “It is cold” and let q be “It is raining”. Give
a simple verbal sentence which describes each of
the following statements:
• (a) ¬p; (b) p ∧ q; (c) p ∨ q; (d) q ∨¬p.
• (a) ¬p;
It is not cold.
• (b) p ∧ q;
It is cold and raining.
• (c) p ∨ q;
It is cold or it is raining
• (d) q ∨¬p.
It is raining or it is not cold.
Using the statements:
P:Food is good.
H:Food is cheap.
Good food is not cheap.
P → ¬H
P Q ¬P ¬Q ¬(P∧Q) (¬P)∨(¬Q)
T T F F F F
T F F T T T
F T T F T T
F F T T T T
Denoted by symbol ⇔
• Let P be “Roses are red” and Q be “Violets are
blue.” Let S be the statement:
“It is not true that roses are red and violets are
blue.”
• Then S can be written in the form ¬(p ∧ q).
• Accordingly, S has the same meaning as the
statement:
“Roses are not red, or violets are not blue.”
Then S can be written in the form ¬p ∨ ¬q.
However, as noted above, ¬(p ∧ q) ⇔ ¬p ∨ ¬q.
Equivalent Statements
• The statements ¬(P∧Q) and (¬P) ∨ (¬Q) are logically equivalent,
since ¬(P∧Q) ↔ (¬P) ∨ (¬Q) is always true.
T T F F F F T
T F F T T T T
F T T F T T T
F F T T T T T
Convert the following English statements in
symbolic form.
p q p →q p q ¬q ¬p ¬q→¬p
Logical Equivalence
The easiest way to check for logical equivalence is to
see if the truth tables of both variants have
identical last columns:
p q p →q p q ¬q ¬p ¬q→¬p
T T T
T F F
F T T
F F T
Logical Equivalence
The easiest way to check for logical equivalence is to
see if the truth tables of both variants have
identical last columns:
p q p →q p q ¬q ¬p ¬q→¬p
T T T T T
T F F T F
F T T F T
F F T F F
Logical Equivalence
The easiest way to check for logical equivalence is to
see if the truth tables of both variants have
identical last columns:
p q p →q p q ¬q ¬p ¬q→¬p
T T T T T F
T F F T F T
F T T F T F
F F T F F T
Logical Equivalence
The easiest way to check for logical equivalence is to
see if the truth tables of both variants have
identical last columns:
p q p →q p q ¬q ¬p ¬q→¬p
T T T T T F F
T F F T F T F
F T T F T F T
F F T F F T T
Logical Equivalence
The easiest way to check for logical equivalence is to
see if the truth tables of both variants have
identical last columns:
p q p →q p q ¬q ¬p ¬q→¬p
T T T T T F F T
T F F T F T F F
F T T F T F T T
F F T F F T T T
Exercises
•Prove that:
1) (P → Q) ⇔ ¬P∨Q
2) P → (Q →R) ⇔ (P∧Q) →R.
Tautologies and Contradictions
• Some propositions P contain only T in the last
column of their truth tables or, in other words,
they are true for any truth values of their
variables. Such propositions are called tautologies.
A tautology is a statement that is always true.
Examples:
• R∨(¬R)
∀ ¬(P∧Q) ↔(¬P)∨(¬Q)
T F
F T
F F
Tautology by truth table
[¬p ∧(p ∨q )]
p q ¬p p ∨q ¬p ∧(p ∨q )
→q
T T F
T F F
F T T
F F T
Tautology by truth table
[¬p ∧(p ∨q )]
p q ¬p p ∨q ¬p ∧(p ∨q )
→q
T T F T
T F F T
F T T T
F F T F
Tautology by truth table
[¬p ∧(p ∨q )]
p q ¬p p ∨q ¬p ∧(p ∨q )
→q
T T F T F
T F F T F
F T T T T
F F T F F
Tautology by truth table
[¬p ∧(p ∨q )]
p q ¬p p ∨q ¬p ∧(p ∨q )
→q
T T F T F T
T F F T F T
F T T T T T
F F T F F T
Tautologies and Contradictions
• a proposition P is called a contradiction if it
contains only F in the last column of its truth table
or, in other words, if it is false for any truth
values of its variables.
• A contradiction is a statement that is always false.
Examples:
• R∧(¬R)
∀ ¬(¬(P∧Q)↔(¬P)∨(¬Q))
T T F F T T
T F F T F F
F T T F T T
F F T T T T
Logical Equivalences
• Identity Laws: p ∧ T ⇔ p and p ∨ F ⇔ p.
• Domination Laws: p ∨ T ⇔ T and p ∧ F ⇔ F.
• Idempotent Laws: p ∧ p ⇔ p and p ∨ p ⇔ p.
• Double Negation Law: ¬(¬ p) ⇔ p.
• Commutative Laws:
• (p ∨ q) ⇔ (q ∨ p) and (p ∧ q) ⇔ (q ∧ p).
• Associative Laws: (p ∨ q) ∨ r ⇔ p ∨ (q ∨ r)
• and (p ∧ q) ∧ r ⇔ p ∧ (q ∧ r).
Logical Equivalences
• Distributive Laws:
• p ∨ (q ∧ r) ⇔ (p ∨ q) ∧ (p ∨ r) and
• p ∧ (q ∨ r) ⇔ (p ∧ q) ∨ (p ∧ r).
• DeMorgan’s Laws:
• ¬(p ∧ q) ⇔ (¬ p ∨ ¬ q) and
• ¬(p ∨ q) ⇔ (¬ p ∧ ¬ q).
• Absorption Laws:
• p ∨ (p ∧ q) ⇔ p and p ∧ (p ∨ q) ⇔ p.
• Negation Laws: p ∨ ¬ p ⇔ T and p ∧ ¬ p ⇔ F.
Logical Equivalences for
Implication
Logical Equivalences for Double
Implication
Substitution instance
• A formula A is called substitution instance of formula B if A
can be obtained from B by substituting formulas for some
variable of B.
Examples:
• B:P →(J ∧ P)
• If P be R ↔ S
• A:(R ↔ S) →(J ∧ (R ↔ S))
• As like we can substitute the formula with another
formula if both have same truth values
• (R → S) ∧ (R ↔ S)
• (¬ R ∨ S) ∧ (R ↔ S)
• Equivalent formula can be substitute for each other.
• Prove that P → (Q →R) ⇔ (P∧Q) →R.
• P → (Q →R) ⇔ P →(¬ Q ∨ R) …..implication law
⇔ ¬P ∨ (¬ Q ∨ R) ..implication law
⇔ (¬P ∨ ¬ Q) ∨ R …Associative law
⇔ ¬(P ∧ Q) ∨ R …Associative law
⇔ (P∧Q) →R.
Prove: (p∧¬q) ∨ q ⇔ p∨q
(p∧¬q) ∨ q Left-Hand Statement
⇔ q ∨ (p∧¬q) Commutative
⇔ (q∨p) ∧ (q ∨¬q) Distributive
⇔ (q∨p) ∧ T Or Tautology
⇔ q∨p Identity
⇔ p∨q Commutative
Begin with exactly the left-hand side statement
End with exactly what is on the right
Justify EVERY step with a logical equivalence
Prove: (p∧¬q) ∨ q ⇔ p∨q
(p∧¬q) ∨ q Left-Hand Statement
⇔ q ∨ (p∧¬q) Commutative
⇔ (q∨p) ∧ (q ∨¬q) Distributive
Why did we need this step?
Our logical equivalence specified that ∨ is distributive on the
right. This does not guarantee the equivalence works on the
left!
Ex.: Matrix multiplication is not always commutative
(Note that whether or not ∨ is distributive on the left is not
the point here.)
Prove: p → q ⇔ ¬q → ¬p
p→q Contrapositive
⇔ ¬p ∨ q Implication Equivalence
⇔ q ∨ ¬p Commutative
⇔ ¬(¬q) ∨ ¬p Double Negation
⇔ ¬q → ¬p Implication Equivalence
p→p∨q
⇔ ¬p ∨ (p ∨ q) Implication Equivalence
⇔ (¬p ∨ p) ∨ q Associative
⇔ (p ∨ ¬p) ∨ q Commutative
⇔ T∨q Or Tautology
⇔ q∨T Commutative
⇔ T Domination
This tautology is called the addition rule of
inference.