SECTION 4.1  Introduction to Functions

Functions

Function Machines


Functions


D E F I N I T I O N S

Given a function f, and sets A and B:

Function A function f from set A to set B is a relationship between elements of A and elements of B where each element of A is related to a unique element of B.  It is denoted by f: A B.

Given an element a in A, there is a unique element b in B that is related to a. f(a) is called f of a, or the image of a under f.

Domain and
Co-Domain
Given a function f from set A to set B:

    A is called the domain of f; and
    B is called the co-domain of f.

Range Given a function f from set A to set B:

The set of all values b in B such that f(a) = b is called the range of f or the image of the set A under f.  It is written symbolically as:

    range of f = {b B | b = f(a), for some a in A}

Inverse Image Given an element b in B, there may exist elements in A with B as their image. The set of all such elements is called the inverse image of b. It is written symbolically as :

    inverse image of b = {a A | f(a) = b}

Equal Functions Suppose f and g are functions from A to B. Then f equals g if, and only if, f(a) = g(a) for all a A.

If A and B are finite sets, an arrow diagram shows a function f from A to B by drawing an arrow from each element in A to the corresponding element of B.

Two properties must be held in the arrow diagram according to the definition of function:

1. Every element of A has an arrow coming out of it.

2. No one element of A has two arrows coming out of it that point to two different elements of B.

These two properties must be held because the definition of function says that each element of A is sent to a unique element of B.

An example of an arrow diagram is shown below:








Function Machines

Functions can be thought of machines. Suppose f is a function from A to B and an input a of A is given.  f can be imagined as a machine that processes a in a certain way to produce the output f(a). For instance, if f : R R is a cubing function, given an input n, f will produce an output f(n) = n3.

Consider the following examples:

1. The Logarithmic Function

Let z be a positive real number. For each positive real number x, the logarithm with base z of x, written logzx, is the exponent to which z must be raised to obtain x.

logzx = yz y = x

The logarithmic function with base z : R+ R, means that it takes each positive real number x to logz x.

Try to find log2(1/8) and click here for answer.



2. Identity Functions

Let X be any set. The identity function on X is

and it is defined by the rule a  X, ix(a) = a.



3. The Hamming Distance Function

The Hamming distance function was invented by the computer scientist Richard W. Hamming. It gives a measure of the "difference" between two strings of 0's and 1's that have the same length.

Let  = {0, 1} and n  Z+; then  is the set of all strings of 0's and 1's of length n. Define a function H :  x   Z+ as follows:  for each pair of strings (s, t)    x ,

Let n = 6, so that  6 is the set of strings comprised of any combination of six 0's and 1's. Applying the distance function H to 2 strings in the set as follows;

H(110001, 110010) = 2

because 110001 and 110010 differ only in the last two positions.








  Go to next section review.  
  Go to Class Agenda.