انت هنا الان : شبكة جامعة بابل > موقع الكلية > نظام التعليم الالكتروني > مشاهدة المحاضرة

Function:

Share |
الكلية كلية العلوم للبنات     القسم قسم الحاسبات     المرحلة 1
أستاذ المادة زينب عبد المنعم عبد الهادي محمد شربة       11/03/2017 21:23:42
Function:
Function is an important class of relation. Definition:
Let A,B be two nonempty sets, a function F: A?B is a rule which associates with each
element of A a unique element in B.
The set A is called the domain of the function, and the set B is called the range of the function.
Example 1:
Consider the function f (x) = x3, i.e., f assigns to each real number its cube. Then the image of 2 is 8, and so we may write f (2) = 8.
Example2 :
consider the following relation on the set A={1,2,3} F = {(1,3),(2,3),(3,1)}
F is a function

----------------------------------------------------------------------- G = {1,2},(3,1)}
G is not a function from A to A

--------------------------------------------------------- H = {(1,3),(2,1),(1,2),(3,1)}
H is not a function


-----------------------------------------------------------------------------------------------------------
One-to-one ,onto and invertible functions :
1) One –to-one : a function F:A?B is said to be one-to-one if different elements in the domain (A) have distinct images.
Or If F(a) =F(a’) ? a = a’
2) Onto : F:A?B is said to be an onto function if each element of B is the image of some element of A.
? b?B ? a ? A : F(a) = b
3) Invertible (One-to-one correspondence)
F:A? B is invertible if its inverse relation f -1 is a function F:B ?A F:A? B is invertible if and only if F is both one-to-one and onto
F -1 :{(b,a) ? (a,b) ? F}

one to one but not onto (3?B but it is not the image under f1)


both one to one & onto
(or one to one correspondence between A and B)
--------------------------------------------------------------------------

not one to one & onto


not one to one & not onto
--------------------------------------------------------------------------------
Graph of a function:
By a real polynomial function, we mean a function f: R ? R of the form

where the ai are real numbers. Since R is an infinite set, it would be impossible to plot each point of the graph. However, the graph of such a function can be approximated by first plotting some of its points and then drawing a smooth curve though these points. The table points are usually obtained from a table where various values are assigned to x and the corresponding value of f(x) computed.

Example 1 : let f:R?R and f(x)= x3 , find f(x) f(3) = 33 = 27
f(-2) = (-2)3 = -8


Example 2: let f: R?R and f (x) = x2 ? 2x – 3, , find f(x)

Geometrical Characterization of One-to-One and Onto Functions
For the functions of the form f : R ? R. the graphs of such functions may be plotted in
the Cartesian plane and functions may be identified with their graphs, so the concepts of being one-to-one and onto have some geometrical meaning :
(1) f :R ? R is said to be one-to-one if there are no 2 distinct pairs (a1,b) and (a2,b) in the graph one-to-one or if each horizontal line intersects the graph of f in at most one point.

(2) f :R ? R is an onto function if each horizontal line intersects the graph of f at one or
more points (at least once)


(3) if f is both one-to-one and onto, i.e. invertible, then each horizontal line will intersect the graph of f at exactly one point.

-----------------------------------------------------------------------------------------------------------


f(x) NOT (ONE-TO-ONE) & NOT (ONTO)

Composition of function:
Let f:A?B and g:B?C, to find the composition function g?f:A?C

(g?f)(a) = g(f(a)) = g(y) = t
(g?f)(b) = g(f(b)) = g(x) = s
(g?f)(c) = g(f(c)) = g(y) = t


SEQUENCES OF SETS
A sequence is a function from the set N = {1, 2, 3, . . .} of positive integers into a set A. The notation an is used to denote the image of the integer n. Thus a sequence is usually denoted by
a1, a2, a3, . . .
A finite sequence over a set A is a function from {1, 2, . . . , m} into A,Such a finite sequence is called a list.
EXAMPLE
(a) The following are two familiar sequences:





Note that the first sequence begins with n = 1 and the second sequence begins with n = 0.

(b) The sequence 1,?1, 1,?1, . . . may be defined by an = (?1)n , where the sequence begins with n = 0.
Summation Symbol, Sums
Here we introduce the summation symbol ? (the Greek letter sigma). Consider a sequence a1, a2, a3, . . ..Then we define the following:
n
? aj = a1 + a2 +? ? ?+an
J=1
EXAMPLE :


5
? j 2 = 22 + 32 + 42 + 52 = 4 + 9 + 16 + 25 = 54
j=2

n
? j = 1 + 2+??+n = n(n + 1)/2, for example, 1 + 2+??+50 = (50 x 51)/2= 1275
j=1
RECURSIVELY DEFINED FUNCTIONS
A function is said to be recursively defined if the function definition refers to itself. In order for the definition not to be circular, the function definition must have the following two properties:
(1) There must be certain arguments, called base values, for which the function does not refer to itself.
(2) Each time the function does refer to itself, the argument of the function must be closer to a base value.
A recursive function with these two properties is said to be well-defined.

Factorial Function
The product of the positive integers from 1 to n, inclusive, is called “n factorial” and is usually denoted by n!. That is,
n! = n(n ? 1)(n ? 2) ? ? ? 3 ? 2 ? 1
where 0! = 1, so that the function is defined for all nonnegative integers. Thus: 0! = 1, 1! = 1,
2! = 2.1 = 2, 3! = 3.2.1 = 6,
4! = 4.3.2.1 = 24 5! = 5.4.3.2.1 = 120
6! = 6.5.4.3.2.1 = 720

This is true for every positive integer n; that is,
n! = n ? (n ? 1)!
Accordingly, the factorial function may also be defined as follows:
Definition of Factorial Function:
(a) If n = 0, then n! = 1.
(b) If n > 0, then n! = n ? (n ? 1)!
The definition of n! is recursive, since it refers to itself when it uses (n ? 1)!. However:
(1) The value of n! is explicitly given when n = 0 (thus 0 is a base value).
(2) The value of n! for arbitrary n is defined in terms of a smaller value of n which is closer to the base value 0.
Accordingly, the definition is not circular, or, in other words, the function is well-defined.

EXAMPLE : the 4! Can be calculated in 9 steps using the recursive definition .


Fibonacci Sequence
The Fibonacci sequence (usually denoted by F0, F1, F2, . . .) is as follows: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, . . .
That is, F0 = 0 and F1 = 1 and each succeeding term is the sum of the two preceding terms. For example, the next two terms of the sequence are
34 + 55 = 89 and 55 + 89 = 144
Fibonacci Sequence can be defined:

(a) If n = 0, or n = 1, then Fn = n.
(b) If n > 1, then Fn = Fn-2 + Fn-1.

Where : The base values are 0 and 1, and the value of Fn is defined in terms of smaller values of n which are closer to the base values.
Accordingly, this function is well-defined.



المادة المعروضة اعلاه هي مدخل الى المحاضرة المرفوعة بواسطة استاذ(ة) المادة . وقد تبدو لك غير متكاملة . حيث يضع استاذ المادة في بعض الاحيان فقط الجزء الاول من المحاضرة من اجل الاطلاع على ما ستقوم بتحميله لاحقا . في نظام التعليم الالكتروني نوفر هذه الخدمة لكي نبقيك على اطلاع حول محتوى الملف الذي ستقوم بتحميله .
الرجوع الى لوحة التحكم