0% found this document useful (0 votes)
22 views40 pages

Discrete Mathematics

The document provides an overview of sets, their elements, and basic operations on sets, including definitions, notations, and examples. It covers concepts such as subsets, proper subsets, disjoint sets, and various set operations like union, intersection, and complement. Additionally, it introduces De Morgan's Laws and Venn diagrams as tools for visualizing set relationships.

Uploaded by

owino24.ondigo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views40 pages

Discrete Mathematics

The document provides an overview of sets, their elements, and basic operations on sets, including definitions, notations, and examples. It covers concepts such as subsets, proper subsets, disjoint sets, and various set operations like union, intersection, and complement. Additionally, it introduces De Morgan's Laws and Venn diagrams as tools for visualizing set relationships.

Uploaded by

owino24.ondigo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

SETS AND BASIC OPERATIONS ON SETS

Sets and Elements


A set is any well-defined collection of objects. The objects in a set are called elements. A set
contains its elements. It is defined by either;
i. Stating or listing its members
ii. Stating the properties/rules which decide whether or not a particular object is a member of
the set.
Examples
1. The numbers 1, 3, 9, 10 form a set
2. The solution of the equation 𝑥 2 + 6𝑥 + 9 = 0 form a set
3. The vowels of English alphabets a, e, i, o, u form a set
Notation
A set is usually denoted by a capital letter such as A, B, X, Y etc. whereas lower case letters e.g.,
a, b, x, y are used to denote elements. 𝑎 ∈ 𝐴 means a is an element of set A.

Examples

i. 𝐴 = {𝑎, 𝑏, 𝑐, 𝑑} is the set A with elements a, b, c, d.


ii. 𝐵 = {1, 3, 4, 5, 7, ⋯ }
= {𝑥: 𝑥 𝑖𝑠 𝑜𝑑𝑑, 𝑥 > 0} (Rule)
Two sets A and B are said to be equal is they have the same elements and if every element in A
also belongs to B and vice versa.
Note:

• The order in which elements are listed is irrelevant.


• The frequency or number of times an element occurs does not matter.
6
e.g., let 𝐸 = {𝑥: 𝑥 2 − 3𝑥 + 2 = 0} 𝐹 = {1, 2} and 𝐺 = {1, 2, 2, 1, 3} the three sets are equal i.e.,
𝐸 = 𝐹 = 𝐺. Also, {𝑔𝑜𝑎𝑡, 𝑐𝑜𝑤, 𝑠𝑐ℎ𝑒𝑒𝑝} = {𝑠ℎ𝑒𝑒𝑝, 𝑔𝑜𝑎𝑡, 𝑐𝑜𝑤} =
{𝑔𝑜𝑎𝑡, 𝑐𝑜𝑤, 𝑐𝑜𝑤, 𝑠ℎ𝑒𝑒𝑝, 𝑠ℎ𝑒𝑒𝑝}.

Question. Is {𝐽𝑜ℎ𝑛} = 𝐽𝑜ℎ𝑛?

Sets can themselves be elements of other sets e.g., {1, {1}} has two elements i.e., the number 1 and
set {1}.
Symbols of special sets

ℕ − Natural numbers (counting numbers) i.e., 1, 2, 3, …


ℤ − Integers

ℤ+ − Positive integers

ℚ − Rational numbers

ℝ − Real numbers

ℚ√𝑏 − Irrational numbers

ℂ − Complex numbers

Universal set and Empty set


All sets under investigations in any application are assumed to be contained in some larger set
called the universal set denoted by 𝑈. An empty set is a set with no elements. It is denoted by ∅ or
{} and is called a null set. There is only one empty set.
Example

Describe the set 𝐷 = {𝑥 ∈ ℝ: 5 < 𝑥 < 2}


Solution

Recall that 𝑎 < 𝑥 < 𝑏 means that 𝑎 < 𝑥 and 𝑥 < 𝑏 and therefore D consists of all numbers greater
than 5 and less than 2. since there are no such numbers, D has no elements ∴ 𝐷 = ∅.

Subsets
Suppose that every element in a set A is also an element of set B, then A is called a subset of B
written 𝐴 ⊆ 𝐵. The set A is called a subset of B if and only if every element of A is an element of
B. If there is at least one element of A not in B, then A is not a subset of B and we write 𝐴 ⊈ 𝐵 or
𝐵 ⊉ 𝐴.
Example

Consider the sets 𝐴 = {1, 3, 5, 8, 9}, 𝐵 = {1, 2, 3, 5, 7} 𝑎𝑛𝑑 𝐶 = {1, 5}. Is 𝐶 ⊆ 𝐴, 𝐶 ⊆ 𝐵, 𝐵 ⊆


𝐴, 𝐴 ⊆ 𝐴?
Note.

1. Every set A is a subset of the universal set 𝑈 since by definition all elements of A belong
to U.
2. Every set A is a subset of itself since trivially the elements of A belong to A.
3. If every element of A belongs to B and every element of B belongs to C then clearly every
element of A belongs to C.
4. If 𝐴 ⊆ 𝐵 and 𝐵 ⊆ 𝐴 then 𝐴 = 𝐵 since they have the same elements. Conversely, if 𝐴 = 𝐵
then 𝐴 ≤ 𝐵 and 𝐵 ≤ 𝐴.

Proper subsets and Disjoint sets

Let A and B be sets. When 𝐴 ≤ 𝐵 but 𝐴 ≠ 𝐵, then we say that A is a proper subset of B i.e., 𝐴 ⊂
𝐵. For example, consider 𝐴 = {1, 3}, 𝐵 = {1, 2, 3} and 𝐶 = {1, 3, 2} then 𝐴 ⊂ 𝐵, 𝐴 ⊂ 𝐶 , 𝐵 ⊆ 𝐶

Two sets are said to be disjoint if they have no elements in common. e.g., if 𝐴 = {1, 2, 3} 𝐵 =
{4, 5} then A and B are disjoint.

Note:
Let S be a set. If there are exactly n distinct elements in S where n is non-negative integer, we say
S is a finite set and n is the cardinality of S or length of S denoted |𝑆| e.g., Let 𝑆 =
{𝑠𝑒𝑡 𝑜𝑓 𝑎𝑙𝑙 𝑎𝑙𝑝ℎ𝑎𝑏𝑒𝑡𝑠} then |𝑆| = 26.

Singleton Set

This is a set with only one element e.g., 𝐴 = {1}


Venn Diagrams
These are graphical or pictorial representation of sets. The universal set U is represented with a
rectangle. Inside the rectangle, are circles or ovals to represent sets e.g.,

A and B are disjoint 𝐴 ⊆ 𝐵 Proper Subset

Set Operations
1. Set Union
The union of two sets A and B denoted by 𝐴 ∪ 𝐵 is the set that contains the elements either in A
or in B or in both i.e., 𝐴 = {𝑥: 𝑥 ∈ 𝐴 𝑜𝑟 𝑥 ∈ 𝐵}. It is shown in the shaded region below;
Given that 𝐴 = {1,2,3} 𝐵 = {1,3,5} then 𝐴 ∪ 𝐵 = {1,2,3,5}
2. Intersection
The intersection of two sets A and B denoted by 𝐴 ∩ 𝐵 is the set containing those elements in both
A and B i.e., 𝐴 ∩ 𝐵 = {𝑥: 𝑥 ∈ 𝐴 𝑎𝑛𝑑 𝑥 ∈ 𝐵}

If 𝐴 = {1,2,4,5} 𝐵 = {1,4,6} then 𝐴 ∩ 𝐵 = {1,4}. If 𝐴 = {1,2,4,5} 𝐵 = {3,6,7} then 𝐴 ∩ 𝐵 = ∅


and A and B are disjoint.
Theorem 1: For any sets A and B we have; 𝐴 ∩ 𝐵 ⊆ 𝐴 ⊆ 𝐴 ∪ 𝐵 and 𝐴 ∩ 𝐵 ⊆ 𝐵 ⊆ 𝐴 ∪ 𝐵
Theorem 2: The following statements are equivalent; 𝐴 ⊆ 𝐵, 𝐴 ∩ 𝐵 = 𝐴, 𝐴 ∪ 𝐵 = 𝐵
Proof
i. 𝐴 ⊆ 𝐵 ≡ 𝐴 ∩ 𝐵 = 𝐴; Suppose that 𝐴 ⊆ 𝐵. Let 𝑥 ∈ 𝐴 then 𝑥 ∈ 𝐵 hence 𝑥 ∈ 𝐴 ∩ 𝐵 so
that 𝐴 ⊆ 𝐴 ∩ 𝐵 (*). By theorem 1, 𝐴 ∩ 𝐵 ⊆ 𝐴 (**). From (*) and (**) we have 𝐴 ∩ 𝐵 = 𝐴.
ii. 𝐴 ⊆ 𝐵 ≡ 𝐴 ∪ 𝐵 = 𝐵: Suppose that 𝐴 ⊆ 𝐵. Let 𝑥 ∈ 𝐴 ∪ 𝐵 then 𝑥 ∈ 𝐴 𝑜𝑟 𝑥 ∈ 𝐵. If 𝑥 ∈
𝐴, then 𝑥 ∈ 𝐵 since 𝐴 ⊆ 𝐵. In either case 𝑥 ∈ 𝐵. Therefore 𝐴 ∪ 𝐵 ⊆ 𝐵 (*). By theorem
1, 𝐵 ⊆ 𝐴 ∪ 𝐵 (**). From (*) and (**), we get 𝐴 ∪ 𝐵 = 𝐵.
Now suppose 𝐴 ∪ 𝐵 = 𝐵, let 𝑥 ∈ 𝐴 then 𝑥 ∈ 𝐴 ∪ 𝐵 hence 𝑥 ∈ 𝐵 since 𝐴 ∪ 𝐵 = 𝐵. Therefore, 𝐴 ⊆
𝐵. Both results show that 𝐴 ⊆ 𝐵 is equivalent to 𝐴 ∪ 𝐵 = 𝐵.
3. Complement
The complement of a set A denoted 𝐴𝐶 𝑜𝑟 𝐴̅ is the set of elements which belong to the universal
set U but which do not belong to A. In other words, the complement of A is 𝑈 − 𝐴.
𝐴𝐶 = {𝑥: 𝑥 ∈ 𝑈, 𝑥 ∉ 𝐴}.
In a Venn diagram;

4. Set Difference (Relative Complement)


Let A and B be sets. The difference of A and B denoted by 𝐴\𝐵 𝑜𝑟 𝐴 − 𝐵 id the set of elements
which are in A but not in B. i.e., 𝐴 − 𝐵 = {𝑥: 𝑥 ∈ 𝐴, 𝑥 ∉ 𝐵}. This difference is also called relative
complement of B w.r.t A.

𝐴−𝐵 ≠𝐵−𝐴
5. Symmetric difference
The symmetric difference of A and B denoted by 𝐴 ⊕ 𝐵 consists of those elements which belong
to A or B but not in both A and B. i.e., 𝐴 ⊕ 𝐵 = {𝐴 ∪ 𝐵\𝐴 ∩ 𝐵} = {𝐴 ∪ 𝐵} − {𝐴 ∩ 𝐵} or 𝐴 ⊕
𝐵 = {𝐴\𝐵 ∪ 𝐵\𝐴} = {𝐴 − 𝐵} ∪ {𝐵 − 𝐴}

Example
If 𝐴 = {1,2,3,4}, 𝐵 = {3,4,5,6,7} and 𝐶 = {6,7,8,9} then;
𝐴 − 𝐵 = {1,2}
𝐵 − 𝐴 = {5,6,7}
𝐵 − 𝐶 = {3,4,5}
𝐶 − 𝐵 = {8,9}
𝐴 − 𝐶 = {1,2,3,4}
𝐶 − 𝐴 = {6,7,8,9}
𝐴 ⊕ 𝐵 = {1,2,5,6,7}
𝐵 ⊕ 𝐶 = {3,4,5,8,9}
𝐴 ⊕ 𝐶 = 𝐴 ∪ 𝐶 = {1,2,3,4,6,7,8,9}

De’Morgans Laws
For all set A and B
i. (𝐴 ∩ 𝐵)𝐶 = 𝐴𝐶 ∪ 𝐵 𝐶
ii. (𝐴 ∪ 𝐵)𝐶 = 𝐴𝐶 ∩ 𝐵 𝐶
Proof
i. Let 𝑥 ∈ (𝐴 ∩ 𝐵)𝐶 then 𝑥 ∉ (𝐴 ∩ B) ⇒ 𝑥 ∉ 𝐴 𝑎𝑛𝑑 𝑥 ∉ 𝐵 ⇒ 𝑥 ∈ 𝐴𝐶 𝑜𝑟 𝑥 ∈ 𝐵 𝐶 ⇒
𝑥 ∈ 𝐴𝐶 ∪ 𝐵 𝐶 .
∴ (𝐴 ∩ 𝐵)𝐶 ⊆ 𝐴𝐶 ∪ 𝐵 𝐶 ………………… (*)
Conversely, let 𝑥 ∈ 𝐴𝐶 ∪ 𝐵 𝐶 ⇒ 𝑥 ∈ 𝐴𝐶 𝑜𝑟 𝑥 ∈ 𝐵 𝐶 ⇒ 𝑥 ∉ 𝐴 𝑎𝑛𝑑 𝑥 ∉ 𝐵 ⇒ 𝑥 ∉
(𝐴 ∩ B) ⇒ 𝑥 ∈ (𝐴 ∩ 𝐵)𝐶 and
∴ 𝐴𝐶 ∪ 𝐵 𝐶 ⊆ (𝐴 ∩ 𝐵)𝐶 ………………… (**)
ii. Let 𝑥 ∈ (𝐴 ∪ 𝐵)𝐶 ⇒ 𝑥 ∉ (𝐴 ∪ B) ⇒ 𝑥 ∉ 𝐴 𝑎𝑛𝑑 𝑥 ∉ 𝐵 ⇒ 𝑥 ∈ 𝐴𝐶 𝑎𝑛𝑑 𝑥 ∈ 𝐵 𝐶 ⇒ 𝑥 ∈
𝐴𝐶 ∩ 𝐵 𝐶 .
∴ (𝐴 ∪ 𝐵)𝐶 ⊆ 𝐴𝐶 ∩ 𝐵 𝐶 ………………… (*)
Next, let 𝑥 ∈ 𝐴𝐶 ∩ 𝐵 𝐶 ⇒ 𝑥 ∈ 𝐴𝐶 𝑎𝑛𝑑 𝑥 ∈ 𝐵 𝐶 ⇒ 𝑥 ∉ 𝐴 𝑜𝑟 𝑥 ∉ 𝐵 ⇒ 𝑥 ∉ (𝐴 ∪ B) ⇒
𝑥 ∈ (𝐴 ∪ 𝐵)𝐶 .
∴ 𝐴𝐶 ∩ 𝐵 𝐶 ⊆ (𝐴 ∪ 𝐵)𝐶 ………………… (**)

Set identities
𝐴∪∅=𝐴 𝐴∩𝑈 = 𝐴 Identity laws
𝐴∪𝐴 =𝐴 𝐴∩∅= ∅ Domination laws
𝐴∪𝐴 =𝐴 𝐴∩𝐴 =𝐴 Idempotent laws
̅̅̅̅̅̅) = 𝐴
(𝐴 Complementation
𝐴∪𝐵 =𝐵∪𝐴 𝐴∩𝐵 =𝐵∩𝐴 Commutative laws
𝐴 ∪ (𝐵 ∪ 𝐶) = (𝐴 ∪ 𝐵) ∪ 𝐶, 𝐴 ∩ (𝐵 ∩ 𝐶) = (𝐴 ∩ 𝐵) ∩ 𝐶 Associative Law
𝐴 ∩ (𝐵 ∪ 𝐶) = (𝐴 ∩ 𝐵) ∪ (𝐴 ∩ 𝐶), 𝐴 ∪ (𝐵 ∩ 𝐶) = (𝐴 ∪ 𝐵) ∩ (𝐴 ∪ 𝐶) Distributive law
̅̅̅̅̅̅̅
𝐴 ∪ 𝐵 = 𝐴̅ ∩ 𝐵̅ , ̅̅̅̅̅̅̅
𝐴 ∩ 𝐵 = 𝐴̅ ∪ 𝐵̅ Demorgans Law
𝐴 ∪ (𝐴 ∩ 𝐵) = 𝐴, 𝐴 ∩ (𝐴 ∪ 𝐵) = 𝐴 Absorption Law
𝐴 ∪ 𝐴̅ = 𝑈, 𝐴 ∩ 𝐴̅ = ∅ Complement Law
Exercise
Prove the distributive law

Finite Sets (Counting Principles)


A set is said to be finite if it contains exactly n distinct elements where n is non-negative integer.
The empty set ∅ and set {−2, 1, 2, 6} are finite sets. The set {𝑥; 𝑥 𝑖𝑠 𝑜𝑑𝑑} is an infinite set. The
number of elements or cardinality is given by |𝐴| = 𝑛(𝐴).
If A and B are disjoint sets, then 𝑛(𝐴 ∪ 𝐵) = 𝑛(𝐴) + 𝑛(𝐵).
Theorem
Let A be any set and U be a finite universal set then;
𝑛(𝐴𝐶 ) = 𝑛(𝑈) − 𝑛(𝐴)
e.g., If there are 20 male students in a set of 35 students, then there are 15 female students.
Suppose that A and B are finite sets, then;
𝑛(𝐴\𝐵) = 𝑛(𝐴 − 𝐵) = 𝑛(𝐴) − 𝑛(𝐴 ∩ 𝐵)
Example: Suppose math and computer class A contains 35 students and 15 of them are also in
chemistry class, then
𝑛(𝐴\𝐵) = 𝑛(𝐴 − 𝐵) = 𝑛(𝐴) − 𝑛(𝐴 ∩ 𝐵) = 35 − 15 = 20

Inclusion – Exclusion Principle


If A and B are finite sets, then 𝐴 ∪ 𝐵 and 𝐴 ∩ 𝐵 are also finite and therefore;
i. 𝑛(𝐴 ∪ 𝐵) = 𝑛(𝐴) + 𝑛(𝐵) − 𝑛(𝐴 ∩ 𝐵)
ii. 𝑛(𝐴 ∪ 𝐵 ∪ 𝐶) = 𝑛(𝐴) + 𝑛(𝐵) + 𝑛(𝐶) − 𝑛(𝐴 ∩ 𝐵) − 𝑛(𝐴 ∩ 𝐶) − 𝑛(𝐵 ∩ 𝐶) + 𝑛(𝐴 ∩
𝐵 ∩ 𝐶)
Example
1. Consider the following 110 students. 30 are on class list A, 35 on B and 20 in both A and
B. find the number of students;
a. On list A or B
b. On exactly one of the lists
c. On neither of the lists
Solution
a. 𝑛(𝐴 ∪ 𝐵) = 𝑛(𝐴) + 𝑛(𝐵) − 𝑛(𝐴 ∩ 𝐵)
30 + 35 − 20 = 45
b. 𝑛(𝐴 − 𝐵) + 𝑛(𝐵 − 𝐴) but
𝑛(𝐴 − 𝐵) = 𝑛(𝐴) − 𝑛(𝐴 ∩ 𝐵) = 30 − 20 = 10
𝑛(𝐵 − 𝐴) = 𝑛(𝐵) − 𝑛(𝐴 ∩ 𝐵) = 35 − 20 = 15
𝐶
c. 𝑛(𝐴 ∪ 𝐵) = 𝑛(𝑈) − 𝑛(𝐴 ∪ 𝐵) = 110 − 45 = 65

2. Consider the following data for 120 students


65 study French, 45 German, 42 Russian, 20 French and German, 25 French and Russian, 15
German and Russian, 8 all 3 languages. Let F, G and R denote the sets of students studying French,
German and Russian respectively.
a. Find the number studying at least one of the 3 languages
b. Fill the correct number in each of the 8 regions in the diagram below

c. Find the number of students studying


i. Exactly one language
ii. Exactly two languages
Solution
a. 𝑛(𝐹 ∪ 𝐺 ∪ 𝑅) = 𝑛(𝐹) + 𝑛(𝐺) + 𝑛(𝑅) − 𝑛(𝐹 ∩ 𝐺) − 𝑛(𝐹 ∩ 𝑅) − 𝑛(𝐺 ∩ 𝑅) + 𝑛(𝐹 ∩
𝐺 ∩ 𝑅)
= 65 + 45 + 42 − 20 − 25 − 15 + 8 = 100
b. See above
c. 1 language; 28 + 18 + 10 = 56
2 languages; 12 + 17 + 7 = 36
Exercise
A professor takes a survey on the first day of class to determine how many students know certain
computer languages. He found out that from 50 students;
30 know R 18 know MATLAB 26 know Python
9 know both R and MATLAB 16 know both R and Python 8 know both MATLAB and
Python
47 know at least one of the 3 languages.
a. How many know none of the 3 languages? 𝐴𝑛𝑠 = 3
b. How many know all 3? 𝐴𝑛𝑠 = 6
c. How many know R and MATLAB but not Python? 𝐴𝑛𝑠 = 3
d. How many know R but neither MATLAB nor Python? 𝐴𝑛𝑠 = 11.

The Power Set


Given a set A, the power set of A denoted 𝑃(𝐴) is the set of all subsets of A. If A has n elements,
the 𝑃(𝐴) has 2𝑛 elements.
Examples
𝑃(∅) = {∅}
|𝑃(∅)| = 20 = 1

Cartesian Product
Given two sets A and B, the cartesian product denoted by 𝐴 × 𝐵 (𝐴 𝑐𝑟𝑜𝑠𝑠 𝐵) is the set of all
ordered pairs (𝑎, 𝑏) where 𝑎 ∈ 𝐴 𝑎𝑛𝑑 𝑏 ∈ 𝐵. i.e., 𝐴 × 𝐵 = {𝑎, 𝑏}: 𝑎 ∈ 𝐴 𝑎𝑛𝑑 𝑏 ∈ 𝐵
Example
𝐴 = {1,2}, 𝐵 = {3,4,5}. Find 𝐴 × 𝐵, 𝐵 × 𝐴
Note: 𝐴 × 𝐵 ≠ 𝐵 × 𝐴
The cartesian product of 𝐴 × 𝐵 × 𝐶 consists of all ordered triples (𝑎, 𝑏, 𝑐) such that 𝑎 ∈ 𝐴, 𝑏 ∈
𝐵, 𝑐 ∈ 𝐶.
Given 𝐴 = {0,1}, 𝐵 = {1,2}, 𝐶 = {0,1,2}. Find 𝐴 × 𝐵, (𝐴 × 𝐵) × 𝐶, 𝑎𝑛𝑑 𝐴 × 𝐵 × 𝐶
Exercise
1. List the numbers of the following sets if 𝑃 = {1,2,3 ⋯ }.
a. 𝐴 = {𝑥: 𝑥 ∈ 𝑃, 3 < 𝑥 < 12}
b. 𝐵 = {𝑥: 𝑥 ∈ 𝑃, 4 + 𝑥 = 3}
2. Show that 𝐴 = {2,3,4,5} is not a subset of 𝐵 = {𝑥: 𝑥 ∈ 𝑃; 𝑥 𝑖𝑠 𝑒𝑣𝑒𝑛} where 𝑃 =
{1,2,3 ⋯ }.
3. Show by shading the wanted region on the Venn diagram the following:
(𝐴 ∩ 𝐵)𝐶
𝐴 − (𝐵 ∩ 𝐶)
𝐶
(𝐴 ∪ (𝐵 − 𝐶))
(𝐴 − 𝐵)𝐶
4. Give 𝐴 = {1,2, {3,2}, 7, 8}, 𝐵 = {1,2}, 𝐶 = {3, 2}. Find 𝐴 ∪ (𝐵 ∩ 𝐶)𝐶 , 𝐴 − (𝐵 ∩ 𝐶)
5. Let 𝐴 = {𝑎, 𝑏}, 𝐵 = {1,2}, 𝐶 = {2,3}, 𝐷 = {3,4} 𝑎𝑛𝑑 𝑈 = {1,4,6,8}. Find
∅𝐶 , 𝐴 × (𝐵 ∪ 𝐶), 𝐴 × (𝐵\𝐶) (𝐴 × 𝐶) ∩ (𝐵 × 𝐷)
LOGICS
Proposition and Compound Statements
A proposition or statement is a declaration sentence that is either true or false but not both.
Example
1. Nairobi is the capital of Kenya – True, T
2. 1 + 1 = 2 – True, T
3. 8 < 5 – False, F
4. 2 + 3 = 6 – False, F
Some sentences are not propositions e.g.,
1. What is your name?
2. What time is it?
3. 𝑥+4=2
4. 𝑥+𝑦 =𝑧
5. Read this correctly.
1,2,5 are not propositions – are not declarative. 3,4 are not propositions since they are neither true
nor false – no values assigned. Letters are used to denoted propositions just as they are used to
denote variables. The convenient letters used are 𝑝, 𝑞, 𝑟, 𝑠 ⋯
If a proposition is true, its truth value id denoted by T and if it is false, its truth value if false
denoted by F. the area of logics that deals with propositions is called propositional calculus or
proportional logic.
A compound proposition is one that is composed of sub propositions and various connectives or
logical operators.
Example
1. Roses are red and violets are blue
2. John is intelligent or studies every night.
The truth value of a compound proposition is determined by the truth values of its sub propositions
together with the way they are connected.
Basic logical operators and their connectives
Operation Logical Operator/ Connective Symbol
Negation Not ¬ 𝑜𝑟~
Conjunction And ∧
Disjunction Or ∨

¬𝑃 𝑜𝑟 ~𝑃 is read as “not P”
1. Negation
Given any proposition P, the negation of P denoted by ¬𝑃 𝑜𝑟 ~𝑃 can eb formed by writing; “it is
not the case that P”, “it is false that P” or if possible, it can be written by inserting in P the word
“not”.
Example
a. Find the negation of “Nairobi is in Kenya”
Solution
It is not the case that Nairobi is in Kenya or it is false that Nairobi is in Kenya or Nairobi is not in
Kenya.
b. Today is Friday
Solution
It is not the case that today is Friday or it is false that today id Friday or Today is not Friday.
The truth value of the negation of P is always opposite that of P and the table is as below.
p ~𝑝
T F
F T

A truth table displays the relationship between the truth values of propositions. They are especially
valuable in the determination of the truth values of propositions constructed from simple
propositions.
2. Conjunction
If p and q are propositions, the conjunction of p and q denoted by 𝑝 ∧ 𝑞 is the proposition “p and
q”. the conjunction 𝑝 ∧ 𝑞 is true when and only when both p and q are true and is false otherwise.
Table;
p q 𝑝∧𝑞
T T T
T F F
F T F
F F F

Note that “p but q” means “p and q” e.g., He is tall but plump means he is tall and plump. Neither
p nor q means not p and not q i.e., ~𝑝 and ~𝑞.
3. Disjunction
If p and q are propositions, the disjunction of p and q denoted by 𝑝 ∨ 𝑞 is the proposition “p or q”.
the disjunction 𝑝 ∨ 𝑞 are false otherwise it is false. The truth table is as below;
p q 𝑝∨𝑞
T T T
T F T
F T T
F F F

4. Exclusive
Let p and q be propositions, the exclusive of p and q denoted by 𝑝 ⊕ 𝑞 is the proposition that is
true when exactly one of p and q is true and is false otherwise.
Truth table
p q 𝑝⊕𝑞
T T F
T F T
F T T
F F F

Construction of truth tables for compound propositions


Start with the variables in the first columns. If there are n variables, 2𝑛 row is required to allow
for all possible combinations of T and F. The truth value of the proposition appears in the last
column.
Example
Construct the truth table for the proposition ∼ (𝑝 ∧∼ 𝑞)
Solution
p q ∼𝑞 𝑝 ∧∼ 𝑞 ∼ (𝑝 ∧∼ 𝑞)
T T F F T
T F T T F
F T F F T
F F T F T

Exercise
Construct truth tables for;
(𝑝 ∨ 𝑞) ∨ 𝑟 (𝑝 ∨ 𝑞) ∧ 𝑟 (𝑝 ∧ 𝑞) ∨ 𝑟 (𝑝 ∧ 𝑞) ∧ 𝑟 (𝑝 ∧ 𝑞) ∨∼ 𝑟 (𝑝 ∧ 𝑞) ∨∼ 𝑟
Tautologies and Contradictions
A tautology is a compound proposition that is true for any truth value of its variables. A
contradiction is a compound proposition that is always false. A contingency is a compound
proposition that is neither a tautology nor a contradiction.
Example
1. ‘p or not p’ is a tautology e.g., he is short or not short.
p ~𝑝 𝑝 ∨∼ 𝑝
T F T
F T T

2. ‘p and not p’ is a contradiction e.g., he is short and not short.


p ~𝑝 𝑝 ∧∼ 𝑝
T F F
F T F

Note: A negation of a contradiction is a tautology and a negation of a tautology is a contradiction.

LOGICAL EQUIVALENCE
Two propositions p and q are said to be logically equivalent denoted 𝑝 ≡ 𝑞 or 𝑝 ⟺ 𝑞 if and only
if the columns giving their truth values agree or have identical values.
Example
~(𝑝 ∧ 𝑞) ≡∼ 𝑝 ∨∼ 𝑞
~(𝑝 ∨ 𝑞) ≡∼ 𝑝 ∧∼ 𝑞

p q 𝑝∧𝑞 ∼ (𝑝 ∧ 𝑞) ∼𝑝 ∼𝑞 ∼ 𝑝 ∨∼ 𝑞
T T T F F F F
T F F T F T T
F T F T T F T
F F F T T T T

Exercise
1. Show that ~(𝑝 ∨ 𝑞) ≡∼ 𝑝 ∧∼ 𝑞.
2. Use the truth table to verify the associative laws
i. (𝑝 ∨ 𝑞) ∨ 𝑟 ≡ 𝑝 ∨ (𝑞 ∨ 𝑟)
ii. (𝑝 ∧ 𝑞) ∧ 𝑟 ≡ 𝑝 ∧ (𝑞 ∧ 𝑟)
3. Use the truth tables to verify the distributive laws (𝑝 ∧ 𝑞) ∨ 𝑟 ≡ (𝑝 ∧ 𝑞) ∨ (𝑝 ∧ 𝑟).
Example
Show that (𝑝 ∨ 𝑞) ∧ 𝑟 and (𝑝 ∨ 𝑞) ∧ (𝑝 ∨ 𝑟) are logically equivalent.
Solution
p q r 𝑞∧𝑟 𝑝∨𝑞 𝑝∨𝑟 𝑝 ∨ (𝑞 ∧ 𝑟) (𝑝 ∨ 𝑞) ∧ (𝑝 ∨ 𝑟)
T T T T T T T T
T T F F T T T T
T F T F T T T T
T F F F T T T T
F T T T T T T T
F T F F T F F F
F F T F F T F F
F F F F F F F F

Conditional and Biconditional Statements


A conditional statement is a statement of the form ‘if p then q’. It is called an implication.
If p and q are statements or propositions, the conditional statement “if p then q” or “p implies q”
is denoted by 𝑝 → 𝑞. It is false when p is true and q is false otherwise it is true. p is called the
hypothesis/antecedent/premise and q is the consequent or conclusion.
Truth table:
p q 𝑝→𝑞
T T T
T F F
F T T
F F T

Other statements to express implication are;


If p then q p implies q
If p, q p only if q
P is sufficient for q a sufficient 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
Example
1. If I am elected, then I will lower taxes
2. For John to get a job it is sufficient for him to ….
3. If you get 100% on the final, then you will get A.
Note: The definition of conditional statements in Mathematics is more general than the meaning
attached to such statements in English.
Example
1. If today is Friday, then 2 + 3 = 5 is true from the definition of implication since its
conclusion is true.
2. If today is Friday, then 2 + 3 = 6 is true every day except Friday, even though 2 + 3 =
6 is false.
Negation of Conditional Statements
The negation of “if p then q” is logically equivalent to “p and not q”.
Example: Negate the following;
1. If my car is in the garage, then I cannot get to class.
➢ My car is in the garage and I can get to class.
2. If John lives in Nchiru, then he lives in Kenya.
➢ John lives in Nchiru and does not live in Kenya.
Exercise
1. Use the following truth tables to shown logical equivalence of the statements.
𝑝 ∨ 𝑞 → 𝑟 𝑎𝑛𝑑 (𝑝 → 𝑟) ∧ (𝑞 → 𝑟) i.e., show that 𝑝 ∨ 𝑞 → 𝑟 ≡ (𝑝 → 𝑟) ∧ (𝑞 → 𝑟)
2. Show that 𝑝 → 𝑟 ≡∼ 𝑝 ∨ 𝑞.
Biconditional Statements
Let p and q be propositions. The biconditional of p and q is “p if and only if q” and is denoted by
𝑝 ⟺ 𝑞. Its true when p and q have the same truth values and false otherwise.
p q 𝑝⇔𝑞
T T T
T F F
F T F
F F T

It is the conjunction of two conditional statements 𝑝 → 𝑞 and 𝑞 → 𝑝 i.e., (𝑝 → 𝑞) ∧ (𝑞 → 𝑝). Other


ways of expressing this are;
➢ p is necessary and sufficient for q.
➢ if p then q and conversely
➢ p if q
➢ p iff q
Example
Rewrite the following statement as a conjunction of two ‘if then’ statements. “You can take a flight
if and only if you buy a ticket.”
Solution
If you can take the flight then you can buy a ticket.
Procedure of logical operations
Operator Procedure
∼ 1
∧ 2
∨ 3
→ 4
⟺ 5

Exercise
Use the truth tables to show that the following propositions are tautologies.
a. [∼ 𝑝 ∧ (𝑝 ∨ 𝑞)] → 𝑞
b. [(𝑝 → 𝑞) ∧ (𝑞 → 𝑟)] → (𝑝 → 𝑟)
c. [𝑝 ∧ (𝑝 → 𝑞)] → 𝑞
d. [(𝑝 ∨ 𝑞) ∧ (𝑝 → 𝑟) ∧ (𝑞 → 𝑟)] → 𝑟
e. [∼ (𝑝 → 𝑞)] ⟺ [𝑝 ∧ (∼ 𝑞)]
f. [𝑝 ∨ (𝑞 ∨ 𝑟)] ⟺ [(𝑝 ∨ 𝑞) ∨ 𝑟]
g. [𝑝 ∧ (𝑞 ∨ 𝑟)] ⟺ [(𝑝 ∧ 𝑞) ∨ (𝑝 ∧ 𝑟)]
h. [(𝑝 → 𝑞) ∧ (𝑞 → 𝑟)] → (𝑝 → 𝑟)
Logical Equivalence
Equivalence Name
𝑝∧𝑇 ≡𝑝 Identity Laws
𝑝∨𝐹 ≡𝑝
𝑝∨𝑇 ≡𝑇 Domination laws
𝑝∧𝐹 ≡𝐹
𝑝∨𝑝 ≡𝑝 Idempotent laws
𝑝∧𝑝 ≡𝑝
∼ (∼ 𝑝) ≡ 𝑝 Double negation law
𝑝∨𝑞 ≡𝑞∨𝑝 Commutative law
𝑝∧𝑞 ≡𝑞∧𝑝
(𝑝 ∨ 𝑞) ∨ 𝑟 ≡ 𝑝 ∨ (𝑞 ∨ 𝑟) Associative law
(𝑝 ∧ 𝑞) ∧ 𝑟 ≡ 𝑝 ∧ (𝑞 ∧ 𝑟)
(𝑝 ∧ 𝑞) ∧ 𝑟 ≡ 𝑝 ∧ (𝑞 ∧ 𝑟)

𝑝 ∨ (𝑞 ∧ 𝑟) ≡ (𝑝 ∨ 𝑞) ∧ (𝑝 ∨ 𝑟) Distributive law
𝑝 ∧ (𝑞 ∨ 𝑟) ≡ (𝑝 ∧ 𝑞) ∨ (𝑝 ∧ 𝑟)
∼ (𝑝 ∧ 𝑞) ≡∼ 𝑝 ∨∼ 𝑞 Demorgans laws
∼ (𝑝 ∨ 𝑞) ≡∼ 𝑝 ∧∼ 𝑞
𝑝 ∨ (𝑝 ∧ 𝑞) ≡ 𝑝 Absorption laws
𝑝 ∧ (𝑞 ∨ 𝑟) ≡ 𝑝
𝑝 ∨∼ 𝑝 ≡ 𝑇 Negation laws
𝑝 ∧∼ 𝑝 ≡ 𝐹

Logical equivalence involving Implication


𝑝 → 𝑞 ≡∼ 𝑝 ∨ 𝑞
𝑝 → 𝑞 ≡∼ 𝑞 →∼ 𝑝
𝑝 ∨ 𝑞 ≡∼ 𝑝 → 𝑞
𝑝 ∧ 𝑞 ≡∼ (𝑝 →∼ 𝑞)
∼ (𝑝 → 𝑞) ≡ 𝑝 ∧∼ 𝑞
(𝑝 → 𝑞) ∧ (𝑝 → 𝑟) ≡ 𝑝 → (𝑞 ∧ 𝑟)
Logical Equivalence involving biconditionals
𝑝 ⟺ 𝑞 ≡ (𝑝 → 𝑞) ∧ (𝑞 → 𝑝)
𝑝 ⟺ 𝑞 ≡∼ 𝑝 ⟺∼ 𝑞
𝑝 ⟺ 𝑞 ≡ (𝑝 ∧ 𝑞) ∨ (∼ 𝑝 ∧∼ 𝑞)
∼ (𝑝 ⟺ 𝑞) ≡ 𝑝 ⟺∼ 𝑞
Exercise
a. Show that the following are logically equivalent
• ∼ 𝑝 ⟺ 𝑞 𝑎𝑛𝑑 𝑝 ⟺∼ 𝑞
• ∼ (𝑝 ⟺ 𝑞) 𝑎𝑛𝑑 ∼ 𝑝 ⟺∼ 𝑞
• ∼ 𝑝 → (𝑞 → 𝑟) 𝑎𝑛𝑑 𝑞 → (𝑝 ∨ 𝑟)
• ∼ (𝑝 ⟺ 𝑞) 𝑎𝑛𝑑 𝑝 ⟺∼ 𝑞
b. Show that (𝑝 ∨ 𝑞) ∧ (∼ 𝑝 ∨ 𝑟) → (𝑞 ∨ 𝑟) is a tautology
c. Show that (𝑝 → 𝑞) ∧ (𝑞 → 𝑞) → (𝑝 → 𝑟) is a tautology
Converse, Contrapositive and Inverse
Starting with a conditional statement 𝑝 → 𝑞, we can form the following special conditional
statements;
• Converse of 𝑝 → 𝑞 is 𝑞 → 𝑝
• Inverse of 𝑝 → 𝑞 is ∼ 𝑝 →∼ 𝑞
• Contrapositive of 𝑝 → 𝑞 is ∼ 𝑞 →∼ 𝑝
Note:
a. The contrapositive always has the same truth value as the statement 𝑝 → 𝑞.
b. Converse and inverse of a conditional statement are equivalent but neither is equivalent to
the original conditional statement.
Example
Write the contrapositive, converse and inverse of;
1. The birds shelter whenever its raining same as if it is raining, birds shelter.
➢ Contrapositive: if the birds do not shelter, then it is not raining
➢ Converse: if the birds shelter, then it is raining
➢ Inverse: if it is not raining, the birds do not shelter.
2. The home team wins whenever it is raining same as if it is raining, then the home team
wins;
➢ Contrapositive: if the home team does not win, then it is not raining
➢ Converse: if the home team wins, then it is raining
➢ Inverse: if it is not raining, then the home team does not win.
Exercise
State the converse, contrapositive and inverse of;
a. If it snows tonight, I will stay at home.
b. If it rains today, I will plant tomorrow.
c. I go to the beach whenever it is a sunny summer day.
d. A positive integer is a prime only if it has no divisors other than one and itself.
e. I come to class whenever there is going to be a quiz.
f. When is stay up late, it is necessary that I sleep up until noon.
Necessary and Sufficient Conditions
If p and q are statements, then;
• P is a sufficient condition for q means “if p then q”
• P is a necessary condition for q means “if not p, then not q” or “if q, then p”
• Consequently, p is a necessary and sufficient condition for q means “p if and only if q”
Examples
Rewrite the following as “if, then…” statements.
1. John’s birth on Kenyan soil is a sufficient condition for him to be a Kenyan citizen.
➢ If John’s birth is on Kenyan soil, then he’s a Kenyan citizen.
2. Mary’s attaining 18 years is a necessary condition for her to be a citizen.
Translating English Sentences
Translating sentences is say English into a logical expression is essential especially when
specifying both hardware and software systems. Systems and software engineers take requirements
in natural language and produce precise and unambiguous specifications that can be used as the
basis for system development.
Examples
Translate the following into logical statements
1. You can access the internet from computer only if you are a computer science major or you
are not a freshman.
Solution
Let a, b, c represent;
a – you can access the internet from computer
b – you are a computer science student major
c – you are a freshman
Hence, 𝑎 → (𝑏 ∨∼ 𝑐)
2. You cannot ride the roller coaster if you are under 4 feet tall unless you are older than 16
years
Solution
p – you can ride the roller coaster
q – you are 4 feet tall
r – you are older than 16 years
Hence (𝑞 ∧∼ 𝑟) → 𝑝
Exercise
1. Consider the following;
p: I will eat my socks
q: it is raining
r: I will go shopping
Represent the following sentences using logical connectives and letters p, q and r.
a. If it is raining, I will eat my socks but I will not go shopping.
b. It is either raining or I will go shopping, but I will eat my sock if it is raining.
c. That it is raining is necessary and sufficient condition for me not to go shopping.
2. Let p and q be;
p: it is below freezing
q: it is snowing
rewrite the following using logical connectives and letters p and q
a. It is not below freezing and snowing.
b. It is below freezing but not snowing.
c. It is not below freezing and it’s not snowing.
d. It is either snowing or below freezing.
e. If it is below freezing, it is also snowing.
f. It is either below freezing if it is below freezing.
3. Let
p: you have the flu
q: you miss the final exam
r: you pass the course
express the following propositions as English sentences.
a. 𝑝→𝑞
b. ~𝑞 ⟺ 𝑟
c. 𝑝∨𝑞∨𝑟
d. (𝑝 ∧ 𝑞) 𝑜𝑟 (∼ 𝑞 ∧ 𝑟)
QUANTIFIERS
Some statements contain variables and hence they are true or false when appropriate values are
satisfied for the variables. e.g., 15 < 𝑥 such are called predicator. 15 is the predicate which tells
us more about subject x. there are two types of quantifiers.
1. Universal Quantifier (∀)
The notation ∀𝑥𝑃(𝑥) denotes the universal quantification of 𝑃(𝑥). Here ∀ is called universal
quantifier. ∀𝑥𝑃(𝑥) is referred a “for all x, P(x)” or “for every x, P(x).” It asserts that a certain
property holds for all objects of a certain type.
Examples
a. Let P(x) be the statement; “𝑥 + 1 > 𝑥”. What is the truth value of quantification ∀𝑥𝑃(𝑥)
where the universe of discourse consists of all real numbers?
Solution
Since P(x) is true for all real numbers x, then quantification ∀𝑥𝑃(𝑥) is true.
b. Let Q(x) be the statement “𝑥 < 2” what is the truth value of ∀𝑥𝑄(𝑥) where the universe
of discourse consists of all real numbers?
Solution
Q(x) is not true for every real number x, since for 𝑄(3) is false. Thus ∀𝑥𝑄(𝑥) is false.
2. Existential Quantifier (∃)
The existential quantifier of P(x) is the proposition “there exists an element x in the universe of
discourse such that P(x) is true”. The notation ∃𝑥𝑃(𝑥) is used. It is read as “there exists an x such
that P(x) is true” or “there is at least one x such that P(x)”.
Examples
a. Let P(x) denote the statement “𝑥 > 3” what is the truth value of ∃𝑥𝑃(𝑥) where the universe
of discourse consists of all real numbers?
Solution
Since 𝑥 > 3, it is true for instance 𝑥 = 4 and therefore ∃𝑥𝑃(𝑥) is true.
b. Let Q(x) denote “𝑥 = 𝑥 + 1” what is the values of the quantification ∃𝑥𝑄(𝑥) where the
universe of discourse consists of all real numbers?
Solution
Since Q(x) is false for all real numbers, then ∃𝑥𝑄(𝑥) is false.
Statement When true When false
∀𝑥𝑃(𝑥) P(x) is true for every x There is an x for which x is not
true
∃𝑥𝑃(𝑥) There is an x for which P(x) is P(x) is false for every x
true

NUMBERS
Set of numbers
The set of numbers can be represented in a Venn diagram as below;

Notations
ℕ = {1,2,3, ⋯ } - Natural or counting numbers
ℤ = {⋯ , −2, −1,0,1,2, ⋯ } - Integers
𝑝 𝑝
ℚ = {𝑞 : 𝑝, 𝑞 ∈ ℤ, 𝑞 ≠ 0} – Irrational numbers i.e., numbers that can be written as 𝑞 where p and q
are integers, 𝑞 ≠ 0 and the gcd of p and q, (𝑝, 𝑞) = 1.
𝑝
ℚ𝐶 are numbers that cannot be written as e.g., 𝑒, 𝜋, √2, ⋯
𝑞

ℝ - the set of real numbers is ℕ ∪ ℤ ∪ ℚ ∪ ℚ𝐶 .


ℂ - the set of complex numbers. These are numbers of the form 𝑎 + 𝑖𝑏 where a and b are integers
and 𝑖 = √−1 e.g., √−4, 1 + 𝑖, ⋯
Laws of Arithmetic in Numbers
a. Associative law for multiplication and addition.
(𝑎 + 𝑏) + 𝑐 = 𝑎 + (𝑏 + 𝑐)
(𝑎 × 𝑏) × 𝑐 = 𝑎 × (𝑏 × 𝑐)
b. Commutative law for multiplication and addition
𝑎+𝑏 =𝑏+𝑎
𝑎×𝑏 = 𝑏×𝑎
c. Distributive law: If a, b and c are real numbers, then
𝑎(𝑏 + 𝑐) = 𝑎𝑏 + 𝑎𝑐
(𝑎 + 𝑏)𝑐 = 𝑎𝑐 + 𝑏𝑐
𝑎(𝑏𝑐) = 𝑎𝑏𝑐
d. Additive identity and multiplicative identity. If a is a real number, then ∃ a number zero
such that 𝑎 + 0 = 0 + 𝑎 = 0. 0 is the additive identity. If a is a real number, then ∃ a
number 1 such that 𝑎 × 1 = 1 × 𝑎 = 𝑎. 1 is a multiplicative identity.
e. Additive inverse: If a is a real number, then ∃ a number (−𝑎) such that 𝑎 + (−𝑎) =
(−𝑎) + 𝑎 = 0 known as the additive inverse
f. Multiplicative inverse: For any number 𝑎 ≠ 0, ∃ its inverse 𝑎−1 such that 𝑎 × 𝑎−1 =
𝑎−1 × 𝑎 = 1
g. Addition and division (except by zero)
𝑎 − 𝑏 = 𝑎 + (−𝑏)
𝑎
𝑎 × 𝑏 −1 =
𝑏
Order and Inequalities
Let a and b be real numbers. We say 𝑎 < 𝑏 if the difference 𝑏 − 𝑎 is positive. Geometrically 𝑎 <
𝑏 iff the point a lies to the left of b on the number line.
Order: This is defined in ℝ in terms of the positive real numbers denoted ℝ+ . All usual properties
of this order relation are a consequence of the following two properties of real numbers;
i. If a and b are positive, then 𝑎 + 𝑏 and 𝑎 × 𝑏 are positive.
ii. For any real number, either a is positive, 𝑎 = 0 or −𝑎 is positive
𝑎>𝑏≡𝑏<𝑎
𝑎 ≤ 𝑏 ≡ 𝑎 < 𝑏 𝑜𝑟 𝑎 = 𝑏
𝑎 ≥ 𝑏 ≡ 𝑎 > 𝑏 𝑜𝑟 𝑎 = 𝑏
Proposition 1: Let a, b, c be real numbers; then
i. 𝑎 ≤ 𝑎
ii. If 𝑎 ≤ 𝑏 and 𝑏 ≤ 𝑎 𝑡ℎ𝑒n 𝑎 = 𝑏
iii. If 𝑎 ≤ 𝑏 and 𝑏 ≤ 𝑐 𝑡hen 𝑎 ≤ 𝑐
Proposition 2: Law of trichotomy
For any real numbers a and b, exactly one of the following holds; 𝑎 < 𝑏, 𝑎 = 𝑏, 𝑎 > 𝑏
Proposition 3: Let a, b, c be real numbers such that 𝑎 ≤ 𝑏 ≤ 𝑐 then
i. 𝑎 + 𝑐 ≤ 𝑏 + 𝑐
ii. 𝑎𝑐 ≤ 𝑏𝑐 when 𝑐 > 0
𝑎𝑐 ≥ 𝑏𝑐 𝑤ℎ𝑒n 𝑐 < 0
Absolute Value Distance
The absolute value of a real number a, denoted |𝑎| may be viewed as the distance between a and
the origin on the real number line. It is the magnitude of a without regard to the sign. i.e.,
𝑎 𝑖𝑓 𝑎 ≥ 0
|𝑎| = {
−𝑎 𝑖𝑓 𝑎 < 0
The distance d between two points (or real numbers a and b) is denoted by 𝑑(𝑎, 𝑏) and is given
by:
𝑑(𝑎, 𝑏) = |𝑎 − 𝑏| = |𝑏 − 𝑎| or 𝑑(𝑎, 𝑏) = |𝑎| + |𝑏| when a and b have different signs or
𝑑(𝑎, 𝑏) = |𝑎| − |𝑏| if they have same signs and |𝑎| ≥ |𝑏|.
Example
Find the distance between the points
a. (2, −7)
Solution
𝑑(2, −7) = |2 − (−7)| = |9| = 9 𝑢𝑛𝑖𝑡𝑠
b. (−4, −9)
Solution
𝑑(−4, −9) = |(−9) − (−4)| = |5| = 5 𝑢𝑛𝑖𝑡𝑠
Proposition 4: Let a and b be any real numbers. Then;
i. |𝑎| ≥ 0 𝑎𝑛𝑑 |𝑎| = 0 𝑖𝑓 𝑎 = 0
ii. −|𝑎| ≤ 𝑎 ≤ |𝑎|
iii. |𝑎𝑏| = |𝑎| × |𝑏|
iv. |𝑎 + 𝑏| ≤ |𝑎| + |𝑏|
v. ||𝑎| ± |𝑏|| ≤ |𝑎 ± 𝑏|

Intervals
Let a and b be distinct numbers with say 𝑎 < 𝑏. The intervals with points a and b are defined as
follows;
(𝑎, 𝑏) = {𝑥: 𝑎 < 𝑥 < 𝑏} – open interval
[𝑎, 𝑏] = {𝑥: 𝑎 ≤ 𝑥 ≤ 𝑏} – closed interval
(𝑎, 𝑏] = {𝑥: 𝑎 < 𝑥 ≤ 𝑏} – open – closed interval
[𝑎, 𝑏) = {𝑥: 𝑎 ≤ 𝑥 < 𝑏} – closed open interval
Example
Find all integers n such that 2𝑛 < 8 − 3𝑛 < 18
Solution
2𝑛 < 8 − 3𝑛 < 18 ⇒ 2𝑛 < 8 − 3𝑛 𝑎nd 8 − 3𝑛 < 18
5𝑛 < 8 −3𝑛 < 10
𝑛 < 1.6 and 𝑛 > −3.3
⇒ −3.3 < 𝑛 < 1.6
⇒ 𝑛 = −3, −2, −1,0,1
Exercise
1. Find the distance between each pair of integers below;
a. 3 and 7 b. -8 and -5 c. 1 and 9 d. -14 and 6 e. 16 and 7.
2. Find the integers x such that 6 < 2𝑥 − 6 < 14
3. Rewrite each interval below using the set builder notation.
a. [-3,8) b. (3,8) c. (4,9] d. [-4,-2]
Examples
1. Prove that if 𝑎 ≤ 𝑏 and 𝑏 ≤ 𝑐 then 𝑎 ≤ 𝑐
Proof:
The proposition is true when 𝑎 = 𝑏 or 𝑏 = 𝑐 thus we need only to consider the case when 𝑎 < 𝑏
and 𝑏 < 𝑐. By proposition 1, if 𝑎 < 𝑏 and 𝑏 < 𝑐 then 𝑏 − 𝑎 and 𝑐 − 𝑏 are positive. The sum is
also positive. i.e.,
(𝑏 − 𝑎) + (𝑐 − 𝑏) > 0
𝑏−𝑎+𝑐−𝑏 > 0
𝑐−𝑎 >0
⇒ 𝑐 > 𝑎 and hence 𝑎 ≤ 𝑐.
2. Write the interval 2 < 𝑥 < 10 in the form |𝑥 − 𝑎| < 𝑟
Solution
Here, a will be the “center” and r the “radius” of the interval i.e., a is the midpoint and r is half the
length of the interval. Thus;
10+2
𝑎= =6 sum of ends and divide by 2
2
10−2
𝑟= =4 find d and divide by 2
2
∴ 2 < 𝑥 < 10 = |𝑥 − 6| < 4
3. Write the interval −7 < 𝑥 < 3 in the form |𝑥 − 𝑎| < 𝑟
Solution
−7 + 3
𝑎= =2
2
3 − (−7)
𝑟= =5
2
∴ −7 < 𝑥 < 3 = |𝑥 − 2| < 5
FUNCTIONS
A function f from a set A to a set B is a relation between elements of A and B with the property
that each input (element of A) is related to one and only one output (element of B).

Functions are also called mappings or transformations.


Domain, Co-domain, Range, Image and Pre-image
If f is a function from A to B, we write 𝑓: 𝐴 → 𝐵. A is called the domain of f (dom f) and B is the
co-domain of f. 𝑓(𝑥)means “output of f for input x” or “value of f at x”. If 𝑓(𝑥) = 𝑦, we say that
y is the image of x and x is the pre-image of y. The range of f is the set of all images of elements
of A.
Example
1. Let 𝑥 = {𝑎, 𝑏, 𝑐} and 𝑦 = {1,2,3,4}. If f is a function defined by the arrow diagram below,
find the domain and co-domain of f. 𝑓(𝑎), 𝑓(𝑏), 𝑓(𝑐), range of and the pre-images of 1 and
4.

Solution
a. 𝐷𝑜𝑚 𝑓 = {𝑎, 𝑏, 𝑐}, 𝑐𝑜 − 𝑑𝑜𝑟𝑚𝑎𝑖𝑛 𝑜𝑓 𝑓 = {1,2,3,4}
b. 𝑓(𝑎) = 2, 𝑓(𝑏) = 4, 𝑓(𝑐) = 2
c. Range of f={2,4}
d. Pre image of 1= ∅, 4 = {𝑏}
2. Let 𝑓: ℤ → ℤ+ be defined by 𝑓(𝑥) = 𝑥 2 . Find the domain, codomain and range of f
Solution
Domain = ℤ, set of all integers
Codomain = ℤ+ , set of all positive integers
Range = {0,1,4,9,16, ⋯ }, the set of all integers that are perfect squares.

One to one (1 – 1) and Onto functions

A function f is said to be 1 – 1 (injective) if it never assigns the same value to two different domain
elements. Let f be a function from a set X to a set Y, f is 1 – 1 or injective iff for all elements 𝑥1
and 𝑥2 in X; if 𝑓(𝑥1 ) = 𝑓(𝑥2 ) 𝑡ℎ𝑒𝑛 𝑥1 = 𝑥2 𝑜𝑟 𝑖𝑓 𝑥1 ≠ 𝑥2 , 𝑡ℎ𝑒𝑛 𝑓(𝑥1 ) ≠ 𝑓(𝑥2 )

Example

1. Determine if 𝑓(𝑥) = 𝑥 2 𝑓𝑟𝑜𝑚 ℤ → ℤ is 1 – 1

Solution

𝑓(𝑥) = 𝑥 2 is not 1 – 1 because for instance 𝑓(1) = 1 and 𝑓(−1) = 1 yet 1 ≠ −1.

2. Determine whether the function f from {a, b, c, d} to {1, 2, 3, 4, 5} with 𝑓(𝑎) = 4, 𝑓(𝑏) =
5, 𝑓(𝑐) = 1 𝑎𝑛𝑑 𝑓(𝑑) = 3 is 1 – 1.

Solution

The function is 1 – 1 since f takes on different values at the four elements of its domain.
3. Determine whether 𝑓(𝑥) = 𝑥 + 1 is 1 – 1

Solution

The function is a 1 – 1 function. To demonstrate this, note that 𝑥 + 1 ≠ 𝑦 + 1 whenever 𝑥 ≠ 𝑦

Onto function

A function is said to be onto (surjective) if every member of the codomain is an image of some
element of the domain. Let f be a function from a set X to a set Y, f is onto iff given any element
𝑦 ∈ 𝑌, it is possible to find an element 𝑥 ∈ 𝑋 with the property 𝑦 = 𝑓(𝑥).

Examples

1. Is the function 𝑓: ℤ → ℤ onto if 𝑓(𝑥) = 𝑥 2 ?

Solution

No because there is no integer x with 𝑥 2 = 3

2. Let f be the function from {a, b, c, d} to {1, 2, 3} defined by 𝑓(𝑎) = 3, 𝑓(𝑏) = 2, 𝑓(𝑐) =
1, 𝑓(𝑑) = 3. Is f onto?

Solution

Since all three elements of the codomain are images of elements in the domain, f is onto.

3. Is 𝑓(𝑥) = 𝑥 + 1 from ℤ → ℤ onto?

Solution

The function is onto since for every integer y, there is an integer x such that 𝑓(𝑥) = 𝑦. Note that
𝑓(𝑥) = 𝑦 iff 𝑥 + 1 = 𝑦 ⇒ 𝑖𝑓 𝑥 = 𝑦 − 1.
Bijective (one to one and onto) functions

A function 𝑓: 𝑋 → 𝑌 is said to be a bijection if it is 1 – 1 and onto.

Example

Let f be the function 𝑓: 𝑋 → 𝑌 defined by the diagram below

i.e., 𝑓(𝑎) = 2, 𝑓(𝑏) = 4, 𝑓(𝑐) = 1, 𝑓(𝑑) = 3

the function f is 1 – 1. It is also onto and therefore it is a 1 – 1 and onto i.e., a bijection.

Inverse Functions

If f is a bijection from a set X to a set Y, then the inverse of f, 𝑓 −1 is the function from Y to X that
sets each element of Y back to the element of X that it came from. i.e., if 𝑓(𝑥) = 𝑦 then 𝑓 −1 (𝑦) =
𝑥.

Note: A function does not have an inverse of it is not a bijection.

Examples

Find the inverse of the following functions;

a. 𝑓(𝑥) = 4𝑥 − 1

Solution

Let 𝑓(𝑥) = 4𝑥 − 1 = 𝑦; make x the subject

𝑦 = 4𝑥 − 1
4𝑥 = 𝑦 + 1
𝑦+1
𝑥=
4
𝑥+1
Replace x with 𝑓 −1 (𝑥) and y with x to get 𝑓 −1 (𝑥) = 4

b. 𝑓(𝑥) = 2𝑥 + 3
3−𝑦
𝑦 = 2𝑥 + 3 ⇒ 2𝑥 = 3 − 𝑦 ⇒ 𝑥 =
2
3−𝑦
𝑓 −1 (𝑥) =
2
c. Given 𝑓(𝑥) = 3𝑥 2 + 4, find 𝑓(2), 𝑓 −1 (𝑥), 𝑓 −1 (7)
𝑓(2) = 3(22 ) + 4 = 16
𝑦−4 𝑦−4
𝑦 = 3𝑥 2 + 4 ⇒ 3𝑥 2 = 𝑦 − 4 ⇒ 𝑥 2 = ⇒𝑥=√
3 3

𝑥−4
𝑓 −1 (𝑥) = √
3

7−4
𝑓 −1 (7) = √ = ±1
3
d. Let f be the function from {a, b, c} to {1, 2, 3} such that 𝑓(𝑎) = 2, 𝑓(𝑏) = 3 𝑎𝑛𝑑 𝑓(𝑐) =
1. Is f invertible and if it is, what is its inverse?

Solution

The function is a bijection since it is both 1 – 1 and onto and therefore invertible. The inverse
function 𝑓 −1 reverses the correspondence given by f so that 𝑓 −1 (1) = 𝑐, 𝑓 −1 (2) = 𝑎, 𝑓 −1 (3) =
𝑏.
Addition and Multiplication and composition of functions

Let 𝑓1 and 𝑓2 be functions from A to B. then 𝑓1 + 𝑓2 and 𝑓1 𝑓2 are also functions from A to B defined
by;
(𝑓1 + 𝑓2 )𝑥 = 𝑓1 (𝑥) + 𝑓2 (𝑥)
(𝑓1 𝑓2 )𝑥 = 𝑓1 (𝑥)𝑓2 (𝑥)
Let g be a function from set A to B and let f be a function from set B to C. the composition of the
functions f and g denoted by (𝑓 ∘ 𝑔)𝑥 = 𝑓(𝑔(𝑥)).

Example
Let 𝑓(𝑥) = 𝑥 2 , 𝑔(𝑥) = 𝑥 − 𝑥 2 find;
a. 𝑓(𝑥) + 𝑔(𝑥) b. (𝑓𝑔)𝑥 c. (𝑓 ∘ 𝑔)𝑥 d. (𝑔 ∘ 𝑓)𝑥
Solution
a. 𝑓(𝑥) + 𝑔(𝑥) = 𝑥 2 + 𝑥 − 𝑥 2 = 𝑥
b. (𝑓𝑔)𝑥 = 𝑥 2 (𝑥 − 𝑥 2 ) = 𝑥 3 − 𝑥 4
c. (𝑓 ∘ 𝑔)𝑥 = 𝑓(𝑔(𝑥)) = 𝑓(𝑥 − 𝑥 2 ) = (𝑥 − 𝑥 2 ) 2 = 𝑥 2 − 2𝑥 3 + 𝑥 4
d. (𝑔 ∘ 𝑓)𝑥 = 𝑔(𝑓(𝑥)) = 𝑔(𝑥 2 ) = 𝑥 2 − (𝑥 2 )2 = 𝑥 2 − 𝑥 4

Inverse of Composite Functions

The inverse (𝑓 ∘ 𝑔)−1 (𝑥) = (𝑔−1 ∘ 𝑓 −1 )𝑥

Examples
1
1. Given that 𝑓(𝑥) = 2 𝑥 + 4, 𝑔(𝑥) = 𝑥 − 5. Show that (𝑓 ∘ 𝑔)−1 (𝑥) = (𝑔−1 ∘ 𝑓 −1 )𝑥.
1
2. Given that 𝑓(𝑥) = 2𝑥 + 3, 𝑔(𝑥) = 3 𝑥 find
a. (𝑓 ∘ 𝑔)−1 (𝑥) b. (𝑔 ∘ 𝑓)−1 (𝑥)
1
3. If 𝑓(𝑥) = 3𝑥, 𝑔(𝑥) = 2𝑥 + 4, ℎ(𝑥) = 4 𝑥, find
a. (𝑓 ∘ 𝑔 ∘ ℎ)(𝑥) b. (𝑔 ∘ 𝑓 ∘ ℎ)𝑥 (ℎ ∘ 𝑔 ∘ 𝑓)𝑥
−1 (𝑥) −1
(𝑓
4. Show that ∘ 𝑔 ∘ ℎ) = (ℎ ∘ 𝑔 ∘ 𝑓 −1 )𝑥
−1
METHODS OF PROOF AND ELEMENTARY NUMBER THEORY

Proofs in mathematics are valid arguments that establish the truth of a mathematical statement of
formula. An argument is a sequence of statements that end with a conclusion. An argument is valid
iff it is impossible for all premises to be true and the conclusion false. Proofs in computer science
are used in;

• Verifying the correctness of a program.


• Establishing that operating systems are secure.
• Showing that system specifications are consistent.

Definitions

1. Theorem /fact /Result: Is a statement that can be shown to be true.


2. Axiom /Postulate: Are statements assumed to be true premises (if any) of the theorem and
previously proven theorem.
3. Corollary: Is a proposition that can be established directly from a theorem that has been
proved.
4. Conjecture: A statement that is being proposed to be a true statement usually on the basis
of some partial evidence or induction of an expert. It is also a statement whose truth value
is unknown and when a proof is found it becomes a theorem.
5. Lemma: Is a simple theorem used in proof of other theorem.
6. Fallacy: Is a common form of an incorrect reasoning.

Review of number theory

The set of natural numbers ℕ is said to be closed under + and × i.e., if a and b are natural numbers,
then 𝑎 + 𝑏 and 𝑎 × 𝑏 are also natural numbers. The set of integers ℤ is closed under +,× 𝑎𝑛𝑑 −
but not under ÷.

There are two types of integers; odd and even. An integer n is said to be even iff ∃ an integer k
such that 𝑛 = 2𝑘. An integer n is said to be odd iff ∃ an integer k such that 𝑛 = 2𝑘 + 1. r is a
𝑎
rational number if ∃ integers a and b such that 𝑟 = 𝑏 , 𝑏 ≠ 0 𝑎𝑛𝑑 (𝑎, 𝑏) = 1.

If n and d are integers, then n is divisible by d iff 𝑛 = 𝑘𝑑 for some integer k. We say ‘d divides n’
𝑑
and write 𝑛.

Methods of Proof

1. Direct Proof

This method makes use of axioms or postulate i.e., statements assumed to be true. to proof a
conditional statement, 𝑝 → 𝑞, we assume that p is true and then proceed to show that q must also
be true.
Example

a. Show that if m and n are even numbers, then their sum is even

Solution

We assume that m and n are even i.e., 𝑚 = 2𝑘, 𝑛 = 2𝑙 for integers k and l. then 𝑚 + 𝑛 = 2𝑘 +
2𝑙 = 2(𝑘 + 𝑙); let 𝑘 + 𝑙 = 𝑠 which is an integer, then 𝑚 + 𝑛 = 2𝑠 hence even.

b. Give a direct proof of the theorem, ‘if n is odd, then 𝑛2 is also odd”

Proof

Suppose that n is odd; then 𝑛 = 2𝑘 + 1 for an integer k and

𝑛2 = (2𝑘 + 1)2
= 4𝑘 2 + 4𝑘 + 1
= 2(2𝑘 2 + 2𝑘) + 1

2𝑘 2 + 2𝑘 is an integer say s, then 𝑛2 = 2𝑠 + 1 an odd number.

Exercise

Proof that the sum of two odd numbers is even while the product is odd

2. Proof by Contradiction

We assume that the opposite of what we want to proof, show that the assumption leads to a
contradiction and then conclude that what was supposed to be proved must have been true.

Example

a. Prove that there is no integer which is both even and odd.

Solution

Suppose that there exists and integer n that is both even and odd, then

𝑛 = 2𝑘 𝑓𝑜𝑟 𝑘 ∈ ℤ and 𝑛 = 2𝑏 + 1 𝑓𝑜𝑟 𝑏 ∈ ℤ. The two must be equal i.e.,

2𝑘 = 2𝑏 + 1
2(𝑘 − 𝑏) = 1 since 𝑘, 𝑏 ∈ ℤ then 𝑘 − 𝑏 = 𝑐 ∈ ℤ ⇒ 2(𝑘 − 𝑏) = 2𝑐 = 1 i.e., 1 is even. This is a
contradiction since 1 is odd. Therefore, the assumption that n is both even and odd is false and
hence the theorem must be true.
b. Prove that √2 is irrational.

Proof
𝑎
Suppose that √2 is irrational, then √2 = 𝑏 where 𝑎, 𝑏 ∈ ℤ, 𝑏 ≠ 0 𝑎𝑛𝑑 (𝑎, 𝑏) = 1 i.e., a and b do
not have another divisor other than 1.

𝑎2
⇒ 𝑏2 = 2 ⇒ 𝑎2 = 2𝑏 2 i.e., 𝑎2 is even ⇒ 𝑎 is even ⟹ 𝑎 = 2𝑘 𝑎𝑛𝑑 𝑎2 = 4𝑘 2 ⇒ 2𝑏 2 =
4𝑘 2 𝑜𝑟 𝑏 2 = 2𝑘 2 ⇒ 𝑏 2 is even and b is even. i.e., both a and b are even a contradiction since
gcd(𝑎, 𝑏) = 1 and therefore √2 is irrational.

Exercise

Prove that √3, √5 are irrational

c. Give a proof by contradiction of the theorem; if 3𝑛 + 2 is odd, then n is odd.

Solution

Assume 3𝑛 + 2 is odd and that n is not odd so that n is even, then 𝑛 = 2𝑘 ∀ 𝑘 ∈ ℤ. It follows that
3𝑛 + 2 = 3(2𝑘) + 2 = 6𝑘 + 2 = 2(3𝑘 + 1) is even since it is a multiple of 2 and therefore not
odd. This is contradicting the assumption that 3𝑛 + 2 is odd.

d. Prove by contradiction that 𝑛2 + 3𝑛 + 2 is even.

3. Proof by Contrapositive/indirect proof

This method is used only for those statements that are universal and conditional. To prove by
contraposition;

i. Express the statement in the form ∀𝑥 𝑖𝑛 𝐷 if 𝑝(𝑥)𝑡ℎ𝑒𝑛 𝑞(𝑥).


ii. Rewrite the statement in contrapositive form; ∀𝑥 𝑖𝑛 𝐷, if q(x) is false then p(x) is false.
iii. Prove the contrapositive by direct proof

Example

a. Prove that if 𝑛2 is odd, then n is odd for every integer n

Solution

Statement: ∀ 𝑛 ∈ ℤ if 𝑛2 is odd, then n is odd

Contrapositive: ∀ 𝑛 ∈ ℤ if n is even, then 𝑛2 is even

Suppose n is even, then 𝑛 = 2𝑘 ∀ 𝑘 ∈ ℤ ⟹ 𝑛2 = (2𝑘)2 = 4𝑘 2 = 2(2𝑘 2 ) = 2𝑡 ⟹ 𝑛2 is even.


Therefore, if 𝑛2 is odd, n is odd.

b. Prove by contraposition that if 3𝑛 + 2 is odd, then n is odd

Statement: ∀ 𝑛 ∈ ℤ, if 3𝑛 + 2 is odd, then n is odd

Contrapositive: ∀ 𝑛 ∈ ℤ if n is even, then 3𝑛 + 2 is even

Suppose n is even, then

𝑛 = 2𝑘, ∀ 𝑘 ∈ ℤ ⟹ 3𝑛 + 2 = 3(2𝑘) + 2 = 6𝑘 + 2 = 3(2𝑘 + 1) thus 3𝑛 + 2 is even since it is


a multiple of 2 and not odd.

4. Proof by Induction

This method is used to prove the statements that assert that 𝑝(𝑛) is true for all positive integers n
where 𝑝(𝑛) is a propositional function (predicate) i.e., ∀ 𝑛, 𝑝(𝑛). A proof by this method has 2
main steps.

• Basic steps: We show that 𝑝(1) is true


• Inductive step: We show that for all positive integers k, if p(k) is true, then 𝑝(𝑘 + 1) is
true.

To complete the inductive step, we assume that p(k) is true for any arbitrary integer k and show
that under this assumption, 𝑝(𝑘 + 1) must be true i.e., 𝑝(𝑘) ⟶ 𝑝(𝑘 + 1) is true.

This rule can be stated as;

[𝑝(1) ∧ ∀ 𝑘 𝑝(𝑘) ⟶ 𝑝(𝑘 + 1)] ⟶ ∀ 𝑛 𝑝(𝑛) where the domain is ℤ.

Examples
𝑛(𝑛+1)
a. Show that if n is a positive integer, then 1 + 2 + 3 + ⋯ + 𝑛 = .
2

Solution
𝑛(𝑛+1)
Let p(n) be the proposition, “sum of first n positive integers is .” i.e., 𝑝(𝑛) ⟹ 1 + 2 + 3 +
2
𝑛(𝑛+1)
⋯+ 𝑛 = 2

1(1+1)
Then 𝑝(1) ⟹ 1 = = 1 is true.
2

Now, assume 𝑝(𝑘) is true for any arbitrary integer k and show that 𝑝(𝑘 + 1) is true.
𝑘(𝑘+1)
𝑝(𝑘) ⟹ 1 + 2 + 3 + ⋯ + 𝑘 = ……………(i)
2
Replacing k with k+1, we get

(𝑘+1)((𝑘+1)+1) (𝑘+1)(𝑘+2)
1 + 2 + 3 + ⋯+ 𝑘 + 1 = = ………………(ii)
2 2

Adding k+1 on both sides of (i) gives


𝑘(𝑘+1) (𝑘+1)(𝑘+2)
1 + 2 + 3 + ⋯ + 𝑘 + (𝑘 + 1) = +𝑘+1= ………..(iii)
2 2

The RHS of (ii) and (iii) are similar and therefore 𝑝(𝑘 + 1) is true. therefore p(n) is true for all
integers.

b. Prove that 1 + 3 + 5 + ⋯ + (2𝑛 − 1) = 𝑛2

Solution

Let 𝑝(𝑛) = 1 + 3 + 5 + ⋯ + (2𝑛 − 1) = 𝑛2

𝑝(1) = 1 = 12 is true.

Suppose 𝑝(𝑘) = 1 + 3 + 5 + ⋯ + (2𝑘 − 1) = 𝑘 2 is true, then

𝑝(𝑘 + 1) = 1 + 3 + 5 + ⋯ + (2(𝑘 + 1) − 1) = (𝑘 + 1)2

Adding 2𝑘 + 1 on both sides of 𝑝(𝑘) we get, 1 + 3 + 5 + ⋯ + (2𝑘 − 1) + 2𝑘 + 1 = 𝑘 2 +


(2𝑘 + 1) = (𝑘 + 1)2

The RHS of the above two statements are similar and therefore 𝑝(𝑘 + 1) is true. since 𝑝(1) is true
and 𝑝(𝑘) → 𝑝(𝑘 + 1) is true, then by induction, p(n) is true ∀ 𝑛 ∈ ℤ.

c. Use mathematical induction to show that 1 + 2 + 22 + 23 + ⋯ + 2𝑛 = 2𝑛+1 − 1 ∀ 𝑛 ∈


ℤ, 𝑛 > 0

Solution

Let 𝑝(𝑛) = 1 + 2 + 22 + 23 + ⋯ + 2𝑛 = 2𝑛+1 − 1

𝑝(0) is true since 20 = 20+1 − 1 = 1

Suppose 𝑝(𝑘) = 1 + 2 + 22 + 23 + ⋯ + 2𝑘 = 2𝑘+1 − 1 is true, replace k with k+1 having

𝑝(𝑘 + 1) = 1 + 2 + 22 + 23 + ⋯ + 2𝑘+1 = 2𝑘+1+1 − 1 = 2𝑘+2 − 1…………. (*) must be true

Adding 2𝑘+1 on both sides of p(k) gives

1 + 2 + 22 + 23 + ⋯ + 2𝑘 + 2𝑘+1 = 2𝑘+1 − 1 + 2𝑘+1 = 2𝑘+2 − 1………….. (**)


The RHS of (*) and (**) are similar and therefore 𝑝(𝑘 + 1) is true. if 𝑝(0) is true and 𝑝(𝑘) →
𝑝(𝑘 + 1) is true, then by induction 1 + 2 + 22 + 23 + ⋯ + 2𝑛 = 2𝑛+1 − 1 ∀𝑛, 𝑛 > 0, 𝑛 ∈ ℤ.

d. Prove that ∀ 𝑛 ∈ ℕ, 𝑛3 − 𝑛 is divisible by 3.

Solution
3
Let 𝑝(𝑛): 3⁄𝑛3 − 𝑛. By division algorithm, 𝑝(0) = 0 which is true since 0 = 3 × 0

Let 𝑝(𝑘): 3⁄𝑘 3 − 𝑘 be true, then 𝑘 3 − 𝑘 = 3𝑟 for some 𝑟 ∈ ℤ

𝑝(𝑘 + 1): 3⁄(𝑘 + 1)3 − (𝑘 + 1) ⟹ (𝑘 + 1)3 − (𝑘 + 1) = 3𝑚 𝑚 ∈ ℤ


⟹ 𝑘 3 + 3𝑘 2 + 3𝑘 + 1 − 𝑘 − 1 = 3𝑚
𝑘 3 − 𝑘 + 3𝑘 2 + 3𝑘 = 3𝑚 𝑏𝑢𝑡 𝑘 3 − 𝑘 = 3𝑟
⟹ 3𝑟 + 3𝑘 2 + 3𝑘 = 3(𝑟 + 𝑘 2 + 𝑘), 𝑘, 𝑟 ∈ ℤ
= 3𝑚, {𝑚 ∈ ℤ = 𝑟 + 𝑘 2 + 𝑘}

e. Use mathematical induction to prove that 2𝑛 < 𝑛! for every positive integer 𝑛 ≥ 4.

Solution

Let 𝑝(𝑛) = 2𝑛 < 𝑛!

𝑝(4) = 24 < 4!
16 < 24 true

Suppose p(k) is true for positive integer 𝑘 ≥ 4

Let 𝑝(𝑘) = 2𝑘 < 4! Be true. we show that 𝑝(𝑘 + 1): 2𝑘+1 < (𝑘 + 1)!

Now

2𝑘+1 = 2𝑘 ∙ 2 by definition of exponent.

< 2 ∙ 𝑘! By inductive hypothesis

< (𝑘 + 1)𝑘! Since 2 < 𝑘 + 1 ∀𝑘 ≥ 4

Hence 𝑝(𝑘 + 1) is true when 𝑝(𝑘) is true.

Therefore, by mathematical induction, 2𝑛 < 𝑛! ∀ integers 𝑛 ≥ 4.

f. For all integers 𝑛 ≥ 3, 2𝑛 + 1 < 2𝑛 . Prove.

Let 𝑝(𝑛): 2𝑛 + 1 < 2𝑛 ∀ 𝑛 ≥ 3, 𝑛 ∈ ℤ


𝑝(3) = 23 + 1 < 23
7 < 8 true

Now suppose 𝑝(𝑛) is true when an integer 𝑘 ≥ 3 is substituted for n i.e.,

𝑝(𝑘) = 2𝑘 + 1 < 2𝑘 , 𝑘 ≥ 3

We must show that 2𝑛 + 1 < 2𝑛 is true for 𝑛 = 𝑘 + 1 i.e., 2(𝑘 + 1) + 1 < 2(𝑘+1) 𝑜𝑟 2𝑘 + 3 <
2(𝑘+1) .

Now,

2𝑘 + 3 = (2𝑘 + 1) + 2 by algebra

< 2𝑘 + 2 by inductive hypothesis

< 2𝑘 + 2𝑘 since 2 < 2𝑘 ∀ 𝑘 ≥ 2

< 2(2𝑘 )

< 2𝑘+1 by law of exponents

Therefore, by induction 2𝑛 + 1 < 2𝑛 ∀ 𝑛 ≥ 3, 𝑛 ∈ ℤ

Exercise

Use mathematical induction to prove the following;

a. 22𝑛−1 is dividible by 3 ∀ 𝑛 ≥ 1
𝑛(𝑛+1)(2𝑛+1)
b. 1 + 22 + 32 + ⋯ + 𝑛2 = 6
c. 2 + 4 + 6 + 8 + ⋯ + 2𝑛 = 𝑛(𝑛 + 1)
d. 𝑛3 − 𝑛 is divisible by 6 for each integer 𝑛 ≥ 2
e. 2𝑛 < (𝑛 + 2)! ∀ 𝑛 ≥ 0, 𝑛 ∈ ℤ

You might also like