Professional Documents
Culture Documents
DS Lecture 2 (Compound Statements)
DS Lecture 2 (Compound Statements)
Lecture # 2
Compound Statements, Truth Table Basic Logic Connectives,
Tautologies & Contradictions
Summiya Alam
LECTURE CONTENTS
• In mathematics, the letters x,y,z,… often denoted variables that can be replaced
by real numbers, and these variables can be combined with the familiar
operations +,*,‐ and division.
• In logic, the letters p,q,r,… denotes propositional variables; that is, variables
that can be replaced by statements.
• we can write;
• p: The sun is shining today
• q: it is cold
COMPOUND STATEMENT CONT..
Find:
p∧q
p∨q
~p
COMPOUND STATEMENT - SOLUTION
• 1. It is not hot. ~p
• 2. It is hot and sunny. p∧q
• 3. It is hot or sunny. p ∨q
• 4. It is not hot but sunny. ~ p ∧q
• 5. It is neither hot nor sunny. ~p∧~q
EXAMPLE
• h = “Zia is healthy”
• w = “Zia is wealthy”
• s = “Zia is wise”
1) ~ c
2) c ∨ m
3) m ∧ ~ c
TRANSLATING FROM SYMBOLS TO
ENGLISH
Solution:
1) ~c
Ali is not a Computer Science student
2) c∨m
Ali is a Computer Science student or good in Mathematics.
3) m∧~c
Ali is good in Mathematics but not a Computer Science Student
TRUTH TABLE
• A truth table specifies the truth value of a compound proposition for all
possible truth values of its constituent propositions.
• Truth table can be formed for all type of connectives
CONNECTIVES
• Solution
a) ~p: 2+3 is not greater than 1. i.e. ~p: 2+3 ≤1. Since p is true in this case,
~p is false.
b) ~q: it is not the case that it is cold. More simply ~q: it is not cold.
CONJUNCTION (∧)
• If p and q are statements, then the conjunction of p and q is “p and q”, denoted
as “p ∧ q”.
• p ∧ q is true only when both p and q are true.
• If either p or q is false, or both are false, then p ∧ q is false.
CONJUNCTION (∧)
EXAMPLES
Solution
• pᴧq: It is snowing and I am feeling cold.
• pᴧq : 2 < 3 and ‐5 > ‐8.
• It is snowing and 3 < 5.
DISJUNCTION (∨) OR INCLUSIVE OR
1. ~ p ∧ q
2. ~ p ∧ (q ∨ ~ r)
3. (p∨q) ∧ ~ (p∧q)
~ P ∧ Q
~ P ∧ (Q ∨ ~ R)
(P ∨ Q) ∧ ~ (P ∧ Q)
THANK YOU