Module 4 Logic Basics NEW
Module 4 Logic Basics NEW
CSC 203
Department of Computer Sciences
“y > 5”
Is this a statement? no
It’s a request.
Is this a proposition? no
• Negation (NOT, )
• Conjunction (AND, )
• Disjunction (OR, )
• Exclusive-or (XOR, )
• Implication (if – then, → )
• Biconditional (if and only if, )
Truth tables can be used to show how these operators
can combine propositions to compound propositions.
Second Semester 2019 CSC 208 - Discrete Structures 13
Negation (NOT)
P P
true (T) false (F)
false (F) true (T)
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→QR
• QR→P
T T F F T
T F T T T
F T T T T
F F T T T
The statements (PQ) and (P) (Q) are logically equivalent,
since they have the same truth table, or put it in another way,
(PQ) (P) (Q) is always true.
Second Semester 2019 CSC 208 - Discrete Structures 26
Tautologies and Contradictions
A tautology is a statement that is always true.
Examples:
◼ R(R)
◼ (PQ) (P)( Q)
Another example:
Let the universe of discourse be the real numbers.
Is it true? yes
Nobody is perfect