0% found this document useful (0 votes)
31 views17 pages

Unit 1

The document discusses relations and functions in discrete mathematics. It defines Cartesian products of sets, relations and their properties including domain, range and composition of relations. It also provides examples and exercises related to relations.
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)
31 views17 pages

Unit 1

The document discusses relations and functions in discrete mathematics. It defines Cartesian products of sets, relations and their properties including domain, range and composition of relations. It also provides examples and exercises related to relations.
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/ 17

PARUL UNIVERSITY - FACULTY OF ENGINEERING & TECHNOLOGY

Department of Applied Science & Humanities


3rd Semester B. Tech (CSE, IT)
Discrete Mathematics (203191202)
UNIT-1 Sets, Relation & Functions

Overview:
 Cartesian product of sets
 Relations and their properties
 Composition of relations
 POSets and equivalence sets
 Matrix representation of relations
 Digraph of relations
 Closures of relations
 n-tuples
 Database and Relations
 Cantor‘s diagonal argument
 The Power set theorem
 Schroder-Bernstein Theorem

Weightage: 11% Teaching Hours: 5

Introduction:
Much of mathematics is about finding a pattern – a recognisable link between quantities that change.
In our daily life, we come across many patterns that characterise relations such as brother and sister,
father and son, teacher and student.
In mathematics also, we come across many relations such as
number m is less than number n,
line is parallel to line ,
set A is a subset of set B.
In all these, we notice that a relation involves pairs of objects in certain order.
In this Chapter, we will learn how to link pairs of objects from two sets and then introduce relations
between the two objects in the pair. Finally, we will learn about special relations which will qualify
to be functions. The concept of function is very important in mathematics since it captures the idea of
a mathematically precise correspondence of one quantities with the other.

Prerequisites:
Theory of sets: Definition
Operations on sets
Cardinality of sets
Subset and Power set
Application:
The time required to manipulate information in a database depends on how this information is stored.
The operations of adding and deleting records, updating records, searching for records, and
combining records from overlapping databases are performed millions of times each day in a large
database. Because of the importance of these operations, various methods for representing databases
have been developed. One of these methods, called the relational data model is based on the
concept of a relation.
The database query language SQL (short for Structured Query Language) can be used to carry out
the operations we have described in this section. Example 12 illustrates how SQL commands are
related to operations on n-ary relations.
CARTESIAN PRODUCTS OF SETS
The ordered n-tuple is the ordered collection ( ) that has as its first element, as its
second element,…, and as its nth element.
Two ordered n-tuples are equal if and only if each corresponding pair of their elements is equal.
In other words, ( ) ( ) if and only if for

Definition
Let P and Q be two sets. The Cartesian product P × Q is the set of all ordered pairs ( ), where
and
i.e. *( ) +
Note the following:
 The Cartesian product of the sets denoted by is the set of
ordered n-tuples ( ), where belongs to for .
In other words, *( )| +The ordered
pairs ( ) and ( ) are equal if and only if and .
 If either P or Q is the null set, then P × Q will also be empty set.
 If A and B are non-empty sets and either A or B is an infinite set, then so is A × B .
 If there are p elements in A and q elements in B, then there will be pq elements in A × B,
i.e., if n(A) = p and n(B) = q, then n(A × B) = pq.
 *( )| +

Illustration
Consider the two sets: * +, where represent Delhi, Madhya Pradesh and
Karnataka, respectively and * + representing codes for the licence plates of vehicles
issued by DL, MP and KA .
If the three states, Delhi, Madhya Pradesh and Karnataka were making codes for the licence plates of
vehicles, with the restriction that the code begins with an element from set A, which are the pairs
available from these sets and how many such pairs will there be ?
The available pairs are:
(DL,01), (DL,02), (DL,03), (MP,01), (MP,02), (MP,03), (KA,01), (KA,02), (KA,03) and the product
of set A and set B is given by
A × B = {(DL,01), (DL,02), (DL,03), (MP,01), (MP,02), (MP,03), (KA,01), (KA,02), (KA,03)}.
It can easily be seen that there will be 9 such pairs in the Cartesian product, since there are 3
elements in each of the sets A and B. This gives us 9 possible codes.
Also note that the order in which these elements are paired is crucial.
For example, the code (DL, 01) will not be the same as the code (01, DL).
RELATIONS AND THEIR PROPERTIES
Definition
A relation R from a non-empty set A to a non-empty set B is a subset of the Cartesian product A × B.
The subset is derived by describing a relationship between the first element and the second element
of the ordered pairs in A × B.
The second element is called the image of the first element.
For example, *( )( )( )( ) ( ) ( ) ( )+ is a relation from the set * +
to the set * +.
A relation from a set A to itself is called a relation on A.

Definition
The set of all first elements of the ordered pairs in a relation R from a set A to a set B is called the
domain of the relation R.

Definition
The set of all second elements in a relation R from a set A to a set B is called the range of the
relation R. The whole set B is called the codomain of the relation R.

Note the following:


 Range ⊆ Codomain.
 If ( ) , then we say that , which can also be written as .
 The total number of relations that can be defined from a set A to a set B is the number of possible
subsets of A × B.
 If n(A ) = p and n(B) = q, then n (A × B) = pq and the total number of relations
 A relation R in a set A is called empty relation (void relation), if no element of A is related to
any element of A, i.e., R = φ⊂ A × A.
 A relation R in a set A is called universal relation, if each element of A is related to every
element of A, i.e., R = A × A.
 Both the empty relation and the universal relation are sometimes called trivial relations.
 A relation R in a set A is called identity relation, if each element of A is related to itself only.
i.e., *( )| +
 In case of relations from a set to a set , is considered as the universal relation. The
complement relation of a relation is denoted and given as ( ) .
 If *( )| + then the inverse relation is denoted and given as
*( )| +.
 Union, intersection, difference and other operations of sets are all applicable to relations as they
are for sets.
Problem.1
What is the largest possible relation from the set * + to the set * +?
Write the relations from to in each of the following cases when
1) is related to if and only if
2) is related to if and only if
3) is related to if and only if
4) if and only if
5) ( ) if and only if
Solution:
The largest possible relation from to is
*( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( )
( ) ( ) ( ) ( ) ( ) ( )+
1) *( )| +
*( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( )+
2) *( )| + *( ) ( ) ( ) ( ) ( ) ( ) ( ) ( )( )+
3) *( )| + * ( ) ( ) ( )+
4) *( )| +
*( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( )+
5) *( )| + *( ) ( ) ( ) ( ) ( )+

Problem.2
Let * + and * + and let *( )| +.
1) Write all the elements of and 2) Write the inverse relation of R.
3) Find the Domain and Range of and .
Solution:
1) *( ) ( ) ( ) ( )+
* ( ) ( ) ( ) ( ) ( )+
2) *( ) ( ) ( ) ( )+
3) ( ) * + ( ) * +
( ) * + ( ) * +

Problem.3
Consider these relations on the set of integers:
*( )| +,
*( )| +
*( )| +
*( )| +
*( )| +
*( )| +
Which of these relations contain each of the pairs (1,1), (1,2), (2,1), (1,−1), and (2,2)?
Solution:
The pair (1,1) is in R1, R3, R4, and R6; (1,2) is in R1 and R6; (2,1) is in R2, R5, and R6; (1,−1) is in R2,
R3, and R6; and finally, (2,2) is in R1, R3, and R4.

Exercise
1. Let * + Let a relation on be defined as
*( ) +. Write down its domain, codomain and range.
2. Let * + and * + . Find the number of relations from to . Which of the
following is not a relation from to ? Justify your answer.
(i) *( )( ) ( )+
(ii) *( ) ( )+
(iii) *( )( ) ( )+
(iv) *( )( )+
3. If *( ) ( ) ( )+ and *( ) ( ) ( )+ represents some relations on some
sets then what is 1) 2) 3) 4) – 5) R⊕S
Also verify if (i) ( ) ( ) ( )
and (ii) ( ) ⊆ ( ) ( )
COMPOSITE OF RELATIONS

Definition
Let be a relation from a set to a set and a relation from B to a set .
The composite of and given by is the relation from to consisting of ordered pairs ( )
where , , and for which there exists an element such that ( ) and
( ) S.
Thus, *( )|( ) ( ) +.
In other words ( ) if and only if and for some .

Note:
1. The powers of a relation R can be recursively defined from the definition of a composite of
two relations.
Let R be a relation on the set A. The powers are defined recursively by
and
Thus, R2 = R ◦R, R3 = R2 ◦R = (R ◦R)◦R, and so on.

Problem.1
Let *( ) ( ) ( ) ( ) ( )+ and * ( ) ( ) ( ) ( ) ( )+ be two relations
on some sets. Check if is possible or not. If it is possible then write the elements of the relation
.

Solution
Here, ( ) * + is a subset of ( ) * +
Hence, is Possible.
Further, *( ) ( ) ( ) ( ) ( ) ( )+

Problem.2
Let *( )( )( )( )}. Find the powers Rn, n= 2,3,4,....
Solution
*( )( ) ( ) ( )+
Further, *( ) ( ) ( ) ( )+
Similarly, *( ) ( ) ( ) ( )+
It follows that for

Exercise:
1. Let *( ) ( ) ( ) ( ) ( ) ( )+ and * ( ) ( ) ( ) ( )+ be two
relations on some sets. Check if is possible or not. If it is possible then write the elements
of the relation .

PROPERTIES OF RELATIONS
Let be a set. Let be a relation on it.
 The relation is said to be reflexive if ( ) for every
In other words, a relation on A is reflexive if every element of A is related to itself.
 The relation is said to be transitive, if ( ) ( ) ( ) , for
all
 The relation is said to be symmetric ( ) ( ) for all
 The relation is said to be anti-symmetric if ( ) ( ) ,for all
In other words, a relation R on a set A is anti-symmetric if and only if there are no pairs of
distinct elements and with related to and related to .
i.e. the only way to have related to and related to is for and to be the same
element.

Definition
A relation R on a set A is said to be equivalence relation, if R is reflexive, transitive and symmetric.
A relation R on a set A is said to be partially ordered relation, if R is reflexive, transitive and anti-
symmetric.
A set with a partially ordered operation ,(i.e. ( )) is said to be Partially Ordered Set (POSet).

Note:
(i) The terms symmetric and antisymmetric are not opposites.
(ii) If R is an equivalence relation, and ( ) , then and are called equivalent. The notation
is often used to denote that and are equivalent elements with respect to a particular
equivalence relation.

Problem 1: Consider * + and a relation on in each of the following cases.


Check whether they are reflexive, symmetric, anti-symmetric or transitive.
Also check which of them is equivalence relation or partially ordered relation.
(1) [R, T, S, AS]
(2) [R, T, AS ]
(3) [S]
(4) *( ) ( ) ( ) ( ) ( )+ [R, T, S]
(5) * ( ) ( ) ( ) ( )+ [T, S]
(6) * ( ) ( )+ [T, S, AS]
(7) *( ) ( ) ( ) ( ) ( )+ [R]

Problem.2
Show that the ―greater than or equal‖ relation (≥) is a partial ordering on the set of integers.
Solution:
Because a ≥ a for every integer a, ≥ is reflexive.
If a ≥ b and b ≥ a, then a = b.
Hence, ≥is antisymmetric.
Finally, ≥is transitive because a ≥ b and b ≥ c imply that a ≥ c.
It follows that ≥is a partial ordering on the set of integers and (Z,≥) is a poset.

Problem.3
Show that the inclusion relation ⊆ is a partial ordering on the power set of a set S.
Solution:
Because A ⊆A whenever A is a subset of S,⊆ is reflexive.
It is antisymmetric because A ⊆ B and B ⊆ A imply that A = B.
Finally, ⊆is transitive, because A ⊆ B and B ⊆ C imply that A ⊆ C.
Hence, ⊆is a partial ordering on P(S), and (P(S),⊆ )is a POset.

Exercise
1. Check whether the following relations are equivalence relation or not on the set of all integers
Where if and only if 1) 2)
2. Check whether from the following relation sets, which are satisfying the transitive, reflexive
or symmetric property which relation is an Equivalence relation and partially ordered
relation.
1) R1 = {(1, 1), (2, 2), (3, 3)}
2) R2 = {(1, 1), (2, 2), (1, 2), (2, 1), (3, 1)}
3) R3= {(1, 1), (1, 2), (2, 1), (1, 3), (3, 1)}
4) R4= {(1, 1), (2, 2), (3, 3), (1, 2), (2, 1), (1, 3), (3, 1), (2, 3), (3, 2)}
3. Prove that ( ) is a partially ordered set where Z is the set of integers.
4. Check if with the ‗ ‘ relation is a POSet.

DIFFERENCE BETWEEN RELATION AND FUNCTION

Function
We can, visualise a function as a rule, which produces new elements out of some given elements.
There are many terms such as ‗map‘ or ‗mapping‘ used to denote a function.

Definition
A relation f from a set A to a set B is said to be a function if every element of set A has one and only
one image in set B.
In other words,
A relation f is a function from a non-empty set A to a non-empty set B if
(i) the domain of f is A
(ii) no two distinct ordered pairs in f have the same first elements.

Note:
If is a function from A to B and ( ) , then we write ( ) , where is called the image
of under and is called the preimage of under f.

Problem.1
Examine each of the following relations given below and state in each case, giving reasons whether
it is a function or not on the given domain?
(i) R = {(2,1),(3,1), (4,2)}, Domain * +
(ii) R = {(2,2),(2,4),(3,3), (4,4)} , Domain * +
(iii) R = {(1,2),(2,3),(3,4), (4,5), (5,6), (6,7)}, Domain * +

REPRESENTION OF RELATIONS
Representing Relations Using Matrices
A relation between finite sets can be represented using a zero–one matrix.
Suppose that R is a relation from * + to * +.
(Here the elements of the sets A and B have been listed in a particular, but arbitrary, order.
Furthermore, when A = B we use the same ordering for A and B.)
( )
The relation R can be represented by the matrix , - where {
( )
In other words, the zero–one matrix representing R has a 1 as its( )th entry when is related to
, and a 0 in this position if is not related to .
Note: Such a representation depends on the orderings used for A and B.
Problem.1
Suppose that * +and * +
Let R be the relation from A to B containing ( ) if .
What is the matrix representing R?
Solution
Because *( )( )( )+, the matrix for R is MR = [ ]

Problem.2
Let * + and * +

Which ordered pairs are in the relation R represented by the matrix MR =[ ]?

Solution:
Because R consists of those ordered pairs ( ) with , it follows that
*( )( )( )( )( )( )( )+
Remark
 R is reflexive if and only if for .
In other words, R is reflexive if all the elements on the main diagonal of MR are equal to 1.
Note that the elements off the main diagonal can be either 0 or 1.

(The matrix for a reflexive relation)


 The relation R is symmetric if and only if whenever .
This also means whenever .
Consequently, R is symmetric if and only if , for all and .
i.e. R is symmetric if and only if ,
i.e, R is symmetric if MR is a symmetric matrix.
 The relation R is anti-symmetric if and only if with ,then .
In other words, if then either .
The form of the matrix for an antisymmetric relation is illustrated in Figure.

Matrix of Union and Intersection of two relations


Suppose that R and S are relations on a set A represented by the matrices and , respectively.
The matrix representing the union of these relations has a 1 in the positions where either or
has a 1.
The matrix representing the intersection of these relations has a 1 in the positions where both
and have a 1.
Thus, the matrices representing the union and intersection of these relations are
and .

Problem.3
Suppose that the relations R and S on a set A are represented by the matrices

=[ ]and =[ ]

What are the matrices representing and ?

Solution:
The matrices of these relations are

[ ] and [ ]

Matrix of Composite of two relations:


Matrix of Composite of two relations can be found using the Boolean product of the matrices for
these relations.
In particular, suppose that R is a relation from A to B and S is a relation from B to C.
Suppose that A, B, and C have and elements, respectively.
Let the zero– one matrices for , and be [ ] , - , -
respectively. (Note that these matrices have sizes , and , respectively).
The ordered pair ( ) belongs to if and only if there is an element such that ( )
and ( ) .
It follows that if and only if for some .
In other words, if and only if row of and column of has 1 at a same position.
From the definition of the Boolean product, this means that .

Problem.4
Find the matrix representing the relation , where the matrices representing R and S are

MR =[ ]and MS =[ ]

Solution:

The matrix for S◦R is [ ].

Exercise

1. Let R be the relation represented by the matrix [ ]. Find the matrix representing

(a) (b) ( )

2. Let and be relations on a set A represented by the matrices [ ] and

[ ] . Find the matrices representing the following relations.

(a) (b) (c) (d) (e)


Representing Relations Using Digraphs
There is another important way of representing a relation using a pictorial representation.
Each element of the set is represented by a point, and each ordered pair is represented using an arc
with its direction indicated by an arrow.
We use such pictorial representations when we think of relations on a finite set as directed graphs,
or digraphs.

Definition
A directed graph, or digraph, consists of a set V of vertices (or nodes) together with a set E of
ordered pairs of elements of V called edges (or arcs). The vertex ‗a‘ is called the initial vertex of the
edge (a,b), and the vertex ‗ b‘ is called the terminal vertex of this edge.
An edge of the form (a,a) is represented using an arc from the vertex ‗a‘ back to itself. Such an edge
is called a loop.

REMARKS
 A relation R is reflexive if and only if there is a loop at every vertex of the directed graph, so
that every ordered pair of the form ( ) occurs in the relation.
 A relation is transitive if and only if whenever there is an edge from a vertex x to a vertex y
and an edge from a vertex y to a vertex z, there is an edge from x to z (completing a triangle
where each side is a directed edge with the correct direction).
 A relation is symmetric if and only if for every edge between distinct vertices in its digraph
there is an edge in the opposite direction, so that ( ) is in the relation whenever ( ) is in
the relation.
 A relation is antisymmetric if and only if there are never two edges in opposite directions
between distinct vertices.

Problem.1 Draw the directed graph of the relation


*( ) ( ) ( ) ( ) ( )( )( )( )+

Problem.2 Draw the directed graph of the relation


*( ) ( ) ( ) ( ) ( ) ( ) ( ) ( )+
Problem.3 Determine whether the relations for the directed graphs shown in the following figure are
reflexive, symmetric, antisymmetric, and/or transitive.

(a) (b) (c) (d)


Problem.4 Write the relation represented by the following digraph and also write the matrix
representing this relation.

(a) (b)

Solution.
(a) *( )( )( )( )( )( )( )( )( )+

[ ]

(b) *( )( )( )( )( )( )( )( )+

[ ]

Exercise
1. Write the relation represented by the following matrices and also draw the corresponding
digraph.
(a) (b) (c)
[ ] [ ]

[ ]
CLOSURES OF RELATIONS
Introduction
Let be a relation on a set .
may or may not have some property , such as reflexivity, symmetry, or transitivity. If there is a
relation with property containing such that is a subset of every relation with property
containing , then is called the closure of .
In other words, is the smallest superset of with the property .
Reflexive closure of R
For given a relation R on a set A, the reflexive closure of R can be formed by adding to R all pairs of
the form ( ) with , not already in R.
The addition of these pairs produces a new relation that is reflexive, contains R, and is contained
within any reflexive relation containing R. Consequently, it is the reflexive closure of .
Thus, the reflexive closure of R can be given by R Δ, where *( )| +is the diagonal
relation on A.
Problem.2
The relation *( )( )( )( )+on the set * + is not reflexive. Obtain the
reflexive closure of R.
Solution Here, diagonal relation on is *( )( )( )+
Therefore, the reflexive closure of is *( )( )( )( )( )( )+
Problem.2
What is the reflexive closure of the relation *( )| +on the set of integers?
Solution: The reflexive closure of R is
*( )| + *( )| + *( )| +

Symmetric closure of R

The symmetric closure of a relation R can be constructed by adding all ordered pairs of the form
( ) for all ( ) that are not already present in R.
Adding these pairs produces a relation that is symmetric, that contains R, and that is contained in
any symmetric relation that contains R. Consequently, it is the symmetric closure of .
The symmetric closure of a relation can be constructed by taking the union of a relation with its
inverse
i.e., is the symmetric closure of R, where *( )|( ) +

Problem.1
Find the symmetric closure of the relation*( )( )( )( )( )( )+on* +.
Solution.
*( )( )( )( )( )( )+
Therefore, symmetric closure of is
*( )( )( )( )( )( )( )( )+

Problem.2
What is the symmetric closure of the relation *( )| + on the set of positive integers?
Solution:
*( )| + *( )| + *( )| +
The symmetric closure of R is the relation
*( )| + *( )| + *( )| +

Transitive closure of R
Suppose that a relation R is not transitive.
Let be the zero–one matrix of the relation R on a set with elements.
Let be the transitive closure of .
Then the zero–one matrix of the transitive closure is
, - , - , -

Here R is known as connectivity relation.


Problem.1
Find the zero–one matrix of the transitive closure of the relation R where

[ ]

Solution:
The zero–one matrix of is , - , - .
Now, , - is the matrix of the composite relation

, - [ ]
and , - is the matrix of the composite relation

, - [ ]

Hence,

[ ] [ ] [ ] [ ]

Exercise:
1. Let R be the relation on the set {0,1,2,3} containing the ordered pairs (0,1), (1,1), (1,2), (2,0),
(2,2), and (3,0). Find a) reflexive closure of R.
b) symmetric closure of R.

DATABASE & RELATIONS


Concepts of relations have a strong application in the theory of relational databases.
Definition:
Let be sets. An n-ary relation on these sets is a subset of .
The sets are called the domains of the relation, and n is called its degree.
For example:
Let R be the relation on consisting of triples ( ) where are integers with
. Then ( ) , but ( ) The degree of this relation is 3. Its domains are
all equal to the set of natural numbers.
For example:
Let be the relation on consisting of all triples of integers ( ) in which
form an arithmetic progression. That is, ( ) if and only if there is an integer such that
and , or equivalently, such that and .
Note that ( ) because and , but ( ) because
while This relation has degree 3 and its domains are all equal to the set of
integers.
For example:
Let R be the relation consisting of ( ) representing airplane flights, where
is the airline, is the flight number, is the starting point, is the destination, and is the
departure time.
For instance, if Nadir Express Airlines has flight 963 from Newark to Bangor at 15:00, then (Nadir,
963, Newark, Bangor, 15:00) belongs to R.
The degree of this relation is 5, and its domains are the set of all airlines, the set of flight numbers,
the set of cities, the set of cities (again), and the set of times.

Database & relations:


The time required to manipulate information in a database depends on how this information is stored.
The operations of adding and deleting records, updating records, searching for records, and
combining records from overlapping databases are performed millions of times each day in a large
database. Because of the importance of these operations, various methods for representing databases
have been developed. We will discuss one of these methods, called the relational data model, based
on the concept of a relation.
A database consists of records, which are n-tuples, made up of fields. The fields are the entries of
the n-tuples. For instance, a database of student records may be made up of fields containing the
name, student number, major, and grade point average of the student. The relational data model
represents a database of records as an n-ary relation.
Definition: (Selection operator)
Let be an relation and be a condition that elements in may satisfy. Then the selection
operator maps the relation to the relations of all n-tuples from R that satisfy
the condition .
Definition: (Projection operator)
The projection where , maps the n-tuple ( ) to the m-tuple
( ), where .
In other words, the projection deletes of the components of an n-tuple, leaving the
and components.
For example:
Consider the student records given by the following table.

These student records can be given using of the form


( )
A sample database of six such records is
( )
( )
( )
( )
( )
( )
To find the records of computer science majors in the relation shown in the above table,
we use the operator , where is the condition The result is the
two 4-tuples ( ) and
( ).
Similarly, to find the records of students who have a grade point average above in this database,
we use the operator , where is the condition . The result is the two 4-tuples
( ) and ( ).
Finally, to find the records of computer science majors who have a GPA above 3.5, we use the
operator , where is the condition ( ). The result
consists of the single 4-tuple ( ).
When the projection is used, the second and third columns of the table are deleted, and pairs
representing student names and grade point averages are obtained. The following table displays the
results of this projection.

Definition: (Join operator)


Let be a relation of degree and be a relation of degree . The join ( ) where and
, is a relation of degree that consists of all ( )
( ), where the m-tuple
( ) belongs to R and the n-tuple ( ) belongs to S.
In other words, the join operator produces a new relation from two relations by combining all m-
tuples of the first relation with all n-tuples of the second relation, where the last p components of the
m-tuples agree with the first p components of the n-tuples
For example: What relation results when the join operator J2 is used to combine the relation
displayed in the following tables?

The join produces a member of relation as ( ) by joining the


members ( ) and ( )
The relation thus produced is shown in the following table.

Exercise:
1. Consider the following Tables.
a. What do you obtain when you apply the selection operator , where C is the condition
( ) ( ), to the database in the table of Parts_inventory.?
b. Construct the table obtained by applying the join operator J2 to the relations in the following
tables
CANTOR’S DIAGONAL ARGUMENT
Finite and infinite sets:
Let S be a set. If there are exactly n distinct elements in S where n is a nonnegative integer, we say
that S is a finite set and that n is the cardinality of S. The cardinality of S is denoted by |S|.
A set is said to be infinite if it is not finite.

Countable and uncountable sets:


A set that is either finite or has the same cardinality as the set of positive integers is called countable.
A set that is not countable is called uncountable.
Note:
Cantor’s diagonal argument
A set is finite iff there is a bijection between and * + for some positive integer , and
infinite otherwise. (i.e., if it makes sense to count its elements.)
Two sets have the same cardinality iff there is a bijection between them.
A set S is called countably infinite if there is a bijection between and . Such a set is countable
because elements can be counted, but unlike a finite set, counting never ends.
On the other hand, not all infinite sets are countably infinite. In fact, there are infinitely many sizes
of infinite sets.
Georg Cantor proved this astonishing fact in 1895 by showing that the set of real numbers is not
countable. That is, it is impossible to construct a bijection between and . In fact, it‘s impossible
to construct a bijection between and the interval , -.
Theorem:
The set of real numbers is not countable
Proof:
Suppose that , - is any function.
Make a table of values of , where the 1st row contains the decimal expansion of ( ), the 2nd row
contains the decimal expansion of ( ), . . . the nth row contains the decimal expansion of ( ), …
Perhaps, ( ) ( ) ( ) ( ) √ ( ) , and so on, so
that the table starts out like this.

Highlighting the digits in the main diagonal of the table.

The highlighted digits are 0.37210 . . . . Suppose that we add 1 to each of these digits, to get the
number
0.48321 . . . . then this number can‘t be in the table. Because
• it differs from f(1) in its first digit;
• it differs from f(2) in its second digit;
•...
• it differs from f(n) in its nth digit;
•...
So it can‘t equal f(n) for any n — that is, it can‘t appear in the table
This looks like a trick, but in fact there are lots of numbers that are not in the table.
As long as we highlight at least one digit in each row and at most one digit in each column, we can
change each the digits to get another number not in the table.
Therefore, there does not exist a bijection between and , -.
Hence, , - is not a countable set.
Since, cardinality of and , - is same, is also uncountable.

The Power set theorem


Statement: For every set S, |S| < |P(S)|
Proof:
Let ( ) be any function and define * | ( )+.
Suppose that ( ) for some
If so, then either belongs to or it doesn‘t.
But by the very definition of , if belongs to then it doesn‘t belong to ( ).
And if it doesn‘t belong to then it belong to ( ).
This situation is impossible.
Hence, cannot equal ( ) for any .
Using the Cantor‘s diagonal argument, this proves that cannot be onto.|
Hence, | | | ( )|. Which gives |S| < |P(S)|.

Schroder-Bernstein Theorem
If A and B are sets with | | | | and | | | |, then | | | |. In other words, if there are one-
to-one functions f from A to B and g from B to A, then there is a one-to-one correspondence between
A and B.

You might also like