Sei sulla pagina 1di 12

A function f from X to Y (in symbols f : X Y) is a relation from X to Y such that Dom(f) = X and if two pairs (x,y) and (x,y)

) f, then y = y

Example: Dom(f) = X = {a, b, c, d}, Rng(f) = {1, 3, 5} f(a) = f(b) = 3, f(c) = 5, f(d) = 1.

Domain of f = X Range of f = { y | y = f(x) for some x X} A function f : X Y assigns to each x in Dom(f) = X a unique element y in Rng(f) Y. Therefore, no two pairs in f have the same first coordinate.

Let x be a nonnegative integer and y a positive integer r = x mod y is the remainder when x is divided by y
Examples: 1 = 13 mod 3 6 = 234 mod 19 4 = 2002 mod 111

mod is called the modulus operator

A function f : X Y is one-to-one for each y Y there exists at most one x X with f(x) = y. Alternative definition: f : X Y is one-to-one for each pair of distinct elements x1, x2 X there exist two distinct elements y1, y2 Y such that f(x1) = y1 and f(x2) = y2.

Examples: 1. The function f(x) = 2x from the set of real numbers to itself is one-to-one 2. The function f : R R defined by f(x) = x2 is not one-to-one, since for every real number x, f(x) = f(-x).

A function f : X Y is onto for each y Y there exists at least one x X with f(x) = y, i.e. Rng(f) = Y.

Example: The function f(x) = ex from the set of real numbers to itself is not onto Y = the set of all real numbers. However, if Y is restricted to Rng(f) = R +, the set of positive real numbers, then f(x) is onto.

A function f : X Y is bijective f is one-to-one and onto

Examples:
1. A linear function f(x) = ax + b is a bijective function

from the set of real numbers to itself 2. The function f(x) = x3 is bijective from the set of real numbers to itself.

Given a function y = f(x), the inverse f -1 is the set {(y, x) | y = f(x)}. The inverse f -1 of f is not necessarily a function.

Example: if f(x) = x2, then f -1 (4) = 4 = 2, not a unique value and therefore f is not a function.

However, if f is a bijective function, it can be shown that f -1 is a function.

Let f(x) = 2x and g(x) = log 2 x = lg x


f g(x) = f(g(x)) = f(lg x) = 2 lg x = x g f(x) = g(f(x)) = g(2x) = lg 2x = x

Therefore, the exponential and logarithmic functions are inverses of each other.

Given two functions g : X Y and f : Y Z, the composition f g is defined as follows: f g (x) = f(g(x)) for every x X.
Example:

g(x) = x2 -1, f(x) = 3x + 5. Then f g(x) = f(g(x)) = f(3x + 5) = (3x + 5)2 - 1

Composition of functions is associative: f (g h) = (f g) h, But, in general, it is not commutative: f g g f.

A binary operator on a set X is a function f that associates a single element of X to every pair of elements in X, i.e. f : X x X X and f(x1, x2) X for every pair of elements x1, x2.

Examples of binary operators are addition, subtraction and multiplication of real numbers, taking unions or intersections of sets, concatenation of two strings over a set X, etc.

A unary operator on a set X associates to each single element of X one element of X.

Examples: 1. Let X = U be a universal set and P(U) the power set of U. Define f : P(U) P(U) the function defined by f (A) = A', the set complement of A in U, for every A U. Then f defines a unary operator on P(U).

Let X be any set, X* the set of all strings over X. If = x1x2xn X*, let f() = -1 = xnxn1x2x1, the string written in reverse order. Then f :X* X* is a function that defines a unary operator on X*. Observe that -1 = -1 =

Potrebbero piacerti anche