Functions - PowerPoint PPT Presentation

1 / 32
About This Presentation
Title:

Functions

Description:

Its co-domain is R but its range is the set of. non-negative real numbers. 15. Terminology ... In other words, the composite of g and f is. really obtained by ... – PowerPoint PPT presentation

Number of Views:34
Avg rating:3.0/5.0
Slides: 33
Provided by: lrcSurc
Category:

less

Transcript and Presenter's Notes

Title: Functions


1
Functions
  • Reading Chapter 6 (94 107) from the text book

2
What is a function?
  • A function is an input/output rule defined on
  • some set.
  • Example the rule that takes as input a
  • student in this class, and produces as output
  • that students age.
  • Intuitively a function from A to B is a way to
  • transform each element of A into an element
    of B

3
What is a function?
  • Two conditions must be satisfied
  • - Each valid input item must produce some
  • output.
  • -The output depends only on the input, and
  • not on any other extra factors. That is,
  • identical input will always produce the
    same
  • output.

4
Relations and functions
  • A function can be thought of as a special
    kind
  • of relation we get this relation by simply
  • taking the set of all pairs
  • (input, output)
  • for every possible input.
  • Formally a function from A to B is a relation on
  • A B such that for all x ? A there exists
    exactly
  • one element y of B such that (x, y) is in the
    relation

5
Functions as lists of pairs
  • Let A 1, 2, 3 and B a, b, c, d, e.
    Consider the relation
  • g ? A B g (1, d), (2, c), (3,
    c)
  • This is a function each element of A is paired
    with a single element of B (both 2 and 3 are
    paired with c but thats allowed).

6
Functions as lists of pairs
  • By contrast h (1, a), (3, c), (1, d)
  • is not a function, because 1 is paired with two
    things, and 2 isnt paired with anything.
  • Exercise Which of the following relations
    on a, b, c 1, 2, 3 are functions
  • R1 (a, 1), (a, 2), (b, 3), (c,
    2)
  • R2 (a, 1), (b, 2), (c, 1)
  • R3 (a, 1), (c, 2)

7
Function notation
  • When we have a function such as g above, we
    often write it in the following way
  • g(1) d g(2) c g(3) d
  • Read g of 1 is equal to d and so on. This
    notation is only used for functions and not for
    more general relations.

8
Arrow diagram
  • Arrow diagrams are used to depict functions
  • for which input sets are finite.
  • Example Let A1, 2, 3 and B1, 2, 3, 4. Let
    f A B, f(1)3, f(2)2, f(3)2. Draw an
    arrow diagram for this function.
  • A
    B

1
1
2
2
3
3
4
9
Functions and formulas
  • It is actually rare to specify a function as a
    list of pairs. More usually, we give a rule or
    formula that makes it possible to work out the
    value (output) of a function on any given element
    of its domain(input).
  • For instance, we can define a function
  • f ?RR by the formula f(x) x2 3

10
Functions and formulas
  • To work out the value of the function we just
    substitute in the formula
  • f(4) 42 3 16 3 19
  • or in another way of writing the same thing
  • (4, 19) ? f. We could also write
  • f (x, x2 3) ? x ? R

11
Important numerical functions
  • Functions from number systems (such as N, Q, or
    R) to themselves, or to other number systems are
    very important, and some of them have special
    names.
  • Well deal with functions from R to R for
    convenience, but the names are the same in other
    cases.

12
Important numerical functions
  • A linear function is one whose value is obtained
    by multiplying its input by a fixed amount, and
    then adding or subtracting a fixed amount from
    the result.
  • For example
  • f(x) 14x - 3
  • In a quadratic function we may also add or
    subtract a fixed multiple of the square of the
    input.

13
Important numerical functions
  • For example g(x) 3x2 - 7x 2
  • More generally, a polynomial function adds
  • together multiples of fixed powers of the
  • input
  • h(x) -2x5 5x3 - 3x2 17x 1
  • In an exponential function we use the input as
  • an exponent over a fixed base s(x) 2x

14
Domain, codomain and range
  • The domain of a function is the set of its
    allowed inputs.
  • The co-domain of a function is the set in which
    we guarantee its outputs lie.
  • The range of a function is the actual set of its
    outputs.

15
Domain, codomain and range
  • To see the difference between the last two
  • concepts consider f R ? R defined by
  • f(x) x2
  • Its co-domain is R but its range is the set of
  • non-negative real numbers.

16
Terminology
  • Let f be a function from A to B. Let x ? A
  • The image of x under f, denoted by f(x), is the
    only element of B such that (x, f(x)) ? f
  • Intuitively, f transforms x into f(x)
  • The domain of f is A
  • the codomain of f is B
  • The range of f is f(x) x ? A

17
Identity and constant functions
  • If the output of a function is always the same,
  • no matter what the input is, then the function
  • is called a constant function.
  • Example f R?R defined by f(x) 42 for all x.
  • Also, given any set A, there is a special
    function
  • called the identity function on A, and usually
  • denoted iA, which has no effect on its input.
    That is
  • iA(x) x for all x ? A.

18
Equality of functions
  • If f and g are functions from A to B then f g
  • if, for every a ? A, f(a) g(a).
  • For example f, g R ? R
  • f(x) (x 1)2 - 2x
  • g(x) x2 1
  • These are equal functions because for any
  • real number x
  • f(x) (x 1)2 - 2x x2 2x 1 - 2x x2 1
    g(x)

19
One to One functions
  • A function, f, is called one to one or one-one
  • if, whenever a ? b, then f(a) ? f(b). That is,
    for
  • any two distinct inputs to the function, the
  • outputs are also distinct.
  • Put another way, if f(a) f(b), then necessarily
  • ab.
  • For example, the function g R?R defined by
  • g(x) 3x 1 is one-one.

20
One to One functions
  • one to one because
  • If g(a) g(b) then 3a 1 3b 1,
  • and so 3a 3b,
  • and finally a b.
  • On the other hand, the function f R?R defined
    by f(x) x2x2 is not one to one because
  • f(0) 2 f(-1) but 0 ? -1.

21
Onto functions
  • A function, g A ? B, is called onto or
  • if, for every b ? B there is at least one a ? A
  • such that g(a) b.
  • In other words, the range of an onto function
  • is equal to its co-domain.
  • The function h R?R defined by h(x) 5x -2
  • is onto because, for given b ?R we can take
  • a (b 2)/5 and then
  • h(a) 5a - 2 5(b 2)/5 - 2 b 2 - 2 b

22
One-One correspondences
  • A function that is both one to one and onto is
    called a one-one correspondence
  • If f A ? B is a one-one correspondence then,
    for every b ? B there is exactly one a ? A such
  • that f(a) b.
  • The identity function on any set A is always
  • one-one correspondence. Consider f J ?N
    defined as follows
  • f(x)

23
One-One correspondences
  • Then, f is a one-one correspondence. To see this,
    let an arbitrary natural number n be given.
  • If n 2k is even, then n f(k), while if n
    2k 1 is odd, then n f(-k). So, f is onto.
  • On the other hand, f is also one to one, since
  • from the value of f(a) we can uniquely determine
    a
  • (if the value is even, a is f(a)/2 and if the
    value is odd, a is -(f(a) - 1)/2.

24
One to One, Onto, One-One correspondence
  • Let f be a function from A to B
  • f is one to one iff for all x, y ? A, if x y,
    then
  • f(x) f(y)
  • f is onto iff for all y ? B, there exists x ? A
    such
  • that f(x) y
  • f is one-one correspondence iff f is both
  • one to one and onto

25
Exercise
  • For each of the following functions from
  • a, b, c, d to 1, 2, 3, 4, decide whether
    it is one to one and/or onto
  • R1 (a, 1), (d, 3), (b, 2), (c, 4)
  • R2 (a, 1), (b, 2), (c, 3), (d, 2)
  • Solution
  • R1 is both one to one and onto
  • R2 is neither one to one nor onto

26
Composition of functions
  • If we think of functions as input-output rules
    then it is natural to string them together, using
    the output of one rule as input to the next.
  • This operation is known as composition of
    functions and is defined formally as follows
    Suppose that f A ? B and g B ? C are
    functions (note that the domain of g its input,
    matches the co-domain of f its possible
    outputs.)

27
Composition of functions
  • Then, given a ? A we can take b f(a) and
  • then c g(b). This association
  • a ? b ? c i.e. a ? f(a) ? g(f(a))
  • defines a function h A ? C called the
    composite or composition of f and g.
  • We write h g ?f.
  • Very important the function that is applied
    second is written first.

28
Examples of composition
  • Let f, g R?R be given by f(x) 3x - 1 and
  • g(x) x2 1. Then (g ?f)(x) (3x - 1)2 1
  • In other words, the composite of g and f is
  • really obtained by substituting the value of f
  • for the argument of g.
  • Note also that since, in this case, the domain
    and co-domain are the same, we could form the
    other composite
  • (f ?g)(x) f(g(x)) f(x2 1) 3(x2
    1) - 1
  • And that this is not equal to g ?f.

29
Rules of composition
  • Let f A ? B, g B ? C and h C ? D be
    functions. Then
  • f ?iA f iB ?f
  • h ?(g ?f) (h ?g) ?f
  • Also, if both f and g are one-one then so is
  • g ? f. Likewise, if both are onto so is f ?
    g.

30
Inverse of a function
  • Remember that we can think of a function
  • f A ? B as a relation, that is, as a subset
    of
  • A B. Specifically
  • f (a, f(a)) ? a ? A
  • For a general relation, we have defined the
  • notion of its inverse obtained by flipping all
  • the ordered pairs belonging to it
  • f-1 (f(a), a) ? a ? A

31
Inverse of a function
  • It seems natural to ask What conditions, if
  • any, do we need to impose on f in order to
  • ensure that f-1 is a function?.
  • Note first that, if f-1 does happen to be a
    function, then it will have the following
    properties for all a ? A, f-1(f(a)) a, and for
    all b ? B, f(f-1(b)) b.
  • Theorem Let f A ? B be a function. The inverse
    relation f-1 B ? A is a function if and only if
    f is a one-to-one correspondence.

32
Inverse relations and invertible functions
  • Let R be a relation on A B
  • The inverse of R, denoted by R-1, is defined as
    follows
  • R-1 (y, x) x, y ?
    R
  • Let f be a function from A to B
  • As f is a relation, we can form the inverse
    relation f-1
  • If f-1 is also a function, we say that f is
    invertible and call f-1 the inverse function
Write a Comment
User Comments (0)
About PowerShow.com