You are on page 1of 12

ICS 3103 : Automata Theory And Computability

Functions and Relations Review


(Continued from Lecture 2.1)

3 Functions
There are three primary ways of expressing relationships among variables: functions, graphs,
and tables.

Definition 3.0.1. Variable: A variable is a symbol used to represent some unknown quantity.

Typically, the letters x and y are used to represent variables.

Consider the following examples:

(a) A light bulb manufacturer who produces x units has a total cost of production of y dollars.

(b) A salesperson who sells x number of cars per month receives a monthly commission of y
dollars.

(c) The local pizza place sells an average of y pizzas daily when the price per pizza is x dollars.

• All these examples have one thing in common: they express relationships between variables.
• The concept of a function is central to any analysis that involves relationships among various
types of variables

• A function is a “black box” (a rule) that takes a numerical input(s) and produces a unique
number as output. The variable that represents the input is called the independent vari-
able, whereas the variable that represents the output is called the dependent variable.

• Typically, the variable x represents the independent variable (e.g., number of cars sold) and
the variable y represents the dependent variable (e.g., car sale commission received). To
express that the variable y is a function of the variable x we write,

y = f (x).

The symbol f (x) denotes “function of x” and is read as “f of x.”

Example 3.0.1. Suppose that we have the function y = f (x) = 2x − 1 and the value of x is
x = 3, then the value of y is y = f (3) = 2(3)1 = 5.

Definition 3.0.2. Functions: A function of a variable x is a rule f that assigns to each value of
x a unique number f (x), known as the value of the function at x.
Page 1 of 12
Example 3.0.2. Let f be the function with domain all real numbers x and defined by the formula

f (x) = 3x3 − 4x2 − 3x + 7. (4)

Find f (2) and f (−2).

In order to obtain f (2) we substitute 2 for every occurrence of x in the formula (4). We then we
have

f (2) = 3(2)3 − 4(2)2 − 3(2) + 7,


= 9.
Definition 3.0.3. Domain: The domain is the set of values that the independent variable is
allowed to take.

So, for the domain we need to avoid division by zero, square roots of negative numbers, logarithms
of zero and logarithms of negative numbers etc.

Definition 3.0.4. The range of a function is simply the set of all possible values that the dependent
variable can assume.

Definition 3.0.5. Composite function: Composition of functions is when one function is inside
another function. For instance, the function h(x) = (2x − 1)2 is composed of two simpler functions.
The inside functions 2x− 1 and the outside function z2. Notice that if we put the inside function
2x − 1 into the outside function z2, we get (2x − 1)2 which is same as h(x).

The composition of two functions f (x) and g(x) is denoted as:

(f ◦ g)(x) = f (g(x))

The order in which the composition is written is very important as follows.

• (f ◦ g)(x) = f (g(x)), means the function g is inside the function f .

• (g ◦ f )(x) = g(f (x)), means the function f is inside the function g.

Example 3.0.4. If f (x) = −4x + 9 and g(x) = 2x − 7, find (f ◦ g)(x) = f (g(x)).

(f ◦ g)(x) = f (g(x)),
= −4(2x − 7) + 9,
= −8x + 28 + 9
= −8x + 37.

Example 3.0.7. If f (x) = −4x + 9 and g(x) = 2x − 7, find (g ◦ f )(x) = g(f (x)).

(g ◦ f )(x) = g(f (x)),


Page 2 of 12
= 2(−4x + 9) − 7,
= −8x + 18 − 7
= −8x + 11.

Example 3.0.8. If f (x) = 2x + 1 and g(x) = x − 3, find (f ◦ g)(x) = f (g(x)).

(f ◦ g)(x) = f (g(x)),
= 2(x − 3) + 1,
= 2x − 6 + 1
= 2x − 5.

3.1 Function Types


3.1.1 Linear Functions
• A linear function is a function of the form f (x) = ax + b, where a and b are real numbers. Here, a
represents the gradient of the line and b represents the y-intercept (the vertical intercept).

• Graphs of these functions are straight lines.

Fig. 13: Graphs of a linear functions

Example 3.1.0. When US Environmental Protection Agency found a certain company dumping
sulfuric acid into the Mississippi River, it fined the company $125, 000, plus $1000 per day until the
company complied with the federal water pollution regulations. Express the total fine as a function
of the number x of days the company continued to violate the federal regulations.

The variable fine for x days pollution at $1000 per day is 1000x dollars. The total fine is therefore
given by the function

Page 3 of 12
f (x) = 125, 000 + 1000x.

The above can be graphically represented in the Figure below

Fig. 14: Graph of f (x) = 125, 000 + 1000x

3.1.2 Quadratic functions


A quadratic function is a function of the form f (x) = ax2 + bx + c, where a, b and c are constants
and a /= 0. The domain of such a function consists of all real numbers. Such graph is called
parabola. If a is a positive number then the parabola opens upward and if a is a negative
number then the parabola opens downward as shown below.

(a) f (x) = x2 (b) f (x) = −x2 + 4x + 5


Fig. 15: The parabolas of two quadratic functions

Page 4 of 12
Fig. 16: Graphs of power functions

3.1.3 Polynomial functions


• A polynomial function f (x) is one of the form

f (x) = anxn + an−1xn−1 + · · · + a0,

where n is a nonnegative whole number and a0, a1, · · · , an are constants.

• The highest power of x that occurs is called the degree of the polynomial
• The following are examples of polynomial functions

f (x) = 5x3 − 3x2 − 2x + 4.


g(x) = x4 − x + 1.

• The domain of a polynomial function consists of all real number.

Fig. 17: Graphs of polynomial functions

3.1.4 Rational function


• A function expressed as the quotient of two polynomials is called rational function

• The following are examples of polynomial functions

x2 + 1
f (x) = .
x
x +3
g(x) = .
x2 − 4
• The domain of a rational function excludes all values of x for which the denominator is
Page 5 of 12
zero.

(a)
(b)

Page 6 of 12
Fig. 18: Graphs of rational functions

3.2.6 Exponential functions

• Functions of the form f (x) = abx are called exponential functions (or power
functions), where x is the exponent and a and b are constants.

• If the base b is greater than 1 then the result is exponential growth. Many physical
quantities grow exponentially (e.g. animal populations and cash in an interest-bearing
account)

• If the base b is smaller than 1 then the result is exponential decay. Many quantities
decay exponentially (e.g. the sunlight reaching a given depth of the ocean and the
speed of an object slowing down due to friction)

(a) b ≥ 1 (b) b < 1

Fig. 19: Graphs of rational functions

3.2.7 Logarithmic functions


• Are functions of the form:
f (x) = a ln(x) + b
where x is in the natural logarithm and a and b are constants.
• They are only defined for positive x
• For small x they are negative and for large x they are positive but stay
small

Page 7 of 12
Fig. 20: Graphs of logarithmic functions

3.2.8 Sinusoidal functions

**Reading Exercise**

3.3 Sequences and Tuples


• A sequence of objects is a list of objects in some order

• We usually designate a sequence by writing the list within parentheses. For example,
the sequence 7, 21, 57 would be written (7, 21, 57)

• The order doesn’t matter in a set, but in a sequence it does. Hence (7, 21, 57) is not
the same as (57, 7, 21)

• As with sets, sequences may be finite or infinite

• Finite sequences often are called tuples.

• A sequence with k elements is a k-tuple. Thus (7, 21, 57) is a 3-tuple. A 2-tuple is also
called an ordered pair

3.4 Relations and Functions


• A function also is called a mapping and, if f(a) = b, we say that f maps a to b.

Page 8 of 12
• For example, the absolute value function abs takes a number x as input and returns x
if x is positive and x if x is negative. Thus abs(-22) = 22.

• Addition is another example of a function, written add . The input to the addition
function is an ordered pair of numbers, and the output is the sum of those numbers.
• The set of possible inputs to the function is called its domain
• The outputs of a function come from a set called its range

• The notation for saying that f is a function with domain D and range R is f : D → R

• In the case of the function abs, if we are working with integers, the domain and the
range are Z, so we write abs : Z→Z.

• In the case of the addition function for integers, the domain is the set of pairs of
integers Z × Z and the range is Z, so we write add: Z × Z→Z

• A predicate or property is a function whose range is TRUE or FALSE


• For example, let even be a property that is TRUE if its input is an even
number and FALSE if its input is an odd number. Thus even(4) = TRUE and
even(5) = FALSE.

3.4.1 Binary Relations

• Cartesian Product Review:

o Let A= {a1, a2, ..ak } and B = {b1,b2,..bm}. The Cartesian product A x B is


defined by a set of pairs {(a1 b1), (a1, b2), … (a1, bm), …, (ak,bm)}

o Cartesian product defines a product set, or a set of all ordered arrangements


of elements in sets in the Cartesian product

• Definition 3.4.1.1: Let A and B be two sets. A binary relation from A to B is a subset
of a Cartesian product A x B
• R ⊆ A x B means R is a set of ordered pairs of the form (a,b) where a ∈ A and b ∈ B.
• We use the notation a R b to denote (a,b) ∈ R
• Example 3.4.1: Let A = {a,b,c} and B = {1,2,3}
• Is R = {(a,1),(b,2),(c,2)} a relation from A to B? - True
• Is Q = {(1,a),(2,b)} a relation from A to B? - False
• Is P = {(a,a),(b,a),(b,a)} a relation from A to A? –True

Page 9 of 12
• We can diagrammatically represent or tabulate a binary relation R. If a R b then
we can also draw an arrow from a to b i.e a → b for instance

• Example 3.4.1.2 : Let A = {0, 1, 2}, B = {u, v} and R = { (0, u), (0, v), (1, v), (2,u) }

a → b: Diagram a → b: Table

3.4.2 Relations on Sets

• Definition: A relation on the set A is a relation from A to itself


• Example 3.4.2.1: Let A = {1,2,3,4} and Rdiv = {(a,b) | a divides b}

• What does Rdiv consist of?

• Rdiv = {(1,1), (1,2), (1,3), (1,4), (2,2), (2,4), (3,3), (4,4)}

• Example 3.4.1.4: Let A = {1, 2, 3, 4}

o Define a R≠ b if and only if a ≠ b

o R≠={(1,2),(1,3),(1,4),(2,1),(2,3),(2,4),(3,1),(3,2),(3,4),(4,1),(4,2),
(4,3)}

o (Draw the table)

Page 10 of 12
3.4.3 Properties of relations on sets

i. Reflexive
o Definition: A relation R on a set A is called reflexive if (a, a) ∈ R for every
element a ∈ A.
o Example 3.4.3.1: Assume relation Rdiv = {(a b), if a |b} on A = {1,2,3,4}
 Is Rdiv reflexive?
 Rdiv = {(1, 1), (1, 2), (1,3), (1, 4), (2, 2), (2, 4), (3, 3), (4, 4)}
 Answer: True - (1, 1), (2, 2), (3, 3), and (4, 4) ∈ A.
o Example 3.4.3.2: Relation Rfun on A = {1,2,3,4} defined as:
Rfun = {(1,2),(2,2),(3,3)}.
 Is Rfun reflexive?

 No. It is not reflexive since (1, 1) ∉ Rfun.


ii. Irreflexive Relation
o A relation R on a set A is called irreflexive if (a, a) ∉ R for every a ∈ A.

iii. Symmetric Relation


• Definition: A relation R on a set A is called symmetric if
∀ a, b ∈ A (a, b) ∈ R → (b, a) ∈ R
• Example 3.4.3.3: Rdiv = {(a b), if a | b } on A = {1,2,3,4}
o Is Rdiv symmetric?
o Rdiv = {(1,1), (1,2), (1,3), (1,4), (2,2), (2,4), (3,3), (4,4)}
o Answer: No. It is not symmetric since (1, 2) ∈ R but (2, 1) ∉ R.
• Example 3.4.3.4: R≠ on A= {1, 2, 3, 4}, such that a R≠ b if and only if a ≠ b.
o Is R≠ symmetric?
R≠={(1,2),(1,3),(1,4),(2,1),(2,3),(2,4),(3,1),(3,2),(3,4),(4,1),(4,2),(4,3)}
o Answer: Yes. If (a,b) ∈ R≠ → (b,a) ∈ R≠
iv. Transitive Relation

• Relation R is transitive if for every x, y, and z, xRy and yRz implies xRz

Page 11 of 12
3.4.2 Relations vs Functions

• Relations represent one to many relationships between elements in A and B

• Given a function defined on sets A and B, A → B assigns to each element in the


domain set A exactly one element from B. So it is a special relation.

• A function is a one to one mapping

One to many mapping One to one mapping


(relation on a set) (Function)

3.4.3: Mathematical proof methods

** Reading Exercise**

Page 12 of 12

You might also like