You are on page 1of 12

DISCRETE STRUCTURES

MAEEDA KHALID
LOGICAL OPERATORS (CONNECTIVES)

p: Today is Friday
q: It is raining today

 Today is Friday AND It is raining today


p and q
 Today is Friday OR It is raining today
p or q
COMPOUND STATEMENT
Definition:
 In compound statements, propositional variables combined by logical connectives
(and, or, if … then, …).
 They are used to form new compound propositions from two/more existing
propositions. The logical operators used are also called connectives.
Examples:
1. The grass is green or it is hot today.
2. DS is not difficult to me.
3. 3 + 2 = 5 and Sialkot is a city of Pakistan.
LOGICAL CONNECTIVES
Most common logical connectives are:
1. Conjunction (AND)

2. Disjunction (OR) or Inclusive OR

3. Exclusive-OR (XOR)

4. Implication (if-then)

5. Biconditional (if and only if)

6. Negation (NOT)
LOGICAL CONNECTIVES
Symbols used for logical connectives:

LOGICAL CONNECTIVES
Operator Meaning Symbol Name
Negation NOT ¬, ~ Tilde
Conjunction AND ∧ Hat
Disjunction OR ∨ Vel
Exclusive-OR XOR ⨁ -
Conditional If-then → Arrow
Biconditional iff ↔ Double arrow
CONJUNCTION
Definition:
If 𝑝 and 𝑞 are statements, then the conjunction of 𝑝 and 𝑞 is the compound
statement 𝑝 and 𝑞, denoted by 𝑝 ∧ 𝑞.

Example: Truth Table for Conjunction


𝑝 𝑞 𝑝∧𝑞
p: Today is Friday
T T T
q: It is raining today
T F F
𝑝 ∧ 𝑞: Today is Friday and It is raining today
F T F
F F F

Both the conditions needs to be true, then the proposition is true.


DISJUNCTION
Definition:
If 𝑝 and 𝑞 are statements, then the disjunction of 𝑝 and 𝑞 is the compound
statement 𝑝 or 𝑞, denoted by 𝑝 ∨ 𝑞.
Truth Table for Disjunction
Example: 𝑝 𝑞 𝑝∨𝑞
p: Today is Friday T T T
q: It is raining today T F T
𝑝 ∨ 𝑞: Today is Friday or It is raining today F T T
F F F

It is true, when at least one of the p or q is true, and false only when both p and q is false.
EXCLUSIVE-OR

Definition:
The exclusive-OR (XOR), of two propositions is true when exactly one of the
propositions is true and other one is false.
Truth Table for Exclusive OR
Example:
𝑝 𝑞 𝑝⨁𝑞
p: Today is Friday
T T F
q: It is raining today T F T
F T T
F F F
Both conditions are same then the it is false.
NEGATION

Definition:
If 𝑝 is a statement, then the negation of 𝑝 is the statement not 𝑝, denoted by ∼𝑝
(sometimes, ¬𝑝, 𝑝ҧ ).
It has opposite truth value from 𝑝 i.e. if 𝑝 is true, ∼𝑝 is false and vice versa.
∼𝑝: “It is not the case that 𝑝”.
Truth Table for Negation
Example: 𝑝 ∼𝑝
𝑝: Today is Friday T F
F T
∼𝑝: Today is not Friday
PRACTICE
Examples:
𝑝 : It is hot.
𝒒 : It is sunny

English Sentence into Propositional form:


 It is not hot ~𝒑
 It is hot and sunny 𝒑 ∧𝒒
 It is not hot but sunny ~𝒑 ∧ 𝒒
 It is neither hot nor sunny ~𝒑 ∧ ~𝒒
PRACTICE
1. A compound statement may have many components:
𝒑 ∨ (𝒒 ∧ ∽ 𝒑 ∧ 𝒓 )

2. Make truth table for (𝒑 ∧ 𝒒) ∨ ∽ 𝒑


Truth Table for (𝒑 ∧ 𝒒) ∨ ∽ 𝒑
𝑝 𝑞 𝒑∧𝒒 ∽𝒑 (𝒑 ∧ 𝒒) ∨ ∽ 𝒑
T T T F T
T F F F F
F T F T T
F F F T T
Thank You!

12

You might also like