CSC 203 - Lecture 1
CSC 203 - Lecture 1
DISCRETE STRUCTURES
i
Textbooks and References
ii
CONTENT
Unit 1: Sets
Unit 2: Proofs and Induction
Unit 3: Logic
iii
MODULE 1 INTRODUCTION TO DISCRETE STRUCTURES
Unit 1: Set Theory
Unit 2: Proofs and Induction
Unit 3: Logic
CONTENTS
1.0 Introduction
2.0 Objectives
3.0 Main Content
3.1 Introduction to Mathematical Statements
3.1.1 Statement Definition
3.1.2 Logical Connectives
3.2 Sets
3.2.1 Definition of Set
3.2.2 Notations
3.2.3 Operations on Set
3.2.4 Rules of Set theory
3.2.5 Disjoint Set
3.2.6 Power Set
3.2.7 Venn Diagram
3.3 Relations
3.3.1 Definition of Relations
4.0 Conclusion
5.0 Summary
6.0 Tutor-Marked Assignment
7.0 References/Further Reading
4
1.0 Introduction
This unit describes Set Theory, a mathematical theory that underlies all of modern
mathematics. The best way to understand mathematics is to talk and write about
mathematics. Mathematics is not all about finding solutions to given tasks. Therefore, as
we tackle a more advanced and abstract mathematics in this unit, your basic understanding
of it will be helped by how well you can read, write and talk about mathematical statements.
2.0 Objectives
By the end of this Unit, you will be able to:
5
The sentence “4 + x = 12” is not a statement because it contains an unknown variable, x.
Depending on the value of x, the sentence is either true or false, however, right now 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 stamen 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 still
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.
“or” - Delight is a boy or 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 determined the truth values of the parts and the type of connective(s). We
do not necessarily need 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 letters found in the middle of the English alphabet 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.
6
• P → Q is read as “if P then Q,” and it is called an implication or conditional.
• P ↔ Q is read as “P if and only if Q,” and it is called a bi-conditional.
• ¬P is read as “not P,” and it is called a negation.
The truth 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 when both P and Q are true
•P Q is true when P or Q or both are true.
• P → Q is true when P is false or Q is true or both.
• P ↔ Q is true when P and Q are both true, or both false.
• ¬P is true when P is false and vice versa.
3.2 Sets
Sets are the most fundamental objects in all of mathematics.
3.2.1 Definition of Set: An informal definition of set is that a set is an unordered
collections of objects. The objects that comprises of the set are called elements. The
number of objects in a set can be finite or infinite.
3.2.2 Notations
A single set, A can be expressed with the following notations:
A = {1, 2}; A = {2, 1}; A = {1, 2, 1, 2}; A = {x | x is an integer, 1 ≤ x ≤ 2}
The notation, A = {1, 2} is read as, “A is the set containing the elements 1 and 2.”
The curly braces “{ }” is used to enclose the elements of a set and the comma “,” is used
to separate the elements inside the braces.
The symbol “|” (or “:” or “”), implies “such that”. Therefore, the notation, {x | x is an
integer, 1 ≤ x ≤ 2} is read as “the set of all x such that x is an integer between 1 and 2 (1
and 2 inclusive)”.
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
7
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
⊆: A B asserts that A is a subset of B | every element of A is also an element of B.
If A is {2, 3, 4}, B is {2, 3, 4, 5}. Then A B.
If A is {2, 3, 4}, B is {2, 3, 4}. Then A B and B A.
If A is {2, 3, 4, 5}, B is {2, 3, 4, 6, 7}. Then B A.
A B asserts that A is a proper subset of B | every element of A is also an element of
B, but every element of B is not an element of A.
Let A = {2, 3, 4} and B = {1, 2, 3, 4, 5}. Then, A B.
If A is {2, 3, 4}, B is {2, 3, 4}. Then A B (read as A is a NOT a proper subset of B).
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 human population, the universal set consist of all people in the
world.
∩: 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: the set containing all elements of A which are not elements of
B.
8
Ac or A:̅ The complement of A is the set of everything which 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 × B is the Cartesian product of two non-empty sets A and B: the set of all 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) where 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 3.2.3.1
Prove that A × B = B × A, only if A = B.
Solution 3.2.3.1
Proof: Let A × B = B × A. then, A ⊆ B and B ⊆ A. Therefore, A = B.
9
Some special sets we will consider in this unit:
•∅ The empty set that contains no element (also denoted as { }).
•U The universe set is the set of all elements
•ℕ {0, 1, 2, 3, . . . }, the non-negative integers
• ℕ+ {1, 2, 3, . . . }, the positive integers
• P(A) The power set of any set A is the set of all subsets of A.
3.2.5 Disjoint Set
Sets X and Y are said to be disjoint sets, if they have no element in common, that is, no
element of X is in Y and no element of Y is 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.
3.2.6 Power Set
We call the set of all subsets of A, the power set of A, and write it as P(A) Example
3.2.6.1 Let A = {1, 2, 3}. Find P(A).
Solution 3.2.6.1 P(A) is a set of sets, all of which are subsets of A.
So, P(A) = {∅, {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, {1, 2, 3}}.
Note: The power set of a set A is normally, 2n, where n is the cardinality of the set A.
Therefore, since |A| = 3, the cardinality of the power set of A, |P(A)| = 23 = 8.
Note: Although 2 ∈ A, it will be wrong to say that 2 ∈ P(A) because none of the elements
in P(A) are numbers. However, we can say that {2} ∈ P(A) because {2} ⊆ 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 A or x is an
10
element of B. Therefore, x ∈ A ∪ B ↔ x ∈ A ∨ x ∈ B. Similarly, x ∈ A ∩ B ↔ x ∈ A ∧ x
∈ B. Also, x ∉ A ↔ ¬(x ∈ A)
Example 3.2.6.2
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 true, false, or meaningless.
1. A ⊂ B. 2. B ⊂ A. 3. A ∈ C. 4. ∅ ∈ B. 5. ∅ ⊂ A.
6. A < E. 7. 3 ∈ C. 8. x ⊂ D. 9. {9} ⊂ E.
Solution 3.2.6.2
1. True. Every element in A is an element in B.
2. False. For example, 1 ∈ B but 1 ∉ A.
3. False. The elements in C are 1, 2, and 3. The set A is not equal to 1, 2, or 3.
4. False. The set B has exactly 6 elements, and none of them is an empty set.
5. True. Everything in the empty set (nothing) is also an element of A. Notice that the
empty set is a subset of every set.
6. Meaningless. A set cannot be less than another set.
7. True. 3 is one of the elements of the set C.
8. Meaningless. x is not a set, so it cannot be a subset of another set.
9. True. 9 is the only element of the set {9}, and is an element of E, so every element in
{9} is an element of E.
11
3.3 Relations
3.3.1 Definition 3.3.1: A relation on a single set S is a subset of S × S. A relation on sets
S and T is a subset of S × T. 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 (A, B),
“taller-than”, “smarter-than” are relations between them. That is (A, B) “taller-than” if
person A is taller than person B. “≥” is a relation on R; “≥” = {(x, y) | x, y R, x ≥ y}.
3.3.2 Definition: A relation R on a set S is:
i. Reflexive if for all x S, (x, x) R.
ii. Symmetric if for all x, y S, whenever (x, y) R, (y, x) R.
iii. Transitive if for all x, y, z S, whenever (x, y) R and (y, z) R, then (x, z) R.
Example 3.3.1.1
i. “≤” is reflexive, but “<” is not.
ii. “sibling-of” is symmetric, but “≤” and “sister-of” is not.
iii. “sibling-of”, “≤”, and “<” are all transitive, but “parent-of” is not (however,
“ancestor of” is transitive).
12
A relation that is reflexive, symmetric and transitive is called an Equivalence relation and
is denoted by the symbol “≡”.
Let “≡” be an equivalence relation on the set S. 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 ≡.
4.0 Conclusion
The bulk of work in this unit is on how set theory (a branch of mathematical logic gives
insight into how Discrete Structure are viable in Computer Science. Emphasis were made
on a set being a collection of objects or groups of objects. The unit further highlighted on
the rules of set theory and its power set.
5.0 Summary
In this unit we learnt that Sets are the most fundamental objects in all of mathematics. That,
a set is a collection of objects or groups of objects. A statement can be an Atomic Statement
if it cannot be divided into smaller statements, otherwise it is called a Molecular Statement.
There are rules governing the set and Venn diagram is a great tool used to visualize and
represent operations on sets.
13
7.0 References/Further Reading
Bunday, BD and Mulholland, H. (2014). Pure Mathematics for Advanced Level. Second edition.
Published by Elsevier science. ISBN: 1483106136, 9781483106137
James, H. (2017). Discrete Structures, Logic and Computability. Published by Jones and
Bartlett. Fourth Edition. ISBN:978-284-07040-8.
Seymour, L. S. (1964). Outline Series: Theory and Problems of Set Theory and Related Topics,
pp. 1-133.
14