Professional Documents
Culture Documents
Lecture 02
Lecture 02
Lecture 02
FUNCTIONS - 1
• Definition: Let X and Y be non-empty sets (not necessarily
distinct). Then a function on X to Y is a subset f of X×Y
with the additional property that for each x∈ X, there is
exactly one ordered pair (x,y) ∈ f. In other words, each x∈
X occurs as the first component in only one ordered pair in f.
• Terminology: X is referred to as the domain of f, and Y is
referred to as the codomain of f. Note that the uniqueness
condition in the definition only applies to elements of the
domain. In other words, for a y ∈ Y, there could be zero, one
or many ordered pairs in f with y as the second component.
FUNCTIONS - 2
• Remark: The formal definition of a function is as a set of
ordered pairs (as in the preceding slide). However, the notion
of a function f is usually introduced as a rule, which assigns
a unique element of the codomain to each and every element
of the domain. This is indicated by the notation f: X→ Y.
For any x ∈ X, the element y ∈ Y assigned to x by f is
notated as f(x), or by the notation x → y (M&N uses a
slightly different arrow), and referred to as the image of x.
The subset {y ∈ Y: y = f(x) for some x∈ X} is notated as
f(X) and referred to as the image of X or the range of f. We
will frequently use this more familiar approach and the
related notation and terminology.
FUNCTIONS - 3
• Definition (Composition of Functions): If f: X → Y. and g:
Y → Z are functions, we can introduce a new function h: X
→ Z by the rule h(x) = g(f(x)) for every x ∈ X. This function
is known as the composition of the functions g and f, and is
denoted by g•f. It is not always possible to define the
composition of functions, but if we restrict ourselves to the
special case that X = Y = Z, then the composition is always
defined. Provided we are in this situation, we often will use
the simpler notation gf for the composition of the functions g
and f.
• Remark: There is a very nice example and illustration on pages
27-28 of M&N. BTW, when using this simpler approach to functions,
the subset {(x,f(x)); x ∈ X} is often referred to as the graph of f.
FUNCTIONS - 4
▪ Definition (Special Types of Functions): Let f: X → Y. ne a
function. Then, f is said to be:
• one-to-one or injective or an injection if every y ∈ Y has at most
one incoming arrow;
• onto or surjective or a surjection if every y ∈ Y has at least one
incoming arrow;
• bijective or a bijection if every y ∈ Y has exactly one incoming
arrow.
• Remark: If f is surjective, then the range and codomain of f
are the same set. If X and Y are finite sets, then there is a
bijection on X to Y if and only if |X| = |Y|.
• Something to Think About: If X and Y are finite sets with |
X| = |Y|, then a function f: X → Y is surjective iff it is injective.
FUNCTIONS - 5
RELATIONS - 1
▪ Definition: Let X1, X2, …….,, Xn be an ordered list of non-
empty sets. Then a relation R on the list is a subset of the
cartesian product X1×X2× ….× Xn, i.e. R ⊆ X1×X2× .× Xn.
▪ Remark 1: This is a more general definition than the one in
M&N, which only considers the case n = 2. Such relations
are also called binary relations, and for the moist part we
will be concerned with this case only.
▪ Remark 2: The general case was not considered very
important until the advent of computer databases. In the
relational model, a database is simply a family of relations.
This has led to a great expansion in the study of relational
algebra, which we will not deal with in the course, but you
will certainly encounter later !.
RELATIONS - 2
▪ For the time being, we will only consider binary relations.
▪ Terminology and Notation: Let R be a relation on X and Y.
If (x,y) ∈ R, we say that x and y are related. This is also
written xRy.
▪ Remark 1: Relations occur very frequently in mathematics.
The word relationship is also very common in day-to-day
life, and so relations often provide a convenient
mathematical model for other disciplines.
▪ Remark 2: Note that a function is also a relation, i.e. the
study of functions is a special case of the study of relations.
However, it is so important, that it is usually considered
separately.
RELATIONS - 3
▪ Representing Relations: Apart from the standard method of
representing a relation as a set of ordered pairs, either by
stating the ordered pairs or by set builder notation, relations
can be represented in the following ways:
▪ As a (0,1) matrix
▪ Pictorially, as a rectangular grid with cells in the relation and those
not in the relation coloured differently.
▪ Pictorially, by representing elements of X and Y as points in
separate regions, and joining points which represent related
elements.
You are probably familiar with these approaches; you may consult
M&N if you need more explanation.
RELATIONS - 4
• Definition (Composition of Relations): Let X, Y, Z be sets
and let R ⊆ X×Y and S ⊆ Y×Z ne relations. The composition
of the relations R and S is the relation T ⊆ X×Z defined as
follows: for a given x ∈ X and a given z ∈ Z, xTz holds if
and only if there is an element y∈ Y such that xRy and ySz.
The usual notation for this is R•S. Remark: Just as with
composition of functions, you would have noticed two
things: the composion of relations is not always defined and,
even if it is defined, composition is not commutative.
However, it is defined if R and S are both relations on the
same set X, i.e. subsets of X×X. You would also have
noticed that the notation is different !