Logic
Logic
Mr Vincent Mwai
October 6, 2020
Chapter 1
LOGIC
INTRODUCTION TO LOGIC
The rules of logic give precise meaning to mathematical statements. They are
used to distinguish between valid and invalid mathematical arguments. In
other words logic is important in understanding mathematical reasoning.
PROPOSITIONS
Def: A proposition is a declarative sentence (i.e. a sentence that declares the
fact) that is either true or false, but not both. It is a statement whose truth
value may be determined. It is not a matter of opinion.
Example
Each of the following is a proposition
1. Nairobi is the capital of Kenya.
2. For all real numbers x and y,x + y = y + x
3. 1 + 1 = 2 :T
4. 2 + 2 = 3 : F
5. Kenya is an island; F
6. There is life in Mars.
7. Every prime number greater than 2 is odd and 6 is not a prime number.
T
1
CHAPTER 1. LOGIC 2
Remarks.
• In the example above propositions (1), (2), (3) and (7) are true
whereas (4) and (5) are false. However, proposition (6) is one whose
truth value we do not know.
1. Questions
2. Exclamations
3. Possibiliies / Probabilities
4. Ambigous (both true and false at the same time)
Example
Consider the following sentences:
1. What time is it?
2. Read this carefully.
3. x+1=2
4. x+y=z
5. x-y=y-x
Sentences (1) and (2) are not propositions since there are not declarative sen-
tences, (3), (4) and (5) are neither true nor false since the variables have not
been assigned any values. Furthermore, sentence (5) is ambiguous: if x and y
are real numbers, the statement will have truth false; however, if y-x=0, then
the statement will have truth value true.
We normally use lower case letters p, q, r, s, ... to denote propositional / state-
ment variable. The truth value of a proposition is true, denoted by T, if it is
a true statement, and false, denoted by F, if it is a false statement.
Logical operators/ Connectives
Logical operators, also called connectives, are used to form new propositions
from existing propositions.
CHAPTER 1. LOGIC 3
Connective Notation
Negation ∼ or NOT
Conjunction ∧ AND
Disjunction ∨ OR
Logical implication/ conditional →
Double implication/biconditional ←→
1. Negation (∼p)
10
9
8
7
6 p
5
4 p
3
2
1
0
−1 0
−1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
2. Conjunction (p ∧ q)
CHAPTER 1. LOGIC 4
Any two propositions p and q can be combined using the word “and” to form a
compound proposition called the conjunction of p and q, denoted by (p ∧ q)
and read “p and q”.
Since (p ∧ q) is a proposition, it has a truth value and this truth value depends
only on the truth values of p and q. The conjunction (p ∧ q) is true when both
p and q are true and is false otherwise. E.g. Suppose p is the statement “it is
cold” and q the statement “it is raining”. Then (p ∧ q) is the statement “it is
cold and it is raining”
• Truth Table for the conjunction of two proposition p and q:
p q (p ∧ q)
T T T
T F F
F T F
F F F
2 3
1
p q r p∧q∧r
T T T T
T T F F
T F T F
F T T F
T F F F
F T F F
F F T F
F F F F
Example
Consider the following four statements
(i) Nairobi is in Kenya and 2+2=4
(ii) Nairobi is in Kenya and 2+2=5
(iii) Nairobi is in Ghana and 2+2=4
(iv) Nairobi is in Ghana and 2+2=5
Only the first statement are true. Each of the others is false at least one of its
subpropositions is false.
3. Disjunction (p ∨ q)
Any two propositions p and q can be combined using the word “or” to form a
compound proposition called the disjunction of p and q, denoted by (p ∨ q) and
read as “p or q”. The disjunction (p ∨ q) is false when both p and q are false and
is true otherwise.
Example
(i) Let p be the proposition “37 is prime” and q the proposition “he is a police-
man”. Then (p ∨ q) is the statement “37 is prime or he is a policeman”.
(ii) Let p be the statement that “he is tired” and q the statement “he is hungry”.
Then (p ∨ q) is the statement “he is either tired or hungry”
• Truth table and Venn diagram for the disjunction of two proposition p
and q:
p q (p ∨ q)
T T T
T F T
F T T
F F F
CHAPTER 1. LOGIC 6
../../../Desktop/DISCRETE MATHEMATICS/c2.PNG
• Truth table for the conjuction, disjunction and negation for two proposi-
tions p and q are:
• Def: Compound propositions that have the same truth values in all cases
are called logically equivalent. This means that in a truth table, the
columns of two logically equivalent expressions are identical.
Example
In the case above ∼ (p ∧ q) and ∼ p∨ ∼ q are logically equivalent. Similarly,
∼ (p ∨ q) and ∼ p∧ ∼ q are logically equivalent. These are the De-Morgan’s
laws.
Defn: Let p and q be propositions. The exclusive or of p and q, denoted by
p q, is the proposition that is true when exactly one of p and q is the true and
is false otherwise i.e. the compound proposition (p ∨ q)∧ ∼ (p ∧ q)
p q pq
T T F
T F T
F T T
F F F
../../../Desktop/DISCRETE MATHEMATICS/c5.PNG
4. Logical Implication (p q)
Let p and q be propositions. The logical implication (p q) is the proposition
“if p, then q”. It is also called a conditional statement since (p q) asserts that
q is true on the condition that p holds / is true
NB: The logical implication (p q) is false when p is true and q is false and is
true otherwise.
In the implication (p q), p is called the hypothesis or premise or antecedent
and q the conclusion or consequence.
Example
CHAPTER 1. LOGIC 7
(i) Let p be the statement “It is raining” and q the statement “It is wet”. Then
(p q) is the statement “If it is raining, then it is wet .”
• Truth table for the logical implication
p q pq
T T T
T F F
F T T
F F T
NB The implication p q is true when both p and q are true and when p is
false (irrespective of the truth value of q).
(ii) Let p be the statement that “2+2=4” and q the statement “3>5”. Then
p q is the statement “If 2+2=4, then 3>5”.
The following p q can be expressed in the following ways:
• If p, then q
• If p, q
• p implies q
• p only if q
• p is sufficient for q
• A suufficient condition for q is p
• q if p
• q whenever p
• q when p
• q is necessary for p
• a necessary condition for p is q
• q follows from p
• q unless ∼ p
Now consider the truth table for the compound proposition ∼ (p∧ ∼ q)
p q ∼q p∧ ∼ q ∼ (p∧ ∼ q)
T T F F T
T F T T F
F T F F T
F F T F T
CHAPTER 1. LOGIC 8
The final column for p → q and ∼ (p∧ ∼ q) are the same and hence the two
compound statements are logically equivalent. It therefore follows that’s the
two have the same Venn diagram representation.
../../../Desktop/DISCRETE MATHEMATICS/c6.PNG
• NB
(i) the biconditional statement p ↔ q is true when p and q have the same
truth values, and is false otherwise.
(ii) p ↔ q is logically equivalent to (p → q) ∧ (q → p)
../../../Desktop/DISCRETE MATHEMATICS/c7.PNG
Example
Let p be the statement “The home team wins” and q the statement “It is raining”.
Then p ↔ q is the statement “The home team wins if and only if it is raining”.
Necessity and Sufficiency
Condition A is said to be sufficient condition for B if and only if the truth /
occurrence of A is sufficient to guarantee the truth / existence / occurrence of
B.
In general from the conditional p → q we say that p is sufficient condition for q.
e.g. Consider the statement :
“If you are registered to vote, then you are at least 18 years old”. The truth of
the condition “You are registered to vote” is sufficient to ensure the truth of the
condition “You are at least 18 years old”.
On the other hand, condition A is said to be a necessary condition for B if the fal-
sity / nonexistence / non-occurrence of A guarantees the falsity/nonexistence/non-
occurrence of B.
In general, from the condition p → q we say that q is a necessary condition for
p.
e.g. In the previous statement , “You are at least 18 years old” is necessary for
“you are eligible to vote”.
Further Examples
Rewrite the conditional “If 2 + 2 = 5”, then he (not a statement since it may be
either be T or F depending on the value of the pronounce “he”) is tall using:
(a) Implies
(b) Only if
(c) Sufficient Condition
(d) Whenever
(e) Necessary
(f) Unless
CHAPTER 1. LOGIC 10
Solution
(a) 2 + 2 = 5 implies he is tall
(b) 2 + 2 = 5 only if he is tall
(c) 2 + 2 = 5 is a sufficient condition for he is tall
(d) He is tall whenever 2 + 2 = 5
(e) He is tall is necessary for 2 + 2 = 5
(f) He is tall unless 2 + 2 6= 5
FURTHER EXAMPLES OF TRUTH TABLES
1. Compute the truth table for the compound proposition (p∧q)∨ ∼ (p → q)
Remarks
Sometimes when computing truth tables, we can deduce the number of columns
by putting truth values under the proposition as well as under the connectives.
One then numbers the columns in the order in which they are filled out. In
this case we evaluate negation first followed by conjunction or disjunction and
finally the logical implication or double implication. When two logical operators
having the same precedence are present, parentheses may be needed.
From the example above (p ∧ q)∨ ∼ (p → q)will have the truth table.
(p ∧ q) ∨ ∼ (p → q)
T T T T F T T T
T F F T T T F F
F F T F F F T T
F F F F F F T F
1 2 1 4 3 1 2 1
(p → q) ∧ [(q ∧ ∼ r) → (p ∨ r)]
T T T T T F F T T T T T
T T T T T T T F T T T F
T F F F F F F T T T T T
F T T T T F F T T F T T
T F F F F F T F T T T F
F T T F T T T F F F F F
F T F T F F F T T F T T
F T F T F F T F T F F F
1 3 1 5 1 3 2 1 4 1 3 1
CHAPTER 1. LOGIC 11
Exercise:
Construct a truth table for each of the following compound proposition
(a) (p → q) ∨ (∼ p ↔ q)
(b) (p → q) ∨ (∼ p → q)
(c) (p → q) ∧ [(p∨ ∼ r) → (q ∧ r)]
(d) (p q) ∧ (p ∼ q)
(e) (p ↔ q) (p ∧ q)
(f) ((p → q) → r) → r
PROPOSITIONAL EQUIVALENCES
Tautology
This is a compound proposition that is always true irrespective of the truth
values of the constituent proposition.
To check whether a given proposition is a tautology, it is sufficient to compose
its truth table and check whether the final column has every entry “T”.
Examples
1. p∨ p and p → p are tautologies.
2. [p ∧ (p → q)] → q
[p ∧ (p → q)] → q
T T T T T T T
T F T F F T F
F F F T T T T
F F F T F T F
1 3 1 2 1 4 1
Since the final column in the truth table has only truth entries “T” then the
proposition is a tautology.
3. ∼ (p ∨ q) ↔ (∼ p∧ ∼ q) is a tautology
∼ (p ∨ q) ↔ (∼ p ∧ ∼ q)
F T T T T F F F
F T T F T F F T
F F T T T T F F
T F F F T T T T
4 1 3 1 5 2 3 2
Contradiction
This is a compound proposition that is always false regardless of the truth values
of the constituent propositions.
To check whether a given proposition is a contradiction, we construct the truth
table and check whether the final column has every entry “F”.
The classical contradiction is p∧ ∼ p.
p ∼p p∧ ∼ p
T F F
F T F
CHAPTER 1. LOGIC 12
Remarks
1. If in a truth table the final column has every entry “T”, the particular
compound proposition is a tautology. The proposition in this case is called
logically true.
2. If in a truth table the final column has every entry “F”, the particular
compound proposition is a contradiction. The proposition in this case is
called logically false.
3. If in a truth table the final column has both entries “F” and “T”, then the
particular compound proposition is said to be logically indeterminable.
Contingency:
This is a compound proposition that is neither a tautology nor a contradiction.
Logical Equivalences
Proposition p and q are called logically equivalent if p ↔ q is a tautology. We
denote this by p ≡ q or p ⇔ q.
Examples
1. Show that the proposition p → q and ∼ p ∨ q are logically equivalent
(p → q) ↔ (∼ p ∨ q)
T T T T F T T T
T F F T F T F F
F T T T T F T T
F T F T T F T F
1 3 1 4 2 1 3 1
Since the final column of the truth table has every entry “T” then (p → q) ⇔(∼
p ∨ q)
2. Show that p ∨ (q ∧ r) and (p ∨ q) ∧ (p ∨ r) are logically equivalent.
p ∨ (q ∧ r) ↔ (p ∨ q) ∧ (p ∨ r)
T T T T T T T T T T T T T
T T T F F T T T T T T T F
T T F F T T T T F T T T T
F T T T T T F T T T F T T
T T F F F T T T F T T T F
F F T F F T F T T F F F F
F F F F T T F F F F F T T
F F F F F T F F F F F F F
1 3 1 2 1 4 1 2 1 3 1 2 1
Since the final column of the truth table has every entry as “T” then
p ∨ (q ∧ r) ⇔(p ∨ q) ∧ (p ∨ r)
Boolean Algebra Identities
Suppose T denotes the compound proposition that’s is always true and F denotes
the compound proposition that is always false. Then we have the following
important inequalities.
CHAPTER 1. LOGIC 13
Equivalence Name
1. p ∧ T ⇔ p, p ∨ F ⇔ p Identity laws
2. p ∨ T ⇔ p, p ∧ F ⇔ p Domination laws
3. p ∨ p ⇔ p, p ∧ p ⇔ p Idempotent laws
4. ∼ (∼ p) ⇔ p Double negation law
5. p ∨ q ⇔ q ∨ p, p ∧ q ⇔ q ∧ p Commutative laws
6. p ∨ (q ∧ r) ⇔ (p ∨ q) ∧ (p ∨ r), p ∧ (q ∨ r) ⇔ (p ∧ q) ∨ (p ∧ r) Distributive laws
7. (p ∨ q) ∨ r ⇔ p ∨ (q ∨ r), (p ∧ q) ∧ r ⇔ p ∧ (q ∧ r) Associative laws
8. ∼ (p ∧ q) ⇔∼ p∨ ∼ q, ∼ (p ∨ q) ⇔∼ p∧ ∼ q De-Morgan’s law
9. p ∨ (p ∧ q) ⇔ p, p ∧ (p ∨ q) ⇔ p Absorption laws
10. p∨ ∼ p ⇔ T, p∧ ∼ p ⇔ F Negation laws
6. (p → r) ∧ (q → r) ⇔ (p ∨ q) → r
7. ∼ (p → q) ⇔ p∧ ∼ q
8. (p → q) ∨ (p → r) ⇔ p → (q ∨ r)
9. (p → r) ∨ (q → r) ⇔ (p ∧ q) → r
Logical Equivalences involving Biconditional Statements
1. p ↔ q ⇔ (p → q) ∧ (q → p)
2. p ↔ q ⇔∼ p ↔∼ q
3. p ↔ q ⇔ (p ∧ q) ∨ (∼ p∧ ∼ q)
4. ∼ (p ↔ q) ⇔ p ↔∼ q
NB The De Morgan’s laws can be extended to
(a). ∼ (p1 ∨ p2 ∨ ... ∨ pn ) ⇔∼ p1 ∧ ∼ p2 ∧ ...∧ ∼ pn ) and
(b).∼ (p1 ∧ p2 ∧ ... ∧ pn ) ⇔∼∼ p1 ∨ ∼ p2 ∨ ...∨ ∼ pn )
Constructing New Logical Equivalences.
Established logical equivalences can be used to construct new logical equiva-
lences. This enables us to replace a proposition by a compound proposition
CHAPTER 1. LOGIC 14
that is logically equivalent to it without changing the truth value of the origi-
nal compound proposition. The technique also uses the fact that if p ⇔ q and
p ⇔ r, (i.e. logical equivalence of propositions is transitive)
Example
1. Show that ∼ (p → q) ⇔ p∧ ∼ q
solution
∼ (p → q)
⇔∼ (∼ p ∨ q)(Since p → q ⇔∼ p ∨ q)
⇔∼ (∼ p)∧ ∼ q (By second De Morgans law)
⇔ p∧ ∼ q (by the double negation law)
2. Show that ∼ (p ∨ (∼ p ∧ q)) ⇔∼ p∧ ∼ q.
Solution
∼ (p ∨ (∼ p ∧ q))
⇔∼ p∧ ∼ (∼ p ∧ q)(By second De morgans law)
⇔∼ p ∧ (∼ (∼ p)∨ ∼ q)(By first De morgans law)
⇔∼ p ∧ (p∨ ∼ q)(By double negation law)
⇔ (∼ p ∧ p) ∨ (∼ p∧ ∼ q) (By second distributive law)
⇔ F ∨ (∼ p∧ ∼ q) (Since ∼ p ∧ p ⇔ F )
⇔∼ p∧ ∼ q (by the identity law of F)
3. Show that (p ∧ q) → (p ∨ q) is a tautology
solution
(p ∧ q) → (p ∨ q)
⇔∼ (p ∧ q) ∨ (p ∨ q)
⇔ (∼ p∨ ∼ q) ∨ (p ∨ q) by De morgans law
⇔ (∼ p ∨ p) ∨ (∼ q ∨ q) By associativity and commutativity
⇔T ∨T
⇔T
Exercise:
(1) Use the truth tables to verify
(a) p ∧ (q ∨ r) ⇔ (p ∧ q) ∨ (p ∧ r)
(b) ∼ (p ∧ q) ⇔∼ p∨ ∼ q
(2)Use truth tables or logical equivalences to show that each of the following
compound proposition is a tautology.
(a)(p ∧ q) → (p ∨ q)
(b) [∼ p ∧ (p ∨ q)] → q
(c) [(p → q) ∧ (q → r)] → (p → r)
VALID ARGUMENTS IN PROPOSITIONAL LOGIC
An argument is a sequence of statements A1 , A2 , ..., An followed by a state-
ment A. All but the final proposition in the argument are called premises or
assumptions or hypothesis and he final proposition is called conclusion.
We denote the argument by
A1 , A2 , ..., An thus A
CHAPTER 1. LOGIC 15
OR
A1
A2
..
.
An
A
From A1 , A2 , ..., An we have premises ans A is the conclusion.
An argument is Valid if whenever all the premises are true, the conclusion is
also true. In other words, an argument is valid and (an argument is invalid if it
is not valid) and only if it is impossible for all the premises to be true and the
conclusion to be false.
Proofs in mathematics are valid arguments that establish the truth of mathe-
matical statements.
Definition An incorrect reasoning that leads to an invalid argument is called
a fallacy.
NB In logic, the words “true” and “valid” have different meanings. A valid argu-
ments may have false premises and a false conclusion, and an invalid argument
may have true premises and a true conclusion.
Def An argument is called sound if and only if it is valid and all its premises
are true. An argument that is not sound is called unsound.
Steps in Determining validity or invalidity of an Argument
1. Identify the premises and conclusion of the argument.
2. Construct a truth table showing the truth values of the premises and the
conclusion.
3. A row of the truth table in which all the premises are true is called a
critical row. If there is a critical row in which the conclusion is false, then
it is possible for an argument to have true premises and a false conclusion,
and so the argument is invalid. If the conclusion in every critical row is
true, then the argument is valid.
Example
1. Consider the argument
p → q e.g If it is raining, then it is wet.
p: it is raining.
Thus q : it is wet
p q p→q
T T T
T F F
F T T
F F T
The bold row represent critical row
CHAPTER 1. LOGIC 16
The first row is the only one in which both premises are true, and the conclusion
in that row is also true. Hence, the argument is valid.
2. p → q e.g If it is raining then it is wet
q it is wet thus it is raining.
Thus p
p q p→q
T T T
T F F
F T T
F F T
The bold rows have are critical rows.
The third row, both premises are true but the conclusion in that row is false.
Hence the argument is invalid.
3. Show that the following argument is invalid
p → (q∨ ∼ r)
q → (p ∧ r)
∴p → r
p → (q ∨ ∼ r) q → (p ∧ r) p → r
T T T T F T T T T T T T T
T T T T T T F T F F T F F
T F F F F F T T T T T T T
F T T T F T F F F T F T T
T T F T T F T T F F T F F
F T T T T T F F F F F T F
F T F F F F T F F T F T T
F T F T T F T F F F F T F
1 4 1 3 2 1 4 1 3 1 1 3 1
In the fifth row, both premises are true but the conclusion in the row is false.
Hence the argument is invalid.
4. Test the validity of the following argument
x is positive or x is negative
If x is positive, then x2 > 0
If x is negative, then x2 > 0
Thus x2 > 0
solution
p = x is positive
q = x is negative
r = x2 > 0
CHAPTER 1. LOGIC 17
p∨q
p→r
q→r
∴ r
p q r p∨q p→r q→r r
T T T T T T T
T T F T F F F
T F T T T T T
F T T T T T T
T F F T F T F
F T F T T F F
F F T F T T T
F F F F T T F
In each of the first, third and forth rows, all the three premises are true, and
the conclusion in each of these rows is also true. Hence, the argument is valid.
Exercise
1. Show that each of the following arguments is valid
(a) p ∧ q thus p (b).p ∧ q thus q (c). p ∧ q , ∼ q thus p (d) p ∨ q, ∼ p thus q (e)
If p , then q, ∼ q thus ∼ p (f)p → q, q → r,thus p → r (g)p → (q∨ ∼ r)
p → (q ∧ r) thus p → r
2. Test the validity of each of the following arguments
(a) (p ∧ q) → r, p thus r (b) p → (q → r), q thus p → r (c) p∨ ∼ s, r ←→ s,
r → q thus p ∨ q (d) p → q, q → (r∨ ∼ s) p ∧ s thus r.
Predicates and Quantifiers
Predicates
Statements involving variables, such as “x > 3”, x + y = 3 and ”x + y = z”
are not propositions since the values of the variables are not specified. The
statements “x > 3” ha stwo parts; x which is the variable is called subject , and
“is greater than 3” is called predicate (the property that the subject of the
statement can have).
Consider the statement “x > 3”. Let p denote the predicate “is greater than 3”
and x is the variable. We can denote the statement by P (x) where P (x) is called
the value of the propositional function P at x. In this case the set of possible
values of x is called the domain of discourse or universe of discourse or
simply domain of x. Once a value has been assigned to the variable x, the
statement P (x) becomes a proposition and has a truth value.
Definition If P(x) is a proposition and x has domain D, the truth set of P(x)
is the set of all elements of D that make P(x) true when subsituted for x. This
is denoted as {x ∈ D|P(x)}.
Example
CHAPTER 1. LOGIC 18
If P (x) is the statement “x > 3”, where the domain is the set of all real numbers,
then the truth set of P (x) is the set of all real numbers greater than 3 e.g. P (4)
is true since 4 > 3 but P (2) is false since 2 ≯ 3.
We can also have statements that involve more than one variable
e.g. the statements ”x + y = 3” can be denoted by Q(x, y), where x and y are
variables and Q is the predicate. When values are assigned to the variables x
and y, the statement Q(x, y) becomes a proposition and has a truth value. For
instance Q(1, 2) is the statement Q(1, 2) is the statement 1 + 2 = 3 which is true
while Q(1,0) is the proposition 1+0=3 which is false.
Quantifiers
Quantification can also be used to create a proposition from a propositional
function. This expresses the extent to which a predicate is true over a range of
elements. There are two types of quantification:
1. Universal quantification - Shows that a predicate is true for every
elements under consideration / every element in the domain.
4. Let Q(x) be the statement ”x < 2” where the domain consists of all
real numbers. The quantification ∀xQ(x) is the statement. “For each
real number x, x<2”. This is false since Q(3) is false. So, x = 3 is a
counterexample for the statement ∀xQ(x).
5. Suppose P (x) is the statement ”x2 > 0” where the universe of discourse
consists of all integers. Then the statement ∀xP (x) is false. In this case
x = 0 is a counterexample since x2 = 0 when x = 0, i.e. x2 ≯ 0 when
x = 0.
Remarks
When all the elements in the universe of discourse can be listed say, x1 ,x2 ,...,
xn , the universal quantification ∀xP (x)is the same as the conjunction.
P (x1 ) ∧ P (x2 ) ∧ ... ∧ p(xn ).
Example
Determine the truth value of ∀xP (x), where P (x) is the statement “x2 < 10”
and the domain consists of the positive integers not exceeding 4.
Solution
The statement ∀xP (x) is the conjuction
P (1) ∧ P (2) ∧ P (3) ∧ P (4)
since the domain consists of the integers 1, 2, 3, and 4. But P (4) which is the
statement ”42 < 10” is false. It then follows that ∀xP (x) is false.
Exercise
Find the truth of the statement ∀x x2 ≥ x if the domain consists of
(a) all real numbers (False)
(b) all integers (True)
Existential Quantifier:
Definition: The existentential quantification of P (x) is the proposition “There
exists an element x in the domain such that P(x)”. This is denoted by ∃x,P (x).
In this case ∃ is called the existential quantifier.
The existential quantification ∃x,P(x) is read as
(i) “There exists xsuch that P (x)” or
(ii) “There is an x such that “P (x)” ”, or
(iii) “There is at least one xsuch that “P (x)” ” or
(iv) “For some x “P (x)” ”.
NB
1. The domain must be specified when a statement ∃x,P (x) is used.
2. The truth value of ∃x,P (x) depends on the domain.
Remarks:
The existential quantification ∃x,P (x) is true when there is an x in the domain
for which P (x) is true and is false when P (x) is false for every x in the domain.
Examples
1. There exists a solution in the set of real numbers such that x2 + 7x = 0.
This is written as ∃x ∈ R|x2 + 7x = 0.
CHAPTER 1. LOGIC 20
2. Let P (x) be the statement ”x > 3” where the domain consists of all real
numbers. Then the existential quantification ∃x, P (x) is the statement
“There exists a real number x, x > 3”. This is true for instance, when
x = 4.
3. Let Q(x) be the statement “x = x + 1” where the domain is the set
of all integers. Since Q(x) is false for every integer x, the exisstential
quantification of Q(x) i.e. ∀xQ(x) is false.
Remarks
When all elements in the domain can be listed say, x1 , x2 , ..., xn , the existential
quantification ∃x,P (x) is the same as the disjunction
P (x1 ) ∨ P (x2 ) ∨ ... ∨ P (xn )
since the disjunction is true if and only if at least one of P (x1 ),P (x2 )...P (xn ) is
true.
Example
What is the truth value of ∃x,P (x), where P (x) is the statement ”x2 > 10” and
the universe of discourse consists of positive integers not exceeding 4?
solution
The domain {1, 2, 3, 4}. Hence, the proposition ∃x,P (x) is the same as the dis-
junction
P (1) ∨ P (2) ∨ P (3) ∨ P (4).
Since P (4), which is a statement “42 > 10” is true, it follows that ∃x,P (x) is
true.
Normally the two types of quantification can be used together.
Example
1. ∀x ∈ R, ∃y∈ R, x + y = 0
2. For every even number x, there exists an integer y such that x = 2y.
Uniqueness Quantifier:
Defn: The notation∃!x, P (x) or ∃, x, P (x) is the statement “There exists a
uniquex such that P (x) is true”. This can also be phrased as “There is exactly
one x for which P (x) is true” or “There is one and only one x for which P (x) is
true”.
example
∃!x, x − 1 = 0. This is a true statement since x = 1 is the unique real number
for which x − 1 = 0.
Negation
Consider the statement: “Every student in this class takes mathematics”.
This can be expressed as ∀xP (x) where P (x) is the statement “x takes math-
ematics” and the domain consists of the students in this class. The negation
of this statement is “It is not the case that every student in this class takes
mathematics”. This is equivalent to “There is a student in this case who does
not take mathematics”. This is existential quantification of the negation of the
original propositional functions, i.e. ∃, x, ∼ P (x)
CHAPTER 1. LOGIC 21
(a) p → (∼ q ∨ r)
(b) ∼ p → (q → r)
(c) p ∨ q) ∨ r
(d) (p ∧ q) ∨ r
(e) (p ∧ q)∧ ∼ r
2. Logic Circuits
Propositional logic can be applied to the design of computer hardware.
A logic (digital) circuit receives input signals p1 ,p2 , ..., pn each a bit [either 0
(off) or 1 (on) ], and produces output signals s1 , s2 , ...sn each a bit.
We restrict ourselves to logic circuits with a single output signal; in general
digital circuits may have multiple outputs.
They are three basic circuits also called gates:
(a) Inverter / Not gate - takes an input bit p, and produces an output ∼ p
MISSING FIGURE
(b) OR gate - takes two input signals p and q, each a bit and produces as output
the signal p ∨ q
MISING FIGURE
(c) AND gate - takes two input signals p and q each a bit, and produces as
output the signal p ∧ q
MISSING FIGURE
Complex circuits are constructed from nasic gates. Given a circuit built from
the basic logic gates and inputs to the circuit, we determine the output by
tracing the circuit.