Discrete Mathematics
Propositional Logic
Syllogism : A logical argument which relies on two or more propositions to come to a
conclusion.
Proposition : A declarative sentence that can be definitively proved to be true or false.
Boolean Algebra
Compound propositions were first discussed by English Mathematician George Boole.
Boolean Algebra is named after him
Negation : If P is a proposition, the negation of P is ¬P .
¬P is true when P is false and vice versa.
Same as a NOT gate
P ¬P
T F
F T
Conjunction : If P and Q are propositions, the conjunction of P and Q is P ∧ Q .
P ∧ Q is true when BOTH P and Q is true.
Same as an AND gate
P Q P ∧ Q
T T T
T F F
F T F
F F F
Disjunction : If P and Q are propositions, the disjunction of P and Q is P ∨ Q .
P ∨ Q is true when either P and/or Q is true.
Same as an OR gate
P Q P ∨ Q
T T T
T F T
P Q P ∨ Q
F T T
F F F
Exclusive or : If P and Q are propositions, the exclusive or of P and Q is P ⊕ Q.
P ⊕ Q is true exclusively when either P or Q is true, but false when both have the same
value.
Same as XOR gate
P Q P ⊕ Q
T T F
T F T
F T T
F F F
Conditional Statements : Denoted by P → Q , false only when P is true and Q is false, and
is true otherwise.
This might be confusing, giving an example will help:
If a proposition is "If it rains today, the ground will get wet", it is denoted by P → Q where,
P → "It's raining today"
Q → "The ground got wet"
Possible scenarios :
1. It rained today (P is true), and the ground got wet (Q is true). As this supports the
original proposition, P → Q is true in this case.
2. It rained today (P is true), but the ground didn't get wet (Q is false). As this contradicts
the original proposition, P → Q is false in this situation.
3. It did not rain today (P is false), but the ground still got wet because of some other
reason (Q is true). This statement does not contradict the original proposition, P → Q
is still true in this situation.
4. It did not rain today (P is false), and the ground did not get wet (Q is false). This
supports the original proposition so P → Q is true in this situation.
P Q P → Q
T T T
T F F
F T T
F F T
Biconditional statement : Denoted by P ↔ Q , true only when both P and Q have same
values and false otherwise.
If P ↔ Q denotes the proposition "A shape is called a triangle only if it has three sides"
where,
P → "A shape is a triangle"
Q → "The shape has three sides"
Possible scenarios :
1. The shape is called a triangle (P is true), and it has three sides (Q is true). As this
supports the original proposition, P ↔ Q is true here.
2. The shape is called a triangle (P is true), but it does not have three sides (Q is false).
This contradicts the proposition which means P ↔ Q is false.
3. The shape is not called a triangle (P is false), but it has three sides (Q is true). This
also contradicts the proposition which means P ↔ Q is false.
4. The shape is not called a triangle (P is false), and it does not have three sides(Q is
false). This supports the original proposition which means P ↔ Q is true.
P Q P ↔ Q
T T T
T F F
F T F
F F T
Converse, Contrapositive and Inverse :
If P → Q is a proposition;
Converse : Q → P
Contrapositive : ¬Q → ¬P
Inverse : ¬P → ¬Q
The contrapositive of a proposition is effectively the same thing as the original
proposition.
Example :
Original proposition : P → Q ; "If it is raining, the ground will get wet"
Contrapositive proposition : ¬Q → ¬P ; "If the ground is not wet, it is not raining"
Converse proposition : Q → P ; "If the ground is wet, it is raining"
Inverse proposition : ¬P → ¬Q ; "If it is not raining, the ground will not get wet"
Truth tables
P Q ¬P ¬Q P ∧ Q P ∨ Q P ⊕ Q P → Q P ↔ Q
T T F F T T F T T
T F F T F T T F F
P Q ¬P ¬Q P ∧ Q P ∨ Q P ⊕ Q P → Q P ↔ Q
F T T F F T T T F
F F T T F F F T T
Practice: Find the truth table for (P ∨ ¬Q) → (P ∧ Q)
P Q ¬Q P ∨ ¬Q P ∧ Q (P ∨ ¬Q) → (P ∧ Q)
T T F T T T
T F T T F F
F T F F F T
F F T T F F
Operator precedence
Operator Precedence
¬ 1
∧ 2
∨ 3
→ 4
↔ 5
Propositional Equivalence
Tautology : A compound proposition that is always true and independent of the truth values
of its constituent propositions
Contradictions : A compound proposition that is always false and independent of the truth
values of its constituent propositions
Contingency : A compound proposition that is neither a tautology nor a contradiction.
Logical Equivalence
When two compound propositions have the same truth values for all possible cases, they
are logically equivalent. This is denoted by P ≡ Q .
If P ↔ Q is a tautology then P ≡ Q .
example:
P Q ¬P P → Q ¬P ∨ Q
T T F T T
T F F F F
F T T T T
F F T T T
(P → Q) ≡ (¬P ∨ Q)
De Morgan's Law is used to convert conjunctions to disjunctions and vice versa.
1. ¬(P ∨ Q) ≡ ¬P ∧ ¬Q
2. ¬(P ∧ Q) ≡ ¬P ∨ ¬Q
Similarly, for n propositional variables;
3. ¬(P 1 ∨ P2 ∨ P3. . . ∨Pn) ≡ ¬P1 ∧ ¬P2 ∧ ¬P3. . . ∧¬Pn
4. ¬(P 1
∧ P2 ∧ P3. . . ∨Pn) ≡ ¬P1 ∨ ¬P2 ∨ ¬P3. . . ∨¬Pn
Practice :
Prove (p ∧ q) → (p ∨ q) is a tautology.
A tautology is a always true.
(p ∧ q) → (p ∨ q) ≡ ¬(p ∧ q) ∨ (p ∨ q)
≡ (¬p ∨ ¬q) ∨ (p ∨ q)
≡ (¬p ∨ p) ∨ (¬q ∨ q)
≡ T ∨ T
≡ T
Some important logical equivalencies:
¬(P ∨ Q) ≡ ¬P ∧ ¬Q
¬(P ∧ Q) ≡ ¬P ∨ ¬Q
¬(P1 ∨ P2 ∨ P3. . . ∨Pn) ≡ ¬P1 ∧ ¬P2 ∧ ¬P3. . . ∧¬Pn
¬(P1 ∧ P2 ∧ P3. . . ∨Pn) ≡ ¬P1 ∨ ¬P2 ∨ ¬P3. . . ∨¬Pn
(P → Q) ≡ (¬P ∨ Q)
P ∧ T ≡ P
P ∧ F ≡ F
P ∨ F ≡ P
P ∨ T ≡ T
(P ∨ Q) ∨ R ≡ P ∨ (Q ∨ R)
(P ∧ Q) ∧ R ≡ P ∧ (Q ∧ R)
P ∨ Q ≡ Q ∨ P
P ∧ Q ≡ Q ∧ P
P ∨ (Q ∧ R) ≡ (P ∨ Q) ∧ (P ∨ R)
P ∧ (Q ∨ R) ≡ (P ∧ Q) ∨ (P ∧ R)
Predicate Quantifiers
Predicates: Statements that, due to lack of information are neither true or false.
x>3 is a predicate as without knowing the value of x we cannot definitively say if
it is true or false.
Predicates are denoted as a propositional function;
P (x) = x > 3
When we assign a value to x and quantify it, the propositional function becomes a
proposition that is either TRUE or FALSE.
Types of quantifications:
Universal quantification: Where a predicate is true for every element in a set. Denoted
by
∀xP (x)
Existential quantification: Where a predicate is true for at least one element in a set.
Denoted by
∃xP (x)
Negating quantified expressions
Let P (x) denote 'It has rained today'
Thus, ∀xP (x) denotes 'It has rained everyday'
Negating this function would give ¬∀xP (x) 'It is not the case that it has rained everyday'
This statement is the same as 'There is at least one day where it has not rained' which
is denoted by ∃x¬P (x)
∴ ¬∀xP (x) ≡ ∃x¬P (x)