Sta
Sta
There are three (3) Modules and eight (8) Units in this course:
We will take a few examples of mathematical statements to illustrate what a proper communication
in mathematics is all about.
Statement Definitions
A statement is a declarative sentence that is either true or false. A statement is said to be an Atomic
Statement if it cannot be divided into smaller statements, else it is termed a Molecular Statement
Example
These statements are examples of atomic statements:
Mobile numbers in Nigeria have 11 digits.
5 is larger than 7.
12 is a perfect square.
Every even number that is greater than 2 can be expressed as the sum of two prime numbers.
However, these examples are not statements:
Would you like some ice cream?
The product of two numbers.
1 + 3 + 5 + 7 + · · · + 2n + 1.
Go to the lecture room!
4 + x = 15
This sentence “4 + x = 15” is clearly not a statement. This is because it contains an unknown
variable, x. The sentence is either true or false, depending on the value of x. However, at the
moment, it is neither true nor false. We can also build a complicated (molecular) sentence by
combining more than one or more simple atomic or molecular sentences by using Logical
Connectives. An example of a molecular statement is:
Mobile numbers in Nigeria have 11 digits and 5 is larger than 7.
This example of a molecular statement can also be broken down into smaller statements which were
only connected by an “and”. Obviously, molecular statements are also statements, therefore, they
must be either true or false. The five connectives we can consider are “and”, “or”, “if… then”, “if
and only if”, and “not.
“and” - I am a boy and my sister is a girl.
“if… then” - If you register then you can write the exam.
“if and only if”- You can register if and only if you were admitted.
“not - You are not admitted.
The connectives, “and”, “or”, “if… then”, “if and only if”, connects two statements and are called
binary connectives while the connective “not” applies to only a single sentence and is called a
unary connective.
In order to determine the truth values of molecular statements, the key observation to make is to
completely determine what the truth values of the parts are and the type of connective(s). We do not
necessarily have to know what the individual parts actually say, we however, only need to know
whether those parts are true or false. Therefore, in order to analyse logical connectives, we use
propositional variables (also called sentential variables) which are the characters found in the
middle of the English alphabets represented in capital: P, Q, R, S, … to represent each atomic
statements in the molecular statement. These variables can only have two values, true or false. The
logical connectives: “and”, “or”, “if… then”, “if and only if”, and “not” can be represented by these
symbols ∧, ∨, →, ↔, and ¬ respectively.
Logical Connectives
• P ∧ Q means “P and Q,” and it is termed a conjunction.
• P ∨ Q means “P or Q,” and it is termed a disjunction.
• P → Q means “if P then Q,” and it is termed an implication or conditional.
• P ↔ Q means “P if and only if Q,” and it is termed a bi-conditional.
• ¬P means “not P,” and it is called a negation.
The truth (T) value of a statement is determined by the truth value(s) of its part(s), depending on
the connectives:
Truth Conditions for Connectives.
• P ∧ Q is true whenever P and Q are both true.
• P ∨ Q is true whenever P or Q or both are true.
• P → Q is true whenever P is false or Q is true or both true.
• P ↔ Q is true whenever P and Q are both false, or both true.
• ¬P is true whenever P is false and vice versa.
SETS
Sets are the most fundamental objects in all of mathematics.
Definition of Set: An informal definition of set is that a set is an unordered collections of objects.
These objects comprise of the set are termed elements. The number of objects in a set can be finite
or infinite.
Notations
A single set, A can be expressed with the following notations:
A = {1, 2}; A = {2, 1}; A = {1, 2, 1, 2}; A = {a: a is an integer, 1 ≤ a < 3}
The notation, A = {1, 3} is read as, “A is the set containing the elements 1 and 3.”
The curly braces “{ }” is used to enclose the elements of the set and the comma “,” is used to separate
the elements inside the braces.
The symbol “:” or “”),, implies “such that”. Therefore, the notation, {a: a is an integer, 1 ≤ a <
3} is read as “the set of all a such that a is an integer between 1 and 3 (1 inclusive and 3
exclusive)”.
Considering the notation: 5 ∈ {1, 2, 5}
The symbol “∈” implies “is in” or “is an element of.” Therefore, the notation is read as 5 is an
element of a set containing 1,2, and 5. This is a true statement. We can also write another true
statement if we say that 3 “is not” an element of the set containing 1,2, and 5. This can be written
as: 3 ∉ {1, 2, 5}
Some other notations
2
CIT206 MODULE 1
U: A fixed set which contains all other sets under investigation is called universal set. In other
words, all other sets under investigation are subsets of the universal set and it is denoted by U.
Example: Considering population of humans, the universal set consist of every person in the world.
Operations on Sets
∪: A ∪ B is the union of A and B: is the set containing all elements which are elements of A or B
or both. If A is {1, 2, 4, 5}, B is {2, 3, 4}. Then A ∪ B = {1, 2, 3, 4, 5}
∩: A ∩ B is the intersection of A and B: the set containing all elements which are elements
of both A and B.
If A is {1, 2, 4, 5}, B is {2, 3, 4}. Then A ∩ B = {2, 4}
\: A \ B is A minus B. That is the set containing all elements of A excluding all elements of B that
appears in A.
Let A = {1, 2, 4, 5, 6}, B = {2, 3, 4}. Then A \ B = {1, 5, 6} and B/A = {3}.
Ac or –𝐴: The complement of A is the set of everything that is not an element of A.
Let the universal set, U be {1, 2, . . ., 9, 10}, A = {2, 3, 4}. Then Ac =
{1, 5, 6, …, 9, 10}.
|A|: The cardinality or size of a set, A is the number of elements that exists in A.
|{1, 2, 3}| = |{a, b, c}| = |{1,{1, 2}, 5}| = |{1, 2, ∅}| = 3.
×: A × B is the Cartesian product of two non-empty sets A and B is the set of all the ordered
pairs (a, b) with a ∈ A and b ∈ B.
Let A be a set. A × A is the set of ordered pairs (x, y) x, y ∈ A.
The expression A × A × · · · × A (n times) can also be denoted as An which is the set of all
ordered subsets (with repetitions) of A of size n.
Examples
i. {0, 1}n the set of all “strings” of 0 and 1 of length n.
ii. Let A = {1, 2}, B = {3, 4, 5}. Then A × B = {(1, 3), (1, 4), (1, 5), (2, 3), (2, 4), (2, 5)}.
Example
Prove that if A × B = B × A, then A = B.
Solution
Proof: Let’s take A × B = B × A. This implies that A ⊆ B and B ⊆ A. Therefore, A = B.
Rules of Set Theory
Let A, B and C be sets.
i. Commutative Law: (A ∪ B) = (B ∪ A) and (A ∩ B) = (B ∩ A).
ii. Associative Law: (A ∪ (B ∪ C)) = ((A ∪ B) ∪ C) and (A ∩ (B ∩ C)) = ((A ∩ B) ∩ C).
iii. Distributive Law: (A ∪ (B ∩ C)) = (A ∪ B) ∩ (A ∪ C) and (A ∩ (B ∪ C)) = (A ∩ B)
∪ (A ∩ C).
iv. De Morgan’s Law: (A ∪ B)C = (Ac ∩ Bc) and (A ∩ B)C = (Ac ∪ Bc)3
CIT206 DISCRETE STRUCTURES
Disjoint Set
Sets X and Y are called disjoint sets, if they contain no common elements, that is, no element of X
is in Y and no element of Y is also in X.
Example 3.2.5.1:
i. Given 𝑋 = {1,2,3} and 𝑌 = {4,5,6}, then 𝑋 and 𝑌 are disjoint sets.
ii. If 𝐴 = {𝑏, 𝑐, 𝑑} and 𝐵 = {𝑑, 𝑒, 𝑔}, then 𝐴 and 𝐵 are not disjoint sets, since 𝑑 is in both
sets.
Power Set
The power set of A is the set of all subsets of A, and it is represented as P(A)
Example Find P(A), if A = {1, 2, 3}.
Solution By definition of power set,
P(A) = {∅, {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, {1, 2, 3}}.
Note: The power set of any set is normally, 2n, where n is the cardinality of the set A. Therefore,
since the cardinality of A in Example is 3, the cardinality of the power set of A, |P(A)| = 23 = 8.
Note: Although 1 ∈ A, it will be wrong to say that 1 ∈ P(A) because there are no elements of P(A)
that are numbers. However, we can say that {1} ∈ P(A) because {1} ⊆ A.
We can relate the symbols of union and intersect to resemble the logic symbols of “or” and “and”.
Remember that the statement x ∈ A ∪ B is read as x is an element of either A or B. Therefore,
x ∈ A ∪ B ↔ x ∈ A ∨ x ∈ B. Similarly,
x ∈ A ∩ B ↔ x ∈ A ∧ x ∈ B. Also,
x ∉ A ↔ ¬(x ∈ A).
Example
Let A = {2, 4, 6}, B = {1, 2, 3, 4, 5, 6}, C = {1, 2, 3}, D = {1, 3, {4, 5}, x}, and E = {7, 8, 9}.
Determine each statement to be either a true, false, or meaningless statement.
i. A ⊂ B. ii. B ⊂ A. iii. A ∈ C. iv. ∅ ∈ B. v. ∅ ⊂ A.
vi. A < E. vii. 2 ∈ C. viii. x ⊂ D. ix. {9} ⊂ P(E).
Solution
i. True. All the elements in A are also elements in B.
ii. False. 1 ∈ B but 1 ∉ A.
iii. False. set C contains the elements 1, 2, and 3. The set A is not equal to 1, 2, or 3.
iv. False. B contains exactly 6 elements with none been an empty set.
v. True. An empty set is a subset of every set, therefore, it is a subset of A.
vi. Meaningless. This is because a set cannot be bigger than or lesser than another set.
vii. True. 2 is an elements of C.
viii. Meaningless. Since x is not a set, it therefore cannot be a subset of another set.
ix. True. {9} is an element of P(E).
4
CIT206 MODULE 1
Venn Diagrams
A Venn Diagram is a great tool used to visualize and represent operations on sets. It is used to
display sets as intersecting circles. Therefore, we can highlight a region under consideration when
we carry out an operation. The cardinality of a set can be represented by putting numbers in the
corresponding area.
Relations
Definition : A relation on a single set B is a subset of B × B. A relation on two sets B and C is a
subset of B × C. Now, let’s consider relationships among sets. For example, we can say that X is
married to Y and they both have a child, Z. In our daily lives, we deal a lot with talks about
relationships. For example, if we consider two human beings (B, C), “taller-than”, “smarter-than”
are relations between them. That is (B, C) ∈ “taller-than” if the person B is taller than the person
C. “≥” is a relation on ℝ. “≥” = {(b, c) | b, c ∈ ℝ, b ≥ c}.
Definition: A relation R on a set S is:
i. Reflexive: if ∀ x ∈ S, (x, x) ∈ R. (∀ means for all) – {1, 2}=(1, 1), (2, 2)
ii. Symmetric: if ∀ x, y ∈ S, whenever (x, y) ∈ R, (y, x) ∈ R. a=b and b=a if all are true.
iii. Transitive: if ∀ x, y, z ∈ S, whenever (x, y) ∈ R and (y, z) ∈ R, then (x, z) ∈ R.
Example
i. “≤” is reflexive, however, “<” is not.
ii. “sibling-of” is symmetric, however, “≤” and “sister-of” are not.
iii. “sibling-of”, “≤”, and “<” are both transitive, however, “parent- of” is not (nevertheless,
“ancestor-of” is transitive). a=b, b=c, then a=c.
An Equivalence relation is a relation that is reflexive, symmetric and transitive and it is
denoted by the symbol “≡”.
For the set S, let “≡” be its equivalence relation. An equivalence class is a maximal subset E of
the set S, such that any two elements in the set E is related. There can be multiple
equivalence class corresponding to the relation ≡.
5
CIT206 DISCRETE STRUCTURES
TUTOR-MARKED ASSIGNMENTS
1. Describe the following sets in words and determine their elements.
a. {x | x + 2 ∈ ℕ}.
b. {x | x + 2 ∈ ℕ+}.
c. {x ∈ ℕ | x + 2 ∈ ℕ}.
d. {x | x ∈ ℕ ∨ −x ∈ ℕ}.
e. {x | x ∈ ℕ ∧ −x ∈ ℕ}.
2. Let A = {7, 1, 2, 3, 6}, B = {2, 3, 4}, C = {1, 6, 7} and D = {5, 8,
4, 9} be subsets of U = {n ℕ : 1 ≤ n ≤10}.
a. Find the following;
i. A ⋃ C ii. (A ⋂ Dc) ⋃ (A ⋂ B)c iii. ∅ ⋃ B iv. (A ⋃ B)c
b. Represent the sets in 2a above by the use of a Venn Diagram.
3. Using a Venn Diagram, determine if the representation A \ B is equivalent to A ∩ B¯.
4. Using the sets W = {2, a, {u, v, w}, ∅}, X = {∅, a}, Y = {1, 2, 4} and Z = {2, 4, 8}. Determine
if the following statements are true, false or meaningless. State your reasons for each.
i. w A ii. B A iii. D > C iv. {2, a} A
j. Find the cardinality of each set below (show cardinality check):
i. A = {23, 24, . . . , 37, 38}
i. B = {1, {2, 3, 4}, 5, ∅}
ii. P(K L) K = {n ℕ : n ≤ 19} and L = { n ℕ : n is prime}
iii. P(C) C = {a, b, c, d}
k. Let A = {1, 2, 3}, B = {4, 5, 6, 7}. Find B × A.
l. If |A| = 5 and |B| = 8 and |A ∪ B| = 11 what is the size of A ∩ B?
m. If |Ac ∩ B| = 10 and |A ∩ Bc | = 8 and |A ∩ B| = 5 then how many elements are there is A ∪
B?
6
CIT206 MODULE 1
INTRODUCTION
Mathematical Induction is an elegant and powerful technique that is used to prove some types of
mathematical statements and propositions which assert that for all positive integers something is
true. There are different types of mathematical proofs. However, in this unit, we will introduce
several basic types, with more emphasis on the proof by induction technique. This technique is
invaluable to the study of discrete mathematics.
Proofs by Induction
The initial step
Firstly, let’s prove that for n = 1 the statement is true. Therefore, if the claim is that the statement
is true for n ≥ a, first prove it for n = a.
Inductive step
Prove that if for n = k the proposition (statement) is true, then for n = k + 1 it must also be true. This
is the difficult step and we will carefully explain it by breaking it down into steps.
Step 1: Here we perform Inductive Hypothesis by writing down what the proposition asserts for
the case n = k.
Step 2: Now, describe what the proposition asserts for the case n = k + 1. Clearly remember that
this is the case that you need to prove.
Step 3: By using the assumption made in Step 1, try and prove the statement in Step 2. Have in
mind that this stage varies for most problems depending on their mathematical contents, therefore,
there is no single way to solve all problems. The main aim here is to apply your skills and determine
how you get from Step1 to Step2.
After the initial and inductive steps have been successfully performed, we then conclude
instantly that the proposition is true ∀ n ≥ 1.
7
CIT206 DISCRETE STRUCTURES
Example 3.3.1. For the first n positive integers, the sum is 1n(n + 1).
2
Initial step: The sum is clearly1, if n = 1, For n = 1,
1
n (n + 1) = 1× 1 × 2 = 1.
2 2
Therefore, this is true for n = 1.
Inductive step:
Step 1: Our assumption (the inductive hypothesis) states that
Step 3: Now we have to ask ourselves how we can get to step 2 from step 1.
To answer this, we will take the left-hand sides of both step 2 and step 1 by adding (k + 1) to
step 1.
Therefore, 1+2+3+ ··· + (k + 1) = 1 + 2 + 3 + ··· + k + (k + 1)
1
= k(k + 1) + (k + 1) [using the inductive hypothesis]
2
= (k + 1)( 1k + 1) [factorizing]
2
Step 1: Let’s consider the proposition F(1). The sum 1 + 2 = 3 is odd because we can demonstrate
there exists an integer k such that 2k + 1 =
3. That is, 2(1) + 1 = 3. Thus, F(x) is true when x = 1.
Step 2: Assume that F(x) is true for some x. Thus, for some x we have that x + (x + 1) is odd. We
add one to both x and x + 1 which gives the sum (x+1) + (x+2). We can make claim to two things:
firstly, the sum (x+1) + (x+2) = F(x+1). Secondly, we claim that the addition of two (2) to any
integer does not change the evenness or oddness of that integer (e.g., 1 + 2 = 3, 2 + 2 = 4). With
these two observations we claim that F(x) is odd implies F(x + 1) is odd.
Step 3: By the principle of mathematical induction, we thus claim that F(x) is odd ∀ integers x.
Thus, the sum of any two consecutive numbers is odd.
Indirect Proofs
Proof by Contrapositive
This proof starts by assuming that the conclusion Y is false, and through a series of logical steps
deduce that the premise X must also be false.
8
CIT206 MODULE 1
Based on first-order logic we can make a statement such as P → Q is equivalent to ¬Q → ¬P. Steps
to proving a theorem by contrapositive:
a. Assume ¬Q is true.
b. Demonstrate that ¬P must be true.
c. By contraposition, you will deduce that P → Q.
Proof by Contradiction
This form of proof tries to reach a logical fallacy by assuming that the premise X is true and the
conclusion Y is false.
Steps involved to applying the proof by contradiction:
a. Assume P is true.
b. Assume Q is false (¬Q is true).
c. Demonstrate a contradiction.
Example 3.4.2.1 Let’s apply this form of proof to example 3.4.1.1
Solution 3.4.2.1
Assume that n2 is even, but n is odd. From solution 3.2.1, we observe that n2 must be odd.
However, n2 cannot be both even and odd at the same time.
TUTOR-MARKED ASSIGNMENT
1. Prove the following:
a. √ 2 is irrational.
b. Let a, b ∈ ℝ+ (non-negative reals). Then, a + b
2
≥ √ ab.
2. Prove that ∀ n ∈ ℕ, ∑𝑛 𝑛+1 − 1. (Use the proof by
𝑘=0 2 = 2
𝑘
induction).
3. Prove that 7n − 1 is a multiple of 6,∀ n ∈ ℕ.
4. Prove that 1 + 3 + 5 + · · · + (2n − 1) = n2,∀ n ≥ 1.
5. Prove that F0 + F2 + F4 + · · · + F2n = F2n+1 – 1. Where Fn is the nth Fibonacci number.
9
CIT206 DISCRETE STRUCTURES
UNIT 3 LOGIC
INTRODUCTION
Logic is a study of mathematics that deals with mathematic reasoning and proofs. This unit covers
logic in some of its basic forms. In the propositional logic, we will discuss the logical connectives
for example “and”, “or”, and “not”. In the first-order logic, we will discuss the reasoning tools. It
contains predicates, quantifiers and variables.
Propositional Logic
Logic is the study of consequences. Given some mathematical statements, we would like to derive
some conclusions from them. For instance, we can say the statement: “Abuja is the capital of
Nigeria” is True and that the statement: “December in a month in the summer” is False. This kind
of statements are called propositions because they are either true or false. The truth or falsehood of
a proposition is called its truth value.
As stated earlier, propositional variables which are the characters (P, Q, R, S, …) found in the middle
of the English alphabet represented in capital and used to represent each atomic statements in the
molecular statement. These variables can only have two values, true or false. The logical
connectives: “and”, “or”, “if… then”, “if and only if ( or if)”, and “not” represented by these symbols
, , →, ↔, and ¬ respectively. The atomic statements: “It is raining” and “I need an umbrella”
can be represented by the letters P and Q respectively.
P Q ¬P ¬P ∨ Q
T T F T
T F F F
F T T T
F F T T
Example 3.1.2. Using truth table, analyse the statement, “if you get more doubles than any other
player you will lose, or that if you lose you must have bought the most properties,”.
Solution 3.1.2. Let’s start by breaking down the molecular statement into atomic statements. Let P
be the statement “you get more doubles than any other player,”; Q be the statement “you will lose,”
and R be the statement “you must have bought the most properties.” Now let’s construct a truth
table to represent the statement as this symbol (P → Q) ∨ (Q → R).
Since there are three atomic statements, we need to develop a truth table of 8 rows. This helps to
take account for every possible combination of truth values among the atomic statements. Here is
the full truth table:
10
CIT206 MODULE 1
P Q R (P → Q) (Q → R) (P → Q) ∨ (Q → R)
T T T T T T
T T F T F T
T F T F T T
T F F F T T
F T T T T T
F T F T F T
F F T T T T
F F F T T T
This is a true statement about monopoly, such that it is irrelevant to the number of properties you
own, the number of doubles you roll, whether you win or lose, the outcome is true for all 8 possible
combinations.
Logical Equivalence
Consider two molecular statements P and Q. They will be logically equivalent as long as P is true
exactly when Q is also true. This implies that for any assignment of truth values to the distinct
atomic parts P and Q they have the same truth value. Then we symbolize it as P ≡ Q. A truth table
can be used to verify that two or more statements are logically equivalent. You then have to check
if the columns for the statements are identical.
Example 3.1.3. Determine if the statements ¬P ∨ Q and P → Q are logically equivalent.
Solution 3.1.3. Let us start by making the truth table for these statements. Check example 3.1.1 and
our first truth table.
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
Since the atomic parts of ¬P ∨ Q and P → Q either both true or both false for whatever values of P
and Q. We therefore say that ¬P ∨ Q is logically equivalent to P → Q.
Exercise 3.1.4. Use a truth table to determine whether ¬(P∨Q) is logically equivalent to
¬P ∧ ¬Q.
Solution 3.1.4. Try it yourself in class.
The solution to exercise 3.1.4 will show that both statements are logically equivalent. It also shows
that we can distribute a negation over a disjunction (“or”). Likewise, the distribution of negation
over a conjunction (“and”) is also possible.
De Morgan’s Laws
1. ¬(P ∧ Q) and ¬P ∨ ¬Q are logically equivalent
2. ¬(P ∨ Q) and ¬P ∧ ¬Q are logically equivalent
Example 3.1.5. Without truth table, prove that ¬(P → Q) is logically equivalent P ∧ ¬Q.
Solution 3.1.5. Let’s select one of the statements and through a series of logically equivalent
statements transform it into the other.
11
CIT206 DISCRETE STRUCTURES
we get
negation we get
P ∧ ¬Q.
Deduction Rule
An argument is said to be valid as long as the conclusion is true when the premises are true. This
means that whenever the premises are true, the conclusion must be true for the argument to be
a valid deduction rule, else it is invalid.
P Q
Example 3.1.6. Determine if the argument P is a valid deduction
Q
rule.
P Q P→Q
T T T
T F F
F T T
F F T
Our premises are P → Q and P. From the truth table we can obverse that in row 1 where both of
the premises are true, our condition Q is also true. Therefore this implies that the argument is a
valid deduction rule.
PQ
¬P∨Q is a valid deduction
Q
Exercise 3.1.6. Determine if the argument rule.
Solution 3.1.6.
Try it yourself in class.
12
CIT206 MODULE 1
rule.
Solution 3.1.7.
However, the conclusion P ∨ Q is not always true when the premises are all true as seen in row 7.
Hence this is not a valid deduction rule.
Adam is a man.
Therefore, Adam is a mammal.
In first order logic, this argument can be interpreted as:
∀x, Man(x) → Mammal(x) Man (Adam)
Mammal (Adam)
TUTOR-MARKED ASSIGNMENT
1. Consider this statement about an event. “If it’s your birthday or there will be cake, then
there will be cake.”
a. Translate the statement into logical expressions. Clearly state the atomic statements, P, Q,
etc.
b. Develop the truth table.
c. Suppose that the statement is true, can you conclude if there will be cake?
d. Suppose that the statement is true, can you conclude if there will not be cake?
e. Assume you confirm the statement to be false. What can you conclude about it?
13
CIT206 DISCRETE STRUCTURES
14
CIT206 MODULE 3
INTRODUCTION
In this unit, you will acquire the skills to distinguish a partially ordered set, in which there exists a
least upper bound and greatest lower bound between a pair of elements. To achieve this, you will
learn from this unit, the types of relations and Boolean algebra.
We normally represent a ≼ b to mean (a, b) ∈ P except some symbols are naturally associated with
a particular partial order, such as a ≼ b for integers a and b, or A ⊂ B with sets A and B. The set
X along with a partial order ≼ is called a partially ordered set, or poset.
A partially ordered set (L, ≼) is termed a lattice if for every pair of elements, a, b ∈ L ∃ a
Least Upper Bound (LUB) or Supremum and a Greatest Lower Bound (GLB) or Infimum. Take
Y to be a subset of the poset X. Let u ∈ X be an upper bound of Y if a ≼ u ∀ a ∈ Y. If u is
an upper bound of Y such that u ≼ v for every other upper bound v of Y, then u is the LUB of Y.
Also an element l ∈ X is said to be a lower bound of Y if l ≼ a ∀ a ∈ Y. If l is a lower bound o f
Y such that k ≼ l for every other lower bound k of Y, then l is the GLB of Y.
The least upper bound is also referred to as the join of a and b, represented by a ∨ b. The greatest
lower bound is also referred to as the meet of a and b, represented by a ∧ b.
If (L, ≼) is a lattice and a, b, c, d ∈ L, then the meet and join have the following order properties:
i. a ∧ b ≼ {a, b} ≼ a ∨ b,
ii. a ≼ b if and only if a ∧ b = a,
iii. a ≼ b if and only if a ∨ b = a,
iv. if a ≼ b, then a ∧ c ≼ b ∧ c and a ∨ c ≼ b ∨∧ c
v. if a ≼ b and c ≼ d, then a ∧ c ≼ b ∧ d and a ∨ c ≼ b ∨ d
Therefore, by the definitions of LUB and GLB, this implies that if the join and meet exist, they are
unique.
Example 3.1.1 The set of integers (or rational, or real) is a poset where a ≤ b has the usual meaning
for two integers a, b ∈ ℤ.
Example 3.1.2 Take X be a set of any kind. Then, the power set of X, P(X) is the set of all subsets
of X. For example, let X = {a, b, c}.
Then P(X) = P({a, b, c}) = {∅, {a}, {b}, {c}, {a, b}, {a, c}, {b, c}, {a, b, c}}
In the power set of a set, the set inclusion, ⊂, is a partial order. This order on {a, b, c} can be
represented through a diagram as in Figure 3.1.
15
CIT206 DISCRETE STRUCTURES
Example 3.3 For a group, G, the set of subgroups of G is a poset, where the partial order is set
inclusion.
Example 3.4 A set can have more than one partial order. A partial order on ℕ can be formed by
a ≼ b if a | b. This relation is reflexive since a | a ∀ a ∈ N. The relation is antisymmetric also,
if m | n and n | m, then m = n. Additionally, the relation is transitive, because if m | n and n
| p, then m | p.
Example 3.5 Take X = {1, 2, 3, 4, 6, 8, 12, 24} to be the set of divisors of 24 with a partial
order as defined in Example 3.4. The partial order on X is represented in Figure 3.2.
Example 3.6 If Y = {2, 3, 4, 6} is contained in the set X in Example 3.5. Then the upper bounds of
Y are 12 and, 24. The LUB of Y is 12. Y has only one lower bound which is 1; therefore, it is also
the GLB.
Theorem 3.1 Let Y be a nonempty subset of a poset X. If Y has a least upper bound, then Y has a
unique least upper bound. If Y has a greatest lower bound, then Y has a unique greatest lower bound.
Proof: We can possibly define binary operations on many posets through the greatest lower bound
and the least upper bound of two elements. A poset L such that every pair of elements in L has a
least upper bound and a greatest lower bound.
Example 3.7 Let X be a set. Then the power set of X, P(X). For two sets A and B in P(X), the least
upper bound of A and B is A ∪ B. Certainly A ∪ B is an upper bound of A and B, since A ⊂
A ∪ B and B ⊂ A ∪ B. If C is some other set containing both A and B, then C must contain
A ∪ B; hence, A ∪ B is the least upper bound of A and B. Similarly, the greatest lower bound
of A and B is A ∩ B.
Axiom 3.1 Principle of Duality: Any statement that is true for all lattices remains true when ≼ is
replaced by ≽ and ∨ and ∧ are interchanged throughout the statement.
Theorem 3.2 If L is a lattice, then the binary operations ∨ and ∧ satisfy the following properties for
x, y, z ∈ L.
16
CIT206 MODULE 3
iii. The join of x and x is the least upper bound of {x}; hence, x ∨ x = x.
iv. Let a = x ∧ y. Then x ≼ x ∨ a. On the other hand, a = x ∧ y ≼ x, and so x ∨ a ≼ x. Therefore,
x ∨ (x ∧ y) = x.
Given any arbitrary set L with operations ∨ and ∧, satisfying the conditions of the previous
theorem, it is natural to ask whether or not this set comes from some lattice. The following theorem
says that this is always the case.
Theorem 3.3 Let L be a nonempty set with two binary operations ∨ and ∧ satisfying the
commutative, associative, idempotent, and absorption laws. We can define a partial order on L by a
≼ b if a ∨ b
= b. Furthermore, L is a lattice with respect to ≼ if ∀ a, b ∈ L, we define the least upper bound and
greatest lower bound of a and b by a ∨ b and a
∧ b, respectively.
Proof
Firstly, let’s show that L is a poset under ≼. Since a ∨ a = a, a ≼ a and ≼ is reflexive. To
show that ≼ is antisymmetric, let a ≼ b and b ≼ a, Then a ∨ b = b and b ∨ a = a. By the
commutative law, b = a ∨ b = b ∨ a = a. Finally, we must show that ≼ is transitive. Let a ≼ b
and b ≼ c. Then a ∨ b = b and b ∨ c = c. Thus,
a ∨ c = a ∨ (b ∨ c) = (a ∨ b) ∨ c = b ∨ c = c, or a ≼ c.
Now, to show that L is a lattice, we need to prove that a ∨ b and a ∧ b are, respectively, the
l e a s t upper and greatest lower bounds of a and b. Since a = (a ∨ b) ∧ a = a ∧ (a ∨ b), it
follows that a ≼ a ∨ a. Similarly, b ≼ a ∨ b. Therefore, a ∨ b is an upper bound for a and b.
Let u be any other upper bound of both a and b. Then a ≼ u and b ≼ u.
But a ∨ b ≼ u since (a ∨ b) ∨ u = a ∨ (b ∨ u) = a ∨ u = u.
Boolean Algebras
Let us investigate the example of the power set, P(X), of a set X more closely. The power set is a
lattice that is ordered by inclusion. By the definition of the power set, the largest element in P(X) is
X itself and the smallest element is ∅, the empty set. For any set A in P(X), we know that A ∩
X = A and A ∪ ∅ = A. This suggests the following definition for lattices. An element I in a poset
X is a largest element if a ≼ I ∀ a ∈
X. An element O is a smallest element of X if O ≼ a ∀ a ∈ X.
for A, B, C ∈ P(X). We will say that a lattice L is distributive if the following distributive law holds:
a ∧ (b ∨ c) = (a ∧ b) ∨ (a ∧ c)
∀ a, b, c ∈ L.
∀ a, b, c ∈ L.
Proof
Let us assume that L is a distributive lattice.
a ∨ (b ∧ c) = [a ∨ (a ∧ c)] ∨ (b ∧ c)
= a ∨ [(a ∧ c) ∨ (b ∧ c)]
= a ∨ [(c ∧ a) ∨ (c ∧ b)]
= a ∨ [c ∧ (a ∨ b)]
= a ∨ [(a ∨ b) ∧ c]
= [(a ∨ b) ∧ a] ∨ [(a ∨ b) ∧ c]
= (a ∨ b) ∧ (a ∨ c).
A Boolean algebra is a lattice B with a greatest element I and a smallest element O such that B
is both distributive and complemented. The power set of X, P(X), is our prototype for a Boolean
algebra. As it turns out, it is also one of the most important Boolean algebras. The following
theorem allows us to characterize Boolean algebras in terms of the binary relations ∨ and ∧
without mention of the fact that a Boolean algebra is a poset.
18
CIT206 MODULE 3
Theorem 3.5 A set B is a Boolean algebra if and only if ∃ (there exist) binary operations ∨ and
∧ on B satisfying the following axioms.
u. a ∨ b = b ∨ a and a ∧ b = b ∧ a for a, b ∈ B.
ii. a ∨ (b ∨ c) = (a ∨ b) ∨ c and a ∧ (b ∧ c) = (a ∧ b) ∧ c for a, b, c ∈
B.
iii. a ∧ (b ∨ c) = (a ∧ b) ∨ (a ∧ c) and a ∨ (b ∧ c) = (a ∨ b) ∧ (a ∨
c) for a, b, c ∈ B.
iv. ∃ elements I and O such that a ∨ O = a and a ∧ I = a ∀ a ∈ B.
v. For every a ∈ B ∃ 𝑎 ∈ B such that a ∨ 𝑎 = I and a ∧ 𝑎 = O.
Proof
Let B be a set satisfying (i) – (v) in the theorem. One of the idempotent laws is satisfied since
a =a∨O
= a ∨ (a ∧ a′)
= (a ∨ a) ∧ (a ∨ a′)
= (a ∨ a) ∧ I
= a ∨ a.
Notice that
I ∨ b = (b ∨ b′) ∨ b = (b′ ∨ b) ∨ b = b′ ∨ (b ∨ b) = b′ ∨ b = I.
a ∨ (a ∧ b) = (a ∧ I) ∨ (a ∧ b)
= a ∧ (I ∨ b)
=a∧I
= a.
The other idempotent and absorption laws are proven similarly. Since B also satisfies
(i)–(iii), the conditions of Theorem 3.3 are met; therefore, B must be a lattice. Condition
(iv) tells us that B is a distributive lattice.
Conversely, suppose that B is a Boolean algebra. Let I and O be the greatest and least
elements in B, respectively. If we define a ∨ b and a ∧ b as least upper and greatest lower
bounds of {a, b}, then B is a Boolean algebra by Theorem 3.3 and Theorem 3.4.
Some of these identities in Boolean algebras are listed in the following theorem.
19
CIT206 DISCRETE STRUCTURES
Proof
We will prove only (ii). The rest of the identities are left as your exercises.
For a ∨ b = a ∨ c and a ∧ b = a ∧ c, we have
b = b ∨ (b ∧ a)
= b ∨ (a ∧ b)
= b ∨ (a ∧ c)
= (b ∨ a) ∧ (b ∨ c)
= (a ∨ b) ∧ (b ∨ c)
= (a ∨ c) ∧ (b ∨ c)
= (c ∨ a) ∧ (c ∨ b)
= c ∨ (a ∧ b)
= c ∨ (a ∧ c)
= c ∨ (c ∧ a)
= c.
i. a ≼ b,
ii. a ∧ b′ = O,
iii. a′ ∨ b = I.
Proof
(i) ⇒ (ii). If a ≼ b, then a ∨ b = b. Therefore, a ∧ b′ = a ∧ (a ∨ b)′
= a ∧ (a′ ∧ b′)
= (a ∧ a′) ∧ b′
= O ∧ b′
= O.
a = a ∧ (a′ ∨ b)
= (a ∧ a′) ∨ (a ∧ b)
= O ∨ (a ∧ b)
= a ∧ b. Thus, a ≼ b.
TUTOR-MARKED ASSIGNMENT
1. Draw the lattice diagram for the power set of X = {a, b, c, d} with the set inclusion relation, ⊂.
2. Draw the diagram for the set of positive integers that are divisors of 30. Is this poset a Boolean
algebra?
3. Let B be the set of positive integers that are divisors of .210. Define an order on B
by a ≼ b if a | b. Prove that B is a Boolean algebra. Find a set X such that B is isomorphic to
P(X).
4. Prove or disprove: ℤ is a poset under the relation a ≼ b if a | b.
5. Draw the switching circuit for each of the following Boolean expressions.
i. (a ∨ b ∨ a′) ∧ a
ii. (a ∨ b)′ ∧ (a ∨ b)
iii. a ∨ (a ∧ b)
iv. (c ∨ a ∨ b) ∧ c′ ∧ (a ∨ b)′
v. Draw a circuit that will be closed exactly when only one of three switches a, b, and
c are closed.
6. Prove or disprove: The set of all nonzero integers is a lattice, where a ≼ b is defined
by a | b.
20
CIT206 MODULE 3
Graphs are simple, however, they are extremely useful mathematical objects. They are universal
in the practical applications of Computer Science. For example:
i. In a computer network, we can use graphs to represent how computers are connected to
each other. We use the nodes to represent the individual computers and the edges to
represent the network connections. Such a graph can then be used to route messages as
quickly as possible.
ii. In a digitalized map, nodes represent intersections (or cities), and edges represent roads
(or highways). We may use directed edges to capture one-way traffic on streets, and
weighted edges to capture distance. Such a graph can be used for generation directions
(e.g., in GPS units).
iii. On the internet, nodes represent web pages, and (directed) edges represent links from one
web page to another. Such a graph can be used to rank each web page in the order of
importance when displaying search results (e.g., the importance of a web page can be
determined by the amount of other web pages that are referencing it or pointing
to it, and recursively how important those web pages are).
iv. In a social network, nodes represent people, and edges represent friendships. One hot
research topic currently is the understanding social networks. For example, how does a
network achieve “x- degrees of separation”, where everyone is approximately x number
of friendships away from anyway else?
Graphs
Graphs are made up of a collection of dots that are called vertices and lines connecting those dots
that are called edges. When two vertices are connected by an edge, we say that they are adjacent.
Definition 3.1.1 A graph is an ordered pair G = (V, E) consisting of a non-empty set V (vertices)
and a set E (edges) of two-element subsets of V.
Definition 3.1.2. A directed graph G is a pair (V, E) where V is a set of vertices (or
nodes), and E ⊆ V × V is a set of edges. The order of the two connected vertices is
important.
Definition 3.1.3. An undirected graph additionally has the property that (u, v) ∈ E if and
only if (v, u) ∈ E.
Example 3.1.1.1 In a school social gathering, Abel, Bill, Clair, Dan, and Eve were assigned to a
group. In that group, all members are allowed to “discuss” with each other. However, it turns out
that the discussions were between Abel and Clair, Bill and Dan. While Eve discussed with everyone.
Represent this situation with a graph.
Solution 3.1.1.1 Each person will be represented by a vertex and each discussion will be represented
by an edge. That is, two vertices will be
A B
adjacent (there will be an edge between them) if and only if the people represented by those
vertices discussed.
E
C D
From definition 3.1.1, a graph could be G = (V, E) = ({a, b, c, d}, {{a, b}, {a, c}, {b, c}, {b, d},
21
CIT206 DISCRETE STRUCTURES
{c, d}}). This graph has four vertices (a, b, c, d ) and five edges (the pairs {a, b}, {a, c}, {b, c},
{b, d}, {c, d}).
Exercise 3.1.1.2 Draw the graph ({a, b, c, d}, {{a, b}, {a, c}, {b, c}, {b, d}, {c, d}}).
Graph 2:
V = {v1, v2, v3, v4, v5},
E = {{v1, v3}, {v1, v5}, {v2, v4}, {v2, v5}, {v3, v5}, {v4, v5}}
Solution 3.1.1.3 (iii). No. Here the vertex sets of each graph are equal, which is a good start. Also,
both graphs have two edges. In the first graph, we have edges {a, b} and {b, c}, while in the second
graph we have edges {a, c} and {c, b}. Now we do have {b, c} = {c, b}, so that is not the problem.
The issue is that {a, b}, {a, c}. Since the edge sets of the two graphs are not equal (as sets), the
graphs are not equal (as graphs).
Solution 3.1.1.4 The two graphs are NOT equal. It is enough to notice that V1, V2 since a ∈ V1 but
a ∉ V2. However, both of these graphs consist of three vertices with edges connecting every pair of
vertices. By drawing the graph as follows:
a u
b c v w
We can clearly see that these graphs are basically the same, so while they are not equal, they will
be isomorphic. This means the renaming of the vertices of one of the graphs and results in the second
graph.
Isomorphic Graphs
An isomorphism between two graphs G1 and G2 is a bijection, f: V1 → V2 between the vertices
of the graphs such that {a, b} is an edge in G1 if and only if {f(a), f(b)} is an edge in G2. Two
graphs are isomorphic if there is an isomorphism between them. In this case we write G1 ≌ G2.
22
CIT206 MODULE 3
Solution 3.1.4.1 The graphs are NOT equal, since {a, d} ∈ E1 but {a, d}
∉ E2. However, we can confirm that both graphs contain the exact same number of vertices and
edges. By this, they might be isomorphic (this is a good start but in most cases, it is not enough).
Let’s try to build an isomorphism. From the definition, let’s try to build a bijection f: V1 → V2,
such that f(a) = b, f(b) = c, f(c) = d and f(d) = a. This is a bijection, but to make sure that the function
is an isomorphism, we must make sure it respects the edge relation.
In G1, the vertices a and b are connected by an edge. In G2, f(a) = b and f(b) = c are connected by
an edge. We are on the right track, however, we have to check the other three edges. The edge {a,
c} in G1 corresponds to {f(a), f(c)} = {b, d}, now we have a problem here. There is no edge between
b and d in G2. Thus f is NOT an isomorphism.
If f is not an isomorphism, it does not mean that there is no isomorphism between G1 and
G2. Let’s draw the graphs and then try to create some match ups (if possible).
It is noticeable in G1 that the vertex a is adjacent to every other vertex. In G2, there is also a vertex
with such property and that is c. Therefore, we can build the bijection g: V1 → V2 by defining g(a)
= c to start with. Next, which vertex should we match with b? In G1, the vertex b is only adjacent
to vertex a. There is exactly one vertex like this in G2, that is d. Therefore, let g(b) = d. By looking
at the last two, we can see that we are free to choose the matches. Therefore, let go with g(c) = b
and g(d) = a (switching these would still work fine).
Finally, let’s check that there is really is an isomorphism between G1 and G2 using g. We have seen
that g is definitely a bijection. Now we have to make sure that the edges are respected. The four
edges in G1 are
{a, b}, {a, c}, {a, d}, {c, d}.
Under the proposed isomorphism these become
{g(a), g(b)}, {g(a), g(c)}, {g(a), g(d)}, {g(c), g(d)}
Subgraphs
Definition. We say that G′ = (V′, E′) is a subgraph of G = (V, E), and write G′ ⊆ G, provided V′ ⊆
V and E′ ⊆ E.
Definition. We say that G′ = (V′, E′) is an induced subgraph of G = (V, E) provided V′ ⊆ V and
every edge in E whose vertices are still in V′ is also an edge in E′.
Example 3.1.5. Considering the graph G1. Which of the graphs G2, G3 and G4 are subgraphs or
induced subgraphs of G1?
Solution 3.1.5. By carefully applying the definitions of a subgraph and an induced subgraph, we
can see that:
i. The graphs G2 and G3 are both subgraphs of G1. 23
CIT206 DISCRETE STRUCTURES
ii. Only the graph G2 is an induced subgraph. This is because every edge in G1 that connects
vertices in G2 is also an edge in G2. However, in G3, the edge {a, b} is in E1 but not E3,
even though vertices a and b are in V3.
iii. The graph G4 is NOT a subgraph of G1. It might seem like it is, however, if you look
closely, you will realize that vertex e does not exist in G4. Therefore, it is enough to say that
G4 is NOT a subgraph of G1, since {c, f} ∈ E4 but {c, f} ∉ E1 and that we don’t have the
required E4 ⊆ E1.
Bipartite Graphs
A graph is bipartite if the vertices can be divided into two sets, A and B, with no two vertices in
adjacent in A and B. The vertices in A can be adjacent to some or all of the vertices in B. If each
vertex in A is adjacent to all the vertices in B, then the graph is a complete bipartite graph, and
gets a special name: Km,n, where |A| = m and |B| = n.
Union and Intersection of a Graph: These are two useful operations for combining graphs. Let
G1 = (V1, E1) and G2 = (V2, E2) be graphs.
i. The union of G1 and G2, denoted by G1 ⋃ G2, is the graph G3 defined as G3 = (V1 ⋃
V2, E1 ⋃ E2).
ii. The intersection of G 1 and G2, denoted by G1 ∩ G2, is the graph G4 defined as G4 =
(V1 ∩ V2, EI ∩ E2).
3.1.4 Complement of a Graph: This operation that is used with a single graph. To define this,
we need an analogue of a universal set. In this case, we use the complete graph on the vertex set
of the graph for which we would like to find the complement. Let G = (V, E) be a subgraph of
K|V|, the complete graph on |V| vertices. The complement of G¯ in K |V|, denoted as G = (V1,
El), is the subgraph of K|V| with V1 = V and E1 = K|V| (E) - E.
24
CIT206 MODULE 3
TUTOR-MARKED ASSIGNMENT
1. Are the graphs below equal? Are they isomorphic? If they are isomorphic, give the
isomorphism else state why they are not.
G1 = V1 = {a, b, c, d, e}, E1 = {{a, c}, {a, d}, {a, e}, {b, d}, {b,
e}, {c, e}, {d, e}}
G2 = a c
b d
e
2. Consider the following two graphs:
G1 V1 = {a, b, c, d, e, f, g} E1 = {{a, b}, {a, d}, {b, c}, {b,
d}, {b, e}, {b, f}, {c, g}, {d, e}, {e, f}, {f, g}}.
G2 V2 = {v1, v2, v3, v4, v5, v6, v7}, E2 = {{v1, v4}, {v1, v5}, {v1, v7}, {v2,
v3}, {v2, v6}, {v3, v5}, {v3, v7}, {v4, v5},
{v5, v6}, {v5, v7}}
i.Let f: G1 → G2 be a function that takes the vertices of Graph 1 to vertices of Graph 2.
The function is given by the following table:
x a b c d e f g
f(x) v4 v5 v1 v6 v2 v3 v7
Does f define an isomorphism between Graph 1 and Graph 2? ii.Define a new
function g (with g, f) that defines an isomorphism
between Graph 1 and Graph 2.
3. If 10 people each shake hands with each other, how many handshakes took place? What
does this question have to do with graph theory?
4. Decide whether the statements below about subgraphs are true or false. If true in 1 or 2
sentences, explain why, else, give a counterexample if false.
i. Any subgraph of a complete graph is also complete.
ii. Any induced subgraph of a complete graph is also complete.
iii. Any subgraph of a bipartite graph is bipartite.
25