0% found this document useful (0 votes)
12 views

DM Chapter+1

Discrete mathematics

Uploaded by

Marc Garcia
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

DM Chapter+1

Discrete mathematics

Uploaded by

Marc Garcia
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

24/01/2024

Sets, Relations and Functions

The Dominican Blessing


May God the Father bless us.
May God the Son heal us.
May God the Holy Spirit enlighten us,
and give us
eyes to see with,
ears to hear with,
hands to do the work of God with,
feet to walk with,
and mouth to preach the word of salvation
with,
and may the angel of peace, watch over us
and lead us at last, by the Lord’s gift, to the
Kingdom.
Amen.

1
24/01/2024

What is Discrete Mathematics?


Is it possible to visit 3 islands in a river with 6 bridges without crossing
any bridge more than once?

This is a discrete
mathematics problem
because there is a
finite (fixed, discrete)
number of bridges.

What is Discrete Mathematics?


Discrete Mathematics is a branch of mathematics
involving discrete elements that uses algebra and
arithmetic. It is increasingly being applied in the
practical fields of mathematics and computer science.
It is a very good tool for improving reasoning and
problem-solving capabilities.

2
24/01/2024

Importance of Discrete Mathematics


✓ Information is stored and manipulated by computers in a
discrete fashion
✓ Applications in many different areas
✓Discrete mathematics is a gateway to more advanced
courses
✓ Develops mathematical reasoning skills
✓ Emphasizes the new role of mathematics

Sets
A set is an unordered collection of different elements. A set can be
written explicitly by listing its elements using set bracket. If the order of
the elements is changed or any element of a set is repeated, it does not
make any changes in the set.

A set can be represented by the uppercase letters A, B, C ….

A object which belong to a set or is a member of or is contained in a set


is said to be an element of this set.
Notations: a ∈ A b∉A

3
24/01/2024

Sets
Examples ---
1. The set of vowels in the English alphabet
2. The set of primary colors
3. The set of natural numbers
4. The set of positive integers between 1 and 40

The set of vowels in the English alphabet


Roster or Tabular Form: A = {a, e, i, o, u}
Set Builder Notation: A = {x : x is a vowel in English alphabet}

Sets
The set of primary colors
Roster or Tabular Form: A = {}
Set Builder Notation: A = {}

4
24/01/2024

Sets
The set of natural numbers
Roster or Tabular Form: A = {}
Set Builder Notation: A = {}

Sets
The set of positive integers between 1 and 40

Roster or Tabular Form: A = {}


Set Builder Notation: A = {}

5
24/01/2024

Sets
Some important sets --

N – the set of all natural numbers = {}


Z – the set of all integers = {}
Z+ – the set of all positive integers = {}
Q – the set of all rational numbers
R – the set of all real numbers
W – the set of all whole numbers

Sets
Cardinality of a set
Cardinality of a set S, denoted by |S|, is the number of elements of the
set. If a set has an infinite number of elements, its cardinality is ∞.

Example − |{1, 4, 3, 5}| = 4, |{1, 2, 3, 4, 5,…}| = ∞

A = {a, e, i, o, u}, |A| =

6
24/01/2024

Types of Sets
Finite Set
A set which contains a definite number of elements is called a finite set.

Example − S = {x | x ∈ N and 70 > x > 50}

Infinite Set
A set which contains infinite number of elements is called an infinite
set.

Example − S = {x | x ∈ N and x > 10}

Types of Sets
Subset
A set Y is a subset of set X (Written as Y ⊆ X) if every element of Y is an
element of set X.

Example 1 − Let, A = { 1, 2, 3, 4, 5, 6 } and B = { 1, 2 }. Here set B is a


subset of set A as all the elements of set B is in set A. Hence, we can
write B ⊆ A.

Example 2 − Let, A = {1, 2, 3} and B = {1, 2, 3}. Here set A is a subset of


set B as all the elements of set A is in set B. Hence, we can write A ⊆ B.

7
24/01/2024

Types of Sets
Proper Subset
The term “proper subset” can be defined as “subset of but not equal
to”. A Set X is a proper subset of set Y (Written as X ⊂ Y) if every
element of X is an element of set Y and |X| < |Y|.

Example − Let, A = {1, 2, 3, 4, 5, 6} and B = {1, 2}. Here set B is a proper


subset of set A as at least one element is more in set B. Hence, we can
write B ⊂ A.

Types of Sets
Universal Set
It is a collection of all elements in a particular context or application. All
the sets in that context or application are essentially subsets of this
universal set. Universal sets are represented as U.

Example − We may define U as the set of all animals on earth. In this


case, set of all mammals is a subset of U, set of all fishes is a subset of
U, set of all insects is a subset of U, and so on.

8
24/01/2024

Types of Sets
Empty Set or Null Set
An empty set contains no elements. It is denoted by ∅. As the number of
elements in an empty set is finite, empty set is a finite set. The cardinality of
empty set or null set is zero.

Example: ∅ = {x | x ∈ N and 7 < x < 8}

Singleton Set or Unit Set


Singleton set or unit set contains only one element. A singleton set is
denoted by {s}.

Example: S = {x | x ∈ N, 7 < x < 9}

Types of Sets
Equal Set
If two sets contain the same elements they are said to be equal.

Example − If A = {1, 2, 6} and B = {6, 1, 2}, they are equal as every element of
set A is an element of set B and every element of set B is an element of set A.

Equivalent Set
If the cardinalities of two sets are same, they are called equivalent sets.

Example − If A = {1, 2, 6} and B = {16, 17, 22}, they are equivalent as


cardinality of A is equal to the cardinality of B. i.e. |A| = |B| = 3

9
24/01/2024

Types of Sets
Overlapping Set
Two sets that have at least one common element are called overlapping sets.
Example − Let, A = {1, 2, 6} and B = {6, 12, 42}. There is a common element
‘6’, hence these sets are overlapping sets.

Disjoint Set
If two sets C and D are disjoint sets as they do not have even one element in
common.
Example − Let, A = {1, 2, 6} and B = {7, 9, 14}, there is no common element,
hence these sets are not overlapping sets.

Venn Diagrams
Venn diagram, invented in 1880 by John Venn, is a schematic diagram
that shows all possible logical relations between different mathematical
sets.

10
24/01/2024

Exercise
Let A = {1, 2, 3, 4, 5, 6, 7, 8} and B = {x ∈ Z | x is divisible by 3}

______ 1. 2 ∈ A
______ 2 . -2 ∈ A
______ 3. -3 ∉ B
______ 4. 11 ∈ B

Exercise
True or False.

______ 1. 12 ∈ Z
______ 2. 15∈ Q
______ 3. - 2 ∈ Q
______ 4. 0 ∈ N
______ 5. - 3 ∈ R

11
24/01/2024

Set Operations
Set Union
If A = {10, 11, 12, 13} and B = {13, 14, 15}, then A ∪ B = {10, 11, 12, 13,
14, 15}. (The common element occurs only once)

Hence, A ∪ B = {x | x ∈ A OR x ∈ B}

Set Operations
Set Intersection
If A = {11, 12, 13} and B = {13, 14, 15}, then A ∩ B = {13}

Hence, A ∩ B = {x | x ∈ A AND x ∈ B}

12
24/01/2024

Set Operations
Set Difference/Relative Complement
If A = {10, 11, 12, 13} and B = {13, 14, 15},
then (A− B) = {10, 11, 12} and (B − A) = {14, 15}.

Hence, A − B = {x | x ∈ A AND x ∉ B}

Set Operations
Complement of a Set
If A = {x | x belongs to set of odd integers}
then A' = {y | y does not belong to set of odd integers}

Hence, A' = {x | x ∉ A}

13
24/01/2024

Set Operations
Cartesian Product / Cross Product
If we take two sets A = {a, b} and B = {1, 2},

The Cartesian product of A and B is written as −


A × B = {(a, 1), (a, 2), (b, 1), (b, 2)}

The Cartesian product of B and A is written as −


B × A = {(1, a), (1, b), (2, a), (2, b)}

Set Operations
Power Set
Power set of a set S is the set of all subsets of S including the empty set.

For a set S = {a, b, c, d} let us calculate the subsets −

Subsets with 0 elements − {∅} (the empty set)


Subsets with 1 element − {a}, {b}, {c}, {d}
Subsets with 2 elements − {a,b}, {a,c}, {a,d}, {b,c}, {b,d},{c,d}
Subsets with 3 elements − {a,b,c},{a,b,d},{a,c,d},{b,c,d}
Subsets with 4 elements − {a,b,c,d}

14
24/01/2024

Set Operations
Power Set
Hence, P(S) = { {∅}, {a}, {b}, {c}, {d}, {a,b}, {a,c}, {a,d}, {b,c}, {b,d}, {c,d},
{a,b,c}, {a,b,d}, {a,c,d}, {b,c,d}, {a,b,c,d}}

|P(S)| = 24 = 16

Set Operations
Partitioning of a Set
Let S = {a, b, c, d, e, f, g, h}

One probable partitioning is {a}, {b, c, d}, {e, f, g, h}

Another probable partitioning is {a, b}, { c, d}, {e, f, g, h}

In this way, we can find out Bn number of different partitions. The


number of partitions of the set is called a Bell number denoted as Bn.

15
24/01/2024

Set Operations
Partitioning of a Set
Partition of a set, say S, is a collection of n disjoint subsets, say P1,
P2,...… Pn, that satisfies the following three conditions −

✓Pi does not contain the empty set


✓The union of the subsets must equal the entire original set
✓The intersection of any two distinct sets is empty

Exercise - Set Operations


1. Let U = {1, 2, 3, 4, 5, 6, 7} and subset A = {1, 2, 3} what is A'?

2. Let U = {1, 2, 3, 4, 5, 6, 7} and subsets A = {1, 2, 3} and B = {2, 3, 4, 5} ,


what is A ∪ B ?

3. Let U = {1, 2, 3, 4, 5, 6, 7} and subsets A = {1, 2, 3} and B = {2, 3, 4, 5},


what is A ∩ B ?

4. Let A = {1, 2, 3, 4, 5, 6, 7} and B = {2, 4, 6, 8, 10} what is A - B ?

5. What is the power set of {a, b, c}?

16
24/01/2024

Relations
Whenever sets are being discussed, the relationship between the elements
of the sets is the next thing that comes up. Relations may exist between
objects of the same set or between objects of two or more sets.

A binary relation R from set x to y (written as xRy or R(x,y)) is a subset of the


Cartesian product x × y. If the ordered pair is reversed, the relation also
changes.

Generally an n-ary relation R between sets A1, ... , and An is a subset of the
n-ary product A1 × ... × An.

For two distinct sets, A and B, having cardinalities m and n respectively, the
maximum cardinality of a relation R from A to B is mn

Relations - Domain and Range


If there are two sets A and B, and relation R have order pair (x, y), then −

The domain of R is the set { x | (x, y) ∈ R for some y in B }.


The range of R is the set { y | (x, y) ∈ R for some x in A }.
Example − State the domain and range of the following relation.
{(2, –3), (4, 6), (3, –1), (6, 6), (2, 3)}
domain: {2, 3, 4, 6}
range: {–3, –1, 3, 6}
Note: It is customary to list these values in numerical order, but it is not
required. Sets are called “unordered lists", so you can list the numbers in any
order you feel like.

17
24/01/2024

Representation of Relations using Graph


A relation can be represented using a directed graph.

Suppose, there is a relation R = {(1, 1), (1,2), (3, 2)} on set S = {1, 2, 3}, it
can be represented by the following graph −

Types of Relations
▪ The Empty Relation between sets X and Y, or on E, is the
empty set ∅
Let X = {} and Y = {}, then R = {}

▪ The Full Relation between sets X and Y is the set X × Y


Let A = {1, 2} and B = {u, v}, then R = {(1,u), (1,v), (2,u), (2,v)}

▪ The Identity Relation on set X is the set {(x, x) | x ∈ X}


Let A = {1, 2}, then R = {(1,1), (1,2), (2,1), (2,2)}

18
24/01/2024

Types of Relations
▪ The Inverse Relation R' of a relation R is defined as −
R’ = {(b, a) | (a, b) ∈ R}
If R = {(1, 2), (2, 3)} then R’ will be {(2, 1), (3, 2)}
▪ Reflexive vs Irreflexive
If A = {1, 2, 3}, R = {(a, b)|a=b} = {(1, 1), (2, 2), (3, 3)}

Types of Relations
▪ Symmetric vs Anti-Symmetric
The relation R = {(1, 2), (2, 1), (3, 2), (2, 3)} on set A = {1,
2, 3} is symmetric.
▪ Transitive
The relation R = {(1, 2), (2, 3), (1, 3)} on set A = {1, 2, 3} is
transitive
▪ A relation is an Equivalence Relation if it is reflexive,
symmetric, and transitive

19
24/01/2024

Functions
▪ A function relates an input to an output.
▪ And the output is related somehow to the input.

Three Main parts:


✓The input
✓The relationship
✓The output

Functions
The "x" is Just a Place-Holder

So this function:
f(x) = 1 - x + x2

is the same function as:


f(q) = 1 - q + q2
h(A) = 1 - A + A2
w(θ) = 1 - θ + θ2

20
24/01/2024

Functions vs Relations
Function has special rules:
▪ It must work for every possible input value
▪ And it has only one relationship for each input value

Functions vs Relations
X Y X Y
1 1 -1 1
1 2 0 0
2 1 1 1
2 2 2 4

21
24/01/2024

Injective, Surjective and Bijective


"Injective, Surjective and Bijective" tells us about how a
function behaves.

Injective, Surjective and Bijective


Examples –
1. Student iD
2. Trip to Jerusalem (chairs to players)
3. Students taking up courses
4. Wife-Husband in Muslim marriage
5. IG accounts to users

22

You might also like