Lecture 2 - Function, Sequence and Sums PDF
Lecture 2 - Function, Sequence and Sums PDF
DEFINITION 1
Let A and B to be nonempty sets. a function f from A to B is an assignment
of exactly one element of B to each element of A. We write f(a) = b if b is the
unique element of B assigned by the function f to the element a of A. If f is a
function from A to B, we write f: A → B.
DEFINITION 2
If f is a function from A to B, we say that A is the domain of f and B is the
Co-domain of f. If f(a) = b, we say that b is the image of a and a is a preimage
of b. The range of f is the set of all images of elements of A. Also, if f is a
function from A to B, we say that f maps A to B.
For each function, we specify its domain, codomain and the mapping of
elements of the domain to elements in the codomain
Two functions are said to be equal if they have the same domain, codomain,
and the map elements of their common domain to the same elements of their
common codomain
Solution:
domain: {Adams, Chou, Goodfriend, Rodriguez, Stevens}
codomain: {A, B, C, D, F}
range: {A, B, C, F}
Solution:
domain: the set of real numbers
DEFINITION 3
If f1 and f2 be functions from A to R. Then f1 + f2 and f1 f2 are also functions
from A to R defined by
(f1 + f2 )(x) = f1(x) + f2 (x)
(f1 f2 ) (x) = f1(x) f2 (x)
DEFINITION 5
A function f is said to be one-to-one, or injective, if and only if
f(a) = f(b) implies that a = b for all a and b in the domain of f. A function is
said to be an injection if it is one-to-one. (every element in the range is a
unique image for element of A – all image have at most one arrow or none)
Solution: Yes.
Example: Is the function f (x) = x2 from the set of integers to the set of
integers onto?
Solution: No. There is no integer x with x2 = -1, for instance.
Computer Sciences Department
2.3 Functions
11
DEFINITION 8
The function f is a one-to-one correspondence or a bijection, if it is both one-
to-one and onto.
b) f(x) = x2 + 1 No
c) f(x) = x3 Yes
DEFINITION 9
Let f be a one-to-one correspondence from the set A to the set B. The inverse
function of f is the function that assigns to an element b belonging to B the
unique element a in A such that f(a) = b.
The inverse function of f is denoted by f-1. Hence, f-1(b)=a when f(a) = b.
A one-to-one correspondence is
called invertible because we can
define an inverse of this function.
DEFINITION 10
Let g be a function from the set A to the set B , and let f be a function from the set B
to the set C . The composition of the functions f and g, denoted by f o g, is
defined by: (f o g)(a) = f(g(a))
Example:
Let g be the function from the set {a , b, c} to itself such that
g(a) = b, g(b) = c, and g(c) = a
Let f be the function from the set {a , b , c} to the set { l , 2 , 3 } such that
f(a) = 3 , f(b) = 2 , and f(c) = 1
What is the composition of f and g, and what is the composition of g and f?
Solution:
• The composition f o g is defined by:
• (f o g)(a) = f(g(a)) = f(b) =2
• (f o g)(b) = f(g(b)) = f(c) =1
• (f o g)(c) = f(g(c)) = f(a) = 3
• g o f is not defined, because the range of f is not a subset of the domain
of g
Computer Sciences Department
2.3 Functions
19
Example:
Let f and g be the functions from the set of integers to the set of integers
defined by f(x) = 2x + 3 and g(x) = 3x + 2.
What is the composition of f and g? What is the composition of g and f?
Solution:
Both the compositions f o g and g o f are defined
• (f o g)(x) = f(g(x)) = f(3x + 2) = 2(3x + 2) + 3 = 6x + 7
• (g 0 f)(x) = g(f(x)) = g(2x + 3) = 3(2x + 3) + 2 = 6x + 11.
DEFINITION 1
a sequence is a function from a subset of the set of integers (usually either
the set {0,1,2,…} or the set {1,2,3,…}) to a set S. We use the notation an to
denote the image of the integer n. We call an a term of the sequence.
DEFINITION 2
a geometric progression is a sequence of the form
a, ar, ar2, …, arn, …
where the initial term a and the common ratio r are real numbers.
DEFINITION 3
A arithmetic progression is a sequence of the form
a, a + d, a + 2d, …, a + nd, …
where the initial term a and the common difference d are real numbers.
Example :
Find formulae for the sequences with the following
first five terms
(a). 1, 1/2, 1/4, 1/8, 1/16
Solution: an = 1/2n
(b). 1, 3, 5, 7, 9
Solution: an = (2n )+ 1
(c). 1, -1, 1, -1, 1
Solution: an = (-1)n
Computer Sciences Department
Exercises
24
A = 4, 8, 16, 32
It is geometric sequence ,
initial term = 4 ,
common ratio = 2 ,
an=4*2n
A6 = 256, A8 = 1024
a ,
j m
j
n
j m
aj
Or
1 j n
aj
Where m is the lower limit, n is the upper limit, and j is the index of the summation
Example:
Express the sum of the first 100 terms of the sequence {an}, where
an = 1/n for n = 1,2,3, ….
Solution: 100
1
j 1 j
Computer Sciences Department
2.4 Sequences and Summations
28
ij = (i 2i 3i)
4
i 1 j 1 i 1
= 6i
i 1
= 6 + 12 + 18 + 24 = 60
𝑘2
𝑘=1