Logic & Set Theory Basics
Logic & Set Theory Basics
Rules for ' ' ℸ ' ', ' ' ⋀ ' ', ' ' ⋁ ' ', '' ⟹'' and ''⟺''
Example 1: Consider the following propositions: State each of the following in words, and
determine the truth value of each.
p: 3 is an odd number. (True)
q: 27 is a prime number. (False)
r: Nairobi is the capital city of Ethiopia. (False)
s: Man is mortal. (True)
a. p : 3 is an not odd number. (False)
b. r : Nairobi is not the capital city of Ethiopia. (True)
c. p ∧q: 3 is an odd number and 27 is a prime number. (False)
d. p ∧(r): 3 is an odd number and Nairobi is not the capital city of Ethiopia. (True)
e. p ∨q: 3 is an odd number or 27 is a prime number. (True)
Then, P is equivalent to Q, since columns 5 and 6 of the above table are identical.
Example 2 Let P : p ⟹ q. and Q : p ⟹ q. Then
p q p q p⟹q p⟹q
T T F F T T
T F F T F T
F T T F T F
F F T T T T
Then, P is not equivalent to Q, since columns 5 and 6 of the above table are not identical.
Converse and cotrapositive
Converse: The hypothesis of a converse statement is the conclusion of the conditional statement
and the conclusion of the converse statement is the hypothesis of the conditional statement.
Example
a. If Kidist lives in Addis Ababa, then she lives in Ethiopia.
Converse: If Kidist lives in Ethiopia, then she lives in Addis Ababa.
Contrapositive: If Kidist does not live in Ethiopia, then she does not live in Addis
Ababa.
Inverse: If Kidist does not live in Addis Ababa, then she does not live in Ethiopia.
b. If it is morning, then the sun is in the east.
Converse: If the sun is in the east, then it is morning.
Contrapositive: If the sun is not in the east, then it is not morning.
Inverse: If it is not morning, then the sun is not the east.
p p p∨ p
T F T
F T T
b. p ∧ p
p p p∧ p
T F F
F T F
p q q⟹ p p ⟹(q ⟹ p)
T T T T
T F T T
F T F T
F F T T
d. ( p ⟹ q ) ⟺( p ∧q).
p q q p ∧q p⟹q ( p ⟹ q ) ⟺( p ∧q)
T T F F T F
T F T T F F
F T F F T F
F F T F T F
The compound proposition ( p ⟹ q ) ⟺( p ∧q) is always false.
Thus, ( p ⟹ q ) ⟺( p ∧q) is a contradiction.
Quantifiers
Universal quantifier symbolized by and has the same meaning with the following
phrase
"for every"
"for all" and
"for each"
If P( x ) is an open proposition with universe U , then ( ∀ x ) P( x ) is a quantified
proposition and is read as “every x ∈ U has the property P.”
Existential quantifier symbolized by and has the same meaning with the following
phrase
"there exists"
"for some " and
"for at least "
If P( x ) is an open proposition with universe U , then (∃ x ) P( x ) is a quantified
proposition and is read as “there exists x ∈ U with the property P.”
Remarks:
i. To show that ( ∀ x ) P( x ) is F, it is sufficient to find at least one a ∈U such that P(a) is
F. Such an element a ∈U is called a counter example.
ii. ( ∃ x ) P (x) is F if we cannot find any a ∈U having the property P.
Example :
a. Write the following statements using quantifiers.
i. For each real number x >0 , x2 + x−6=0 .
Solution: ( ∀ x> 0 ) (x 2+ x −6=0).
ii. There is a real number x >0 such that x 2+ x−6=0.
Solution: ( ∃ x >0 ) (x 2 + x−6=0).
iii. The square of any real number is nonnegative.
Solution: ( ∀ x ∈ R ) (x2 ≥ 0).
b. Let U =R.
i. Let P ( x ) : x 2+1 ≥ 0.
The truth value for ( ∀ x ) P( x ) [i.e ( ∀ x )( x 2 +1 ≥0)] is T .
ii. Let P ( x ) : x < x2 .
1 1
The truth value for ( ∀ x )(x < x 2 ) is F. x= is a counterexample since ∈ R but
2 2
1 1
< . On the other hand, ( ∃ x ) P (x) is true, since −1 ∈ R such that −1<1.
2 4
iii. Let P ( x ) :|x|=−1. The truth value for ( ∃ x ) P (x) is F since there is no real number
whose absolute value is −1.
Example
Let U =¿ The set of integers.
Let P ( x ) : x is a prime number.
Q ( x ) : x is an even number.
R ( x ): x is an odd number.
Then
a. ( ∃ x ) [ P( x)⟹Q (x)] is T ; since there is an x, say 2, such that P(2)⟹ Q(2) is T .
b. ( ∀ x ) [P(x )⟹ Q( x)] is F. As a counterexample take 7. Then P(7) is T and Q(7) is F.
Hence P(7)⟹Q(7).
c. ( ∀ x ) [R( x )∧ P( x)] is F.
d. ( ∀ x ) [(R ( x ) ∧ P ( x ) )⟹ Q( x )] is F.
So far, we have only considered cases in which universal and existential quantifiers appear
simply. However, if we consider cases in which universal and existential quantifiers occur in
combination, we are lead to essentially new logical structures. The following are the simplest
forms of combinations:
1. ( ∀ x )( ∀ y ) P( x , y)
“for all x and for all y the relation P( x , y ) holds”;
2. ( ∃ x ) ( ∃ y ) P( x , y)
“there is an x and there is a y for which P(x , y ) holds”;
3. ( ∀ x )( ∃ y ) P( x , y )
“for every x there is a y such that P( x , y ) holds”;
4. ( ∃ x ) ( ∀ y ) P ( x , y )
“there is an x which stands to every y in the relation P( x , y ).”
Example :
Let U =¿ The set of integers.
Let P( x , y ): x+ y =5.
a. (∃ x )(∃ y ) P( x , y) is True. Example x=1 and y= 4
b. (∃ x )(∀ y) P(x , y ) is False
c. ( ∀ x)(∃ y) P(x , y ) means that for every integer x, there is an integer y such that
x + y=5. Let x=a, then y=5−a will always be an integer, so this is a true statement.
d. ( ∀ x)(∀ y )P( x , y) means that for every integer x and for every integer y, x + y=5. This
is false, for if x=2 and y=7, we get 2+7=9 ≠5.
Exercise
1. Determine the truth value of the following statements.
a. ( ∃ x ∈ R ) (x 2−x=0).
b. ( ∀ x ∈ N ) (x+1 ≥ 2).
c. ( ∀ x ∈ R ) ( √ x 2=x ).
d. ( ∃ x ∈Q ) (3 x 2−27=0).
e. ( ∃ x ∈ R ) ( ∃ y ∈ R ) (x + y +3=8).
f. ( ∃ x ∈ R ) ( ∃ y ∈ R ) ( x 2 + y 2=9).
g. ( ∀ x ∈ R )( ∃ y ∈ R ) ( x+ y =12).
h. ( ∃ x ∈ R ) ( ∀ y ∈ R ) (x+ y =10)
Argument and Validity
An argument (logical deduction) is an assertion that a given set of statements p1 , p2 , p 3 , … , pn, called
hypotheses or premises, yield another statement Q , called the conclusion. Such a logical deduction is
denoted by:
p1 , p2 , p 3 , … , pn ├ Q or
p1
p2
⟨G , ∘ ⟩
pn
Q
An argument form p1 , p2 , p 3 , … , pn ├ Q is said to be valid if Q is true whenever all the premises
p1 , p2 , p 3 , … , pn are true; otherwise it is invalid.
Rules of inferences
Below we list certain valid deductions called rules of inferences.
1. Modes Ponens
p
p⟹q
q
2. Modes Tollens
q
p⟹q
p
3. Principle of Syllogism
p⟹q
q⟹r
p ⟹r
4. Principle of Adjunction
a. p
q
p ∧q
b. q
p ∨q
5. Principle of Detachment
p ∧q
p,q
6. Modes Tollendo Ponens
p
p ∨q
q
7. Modes Ponendo Tollens
( p ∧q)
p
q
8. Constructive Dilemma
( p ⟹ q ) ∧(r ⟹ s )
p ∨r
q∨s
9. Principle of Equivalence
p⟺q
p
q
10. Principle of Conditionalization
p
q⟹ p
a. p⇒ q,¬q|−¬ p
b. If you study hard, then you will pass the exam.
You did not pass the exam.
Therefore, you did not study hard.
Let p: You study hard.
q: You will pass the exam.
The argument form can be written as:
pq
q
p
c. If it rains, crops will be good. It did not rain. Therefore, crops were not good.
d. p ⟹ q , q ├ p.
e. p ⟹ p , p ,r ⟹ q ├ r.
f. p ⟹ q , r ⟹ q ├ r ⟹ p.
g. p ⟹ q , p ⟹ r , r ⟹ s ├ q ⟹ s.
h. If he studies medicine, he will get a good job. If he gets a good job, he will get a good
wage. He did not get a good wage. Therefore, he did not study medicine.
i. If the team is late, then it cannot play the game. If the referee is here, then the team is can
play the game. The team is late. Therefore, the referee is not here.
Set theory
The concept of a set
The term set refers to a well-defined collection of objects. The term “well-defined” here means
that the set is described in such a way that one can decide whether or not a given object belongs
in the set. If A is a set, then the objects of the collection A are called the elements or members of
the set A. If x is an element of the set A, we write x ∈ A. If x is not an element of the set A, we
write x ∉ A.
We use capital letters to denote the names of sets and lowercase letters for elements of a set.
Description of sets
Sets are described or characterized by one of the following four different ways.
1. Verbal Method
In this method, an ordinary English statement with minimum mathematical symbolization of
the property of the elements is used to describe a set. Actually, the statement could be in any
language.
Example:
a. The set of counting numbers less than ten.
b. The set of letters in the word “Addis Ababa.”
c. The set of all countries in Africa.
If the elements of a set can all be listed, we list them all between a pair of braces without
repetition separating by commas, and without concern about the order of their appearance. Such
a method of describing a set is called the roster/complete listing method.
Example:
a. The set of vowels in English alphabet may also be described as {a , e , i, o , u }.
b. The set of positive factors of 24 is also described as {1 , 2 ,3 , 4 , 6 , 8 ,12 , 24 }.
Remark:
i. We agree on the convention that the order of writing the elements in the list is
immaterial. As a result the sets {a ,b , c },{b , c , a } and {c , a , b } contain the same
elements, namely a , b and c .
ii. The set {a , a ,b ,b ,b } contains just two distinct elements; namely a and b, hence it is the
same set as { a , b } . We list distinct elements without repetition.
Example:
a. Let A={a , b , {c }}. Elements of A are a , b and {c }.
Notice that c and { c } are different objects. Here { c } ∈ A but c ∉ A.
b. Let B= { { a } }. The only element of B is {a }. But a ∉ B.
c. Let C={a ,b ,{a , b }, {a ,{a }}}. Then C has four elements.
The readers are invited to write down all the elements of C.
3.Partial Listing Method
In many occasions, the number of elements of a set may be too large to list them all; and in
other occasions there may not be an end to the list. In such cases we look for a common
property of the elements and describe the set by partially listing the elements. More precisely,
if the common property is simple that it can easily be identified from a list of the first few
elements, then with in a pair of braces, we list these few elements followed (or preceded) by
exactly three dotes and possibly by one last element. The following are such instances of
describing sets by partial listing method.
Example:
a. The set of all counting numbers is N={1 ,2 , 3 , 4 , … }.
b. The set of non-positive integers is {… ,−4 ,−3 ,−2 ,−1 , 0 }.
c. The set of multiples of 5 is {… ,−15 ,−10 ,−5 , 05 ,10 , 15 , …}.
d. The set of odd integers less than 100 is {… ,−3 ,−1, 1 ,3 , 5 , … 99 }.
4.Set-builder Method
When all the elements satisfy a common property P, we express the situation as an open
proposition P( x ) and describe the set using a method called the Set-builder Method as
follows:
A={x∨P( x )}∨ A={x : P(x) }
We read it as “ A is equal to the set of all x’s such that P( x ) is true.” Here the bar “∨‟ and the
colon “ ” mean “such that.” Notice that the letter x is only a place holder and can be replaced
throughout by other letters. So, for a property P, the set {x∨P(x )},{t∨P(t) } and { y ∨P( y )} are
all the same set.
Example: The following sets are described using the set-builder method.
a. A={x∨x is a vowel∈the Englishalphabet }.
b. B={t∨t is an even integer }.
c. C={n∨n is a natural number∧2 n – 15 is negative }.
d. D={ y∨ y 2 – y – 6=0 }.
e. E={x∨x is an integer ∧x – 1<0 ⟹ x 2 – 4> 0 }.
The set which has no element is called the empty (or null) set and is denoted by ϕ or {}.
Sets A and B are said to be equal if they contain exactly the same elements.
Set A is said to be a proper subset of set B if every element of A is also an element of B, but B
has at least one element that is not in A. In this case, we write A ⊂B. We also say B is a proper
super set of A, and write B⊃ A. It is clear that
A ⊂ B ⟺ [ ( ∀ x ) ( x ∈ A ⟹ x ∈ B)∧(A ≠ B)].
Let A be a set. The power set of A, dented by P( A), is the set whose elements are all subsets
The union of two sets A and B, denoted by A ∪ B , is the set of all elements that are either in A or in B
(or in both sets). That is,
A ∪ B={x :( x ∈ A)∨( x ∈ B)}.
The intersection of two sets A and B, denoted by A ∩ B, is the set of all elements that are in A and B.
That is,
A ∩ B={ x :(x ∈ A) ∧(x ∈ B)}.
Two sets A and B are said to be disjoint sets if A ∩ B=ϕ.
Example:
a. Let A={0 , 1 ,3 , 5 , 6 } and B={1, 2 , 3 , 4 , 6 , 7 }. Then,
A ∪ B={0 ,1 , 2 ,3 , 4 ,5 , 6 , 7 } and A ∩ B={1, 3 , 6 }.
b. Let A = The set of positive even integers, and
B = The set of positive multiples of 3. Then,
A ∪ B={x : x is a positiveintger that is either even∨a multiple of 3 }
¿ {2 , 3 , 4 , 6 , 8 , 9 , 10 ,12 , 14 , 15 ,16 , … }
A ∩ B={ x∨x is a positive integer that is both even∧multiple of 3 }
¿ {6 ,12 , 18 ,24 , …}
The difference between two sets A and B, denoted by A−B, is the of all elements in A and not
in B; this set is also called the relative complement of B with respect to A. Symbolically,
A−B={x : x ∈ A ∧ x ∉ B }.
The relative complement of A with respect to the universal set U is given by,
A' =U − A .
Example:
a. If U ={0,1,2,3,4 }, and if A={3,4 }, then A' ={0 , 1, 2 }.
b. Let U ={1 ,2 , 3 , … ,12 }
A={x∨x is a positive factor of 12}
and B={ x∨x is an odd integer ∈U }.
Then, A={5 , 7 , 8 , 9 ,10 , 11}, B={2 , 4 , 6 , 8 ,10 , 12 },
( A ∪ B)=¿, A ∪ B={2 , 4 ,5 , 6 , … , 12} ,
A ∩ B={8 ,10 }, and ( A ¿)={1, 3 , 5 ,7 ,8 , 9 , 10 ,11}.
c. Let U ={ a , b , c , d , e , f , g , h } ,
A={a , e , g , h } and B={b , c , e , f , h }. Then
A={b , c , d , f }, B={a , d , g },
B – A={b , c , f },
Thus A ΔB={2,3,4,5,6,7,8,10}.
Chapter Two
Functions
The real number systems
Rational Numbers
a
Any number that can be expressed in the form , where a and b are integers and b ≠ 0, is
b
called a rational number. The set of rational numbers, denoted by Q, is the set described
by
Real Numbers
The set of real numbers, denoted by R , can be described as the union of the sets of
rational and irrational numbers.
R={ x : x is a rational number∨an irrational number . }
Give two real numbers a and b, we may add or multiply them to obtain two new real numbers
x+ y and x⋅y (also written simply as xy ). The real numbers along with the operations
of addition (+) and multiplication ( × ), obey the properties listed below.
The commutative Properties
For addition: a+b=b+ a
which has the property that a+0=a=0+ a for all real numbers a .
For multiplication: There is a unique real number called the multiplicative identity,
represented by 1, which has the property that a⋅1=a=1⋅a for all real numbers a .
Inverses
For addition: Each real number a has a unique additive inverse, represented by −a
b) 3(2 x 1) 2(1 5 x ) 6 x 11
Solution:
8x 3 5
5( x 2) 3( x )
2. Find the solution set of 2 6
8x 3 5
5( x 2) 3( x )
Solution: 2 6 (The given equation)
This gives us:
3 5
4x 5 x 10 3 x
2 2
5 3
4 x 5 x 3x 10
2 2 Using addition property
2x 6
Hence, x 3 . That is, the solution set is {3}.
6=6
Thus, S.S = ℜ .
A linear inequality is an inequality that can be put in the form ax +b<0 , where a
and b are constants with a≠0 . (The ¿ symbol can be replaced with ¿, ≤ or
¿ )
b. 3x 5(x+2) 0.
Solution: 3x 5(x 2) 0 (The given inequality)
3x 5x + 10 0 (Removing the parentheses by distribution)
2x + 10 0 (Combining like terms)
2x 10 (Subtracting 10 from both sides)
10
x 2 (Dividing both sides by 2 reverse the inequality)
x 5.
Therefore, S.S = {x: x 5}, the set of all real numbers less 5.
4 x 4
4 4 or x 1
However, there is no negative whole number.
Therefore, the solution set of the given inequality in W is , empty set.
−B±√ B 2−4 AC
x=
quadratic formula 2A
Example: Solve each of the following
2
a) 4 x +10 x=6
2
b) 5 x −6=8
2
c) ( x−2) =6
Solution:
2
a.
4 x +10 x=6 Put into standard form
2
4 x + 10 x−6=0 Factor the left hand side
2(2 x−1)( x+3)=0 Hence we have
2 x −1=0 or x+ 3=0 Solving each linear equation, we get
1
x= 2 or x=−3
2 2
b.
5 x −6=8 Isolate x on the left-hand side before applying
the
square root theorem
2
5 x =14
14
x 2= 5 Applying the square root theorem we get
14
x=± √ 5
x=2± √6 .
c.
2
A quadratic inequality is in standard form if it is in the form Ax + Bx+C <0 . (We
2
a) x +2 x−24> 0
⟹ x2 +6 x−4 x−24=0
⟹ x ( x +6 )−4 ( x +6 ) =0
⟹ x+ 6=0∨x−4=0
⟹ x=−6∨x=4
-6 4
- 0 + +
- - 0 +
+ - +
Therefore S . S=(−∞ ,−6 ) ∪ ( 4 , ∞ )
2
b) x −5 x≤24
⟹ x2 +3 x−8 x−24=0
⟹ x ( x +3 )−8 ( x +3 ) =0
⟹ ( x+3 )( x−8 )=0
⟹ x+3=0∨x−8=0
⟹ x=−3∨x=8
-3 8
- 0 + +
- - 0 +
+ - +
Therefore S . S=[ −3 , 8 ]